/* ==== ЗАЩИТА ОТ МЕЛЬКАНИЯ МОДАЛОК И АДМИНКИ ПРИ ЗАГРУЗКЕ (FOUC) ==== */
[v-cloak],
[v-cloak] * {
  display: none !important;
}

/* Все оверлейные модальные окна скрыты по умолчанию, пока Vue не скомпилирует v-if */
.fixed[v-if] {
  display: none !important;
}

/* ==== СКЕЛЕТОН ЗАГРУЗКИ ==== */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--muted-bg) 25%,
    var(--card-border) 37%,
    var(--muted-bg) 63%
  );
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
}

@keyframes skeletonShimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ==== ДИЗАЙН-СИСТЕМА UMACITY (BRAND DNA & GLASSMORPHISM) ==== */
html, body, .theme-card, .theme-panel, nav, header, aside, .sticky-header {
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.uma-card {
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
}

.glass-panel {
  background: rgba(18, 23, 33, 0.82) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--panel-shadow) !important;
}
html[data-theme="light"] .glass-panel {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.09) !important;
}

/* Спортивные диагональные бейджи в стиле Umamusume */
.badge-slanted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: skewX(-10deg);
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  line-height: 1.3;
}
.badge-slanted > * {
  transform: skewX(10deg);
  display: inline-flex;
  align-items: center;
}

/* 3D Tilt эффект для карточек манги на десктопе */
@media (hover: hover) and (pointer: fine) {
  .tilt-card {
    transition: transform 0.15s ease-out, box-shadow 0.2s ease;
    transform-style: preserve-3d;
    will-change: transform;
  }
  .tilt-card:hover {
    box-shadow: 0 16px 32px -10px rgba(99, 102, 241, 0.3),
                0 0 0 1px rgba(99, 102, 241, 0.4);
  }
}

/* Анимация Shimmer (сияние для топ-3 лидерборда) */
@keyframes goldShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.rank-shimmer-gold {
  background: linear-gradient(90deg, #f59e0b 0%, #fef08a 50%, #f59e0b 100%);
  background-size: 200% auto;
  color: #78350f !important;
  animation: goldShimmer 3s linear infinite;
}
.rank-shimmer-silver {
  background: linear-gradient(90deg, #94a3b8 0%, #ffffff 50%, #94a3b8 100%);
  background-size: 200% auto;
  color: #0f172a !important;
  animation: goldShimmer 3.5s linear infinite;
}
.rank-shimmer-bronze {
  background: linear-gradient(90deg, #b45309 0%, #fdba74 50%, #b45309 100%);
  background-size: 200% auto;
  color: #451a03 !important;
  animation: goldShimmer 4s linear infinite;
}

/* Каскадное появление строк топа */
.cascade-item {
  animation: cascadeFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cascadeFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Стеклянные Sonner-подобные Toast-уведомления */
.sonner-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
@media (max-width: 640px) {
  .sonner-toast-container {
    bottom: 80px;
    left: 16px;
    right: 16px;
    align-items: center;
  }
}
.sonner-toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18, 23, 33, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  animation: toastPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}
html[data-theme="light"] .sonner-toast {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.15);
  color: #0f172a;
}
@keyframes toastPop {
  0% { opacity: 0; transform: translateY(16px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Мобильный Bottom Sheet */
.mobile-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  transition: opacity 0.25s ease;
}
.mobile-bottom-sheet-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  background: rgba(18, 23, 33, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  overflow: hidden;
}
html[data-theme="light"] .mobile-bottom-sheet-content {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.15);
}
.bottom-sheet-handle-bar {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  margin: 10px auto 4px auto;
  cursor: grab;
  touch-action: none;
}
html[data-theme="light"] .bottom-sheet-handle-bar {
  background: rgba(15, 23, 42, 0.2);
}

/* Плейсхолдер страницы читалки (Skeleton placeholder) */
.reader-page-skeleton {
  min-height: 480px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Кнопки-иконки и фокус клавиатуры */
.icon-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.icon-button:hover { color: var(--accent-hover); background: var(--muted-bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ==== КНОПКИ В ШАПКЕ (ЕДИНАЯ ВЫСОТА И ЦЕНТРОВКА) ==== */
.header-donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.header-donate-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.5);
}
.header-donate-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Кнопка меню подгоняется под размер кнопки «Поддержать» */
.burger-btn {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.burger-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}
.burger-btn:active {
  transform: translateY(0) scale(0.97);
}

@media (max-width: 480px) {
  .header-donate-btn {
    padding: 0 10px;
    height: 36px;
    min-height: 36px;
    font-size: 11px;
  }
  .burger-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }
}
@media (max-width: 360px) {
  .header-donate-text {
    display: none;
  }
  .header-donate-btn {
    padding: 0 10px;
  }
}

.meta-card-detail-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.13), rgba(14, 165, 233, 0.08));
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.meta-card-detail-date span {
  color: var(--text-primary, #e2e8f0);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.translation-author {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.09);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}
.translation-author-icon { font-size: 12px; }
.translation-author-label { font-weight: 700; }
.translation-author-name {
  color: #c4b5fd;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.episode-comment {
  padding: 11px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--muted-bg);
}
.episode-comments-login {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.episode-comments-login:hover { background: rgba(37, 99, 235, 0.2); }

html[data-theme="light"] .meta-card-detail-date {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.06));
  color: #1d4ed8;
}
html[data-theme="light"] .meta-card-detail-date span { color: #0f172a; }
html[data-theme="light"] .translation-author {
  border-color: rgba(109, 40, 217, 0.18);
  background: rgba(139, 92, 246, 0.06);
}
html[data-theme="light"] .translation-author-name { color: #6d28d9; }
html[data-theme="light"] .episode-comment { background: #ffffff; }
html[data-theme="light"] .episode-comments .text-slate-200 { color: var(--text-primary) !important; }
html[data-theme="light"] .episode-comments-login { color: #1d4ed8; }

/* Полное отключение старой плавающей кнопки */
.donors-fab {
  display: none !important;
}

/* ==== КОМПАКТНЫЙ РЕЖИМ СПИСКА ГЛАВ ==== */
.chapter-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  min-height: 52px;
  height: auto;
  width: 100%;
  gap: 12px;
  overflow: visible;
}
.chapter-compact-row:hover {
  border-color: var(--card-hover-border);
  background-color: var(--muted-bg);
  transform: translateX(3px);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.35);
}

/* Левая часть: чекбокс + галочка + текст */
.chapter-compact-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.chapter-compact-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.chapter-compact-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-width: 0;
  flex: 1 1 auto;
}

/* Глобальный стиль индикатора новинки */
.chapter-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1.5px 5.5px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.38);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
  margin-left: 7px;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Правая часть: кнопки */
.chapter-compact-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Группа кнопок действий */
.chapter-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Главная кнопка "Читать" */
.chapter-actions-group .compact-read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35), inset 0 1px rgba(255, 255, 255, 0.15);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.chapter-actions-group .compact-read-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5), inset 0 1px rgba(255, 255, 255, 0.2);
}
.chapter-actions-group .compact-read-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Вторичные кнопки-иконки */
.chapter-actions-group .fav-btn,
.chapter-actions-group .admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1;
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.chapter-actions-group .fav-btn:hover,
.chapter-actions-group .admin-icon-btn:hover {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  transform: translateY(-1px);
}
.chapter-actions-group .fav-btn:active,
.chapter-actions-group .admin-icon-btn:active {
  transform: scale(0.94);
}

/* Активные состояния */
.chapter-actions-group .admin-icon-btn.admin-icon-amber {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.28);
}
.chapter-actions-group .admin-icon-btn.admin-icon-amber:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}
.chapter-actions-group .admin-icon-btn.admin-icon-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}
.chapter-actions-group .admin-icon-btn.admin-icon-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}

/* Плашка просмотров */
.chapter-actions-group .chapter-views-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

/* ==== КРАСИВАЯ РАЗДЕЛИТЕЛЬНАЯ ПОЛОСА МЕЖДУ ТОМАМИ ==== */
.chapter-volume-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0 6px;
  padding: 4px 0;
  user-select: none;
}

.chapter-volume-divider:first-child {
  margin-top: 2px;
}

.chapter-volume-divider.col-span-full {
  grid-column: 1 / -1;
}

.chapter-volume-divider-line {
  flex: 1;
  height: 1px;
}

.chapter-volume-divider-line.left {
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.45));
}

.chapter-volume-divider-line.right {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.45), transparent);
}

.chapter-volume-divider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 10px -2px rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chapter-volume-divider-icon {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 640px) {
  .chapter-volume-divider {
    margin: 10px 0 4px;
    gap: 8px;
  }
  .chapter-volume-divider-badge {
    font-size: 10.5px;
    padding: 2.5px 10px;
  }
}

/* Стилизация разделов томов в селекторе читалки */
.reader-chapter-select optgroup {
  background-color: #0b0f19;
  color: #fbbf24;
  font-weight: 800;
  font-style: normal;
  padding: 6px 10px 4px;
}

.chapter-volume-tag {
  display: none !important; /* Отключаем старый повторяющийся бейдж у каждой главы */
}

/* Аккуратный компактный бейдж персонажей в строке главы */
.chapter-compact-char {
  display: inline-block;
  max-width: 175px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2.5px 8px;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chapter-compact-char:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
}

@media (max-width: 640px) {
  /* 1. РЕЖИМ «СПИСОК» (вертикальный стек: название сверху, действия снизу) */
  .chapter-compact-row {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
    min-height: 0;
    border-radius: 13px;
  }
  .chapter-compact-row:hover {
    transform: none;
  }
  .chapter-compact-info {
    width: 100%;
    align-items: flex-start;
  }
  .chapter-compact-title-wrap {
    width: 100%;
  }
  .chapter-compact-title {
    font-size: 14px;
    font-weight: 700;
    -webkit-line-clamp: 3;
    line-height: 1.4;
  }
  .chapter-new-badge {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 4px;
    margin-left: 4px;
  }
  .chapter-compact-controls {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .chapter-compact-controls .tag-tooltip-wrap {
    display: none;
  }
  .chapter-actions-group {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
  .chapter-actions-group .compact-read-btn {
    flex: 1 1 auto;
    max-width: 140px;
    height: 36px;
    min-height: 36px;
    font-size: 12.5px;
    font-weight: 800;
    padding: 0 14px;
    border-radius: 9px;
  }
  .chapter-actions-group .fav-btn,
  .chapter-actions-group .admin-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 14px;
    border-radius: 9px;
  }
  .chapter-actions-group .chapter-views-pill {
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  /* 2. ПОЛНОЕ ОТКЛЮЧЕНИЕ ТЕСНОЙ ДВУХКОЛОНОЧНОЙ СЕТКИ НА МОБИЛЬНЫХ */
  .comic-chapters-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    grid-template-columns: none !important;
  }
  .chapter-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    padding: 11px 12px !important;
    gap: 8px !important;
    border-radius: 13px !important;
    min-height: 46px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .chapter-card > div:first-child {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .chapter-card .chapter-title-text {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    min-height: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .chapter-card > div:last-child {
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-top: 8px !important;
    width: 100% !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .chapter-card > div:last-child > div:last-child {
    width: 100% !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }
  .chapter-compact-row.is-read,
  .chapter-card.is-read {
    opacity: 1 !important;
  }
  .chapter-compact-row.is-read .chapter-compact-title,
  .chapter-card.is-read .chapter-title-text {
    color: var(--text-muted) !important;
  }
  .chapter-card .tag-tooltip-wrap {
    display: none !important;
  }
  .chapter-card .reader-cta {
    flex: 1 1 auto !important;
    max-width: 140px !important;
    padding: 0 14px !important;
    height: 36px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 9px !important;
  }
  .chapter-card .fav-btn,
  .chapter-card .compact-tg-btn,
  .chapter-card .read-check-btn,
  .chapter-card .admin-icon-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: 14px !important;
    border-radius: 9px !important;
  }
  .chapter-card .chapter-views-pill {
    height: 26px !important;
    padding: 0 7px !important;
    font-size: 10.5px !important;
  }
}

.tag-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tag-tooltip-box {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  transform: translateY(6px);
  background: rgba(13, 19, 34, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.38);
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.75), 0 0 16px rgba(245, 158, 11, 0.18);
  border-radius: 12px;
  padding: 9px 12px;
  z-index: 200;
  min-width: 160px;
  max-width: 290px;
  width: max-content;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
}

.tag-tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 22px;
  border: 6px solid transparent;
  border-top-color: rgba(13, 19, 34, 0.97);
}
.tag-tooltip-box::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 21px;
  border: 7px solid transparent;
  border-top-color: rgba(245, 158, 11, 0.38);
}

.tag-tooltip-wrap:hover .tag-tooltip-box {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.tag-tooltip-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-tooltip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-tooltip-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2.5px 7px;
  border-radius: 6px;
  line-height: 1.3;
}

/* На смартфонах подсказка-поповер вылезала за край экрана:
   персонажи и так перечислены в самой плашке, поэтому скрываем поповер. */
@media (max-width: 640px) {
  .tag-tooltip-box {
    display: none !important;
  }
}

/* Окно саппорт-карты не должно выходить за пределы экрана на телефоне */
.support-card-preview-box {
  box-sizing: border-box;
  max-width: min(24rem, calc(100vw - 24px));
}
.support-card-preview-box > * {
  min-width: 0;
}
.support-card-preview-box img {
  max-width: 100%;
}
@media (min-width: 640px) {
  .support-card-preview-box {
    max-width: min(28rem, calc(100vw - 32px));
  }
}

.compact-read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  box-sizing: border-box;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.compact-read-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}
.compact-read-btn:active {
  transform: translateY(0) scale(0.97);
}

.compact-tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  width: 28px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  border-radius: 8px;
  background: var(--muted-bg);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.compact-tg-btn:hover {
  color: #60a5fa;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  width: 28px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  transition: transform 0.15s ease;
}
.fav-btn:hover {
  transform: scale(1.15);
}

.read-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  width: 28px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.15s ease;
}
.read-check-btn.is-active {
  color: #10b981;
  font-weight: 900;
}
.chapter-compact-row.is-read,
.chapter-card.is-read {
  opacity: 0.55;
}
.chapter-compact-row.is-read:hover,
.chapter-card.is-read:hover {
  opacity: 0.9;
}
.chapter-compact-row.is-read .chapter-compact-title,
.chapter-card.is-read .chapter-title-text {
  color: var(--text-muted);
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--muted-bg);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: #ffffff;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.comic-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comic-filter-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  font-size: 12px;
  padding: 7px 28px 7px 11px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease;
}
.comic-filter-input:focus {
  border-color: #3b82f6;
}
.comic-filter-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}
.comic-filter-clear:hover {
  color: #ef4444;
}

.pagination-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pagination-btn-primary {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}
.pagination-btn-primary:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
}
.pagination-btn-secondary {
  background: var(--muted-bg);
  color: var(--text-muted);
  border-color: var(--card-border);
}
.pagination-btn-secondary:hover {
  color: var(--text-primary);
  border-color: #64748b;
}
.pagination-counter {
  font-size: 11px;
  opacity: 0.75;
}

/* Админ-кнопки теперь всегда видимы и оформлены как обычные icon-кнопки
   внутри .chapter-compact-actions / .chapter-card — отдельная прозрачность не нужна. */


.reader-cta {
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Единый контейнер плавающих кнопок у нижней панели («+ Глава» и «Наверх») */
.dock-floating-actions {
  position: fixed !important;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  right: 16px !important;
  left: auto !important;
  z-index: 9996 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  pointer-events: none !important;
}

.dock-floating-actions > * {
  pointer-events: auto !important;
}

.dock-floating-actions .floating-add-chapter-btn,
.dock-floating-actions .scroll-top-btn {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
}

/* На планшетах (768px - 959px): опускаем к уровню плавающей панели */
@media (min-width: 768px) {
  .dock-floating-actions {
    bottom: 24px !important;
    right: 16px !important;
    left: auto !important;
    gap: 8px !important;
  }
}

/* На ПК (от 960px): прижимаем справа вплотную к плавающей панели навигации */
@media (min-width: 960px) {
  .dock-floating-actions {
    left: calc(50% + min(340px, (100vw - 48px) / 2) + 12px) !important;
    right: auto !important;
  }
}

/* Плавная анимация появления/исчезновения кнопки наверх */
.scroll-top-fade-enter-active,
.scroll-top-fade-leave-active {
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.scroll-top-fade-enter-from,
.scroll-top-fade-leave-to {
  opacity: 0 !important;
  transform: scale(0.82) !important;
}

.floating-add-chapter-btn {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: 68px;
  z-index: 9996;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  padding: 11px 18px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  user-select: none;
}

.floating-add-chapter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.55);
  filter: brightness(1.1);
}

.floating-add-chapter-btn:active {
  transform: translateY(0) scale(0.96);
}

@media (max-width: 640px) {
  .floating-add-chapter-btn {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 66px;
    padding: 9px 13px;
    font-size: 11.5px;
  }
}


.bottom-add-chapter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bottom-add-chapter-btn:hover {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.25);
  border-color: #3b82f6;
  border-style: solid;
}

/* ============================================================ */
/* ==== СТРОЧНЫЙ РЕЖИМ МЕТА-КАРТ (СВЕРХУ ВНИЗ, АРТ СЛЕВА) ==== */
/* ============================================================ */

/* Цветовые полосы и бейджи статов GameTora */
.type-speed { border-left: 4px solid #3b82f6 !important; }
.type-stamina { border-left: 4px solid #f97316 !important; }
.type-power { border-left: 4px solid #eab308 !important; }
.type-guts { border-left: 4px solid #ec4899 !important; }
.type-wit { border-left: 4px solid #10b981 !important; }
.type-pal, .type-group { border-left: 4px solid #a855f7 !important; }

.badge-stat {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-stat.speed { background: rgba(59, 130, 246, 0.18); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-stat.stamina { background: rgba(249, 115, 22, 0.18); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.badge-stat.power { background: rgba(234, 179, 8, 0.18); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.35); }
.badge-stat.guts { background: rgba(236, 72, 153, 0.18); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.badge-stat.wit { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-stat.pal, .badge-stat.group { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

/* Блок ОСНОВНОГО скилла карты (золотистый градиентный акцент) */
.card-skill-box {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.09) 0%, rgba(20, 29, 35, 0.85) 100%);
  border: 1px solid rgba(250, 204, 21, 0.32);
  border-left: 3px solid #facc15;
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: 0 4px 14px -4px rgba(234, 179, 8, 0.12);
}

/* Светлая тема для блоков описания, скиллов и таймлайна карты */
html[data-theme="light"] .uma-date-badge {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .uma-date-day {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .uma-date-weekday {
  color: var(--text-muted) !important;
}

html[data-theme="light"] .card-skill-box {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, #ffffff 100%) !important;
  border-color: rgba(234, 179, 8, 0.4) !important;
  box-shadow: 0 4px 14px -4px rgba(234, 179, 8, 0.15) !important;
}
html[data-theme="light"] .card-skill-name {
  color: #b45309 !important;
}
html[data-theme="light"] .card-skill-text {
  color: #334155 !important;
}
html[data-theme="light"] .card-skill-text strong {
  color: #0f172a !important;
}

html[data-theme="light"] .card-note-box {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: var(--card-border) !important;
  border-left: 3px solid #0284c7 !important;
}
html[data-theme="light"] .card-note-header {
  color: #0284c7 !important;
}
html[data-theme="light"] .card-note-text {
  color: #334155 !important;
}
html[data-theme="light"] .card-note-text strong {
  color: #0f172a !important;
}

html[data-theme="light"] .card-skills-toggle {
  background: var(--muted-bg) !important;
  color: var(--accent) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .card-skills-toggle:hover {
  background: #ffffff !important;
  color: var(--accent-hover) !important;
}

html[data-theme="light"] .strategy-badge {
  background: var(--muted-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--card-border) !important;
}

html[data-theme="light"] .meta-card-ext-links {
  background: rgba(241, 245, 249, 0.85) !important;
}
html[data-theme="light"] .meta-card-ext-btn {
  background: #ffffff !important;
  color: var(--accent) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .meta-card-ext-btn:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .meta-card-detail-btn {
  background: rgba(37, 99, 235, 0.1) !important;
  color: var(--accent) !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}
html[data-theme="light"] .meta-card-detail-btn:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
}

/* ==== СВЕТЛАЯ ТЕМА: ДОПОЛНИТЕЛЬНЫЕ СКИЛЛЫ КАРТЫ ==== */
html[data-theme="light"] .card-skills-list .card-skill-row {
  background: rgba(241, 245, 249, 0.9) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .card-skills-list .card-skill-row:hover {
  border-color: rgba(37, 99, 235, 0.45) !important;
  background: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08) !important;
}
html[data-theme="light"] .card-skill-row-name {
  color: #1d4ed8 !important;
  border-bottom-color: rgba(37, 99, 235, 0.4) !important;
}
html[data-theme="light"] .card-skill-row-badge {
  background: rgba(37, 99, 235, 0.09) !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}
html[data-theme="light"] .card-skill-row-mobile-desc {
  color: #334155 !important;
}
html[data-theme="light"] .card-skill-row-mobile-desc .card-desc-value {
  color: #a16207;
}
html[data-theme="light"] .card-skill-row-name .skill-tooltip .card-desc-value {
  color: #a16207;
}
html[data-theme="light"] .card-skill-row-name .skill-tooltip {
  background: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: #1e293b !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
}

/* ==== СВЕТЛАЯ ТЕМА: ФОН КАРТЫ И МОДАЛКА ДЕТАЛЬНОГО ПРОСМОТРА ==== */
html[data-theme="light"] .card-detail-imgbox {
  background-color: #f8fafc !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.025) 75%) !important;
}
html[data-theme="light"] .meta-card-row {
  background-color: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .meta-card-row:hover {
  border-color: var(--card-hover-border) !important;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.1) !important;
}
@media (max-width: 600px) {
  html[data-theme="light"] .meta-card-left {
    background: #f1f5f9 !important;
    border-bottom-color: var(--card-border) !important;
  }
}

/* ==== СВЕТЛАЯ ТЕМА: УСТРАНЕНИЕ ЧЁРНЫХ ПОЛОС В КАРТАХ И САЙТАХ ==== */
html[data-theme="light"] .cards-filter-panel div[class*="border-"],
html[data-theme="light"] .cards-vertical-list div[class*="border-"],
html[data-theme="light"] .theme-panel div[class*="border-slate-800"],
html[data-theme="light"] [class*="border-slate-800"],
html[data-theme="light"] [class*="border-slate-700"] {
  border-color: var(--card-border) !important;
}

.card-skill-box .card-skill-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 12px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
.card-skill-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card-skill-name {
  font-size: 15.5px;
  font-weight: 800;
  color: #fde047;
  line-height: 1.3;
}
.card-skill-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-top: 3px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Блок описания / мета-оценки */
.card-note-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  border-left: 3px solid #38bdf8;
  border-radius: 12px;
  padding: 11px 13px;
}
.card-note-header {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #34d399;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-note-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==== ДОПОЛНИТЕЛЬНЫЕ СКИЛЛЫ КАРТЫ (список с тултипами на ПК и подписью на смартфонах) ==== */
.card-skills-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-skills-list .card-skill-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card-skill-row:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(15, 23, 42, 0.85);
}

.card-skill-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.card-skill-row-img {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 7px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

.card-skill-row-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.card-skill-row-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #93c5fd;
  cursor: help;
  border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
  position: relative;
}

.card-skill-row-name .skill-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 200px;
  max-width: 320px;
  width: max-content;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}
.card-skill-row-name:hover .skill-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.card-skill-row-name .skill-tooltip .card-desc-value {
  color: #fcd34d;
  font-weight: 800;
  white-space: nowrap;
}

.card-skill-row-mobile-desc {
  display: none;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  padding-left: 44px;
  word-break: break-word;
}
.card-skill-row-mobile-desc .card-desc-value {
  color: #fcd34d;
  font-weight: 800;
  white-space: nowrap;
}

.card-skill-row-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Редактор дополнительных скиллов в модалке */
.skills-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skills-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr 90px 32px;
  gap: 6px;
  align-items: start;
}
@media (max-width: 640px) {
  .skills-editor-row {
    grid-template-columns: 1fr;
  }
}
.skills-editor-row input {
  font-size: 12px;
}

/* Стратегия бейдж */
.strategy-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Заголовок и дата мета-карты */
.meta-card-title {
  font-size: 26px;
  line-height: 1.25;
  word-break: break-word;
}
.meta-card-date {
  font-size: 16px;
  font-weight: 700;
}

/* Сворачивание длинной оценки карты */
.card-note-text.is-collapsed {
  max-height: 135px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}

/* Чипсы-годы */
.year-filter-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.year-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 78px;
  padding: 6px 14px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--card-border);
  background: var(--muted-bg);
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.year-chip:hover {
  color: var(--text-primary);
  border-color: #3b82f6;
}
.year-chip.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.45);
}
.year-chip-num {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.year-chip-meta {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.75;
}

/* Контейнер вертикального списка */
.cards-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.timeline-year-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-year-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  margin-top: 8px;
}
.timeline-year-divider-text {
  font-size: 18px;
  font-weight: 900;
  color: #60a5fa;
  letter-spacing: 0.05em;
}
.timeline-year-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), transparent);
}

/* ==== ЕДИНЫЙ ТАЙМЛАЙН ДАТ (27.11 + СПЛОШНАЯ ПОЛОСА) ==== */
.uma-timeline-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Единая непрерывная вертикальная полоса через весь список карт */
.uma-timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 112px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(96, 165, 250, 0.35) 24px,
    rgba(96, 165, 250, 0.35) calc(100% - 24px),
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

.uma-timeline-day-row {
  display: flex;
  align-items: stretch;
  gap: 20px;
  position: relative;
}

.uma-timeline-left {
  flex: 0 0 112px;
  width: 112px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  position: relative;
  padding-top: 16px;
  padding-bottom: 16px;
  user-select: none;
}

.uma-date-sticky {
  position: sticky;
  top: 86px;
  align-self: flex-start;
  text-align: right;
  padding-right: 18px;
}

.uma-date-main {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  line-height: 1;
}

.uma-date-day {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.uma-date-weekday {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: lowercase;
}

.uma-timeline-node {
  position: absolute;
  top: 16px;
  bottom: 16px;
  right: -1px;
  width: 0;
  z-index: 2;
}

.uma-timeline-dot {
  position: sticky;
  top: 92px;
  display: block;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.uma-timeline-dot.dot-speed   { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59, 130, 246, 0.7); }
.uma-timeline-dot.dot-stamina { border-color: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.7); }
.uma-timeline-dot.dot-power   { border-color: #eab308; box-shadow: 0 0 10px rgba(234, 179, 8, 0.7); }
.uma-timeline-dot.dot-guts    { border-color: #ec4899; box-shadow: 0 0 10px rgba(236, 72, 153, 0.7); }
.uma-timeline-dot.dot-wit     { border-color: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.7); }
.uma-timeline-dot.dot-pal,
.uma-timeline-dot.dot-group   { border-color: #a855f7; box-shadow: 0 0 10px rgba(168, 85, 247, 0.7); }

.uma-timeline-day-row:hover .uma-timeline-dot {
  transform: scale(1.25);
  background: #38bdf8;
}

.uma-timeline-cards {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.uma-date-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.timeline-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.2));
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-size: 14px;
  font-weight: 900;
}

.timeline-year-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Адаптив таймлайна для смартфонов: единая аккуратная ось и компактная плашка даты */
@media (max-width: 680px) {
  .uma-month-title {
    font-size: 16.5px;
  }
  .uma-timeline-container::before {
    left: 8px;
  }
  .uma-timeline-day-row {
    flex-direction: column;
    gap: 8px;
    padding-left: 24px;
    padding-top: 10px;
    padding-bottom: 12px;
    border-left: none !important;
    margin-left: 0 !important;
  }
  .uma-timeline-left {
    width: 100%;
    flex: none;
    justify-content: flex-start;
    padding: 0;
  }
  .uma-date-sticky {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding-right: 0;
    text-align: left;
  }
  .uma-date-badge {
    flex-direction: row;
    align-items: baseline;
    gap: 7px;
    padding: 3.5px 10px;
  }
  .uma-date-day {
    font-size: 18px;
  }
  .uma-date-weekday {
    font-size: 11.5px;
  }
  .uma-timeline-node {
    position: absolute;
    left: -20px;
    top: 8px;
    bottom: auto;
    right: auto;
  }
  .uma-timeline-dot {
    position: static;
    width: 11px;
    height: 11px;
    margin: 0;
  }
  .uma-timeline-cards {
    padding-top: 2px;
    padding-bottom: 4px;
    gap: 12px;
  }
}

/* Сама карточка строкой: слева арт, справа весь контент */
.meta-card-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background-color: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  width: 100%;
}
.meta-card-row:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.meta-card-left {
  flex: 0 0 150px;
  width: 150px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  position: relative;
  border-right: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  padding: 8px;
}

/* Светлая подложка для артов карт и бейджей годов */
html[data-theme="light"] .meta-card-left {
  background: #f1f5f9 !important;
}
html[data-theme="light"] .meta-card-left img {
  background-color: #ffffff !important;
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.035) 75%) !important;
}

html[data-theme="light"] .timeline-year-badge {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .timeline-year-count {
  background: rgba(37, 99, 235, 0.12) !important;
  color: var(--accent) !important;
}

html[data-theme="light"] .meta-card-row button[class*="bg-slate-800"] {
  background-color: var(--muted-bg) !important;
  border: 1px solid var(--card-border) !important;
}
html[data-theme="light"] .meta-card-row button[class*="bg-slate-800"]:hover {
  background-color: #ffffff !important;
  border-color: var(--card-hover-border) !important;
}

.meta-card-left img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
  border-radius: 8px;
  background-color: rgba(15, 23, 42, 0.5);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.045) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.meta-card-noimg {
  font-size: 38px;
  color: var(--text-muted);
}

/* 2. ПРАВАЯ КОЛОНКА КАРТОЧКИ */
.meta-card-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 10px;
}

/* Полоса автоматического диапазона дат */
.timeline-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 11.5px;
  font-weight: 700;
  color: #93c5fd;
}

/* Картинка в модалке «Подробнее» */
.card-detail-imgbox {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.5);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
}
.card-detail-imgbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card-detail-noimg {
  font-size: 46px;
  color: var(--text-muted);
}

/* Мобильный адаптив мета-карт */
@media (max-width: 600px) {
  .meta-card-row {
    flex-direction: column;
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .meta-card-row:hover {
    transform: none;
  }
  .meta-card-left {
    flex: 0 0 auto;
    width: 100%;
    height: 156px;
    min-height: 156px;
    padding: 8px;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    background: radial-gradient(ellipse at center, rgba(51, 65, 85, 0.5) 0%, rgba(15, 23, 42, 0.92) 72%);
  }
  .meta-card-left img {
    max-height: 140px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }
  .meta-card-right {
    padding: 12px;
    gap: 10px;
  }
  .meta-card-right > .flex:first-child {
    row-gap: 7px;
  }
  .meta-card-title {
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.015em;
  }
  .meta-card-date {
    font-size: 12.5px;
  }
  .card-skill-box,
  .card-note-box {
    padding: 10px 11px;
  }
  .card-skill-icon-wrap {
    width: 40px;
    height: 40px;
  }
  .card-skill-name {
    font-size: 15px;
    line-height: 1.3;
  }
  .card-note-header {
    font-size: 13px;
    margin-bottom: 3px;
  }
  .card-skill-text,
  .card-note-text {
    font-size: 13px;
    line-height: 1.48;
  }
  /* На телефонах отключаем hover-тултип и показываем текст скилла сразу под его названием */
  .card-skill-row-name {
    border-bottom: none;
    cursor: default;
  }
  .card-skill-row-name .skill-tooltip {
    display: none !important;
  }
  .card-skill-row-mobile-desc {
    display: block;
  }
  .meta-card-detail-btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    padding: 8px 12px;
  }
  .card-skills-toggle {
    min-height: 38px;
    padding: 7px 10px;
  }
  .card-detail-imgbox {
    max-height: 38vh;
    aspect-ratio: auto;
    padding: 10px;
  }
}

/* ==== ИКОНКИ СТАТОВ КАРТ ==== */
.stat-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ==== ВНЕШНИЕ ССЫЛКИ У МЕТА-КАРТ (GAMETORA / UMA GUIDE) ==== */
.meta-card-left-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 150px;
  width: 150px;
}
.meta-card-ext-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.4);
  border-right: 1px solid var(--card-border);
  border-top: 1px solid var(--card-border);
}
.meta-card-ext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 8px;
  height: 26px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.meta-card-ext-btn:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: #3b82f6;
  color: #ffffff;
}

@media (max-width: 600px) {
  .meta-card-left-col {
    width: 100%;
    flex: none;
  }
  .meta-card-ext-links {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    gap: 7px;
    padding: 8px 10px;
  }
  .meta-card-ext-btn {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    height: auto;
    padding: 7px 8px;
    border-radius: 9px;
    font-size: 11.5px;
  }
}

/* ==== ВЫРАВНИВАНИЕ И СТАБИЛИЗАЦИЯ ВЫСОТЫ КНОПОК ==== */
.compact-read-btn,
.compact-tg-btn,
.view-toggle-btn,
.pagination-btn,
.ext-link-btn,
.header-donate-btn,
.tools-auth-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}

/* Строки персонажей строго прижаты влево */
.character-row-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  background: transparent;
  border: none;
}

/* Единый фиксированный размер для прозрачных PNG-иконок chr_icon без внешних рамок */
.character-avatar {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  flex-shrink: 0 !important;
  display: block !important;
}

/* Стандартизация кнопок списка глав */
.compact-read-btn {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
}
.compact-tg-btn {
  height: 28px;
  min-height: 28px;
  width: 28px;
  padding: 0;
}
.view-toggle-btn {
  height: 28px;
  min-height: 28px;
  padding: 0 9px;
}
.fav-btn,
.read-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
}

/* Кнопки пагинации */
.pagination-btn {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
}

/* ==== СТИЛИ ДЛЯ ПЕРЕРАБОТАННОГО БОКОВОГО МЕНЮ ==== */
.side-menu-section-title {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}
.side-menu-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.side-menu-link:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}
.side-menu-link.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.15));
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}
.side-menu-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
}
.side-menu-arrow {
  font-size: 16px;
  opacity: 0.4;
  margin-left: auto;
}
.side-menu-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.side-menu-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background-image: linear-gradient(135deg, var(--tw-gradient-stops));
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.side-menu-action-btn:hover {
  filter: brightness(1.1);
}
.side-menu-action-btn:active {
  transform: scale(0.98);
}

/* ==== ИКОНКА ОСНОВНОГО СКИЛЛА КАРТЫ ==== */
.card-skill-icon-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-self: flex-start; /* Иконка всегда зафиксирована вверху */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; /* Убран тёмный прямоугольник на фоне */
  border: none;             /* Убрана рамка контейнера */
  border-radius: 0;
  overflow: visible;
}
.card-skill-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.card-skill-icon-fallback {
  font-size: 16px;
}

/* ==== КНОПКА СПОЙЛЕРА СКИЛЛОВ ==== */
.card-skills-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.card-skills-toggle:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #ffffff;
}

/* Отключаем backdrop-filter и transform на .overlay-container,
   чтобы они НЕ ломали position: fixed у шапки и нижней панели! */
.overlay-container {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
}

/* ==== НИЖНЯЯ ПАНЕЛЬ НАВИГАЦИИ ==== */
.bottom-nav-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: rgba(7, 10, 18, 0.9) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--card-border);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.55);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-theme="light"] .bottom-nav-bar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-top: 1px solid var(--card-border) !important;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .sticky-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--card-border) !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .header-notif-btn {
  color: var(--text-primary) !important;
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}

html[data-theme="light"] .header-notif-btn:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}
.bottom-nav-inner {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  height: 64px;
  padding: 0 6px;
}
/* 4 перехода в нижней панели профиля: основные разделы и профиль */
.bottom-nav-inner--profile {
  grid-template-columns: repeat(4, 1fr) !important;
}
.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
  padding: 4px 1px;
  box-sizing: border-box;
  transition: color 0.2s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 420px) {
  .bottom-nav-inner {
    padding: 0 2px;
  }
  .bottom-nav-icon-wrap {
    width: 38px;
    height: 26px;
  }
  .bottom-nav-icon {
    font-size: 17px;
  }
  .bottom-nav-label {
    font-size: 9.5px;
    letter-spacing: -0.2px;
  }
}
.bottom-nav-btn:active {
  transform: scale(0.92);
}

/* Фиксированная капсула для выравнивания всех иконок строго по одной линии */
.bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
  border: 1px solid transparent;
}
.bottom-nav-icon {
  font-size: 19px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Фиксированная базовая линия для названий кнопок */
.bottom-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color 0.2s ease, transform 0.2s ease;
}

.bottom-nav-btn:hover {
  color: var(--text-primary);
}

/* Выделение активной вкладки: плавающая капсула управляет подложкой */
.bottom-nav-btn.active {
  color: #34d399;
}
.bottom-nav-btn.active .bottom-nav-icon-wrap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.bottom-nav-btn.active .bottom-nav-icon {
  transform: scale(1.14);
  filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.6));
}
.bottom-nav-btn.active .bottom-nav-label {
  color: #93c5fd;
  font-weight: 800;
}
html[data-theme="light"] .bottom-nav-btn.active .bottom-nav-label {
  color: #2563eb;
}

.bottom-nav-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  z-index: 2;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 999px;
  line-height: 1.25;
  border: 1.5px solid #0b0f19;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
@media (max-width: 420px) {
  .bottom-nav-badge {
    top: -6px;
    right: -9px;
    font-size: 8px;
    padding: 1px 3.5px;
  }
}
html[data-theme="light"] .bottom-nav-badge {
  border-color: #ffffff;
}

/* Плавная анимация появления контента при переключении вкладок */
.space-y-6,
.useful-sites-grid,
.cards-vertical-list {
  animation: tabFadeIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== ВКЛАДКИ ПОДРАЗДЕЛА «ПЕРЕВОДЫ» ВВЕРХУ СТРАНИЦЫ ==== */
.translations-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--card-shadow);
  overflow-x: auto;
  scrollbar-width: none;
}
.translations-tabs-bar::-webkit-scrollbar {
  display: none;
}
.trans-tab-btn {
  flex: 1;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.trans-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.08);
}
.trans-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.trans-tab-badge {
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 5.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==== ШТОРКА «ИНСТРУМЕНТЫ» СНИЗУ ==== */
.tools-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  touch-action: none;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

.overlay-container {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden !important;
  max-width: 100vw;
}

.tools-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  max-height: 86dvh;
  margin: 0 auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.25s;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.7);
  padding: 16px 18px 12px;
  pointer-events: none;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden !important;
}
.tools-sheet.open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
@media (min-width: 768px) {
  .tools-sheet {
    max-width: min(760px, calc(100vw - 48px));
    max-height: 90vh;
    max-height: 90dvh;
  }
}
@media (min-width: 640px) {
  .tools-sheet.tools-sheet--wide {
    max-width: min(980px, calc(100vw - 32px)) !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
  }
}
.tools-sheet-content {
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  padding-right: 2px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Шапка: компактная, прижатая ближе к контенту сайта */
.sticky-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  background: rgba(7, 10, 18, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid var(--card-border) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  padding: 4px 12px !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease !important;
}

.sticky-header.hidden {
  transform: translateY(-110%) !important;
}

/* Оптимальный отступ сверху: шапка не перекрывает кнопку «На главную» */
.page-with-fixed-header {
  padding-top: 60px !important;
}

.sticky-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  height: 44px;
  max-width: 72rem !important; /* Совпадает с шириной основного контейнера профиля */
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* Кнопка возврата на главную (расположена справа в карточке раздела) */
.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--card-border);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.back-to-home-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}
.back-to-home-btn:active {
  transform: scale(0.97);
}

/* Карточки разделов: чистое левое выравнивание, компактная высота */
.tab-intro-panel {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: left !important;
  padding: 16px 20px !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.tab-intro-panel > div {
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: auto !important;
}

.tab-intro-panel .site-title {
  text-align: left !important;
  justify-content: flex-start !important;
  display: inline-flex !important;
  width: auto !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

.tab-intro-panel p {
  text-align: left !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
}

@media (max-width: 640px) {
  .tab-intro-panel {
    padding: 14px 16px !important;
    gap: 8px !important;
  }
}

@media (max-width: 640px) {
  .sticky-header {
    padding: 3px 8px !important;
  }
  .sticky-header-inner {
    min-height: 42px;
    height: 42px;
    padding: 0;
  }
  .page-with-fixed-header {
    padding-top: 54px !important;
  }

  .tab-intro-panel {
    padding: 14px 16px !important;
    gap: 12px !important;
  }
}

  @media (max-width: 640px) {
  /* ==== ЦЕНТРИРОВАНИЕ ТЕКСТА ВО ВСЕХ ВКЛАДКАХ НА МОБИЛЬНЫХ ==== */
  .tab-intro-panel {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 16px !important;
    gap: 8px !important;
  }

  .tab-intro-panel > div {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .tab-intro-panel .site-title {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 19px !important;
  }

  .tab-intro-panel p {
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }
}

/* ==== ПРОМО-КАРТОЧКА СТАТЬИ HACHIMI EDGE ==== */
.article-promo-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.28) 0%, var(--panel-bg) 65%) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-promo-card:hover {
  border-color: rgba(96, 165, 250, 0.65) !important;
  box-shadow: 0 14px 32px -8px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.article-promo-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.article-promo-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.article-promo-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  flex: 1 1 320px;
}

.article-promo-logo-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
}

.article-promo-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-promo-title {
  font-size: 16.5px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.35;
}

.article-promo-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.article-promo-action {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.article-promo-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.article-promo-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.article-promo-btn:active {
  transform: scale(0.98);
}

/* Универсальные кнопки-пилюли для фильтров карт и категорий сайтов */
.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-pill-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}
.filter-pill-btn.is-active-blue {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.5);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.filter-pill-btn.is-active-amber {
  background: linear-gradient(135deg, #d97706, #ea580c);
  color: #ffffff;
  border-color: rgba(253, 224, 71, 0.5);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}
.filter-pill-count {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

/* Светлая тема для пилюль фильтров и темных служебных кнопок */
html[data-theme="light"] .filter-pill-btn:not(.is-active-blue):not(.is-active-amber) {
  background: var(--muted-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .filter-pill-btn:not(.is-active-blue):not(.is-active-amber):hover {
  background: #ffffff !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
html[data-theme="light"] .filter-pill-count {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
}

/* Переопределение темных Tailwind-кнопок (Создать статью, быстрые фильтры) */
html[data-theme="light"] button.bg-slate-800,
html[data-theme="light"] .bg-slate-800:not(.bg-blue-600) {
  background-color: var(--muted-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] button.bg-slate-800:hover,
html[data-theme="light"] .hover\:bg-slate-700:hover {
  background-color: #ffffff !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.meta-card-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.meta-card-left:hover .meta-card-zoom-hint {
  opacity: 1;
}

.meta-card-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}
.meta-card-detail-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

@media (max-width: 640px) {
  .article-promo-card {
    padding: 16px !important;
  }
  .article-promo-info {
    gap: 12px;
  }
  .article-promo-logo-wrap {
    width: 46px;
    height: 46px;
  }
  .article-promo-title {
    font-size: 14.5px;
  }
  .article-promo-desc {
    font-size: 11.5px;
  }
  .article-promo-action {
    width: 100%;
  }
  .article-promo-btn {
    width: 100%;
    justify-content: center;
    height: 40px;
    font-size: 12px;
  }
}

/* ==== ЦВЕТА КАТЕГОРИЙ В ПОЛЕЗНЫХ САЙТАХ ==== */
.site-badge.badge-cat-database {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
}

.site-badge.badge-cat-calc {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
}

.site-badge.badge-cat-guide {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.38) !important;
}

.site-badge.badge-cat-settings {
  background: rgba(168, 85, 247, 0.16) !important;
  color: #c084fc !important;
  border-color: rgba(168, 85, 247, 0.38) !important;
}

.site-badge.badge-cat-media {
  background: rgba(244, 63, 94, 0.16) !important;
  color: #fb7185 !important;
  border-color: rgba(244, 63, 94, 0.38) !important;
}

/* ==== ОПТИМИЗАЦИЯ СКОРОСТИ И ПАМЯТИ В ЧИТАЛКЕ ==== */
.reader-image {
  content-visibility: auto;
  contain-intrinsic-size: 800px 1200px;
  will-change: transform;
}

/* ==== ФОРМАТИРОВАНИЕ ТЕКСТА В ОПИСАНИИ МЕТА-КАРТ ==== */
.card-note-text strong {
  font-weight: 700;
  color: #ffffff;
}

.card-note-text em {
  font-style: italic;
  color: #e2e8f0;
}

.card-note-text .card-desc-h1 {
  font-size: 16px;
  font-weight: 900;
  color: #60a5fa;
  margin-top: 8px;
  margin-bottom: 2px;
  line-height: 1.3;
}
.card-note-text .card-desc-h1:first-child {
  margin-top: 0;
}

.card-note-text .card-desc-h2 {
  font-size: 14.5px;
  font-weight: 800;
  color: #facc15;
  margin-top: 6px;
  margin-bottom: 2px;
  line-height: 1.3;
}
.card-note-text .card-desc-h2:first-child {
  margin-top: 0;
}

.card-note-text .card-desc-h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: #c084fc;
  margin-top: 5px;
  margin-bottom: 2px;
  line-height: 1.3;
}
.card-note-text .card-desc-h3:first-child {
  margin-top: 0;
}

.card-note-text .card-desc-li {
  padding-left: 6px;
  margin: 2px 0;
  color: #cbd5e1;
}

/* ==== КОМПАКТНЫЕ ИКОНКИ СКИЛЛОВ В МОДАЛКЕ РЕДАКТИРОВАНИЯ ==== */
.skill-icon-preview {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 12px;
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.skill-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.skill-icon-preview.small {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 9px;
  padding: 2px;
}

/* Кнопки пресетов из списка «Доступные иконки» */
.skill-icon-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.skill-icon-preset-btn:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: #3b82f6;
  color: #60a5fa;
  transform: translateY(-1px);
}

.skill-icon-preset-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
}

.skill-icon-preset-btn img {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  object-fit: contain;
  border-radius: 5px;
  display: block;
}

/* Стили форматирования для текста основного скилла */
.card-skill-text strong {
  font-weight: 800;
  color: #ffffff;
}

.card-skill-text em {
  font-style: italic;
  color: #fef08a;
}

.card-skill-text .card-desc-h1 {
  font-size: 15px;
  font-weight: 800;
  color: #60a5fa;
  margin: 3px 0 1px;
}

.card-skill-text .card-desc-h2 {
  font-size: 14px;
  font-weight: 800;
  color: #facc15;
  margin: 3px 0 1px;
}

.card-skill-text .card-desc-h3 {
  font-size: 13px;
  font-weight: 700;
  color: #c084fc;
  margin: 2px 0 1px;
}

.card-skill-text .card-desc-li {
  padding-left: 4px;
  margin: 1px 0;
  color: #e2e8f0;
}

/* ==== АДАПТИВНОЕ ОТОБРАЖЕНИЕ ТАЙТЛОВ НА МОБИЛЬНЫХ ==== */
.comic-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.comic-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.comic-character-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 12px; /* Чуть уменьшили радиус, чтобы при переносе строк смотрелось аккуратнее */
  max-width: 100%;
  line-height: 1.3;
  white-space: normal; /* Разрешаем перенос строк */
  word-break: break-word; /* Ломаем длинные слова, если нужно */
  text-align: left;
}

@media (max-width: 640px) {
  .comic-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .comic-actions-bar {
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Ограничиваем ширину плашки персонажей и разрешаем перенос */
  .comic-character-badge {
    display: inline-block; /* Меняем на block/inline-block для нормального переноса текста */
    width: auto;
    max-width: 100%;
    padding: 3px 8px;
    font-size: 10.5px;
    border-radius: 8px; /* На мобильных делаем менее круглым, чтобы при переносе текст не прилипал к краям */
    white-space: normal;
    word-break: break-word;
  }
}

.tools-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 12px;
}
.tools-sheet-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.tools-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #ffffff;
  background-image: linear-gradient(135deg, var(--tw-gradient-stops));
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.tools-item-btn:hover {
  filter: brightness(1.1);
}
.tools-item-btn:active {
  transform: scale(0.98);
}
.tools-auth-btn {
  flex: 1;
  padding: 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tools-auth-btn:hover {
  border-color: #3b82f6;
  color: #60a5fa;
}

/* ==== ОФОРМЛЕНИЕ ВКЛАДКИ АВТОРОВ ==== */
.authors-stat-bar {
  border: 1px solid var(--card-border);
}
.authors-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  align-items: start;
}
@media (max-width: 640px) {
  .authors-grid {
    grid-template-columns: 1fr;
  }
}
.author-card {
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.author-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
}
.author-card.is-open {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  grid-column: 1 / -1; /* Раскрытый автор занимает всю ширину экрана */
}
.author-card-head {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.author-card-head:hover {
  background-color: rgba(59, 130, 246, 0.06);
}
.author-monogram {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.author-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}
.author-chevron.rotate-180 {
  transform: rotate(180deg);
  color: #60a5fa;
}

/* Кнопка случайной главы в панели переводов */
.trans-tab-random {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  font-weight: 800;
}
.trans-tab-random:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}

/* Кнопки фильтра по типу стата в календаре */
.card-type-filter-btn {
  --type-filter-rgb: 148, 163, 184;
  position: relative;
  isolation: isolate;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 5px;
  border-radius: 11px;
  border: 1px solid rgba(var(--type-filter-rgb), 0.28);
  background: linear-gradient(145deg, rgba(var(--type-filter-rgb), 0.12), var(--muted-bg) 72%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.card-type-filter-btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border: 1px solid rgba(var(--type-filter-rgb), 0.12);
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.15s ease;
}
.stat-btn-all { --type-filter-rgb: 168, 85, 247; }
.stat-btn-speed { --type-filter-rgb: 59, 130, 246; }
.stat-btn-stamina { --type-filter-rgb: 239, 68, 68; }
.stat-btn-power { --type-filter-rgb: 245, 158, 11; }
.stat-btn-guts { --type-filter-rgb: 236, 72, 153; }
.stat-btn-wit { --type-filter-rgb: 16, 185, 129; }
.stat-btn-pal { --type-filter-rgb: 14, 165, 233; }
.card-type-filter-btn:focus-visible {
  outline: 2px solid rgba(var(--type-filter-rgb), 0.9);
  outline-offset: 2px;
}
.card-type-filter-btn:hover {
  border-color: rgba(var(--type-filter-rgb), 0.75);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(var(--type-filter-rgb), 0.22), inset 0 1px rgba(255, 255, 255, 0.12);
}
.card-type-filter-btn.active {
  background: linear-gradient(145deg, rgba(var(--type-filter-rgb), 0.42), rgba(var(--type-filter-rgb), 0.2));
  border-color: rgba(var(--type-filter-rgb), 0.95);
  box-shadow: 0 0 0 2px rgba(var(--type-filter-rgb), 0.14), 0 0 14px rgba(var(--type-filter-rgb), 0.36), inset 0 1px rgba(255, 255, 255, 0.18);
}
.card-type-filter-btn.active::after {
  border-color: rgba(var(--type-filter-rgb), 0.45);
}
.card-type-filter-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
@media (prefers-reduced-motion: reduce) {
  .card-type-filter-btn,
  .card-type-filter-btn::after {
    transition: none;
  }
  .card-type-filter-btn:hover {
    transform: none;
  }
}

/* ==== ВКЛАДКА: ПОЛЕЗНЫЕ САЙТЫ ==== */
.useful-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
@media (max-width: 640px) {
  .useful-sites-grid {
    grid-template-columns: 1fr;
  }
}
.site-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-card:hover {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 14px 32px -6px rgba(0, 0, 0, 0.55);
  transform: translateY(-3px);
}
.site-preview-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 160px;
  max-height: 220px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.55) 0%, rgba(11, 15, 25, 0.95) 100%);
  border-bottom: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  contain: paint;
}
.site-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-card:hover .site-preview-img {
  transform: scale(1.03);
}
.site-preview-fallback {
  font-size: 48px;
  opacity: 0.5;
}
.site-preview-zoom-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 5;
}
.site-preview-box:hover .site-preview-zoom-badge {
  opacity: 1;
  transform: translateY(0);
}
.site-preview-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.site-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.site-preview-dot.active {
  width: 16px;
  background: #60a5fa;
}
.site-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.site-badge {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2.5px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  align-self: flex-start;
  flex-shrink: 0;
}
.site-domain-pill {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  padding: 2px 7px;
  border-radius: 6px;
}
.site-card-title {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
}
.site-visit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(79, 70, 229, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.18s ease;
}
.site-visit-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.site-desc-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.site-desc-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  transition: max-height 0.25s ease;
}

.site-desc-text strong {
  font-weight: 700;
  color: #ffffff;
}

.site-desc-text em {
  font-style: italic;
  color: #e2e8f0;
}

.site-desc-text .site-desc-h1 {
  font-size: 15px;
  font-weight: 800;
  color: #60a5fa;
  margin-top: 10px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.site-desc-text .site-desc-h1:first-child {
  margin-top: 0;
}

.site-desc-text .site-desc-h2 {
  font-size: 13.5px;
  font-weight: 700;
  color: #facc15;
  margin-top: 8px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.site-desc-text .site-desc-h2:first-child {
  margin-top: 0;
}

.site-desc-text .site-desc-h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: #a78bfa;
  margin-top: 6px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.site-desc-text .site-desc-h3:first-child {
  margin-top: 0;
}

/* Изначально полускрытый режим с мягким угасанием снизу */
.site-desc-text.is-collapsed {
  max-height: 120px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Широкая тонкая кнопка для раскрытия / сворачивания */
.site-desc-expand-btn {
  width: 100%;
  height: 26px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.site-desc-expand-btn:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  color: #ffffff;
}

.site-desc-expand-btn:active {
  transform: scale(0.99);
}

/* ==== ОТДЕЛЬНАЯ КНОПКА «СЛУЧАЙНАЯ ГЛАВА» ==== */
.random-chapter-standalone-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.random-chapter-standalone-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fbbf24;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

/* Высокий контраст кнопки «Случайная глава» в светлой теме */
html[data-theme="light"] .random-chapter-standalone-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.14)) !important;
  border-color: rgba(217, 119, 6, 0.5) !important;
  color: #92400e !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12) !important;
}
html[data-theme="light"] .random-chapter-standalone-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
}

/* Контрастные цвета в модалке донатов для светлой темы */
html[data-theme="light"] .bg-amber-500\/10 {
  background-color: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="light"] .text-amber-400 {
  color: #b45309 !important;
}
html[data-theme="light"] .text-amber-300 {
  color: #92400e !important;
}

.site-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
  z-index: 5;
}
.site-preview-nav:hover {
  background: #2563eb;
  border-color: #60a5fa;
  transform: translateY(-50%) scale(1.08);
}
.site-preview-nav:active {
  transform: translateY(-50%) scale(0.95);
}
.site-preview-nav.prev { left: 10px; }
.site-preview-nav.next { right: 10px; }

.site-preview-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 5;
}

/* ==== ПОЛНОЭКРАННАЯ ГАЛЕРЕЯ ДЛЯ ЛИСТАНИЯ ==== */
.site-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10005;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  box-sizing: border-box;
}

.site-gallery-container {
  width: 100%;
  max-width: 860px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 5;
}

.site-gallery-viewport {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Обёртка изображения, гарантирующая позиционирование стрелок строго относительно картинки */
.site-gallery-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.site-gallery-img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(11, 15, 25, 0.8);
  display: block;
}

@media (min-width: 900px) {
  .site-gallery-modal {
    padding: 24px 32px 40px;
  }
  .site-gallery-container {
    width: min(100%, 1440px);
    max-width: 1440px;
  }
  .site-gallery-img {
    max-height: 74vh;
  }
}

/* Кнопки перелистывания: строго по бокам картинки по её вертикальному центру */
.site-gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.15s ease;
  z-index: 10;
}
.site-gallery-btn:hover {
  background: #2563eb;
  border-color: #60a5fa;
  transform: translateY(-50%) scale(1.08);
}
.site-gallery-btn:active {
  transform: translateY(-50%) scale(0.95);
}
.site-gallery-btn.prev {
  left: 12px;
}
.site-gallery-btn.next {
  right: 12px;
}

/* Карточка полного описания под картинкой */
.site-gallery-info {
  width: 100%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .site-gallery-btn {
    width: 38px;
    height: 38px;
  }
  .site-gallery-btn.prev { left: 8px; }
  .site-gallery-btn.next { right: 8px; }

  .site-gallery-viewport {
    max-height: 48vh;
  }
  .site-gallery-img {
    max-height: 48vh;
  }
}

@media (min-width: 900px) {
  .episode-player-dialog {
    width: min(90vw, 1280px, 125vh);
    max-width: 1280px !important;
    max-height: calc(100dvh - 32px);
  }
  .meta-card-detail-modal {
    max-width: min(92vw, 1280px) !important;
  }
  .meta-card-detail-grid {
    grid-template-columns: minmax(0, min(38vw, 440px)) minmax(0, 1fr) !important;
  }
}

@media (max-width: 640px) {
  /* Пропорциональная адаптивная сетка: короткое «Все» не тратит место, длинное «Избранное» и «Авторы» влезают на 100% */
  .translations-tabs-bar {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: grid !important;
    grid-template-columns: 0.7fr 1.35fr 1.25fr 0.95fr !important;
    gap: 3px !important;
    padding: 3px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .translations-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .trans-tab-btn {
    min-width: 0 !important;
    width: 100% !important;
    padding: 6px 3px !important;
    font-size: 11px !important;
    gap: 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .trans-tab-badge {
    padding: 1px 4px !important;
    font-size: 8.5px !important;
    font-weight: 900 !important;
    margin-left: 1px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
  }

  /* Кнопка случайной главы переносится ниже на 100% ширины */
  .random-chapter-standalone-btn {
    width: 100%;
    justify-content: center;
    height: 34px;
    font-size: 11.5px;
  }
}

@media (max-width: 380px) {
  .translations-tabs-bar {
    grid-template-columns: 0.65fr 1.4fr 1.25fr 0.95fr !important;
    gap: 2px !important;
    padding: 2.5px !important;
  }

  .trans-tab-btn {
    padding: 5px 1px !important;
    font-size: 10px !important;
    gap: 2px !important;
    letter-spacing: -0.25px !important;
  }

  .trans-tab-badge {
    padding: 1px 3px !important;
    font-size: 8px !important;
  }
}

/* ==== СТИЛИ ДЛЯ СТАТЕЙ ==== */
.article-h1,
.article-h2,
.article-h3 {
  scroll-margin-top: 75px; /* Защита от перекрытия заголовка фиксированной шапкой */
}

.article-h1 {
  font-size: 1.45rem;
  font-weight: 900;
  color: #60a5fa;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}
.article-h1:first-child {
  margin-top: 0;
}
.article-h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #facc15;
  margin-top: 1.3rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.article-h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c084fc;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

/* Оглавление статьи */
.article-toc {
  box-sizing: border-box;
  max-width: 100%;
}
.article-toc a {
  cursor: pointer;
  line-height: 1.45;
}

/* Адаптация оглавления для светлой темы */
html[data-theme="light"] .article-toc {
  background: #f8fafc !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .article-toc span.text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .article-toc a {
  color: #334155 !important;
}
html[data-theme="light"] .article-toc a:hover {
  color: #1d4ed8 !important;
}
html[data-theme="light"] .article-toc .border-white\/10 {
  border-color: var(--card-border) !important;
}

.article-content {
  word-break: break-word;
}

/* 1. Курсив в статьях */
.article-content em {
  font-style: italic !important;
  color: #e2e8f0;
}
html[data-theme="light"] .article-content em {
  color: #475569 !important;
}

/* 3. Нумерованные пункты и красная строка */
.article-num-li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  line-height: 1.55;
}

.article-bullet-li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 5px 0;
  line-height: 1.55;
}

.article-p {
  line-height: 1.65;
  margin: 8px 0;
}

/* Изображения внутри статей */
.article-img-wrap {
  margin: 14px 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.article-img-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* ============================================================ */
/* ==== ВИЗУАЛЬНОЕ ОКНО КОДА (TERMINAL / CODE BOX) ==== */
/* ============================================================ */
.article-code-window {
  border-radius: 14px;
  background: #0b0f19;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  margin: 16px 0;
}

.article-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  user-select: none;
}

.article-code-mac-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-code-mac-dots .dot-red {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  opacity: 0.85;
}

.article-code-mac-dots .dot-yellow {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  opacity: 0.85;
}

.article-code-mac-dots .dot-green {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.85;
}

.article-code-lang-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-left: 8px;
}

.article-code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.article-code-copy-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.article-code-copy-btn.is-copied {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

.article-code-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #f1f5f9;
  background: transparent;
}

.article-code-pre code {
  font-family: inherit;
  color: inherit;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  white-space: pre !important;
  word-break: normal !important;
}

/* Инлайн-код внутри текста */
.article-inline-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

/* Адаптация окна кода для светлой темы (остаётся контрастным темным IDE-блоком) */
html[data-theme="light"] .article-code-window {
  background: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.15) !important;
}
html[data-theme="light"] .article-code-header {
  background: #1e293b !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="light"] .article-code-pre {
  color: #f8fafc !important;
}
html[data-theme="light"] .article-inline-code {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.22) !important;
}

/* Кнопка наверх: в едином градиентном капсульном стиле с кнопкой «+ Глава» */
.scroll-top-btn {
  position: fixed !important;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  right: 16px !important;
  width: 42px !important;
  height: 42px !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #2563eb, #8b5cf6) !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45) !important;
  z-index: 9980 !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}
.scroll-top-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.55) !important;
  filter: brightness(1.1) !important;
}
.scroll-top-btn:active {
  transform: translateY(0) scale(0.96) !important;
}

@media (max-width: 640px) {
  .scroll-top-btn {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    width: 38px !important;
    height: 38px !important;
    font-size: 16px !important;
  }
}

/* Компактный строчный список арт-дней для удобного листания на смартфонах */
.artday-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  gap: 10px;
  transition: border-color 0.15s ease;
}
.artday-compact-row:hover {
  border-color: rgba(236, 72, 153, 0.5);
}
.artday-date-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.artday-date-badge.soon {
  background: rgba(236, 72, 153, 0.18);
  border-color: rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

/* ==== КНОПКА ОТМЕТКИ ПРОСМОТРА В КАРТОЧКАХ СЕРИЙ UMAYURU ==== */
.ep-check-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  height: 28px !important;
  min-height: 28px !important;
  width: auto !important;
  max-width: 100% !important;
  padding: 0 9px !important;
  box-sizing: border-box !important;
  border-radius: 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap !important;
  transition: all 0.15s ease;
  line-height: 1 !important;
}
.ep-check-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.ep-check-btn.is-watched {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

/* Переключатель плеера YouTube / VK Видео */
.player-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.player-source-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.player-source-btn.is-active-yt {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}
.player-source-btn.is-active-vk {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

/* Плашка обхода анти-бота YouTube */
.yt-bypass-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11px;
  box-sizing: border-box;
}

.yt-bypass-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.yt-bypass-switch-btn:hover {
  background: #2563eb;
  color: #ffffff;
}

/* ==== КНОПКИ ДЕЙСТВИЙ В ДЕТАЛЬНОМ ПРОСМОТРЕ КАРТЫ ==== */
.card-detail-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: var(--muted-bg);
  color: var(--text-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.card-detail-action-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.card-detail-action-btn--edit {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}
.card-detail-action-btn--art {
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

/* ==== ОФОРМЛЕНИЕ ОКНА СИНХРОНИЗАЦИИ ==== */
.sync-compare-grid {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}
.sync-option-card {
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.sync-option-card:hover {
  transform: translateY(-1px);
}
.sync-option-card:active {
  transform: scale(0.99);
}

/* ============================================================ */
/* ==== ПЛАШКА СИНХРОНИЗАЦИИ ПРОФИЛЯ TELEGRAM В НАСТРОЙКАХ ==== */
/* ============================================================ */
.sync-status-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Светлая тема для карточек синхронизации и кнопок в шторке настроек */
html[data-theme="light"] .sync-status-card {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .sync-status-card .text-slate-100 {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .sync-status-card .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .sync-status-card .text-slate-400 {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .sync-badge--active {
  background: rgba(16, 185, 129, 0.1) !important;
}

html[data-theme="light"] .tools-item-btn.from-slate-800,
html[data-theme="light"] .tools-item-btn.from-slate-900 {
  background-image: linear-gradient(135deg, #ffffff, #f1f5f9) !important;
  color: var(--text-primary) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .tools-item-btn.from-slate-800:hover,
html[data-theme="light"] .tools-item-btn.from-slate-900:hover {
  border-color: var(--card-hover-border) !important;
}
html[data-theme="light"] .tools-item-btn .bg-white\/10 {
  background-color: rgba(15, 23, 42, 0.08) !important;
  color: var(--text-primary) !important;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.sync-badge--active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.sync-badge--linked {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.3);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

.sync-dot--sky {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* ============================================================ */
/* ==== КНОПКА ШАРИНГА ССЫЛКИ И ПОДСВЕТКА DEEP LINKING ==== */
/* ============================================================ */
.share-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  height: 22px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-link-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .share-link-label {
    display: none;
  }
  .share-link-btn {
    padding: 2px 6px;
  }
}

/* ============================================================ */
/* ==== МОДАЛЬНОЕ ОКНО ЧЕЙНДЖЛОГА (TIMELINE ВЕРСИЙ 1.0) ==== */
/* ============================================================ */
.changelog-version-pill {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fef08a;
}

.changelog-new-dot {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffffff;
  color: #db2777;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: pulse 1.8s infinite;
}

.changelog-hero {
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.16), rgba(37, 99, 235, 0.12) 55%, transparent 100%);
}

.changelog-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 20px;
}

.changelog-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  background: linear-gradient(to bottom, #f59e0b 0%, #3b82f6 50%, rgba(148, 163, 184, 0.2) 100%);
  border-radius: 999px;
}

.changelog-release-item {
  position: relative;
}

.changelog-node-dot {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1e293b;
  border: 2.5px solid #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
  z-index: 2;
}

.changelog-release-item.is-major .changelog-node-dot {
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85);
}

.changelog-release-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.changelog-release-item.is-major .changelog-release-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 10px 28px -8px rgba(245, 158, 11, 0.15);
}

.changelog-ver-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  padding: 2.5px 9px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.changelog-ver-tag.major {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.changelog-latest-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.changelog-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.changelog-highlight-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.changelog-change-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.changelog-badge {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 2px;
}

.changelog-badge.badge-new {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.changelog-badge.badge-improved {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.changelog-badge.badge-fixed {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.changelog-change-text {
  flex: 1;
  min-width: 0;
}

/* ==== МОБИЛЬНЫЙ АДАПТИВ ИСТОРИИ ОБНОВЛЕНИЙ (УЛУЧШЕННАЯ ЧИТАБЕЛЬНОСТЬ) ==== */
@media (max-width: 640px) {
  /* 1. Компактная шапка, чтобы оставалось больше места под список */
  .changelog-hero {
    padding: 12px 14px !important;
  }
  .changelog-hero h2,
  .changelog-hero h3,
  .changelog-hero .text-xl,
  .changelog-hero .text-2xl {
    font-size: 16.5px !important;
    line-height: 1.25 !important;
    margin-top: 4px !important;
  }
  .changelog-hero p {
    font-size: 11.5px !important;
    margin-top: 2px !important;
  }

  /* 2. Экономим место по ширине: прижимаем таймлайн ближе к левому краю */
  .changelog-timeline {
    padding-left: 12px;
    gap: 12px;
  }
  .changelog-timeline::before {
    left: 2px;
    width: 1.5px;
  }
  .changelog-node-dot {
    left: -14px;
    top: 13px;
    width: 9px;
    height: 9px;
    border-width: 2px;
  }

  /* 3. Уменьшаем поля карточки релиза, отдавая ширину тексту */
  .changelog-release-card {
    padding: 12px 13px;
    border-radius: 13px;
  }
  .changelog-ver-tag {
    font-size: 11px;
    padding: 2px 7px;
  }

  /* 4. Компактные чипсы ключевых фич */
  .changelog-highlights-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .changelog-highlight-chip {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* 5. Строки изменений: делаем бейдж компактным inline-блоком в начале текста,
     чтобы длинные бейджи ("ИСПРАВЛЕНО") не сжимали текст в узкую колонку */
  .changelog-change-row {
    display: block;
    font-size: 12.5px;
    line-height: 1.48;
    padding: 3px 0;
  }
  .changelog-badge {
    display: inline-block;
    vertical-align: baseline;
    font-size: 8.5px;
    padding: 1.5px 5.5px;
    border-radius: 5px;
    margin-top: 0;
    margin-right: 6px;
    letter-spacing: 0.03em;
  }
  .changelog-change-text {
    display: inline;
  }
}

/* ============================================================ */
/* ==== ИНТУИТИВНАЯ КНОПКА СОРТИРОВКИ ГЛАВ (С 1-Й / НОВЫЕ) ==== */
/* ============================================================ */
.sort-order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--muted-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sort-order-pill:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
  color: #ffffff;
}
.sort-order-pill.is-desc {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde047;
}
.sort-order-icon {
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

/* ============================================================ */
/* ==== СТИЛИЗОВАННЫЕ КНОПКИ АДМИНИСТРИРОВАНИЯ (PILL & ICON)  ==== */
/* ============================================================ */

.admin-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.admin-pill-btn:active {
  transform: translateY(0) scale(0.97);
}

.admin-pill-btn.admin-pill-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.admin-pill-btn.admin-pill-blue:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #93c5fd;
  transform: translateY(-1px);
}

.admin-pill-btn.admin-pill-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0 8px;
}
.admin-pill-btn.admin-pill-amber:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fde68a;
  transform: translateY(-1px);
}

.admin-pill-btn.admin-pill-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0 8px;
}
.admin-pill-btn.admin-pill-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  transform: translateY(-1px);
}

.admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.admin-icon-btn:active {
  transform: scale(0.93);
}

.admin-icon-btn.admin-icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.admin-icon-btn.admin-icon-amber:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  color: #fde68a;
  transform: scale(1.08);
}

.admin-icon-btn.admin-icon-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.admin-icon-btn.admin-icon-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fca5a5;
  transform: scale(1.08);
}

/* ==== ПРОДВИНУТАЯ ЧИТАЛКА В СТИЛЕ MANGALIB (ЗУМ И ПАНЕЛИ) ==== */

.reader-bar {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  padding: 7px 10px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  gap: 7px !important;
}
.reader-bar--hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.reader-bar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.reader-bar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.reader-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: 9px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.reader-top-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.reader-top-btn.is-active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #ffffff;
}
.reader-top-btn--icon,
.reader-top-btn--close {
  min-width: 36px;
  padding: 0 10px;
}

/* Приоритетное растяжение кнопки комментариев */
.reader-top-btn--comments {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(18, 19, 31, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  color: #93c5fd;
}
.reader-top-btn--comments:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}
.reader-top-btn--comments.is-active {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}

/* Просмотры текущей главы в шапке */
.reader-top-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Селектор и стрелки переключения глав в шапке читалки */
.reader-nav-ch-btn {
  width: 32px;
  min-width: 32px;
  height: 36px;
  border-radius: 9px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.reader-nav-ch-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}
.reader-nav-ch-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Приоритетное растяжение выпадающего списка глав */
.reader-chapter-select {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  min-width: 120px;
  flex: 1 1 auto;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  color-scheme: dark;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}
.reader-chapter-select:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
}

.reader-chapter-select option {
  background-color: #0f172a;
  color: #f8fafc;
  font-weight: 600;
  padding: 6px 10px;
}

/* Адаптивное поведение: на смартфонах и в Telegram WebApp оба ряда занимают 100% ширины */
@media (max-width: 680px) {
  .reader-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
  }
  .reader-bar-left {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .reader-nav-chapters {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .reader-chapter-select {
    max-width: none !important;
    font-size: 11.5px;
  }
  .reader-bar-right {
    width: 100% !important;
    flex: 1 1 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .reader-top-btn--comments {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}

/* Пульт зума в шапке */
.reader-zoom-controls {
  display: inline-flex;
  align-items: center;
  height: 36px;
  min-height: 36px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  overflow: hidden;
}
.reader-zoom-btn {
  width: 28px;
  height: 100%;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.reader-zoom-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.reader-zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.reader-zoom-val {
  height: 100%;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.reader-zoom-val:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #a5b4fc;
}

/* Выдвижная панель настроек читалки */
.reader-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10010;
}
.reader-settings-drawer {
  position: fixed;
  top: 56px;
  right: 12px;
  width: calc(100vw - 24px);
  max-width: 360px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 16px;
  z-index: 10011;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.8);
}

@media (max-width: 640px) {
  .reader-settings-drawer {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 82vh !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    padding: 10px 18px 28px 18px !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85) !important;
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}

/* Единый Segmented Control для режимов читалки */
.reader-segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.reader-seg-btn {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.2;
}
.reader-seg-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}
.reader-seg-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.reader-opt-btn {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reader-opt-btn:hover {
  border-color: #60a5fa;
  color: #fff;
}
.reader-opt-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: #93c5fd;
  color: #ffffff;
}

/* Пресеты ширины страницы */
.reader-preset-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}
.reader-preset-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.5);
}
.reader-preset-chip:active {
  transform: scale(0.97);
}
.reader-preset-chip.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1, 0 4px 12px rgba(99, 102, 241, 0.25);
}
.reader-preset-name {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}
.reader-preset-val {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.reader-preset-chip.active .reader-preset-val {
  color: #a5b4fc;
}

/* Кнопки зума */
.reader-zoom-btn-pill {
  min-width: 54px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.reader-zoom-btn-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.5);
}
.reader-zoom-btn-pill:active {
  transform: scale(0.97);
}

/* Сетка выбора фона читалки */
.reader-bg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.reader-bg-swatch {
  height: 38px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  position: relative;
  outline: none;
}
.reader-bg-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
}
.reader-bg-swatch.active {
  border: 2px solid #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}
.reader-bg-check {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Кастомный переключатель (Toggle Switch) */
.reader-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.reader-switch-track {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.reader-switch-track.is-checked {
  background: #6366f1;
  border-color: #818cf8;
}
.reader-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 999px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.reader-switch-track.is-checked .reader-switch-thumb {
  transform: translateX(18px);
}

/* Контейнер зума в вертикальной ленте */
.reader-pages.is-zoomed {
  overflow-x: auto;
  align-items: flex-start;
}
.reader-zoom-track {
  margin: 0 auto;
  transition: width 0.18s ease;
}
.reader-page-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.reader-image {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
  user-select: none;
}
.reader-image--seamless {
  border-radius: 0 !important;
  margin: 0 !important;
}

/* Контейнер зума и рабочей ширины в горизонтальном (постраничном) режиме */
.reader-horizontal {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 46px);
  height: auto !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 !important; /* Убираем padding-bottom: 100px, который создавал чёрную полосу внизу */
  margin: 0 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.reader-horizontal-stage {
  position: relative;
  margin: 0 auto;
  padding-top: 16px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.18s ease;
}

.reader-horizontal-stage img,
.reader-horizontal-img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  user-select: none;
}

/* Секция комментариев: занимает всю ширину и уходит вниз до упора экрана во всех темах */
.reader-horizontal-comments-box {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important; /* Автоматически заполняет 100% оставшейся высоты страницы вниз */
  min-height: 45vh !important;
  margin: 0 !important;
  padding: 28px 16px calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(13, 19, 34, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: none !important;
  text-align: left;
  box-sizing: border-box !important;
  position: relative;
  z-index: 10;
}

/* Центрирование контента комментариев для комфортного чтения */
.reader-horizontal-comments-box > * {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* ==== СВЕТЛАЯ ТЕМА ДЛЯ ЭЛЕМЕНТОВ УПРАВЛЕНИЯ ЧИТАЛКИ ==== */
/* Сами поля по бокам страницы остаются темным кинотеатральным фоном,
   а верхняя панель, нижний HUD и блок комментариев корректно переключаются в светлую тему */
html[data-theme="light"] .reader-bar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid var(--card-border) !important;
}
html[data-theme="light"] .reader-bar .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-top-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-top-btn:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
html[data-theme="light"] .reader-chapter-select {
  background-color: #ffffff !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
  color-scheme: light !important;
}
html[data-theme="light"] .reader-chapter-select option,
html[data-theme="light"] .reader-chapter-select optgroup {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-zoom-controls {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .reader-zoom-btn {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-zoom-val {
  color: var(--accent) !important;
}
html[data-theme="light"] .reader-nav-ch-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}

/* Нижний HUD страниц читалки */
html[data-theme="light"] .reader-bottom-hud {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15) !important;
}
html[data-theme="light"] .reader-hud-page-select {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
  color-scheme: light !important;
}
html[data-theme="light"] .reader-hud-page-select option {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-hud-step-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-hud-comment-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}

/* Настройки читалки в светлой теме */
html[data-theme="light"] .reader-settings-drawer {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.2) !important;
}
html[data-theme="light"] .reader-settings-drawer .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-segmented {
  background: #f1f5f9 !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .reader-seg-btn {
  color: #64748b !important;
}
html[data-theme="light"] .reader-seg-btn:hover:not(.active) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .reader-seg-btn.active {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  color: #ffffff !important;
}
html[data-theme="light"] .reader-preset-chip {
  background: #f8fafc !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .reader-preset-name {
  color: #0f172a !important;
}
html[data-theme="light"] .reader-preset-chip.active {
  background: rgba(99, 102, 241, 0.12) !important;
  border-color: #6366f1 !important;
}
html[data-theme="light"] .reader-zoom-btn-pill {
  background: #f8fafc !important;
  border-color: var(--card-border) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .reader-switch-track {
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
}
html[data-theme="light"] .reader-switch-track.is-checked {
  background: #6366f1 !important;
  border-color: #4f46e5 !important;
}

/* Блок комментариев под страницей манги */
html[data-theme="light"] .reader-horizontal-comments-box {
  background: #ffffff !important;
  border-top: 1px solid var(--card-border) !important;
  color: var(--text-primary) !important;
}

html[data-theme="light"] .reader-horizontal {
  background: transparent !important;
}

html[data-theme="light"] .reader-end-box,
html[data-theme="light"] .reader-comments-drawer,
html[data-theme="light"] .reader-settings-drawer {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12) !important;
  color: var(--text-primary) !important;
}

/* Форма добавления комментария внутри светлой читалки */
html[data-theme="light"] .reader-horizontal-comments-box div[class*="bg-slate-900"],
html[data-theme="light"] .reader-comments-drawer div[class*="bg-slate-900"] {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .reader-horizontal-comments-box .text-slate-100 {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .reader-horizontal-comments-box .text-slate-400,
html[data-theme="light"] .reader-horizontal-comments-box .text-slate-500 {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box h4,
html[data-theme="light"] .reader-horizontal-comments-box .text-white,
html[data-theme="light"] .reader-comments-drawer h4,
html[data-theme="light"] .reader-comments-drawer .text-white,
html[data-theme="light"] .reader-settings-drawer h4,
html[data-theme="light"] .reader-settings-drawer .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .border-white\/10,
html[data-theme="light"] .reader-comments-drawer .border-white\/10,
html[data-theme="light"] .reader-settings-drawer .border-white\/10 {
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .comment-item,
html[data-theme="light"] .reader-comments-drawer .comment-item {
  background: rgba(241, 245, 249, 0.85) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .comment-text,
html[data-theme="light"] .reader-comments-drawer .comment-text {
  color: #1e293b !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .comment-author-name,
html[data-theme="light"] .reader-comments-drawer .comment-author-name {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .theme-input,
html[data-theme="light"] .reader-comments-drawer .theme-input {
  background-color: #ffffff !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-horizontal-comments-box .theme-input::placeholder,
html[data-theme="light"] .reader-comments-drawer .theme-input::placeholder {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .reader-opt-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .reader-opt-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  .reader-horizontal-comments-box {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin: 16px auto 80px !important;
    padding: 14px 12px !important;
    border-radius: 14px;
    box-sizing: border-box !important;
  }
  .reader-horizontal-comments-box .comment-item {
    padding: 10px 11px;
    background: rgba(15, 23, 42, 0.85);
  }
  .reader-horizontal-comments-box .comment-text {
    font-size: 13.5px !important;
    line-height: 1.5;
    color: #f8fafc !important;
  }
  .reader-horizontal-comments-box .comment-author-name {
    font-size: 13px !important;
    color: #ffffff !important;
  }
}

/* ============================================================ */
/* ==== DRAG & DROP СОРТИРОВКА СТРАНИЦ В РЕДАКТОРЕ ГЛАВЫ ==== */
/* ============================================================ */
.page-preview-item {
  position: relative;
  cursor: grab;
  user-select: none;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.page-preview-item:hover {
  border-color: #60a5fa !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.page-preview-item:active {
  cursor: grabbing;
}

.page-preview-item img {
  pointer-events: none;
  user-select: none;
}

.page-preview-item.is-dragging {
  opacity: 0.35;
  transform: scale(0.93);
  border: 2px dashed #60a5fa !important;
}

.page-preview-item.is-drop-target {
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 8px 20px rgba(0, 0, 0, 0.6) !important;
  transform: scale(1.05);
  z-index: 5;
}

/* Кнопка быстрого удаления отдельной страницы в правом верхнем углу миниатюры */
.page-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 3;
}

.page-preview-item:hover .page-remove-btn {
  opacity: 1;
}

.page-remove-btn:hover {
  transform: scale(1.15);
  background: #ef4444;
}

/* Стрелки сдвига для удобства на тач-экранах */
.page-move-arrows {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}

.page-preview-item:hover .page-move-arrows {
  opacity: 1;
}

.page-step-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.page-step-btn:hover {
  background: #2563eb;
  color: #ffffff;
}

@media (max-width: 640px) {
  .page-remove-btn,
  .page-move-arrows {
    opacity: 1;
  }
}

/* ============================================================ */
/* ==== КНОПКА «ВОЙТИ В ТГ АККАУНТ» В ШАПКЕ РЯДОМ С ДОНАТОМ ==== */
/* ============================================================ */
.header-tg-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #229ED9, #0088cc);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.header-tg-login-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.5);
}
.header-tg-login-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ==== 1.1.2: компактная аватарка TG-профиля в шапке + поповер ==== */
.header-tg-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-tg-avatar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}
.header-tg-avatar-btn:hover,
.header-tg-avatar-btn.is-open {
  transform: translateY(-1px);
  border-color: #34d399;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.header-tg-avatar-btn .header-tg-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  border: none;
}
.header-tg-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 520px) {
  .header-tg-login-btn {
    padding: 0 10px;
    height: 36px;
    min-height: 36px;
    font-size: 11px;
  }
  .header-tg-avatar-btn {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 390px) {
  .header-tg-login-text {
    display: none;
  }
}

/* Окно профиля Telegram: всегда открывается прямо под аватаркой */
.header-tg-avatar-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

.header-tg-avatar-wrap .tg-profile-popover {
  display: flex;
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 300px !important;
  max-width: calc(100vw - 20px) !important;
  background: linear-gradient(165deg, rgba(17, 25, 44, 0.98) 0%, rgba(11, 15, 27, 0.98) 100%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 16px !important;
  padding: 14px !important;
  z-index: 10030 !important;
  box-shadow:
    0 20px 48px -6px rgba(0, 0, 0, 0.85),
    0 0 20px rgba(16, 185, 129, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  flex-direction: column !important;
  gap: 11px !important;
  transform-origin: top right !important;
  box-sizing: border-box !important;
}

/* ==== АККУРАТНАЯ СТИЛИЗАЦИЯ КАРТОЧКИ HACHIMI EDGE ==== */
.article-promo-card {
  position: relative;
  overflow: hidden;
  padding: 16px 20px !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.28) 0%, var(--panel-bg) 70%) !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.article-promo-card:hover {
  border-color: rgba(96, 165, 250, 0.6) !important;
  box-shadow: 0 12px 28px -6px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-2px);
}

.article-promo-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.article-promo-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.article-promo-logo-wrap {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

.article-promo-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
}

.article-promo-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

/* Адаптация карточки Hachimi Edge и текстов сайтов для светлой темы */
html[data-theme="light"] .article-promo-card {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.65) 0%, var(--card-bg) 70%) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.07) !important;
}
html[data-theme="light"] .article-promo-title {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .article-promo-desc {
  color: #475569 !important;
}
html[data-theme="light"] .article-promo-logo-wrap {
  background: #ffffff !important;
  border-color: rgba(96, 165, 250, 0.3) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .site-card-title,
html[data-theme="light"] .site-card-title a {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .site-card-title a:hover {
  color: var(--accent) !important;
}
html[data-theme="light"] .site-desc-text {
  color: #334155 !important;
}
html[data-theme="light"] .site-desc-text strong {
  color: #0f172a !important;
}
html[data-theme="light"] .site-domain-pill {
  background: rgba(15, 23, 42, 0.04) !important;
  color: var(--text-muted) !important;
}
html[data-theme="light"] .site-desc-expand-btn {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--accent) !important;
}
html[data-theme="light"] .site-desc-expand-btn:hover {
  background: #ffffff !important;
  color: var(--accent-hover) !important;
}

/* Исправление невидимого белого текста в светлой теме */
html[data-theme="light"] .meta-card-title,
html[data-theme="light"] h3.meta-card-title {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .theme-card h3.text-slate-100,
html[data-theme="light"] .theme-card .text-slate-100,
html[data-theme="light"] .artday-compact-row .text-slate-100 {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .artday-date-badge {
  background: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}

html[data-theme="light"] .artday-compact-row {
  background-color: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}

/* Светлая тема для раздела «Клуб» */
html[data-theme="light"] .theme-panel h3.text-white,
html[data-theme="light"] .theme-panel .text-white {
  color: var(--text-primary) !important;
}

/* Список и карточки участников клуба */
html[data-theme="light"] [class*="bg-slate-900/70"] {
  background-color: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] [class*="bg-slate-900/70"]:hover {
  border-color: var(--card-hover-border) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] [class*="bg-slate-900/70"] .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] [class*="bg-slate-900/70"] .bg-white\/5 {
  background-color: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-muted) !important;
}

/* Переключатель «В клубе (30) / Все (33)» */
html[data-theme="light"] .bg-slate-900\/80 {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .bg-slate-900\/80 button:not(.bg-blue-600) {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .bg-slate-900\/80 button:not(.bg-blue-600):hover {
  color: var(--text-primary) !important;
}

.article-promo-action {
  flex-shrink: 0;
}

.article-promo-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 18px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.15s ease;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .article-promo-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .article-promo-info {
    align-items: flex-start;
  }
  .article-promo-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Окно профиля Telegram: всегда крепится строго под аватарку */
.header-tg-avatar-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

.tg-profile-popover {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 300px !important;
  max-width: calc(100vw - 20px) !important;
  background: linear-gradient(165deg, rgba(17, 25, 44, 0.98) 0%, rgba(11, 15, 27, 0.98) 100%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 16px !important;
  padding: 14px !important;
  z-index: 10030 !important;
  box-shadow:
    0 20px 48px -6px rgba(0, 0, 0, 0.85),
    0 0 20px rgba(16, 185, 129, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 11px !important;
  transform-origin: top right !important;
  box-sizing: border-box !important;
}

.tg-popover-fade-enter-active,
.tg-popover-fade-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tg-popover-fade-enter-from,
.tg-popover-fade-leave-to {
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
}

@media (max-width: 480px) {
  .tg-profile-popover {
    width: min(290px, calc(100vw - 16px)) !important;
    right: -4px !important;
  }
}

@keyframes tgPopoverIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.tg-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 2px 2px 4px;
}

.tg-profile-avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.tg-profile-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.tg-profile-name {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tg-profile-login {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  margin-top: 2px;
}

.tg-profile-id {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5px 6px;
  border-radius: 5px;
  margin-top: 4px;
}

.tg-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0;
  border: none;
}

.tg-profile-stat {
  text-align: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tg-profile-stat:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(15, 23, 42, 0.95);
}

.tg-profile-stat-value {
  font-size: 16.5px;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: #34d399;
  line-height: 1.1;
}

.tg-profile-stat-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.tg-profile-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.tg-profile-action-btn {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(79, 70, 229, 0.22));
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.tg-profile-action-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: #93c5fd;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.tg-profile-action-btn:active {
  transform: translateY(0) scale(0.98);
}

.tg-profile-action-btn--danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fca5a5;
  box-shadow: none;
}

.tg-profile-action-btn--danger:hover {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
  border-color: #f87171;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* ==== 1.1.2: улучшенный мобильный вид «Полезных сайтов» ==== */
@media (max-width: 640px) {
  .useful-sites-grid {
    gap: 12px;
  }
  .site-preview-box {
    height: 170px;
  }
  .site-card-body {
    padding: 12px 13px;
    gap: 6px;
  }
  .site-card-title {
    font-size: 15.5px;
    line-height: 1.3;
  }
  .site-domain-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
  .site-badge {
    font-size: 9.5px;
    padding: 2px 7px;
  }
  .site-desc-text {
    font-size: 12px;
  }
  .site-visit-btn {
    height: 40px;
    font-size: 13px;
  }
}

/* ============================================================ */
/* ==== ИДЕИ 3, 4, 5: ИЗБРАННОЕ, СЦЕНАРИИ И КОМПАКТНЫЙ ВИД ==== */
/* ============================================================ */

/* Переключатель вида (Сетка ⊞ / Список ☰) */
.sites-view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--muted-bg);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  gap: 2px;
  flex-shrink: 0;
}

.sites-view-btn {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sites-view-btn:hover {
  color: var(--text-primary);
}
.sites-view-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Кнопка звёздочки избранного (⭐) */
.site-fav-btn {
  background: transparent;
  border: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
  user-select: none;
}
.site-fav-btn:hover {
  transform: scale(1.2);
  color: #fbbf24;
}
.site-fav-btn.active {
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
}

.site-card.is-favorite-card {
  border-color: rgba(245, 158, 11, 0.38) !important;
  box-shadow: 0 8px 24px -6px rgba(245, 158, 11, 0.15);
}

/* Компактный режим отображения (строки) */
.useful-sites-compact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.site-compact-row {
  min-height: 46px;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.site-compact-row:hover {
  border-color: var(--card-hover-border) !important;
  background-color: var(--muted-bg);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.25);
}
.site-compact-row.is-favorite {
  border-left: 3.5px solid #f59e0b !important;
}

.site-compact-thumb {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Адаптация под светлую тему */
html[data-theme="light"] .sites-view-toggle {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .sites-view-btn:not(.active) {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .sites-view-btn:not(.active):hover {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .site-compact-row {
  background-color: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}
html[data-theme="light"] .site-compact-row:hover {
  background-color: #ffffff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

/* Горизонтальный скролл фильтров-категорий на телефоне, чтобы не сжимались в кашу */
@media (max-width: 640px) {
  .useful-sites-grid ~ .theme-panel,
  .theme-panel:has(.filter-pill-btn) {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .theme-panel:has(.filter-pill-btn)::-webkit-scrollbar {
    display: none;
  }
  .filter-pill-btn {
    flex-shrink: 0;
  }
}
.reader-zone.zone-narrow {
  width: 15% !important;
}

/* При активном зуме отключаем клик-зоны, чтобы одним пальцем можно было спокойно двигать страницу */
.reader-horizontal.is-zoomed .reader-zone,
.reader-horizontal[data-zoomed="true"] .reader-zone {
  pointer-events: none !important;
  display: none !important;
}

/* Компактный нижний бар страниц (аккуратная плашка, не перекрывающая кадры) */
.reader-bottom-hud {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: min(94vw, 380px);
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(18, 19, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10005;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
  user-select: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.reader-hud-page-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.reader-hud-page-select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  height: 36px;
  padding: 0 24px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reader-hud-page-select:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
}

.reader-hud-page-select option {
  background-color: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  padding: 6px 10px;
}

.reader-hud-page-chevron {
  position: absolute;
  right: 9px;
  font-size: 8px;
  color: #94a3b8;
  pointer-events: none;
}

.reader-hud-step-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reader-hud-step-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
}

.reader-hud-step-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Блок конца главы и плавающий счётчик страницы */
.reader-end-box {
  width: min(95vw, 840px);
  max-width: 840px;
  margin: 28px auto 48px;
  padding: 22px 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .reader-end-box {
    width: calc(100% - 16px);
    margin: 18px 8px 36px;
    padding: 16px 12px;
    border-radius: 14px;
  }
}

.comment-input-textarea {
  min-height: 96px;
  line-height: 1.5;
  font-size: 13.5px;
  resize: vertical;
}

@media (max-width: 640px) {
  /* 16px предотвращает принудительный авто-зум экрана в iOS Safari и Telegram WebApp */
  .comment-input-textarea,
  .comic-filter-input {
    font-size: 16px !important;
  }
  .comment-input-textarea {
    min-height: 80px;
  }
}
.reader-next-ch-btn {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reader-next-ch-btn--primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.reader-next-ch-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.reader-floating-counter {
  position: fixed;
  bottom: 14px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  z-index: 10004;
}

/* ============================================================ */
/* ==== БЛОК КОММЕНТАРИЕВ К ГЛАВЕ ==== */
/* ============================================================ */
.reader-comments-section {
  width: 100%;
  margin-top: 20px;
  text-align: left;
}

.comment-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}
.comment-item:hover {
  border-color: rgba(96, 165, 250, 0.35);
}

.comment-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 1.5px solid rgba(96, 165, 250, 0.45) !important;
  display: block !important;
  pointer-events: auto !important;
}

.comment-avatar-fallback {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #2563eb, #8b5cf6) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
}

.comment-author-name {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
}

.comment-username-link {
  font-size: 11px;
  color: #60a5fa;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
}
.comment-username-link:hover {
  text-decoration: underline;
}

.comment-date {
  font-size: 10.5px;
  color: var(--text-muted);
}

.comment-text {
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.6;
  padding: 2px 6px;
  border-radius: 6px;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.comment-delete-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
}

.comment-tg-login-banner {
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.12), rgba(37, 99, 235, 0.1));
  border: 1px solid rgba(34, 158, 217, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Гарантированное отображение всплывающих уведомлений (Toast) поверх модалки читалки */
.toast-wrap {
  z-index: 100100 !important;
}

/* Плавный скролл, смена фона и поддержка touch-прокрутки для читалки */
.reader-modal {
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch !important;
  transition: background-color 0.25s ease !important;
}

.reader-modal.reader-bg-black { background-color: #050507 !important; }
.reader-modal.reader-bg-dark  { background-color: #132038 !important; }
.reader-modal.reader-bg-sepia { background-color: #2b231d !important; }
.reader-modal.reader-bg-gray  { background-color: #27272a !important; }

.reader-pages,
.reader-page-wrap,
.reader-zoom-track,
.reader-horizontal,
.reader-horizontal-stage {
  background-color: transparent !important;
  background: transparent !important;
}

#reader-comments-anchor {
  scroll-margin-top: 60px;
}

/* Кнопка комментариев на каждой странице ленты */
.page-comments-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0 10px;
}

.page-comments-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.page-comments-btn:hover {
  background: rgba(37, 99, 235, 0.35);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

.page-comments-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
}

/* Кнопка комментариев в нижнем баре постраничного режима */
.reader-hud-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reader-hud-comment-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

/* ==== ОФОРМЛЕНИЕ ШТОРКИ ПОСТРАНИЧНЫХ КОММЕНТАРИЕВ ==== */
.reader-comments-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10020;
}

.reader-comments-drawer {
  position: fixed;
  top: 54px;
  right: 14px;
  left: auto;
  width: min(440px, calc(100vw - 28px));
  max-width: 440px;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  background: rgba(13, 19, 34, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  padding: 16px;
  z-index: 10025;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  box-sizing: border-box !important;
  text-align: left !important;
  overflow: hidden;
}

@media (max-width: 640px) {
  .reader-comments-drawer {
    top: 50px !important;
    bottom: 12px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 62px) !important;
    max-height: calc(100dvh - 62px) !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }
}

/* ==== ВИДЖЕТ ПРОГРЕССА ПРОСМОТРА СЕРИЙ UMAYURU ==== */
.umayuru-progress-widget {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 7px !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.22) !important;
  width: auto !important;
  min-width: 210px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.umayuru-progress-content {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

.umayuru-progress-icon {
  font-size: 15px;
  line-height: 1;
}

.umayuru-progress-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.umayuru-progress-numbers {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: #94a3b8;
}

.umayuru-progress-percent {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  padding: 1.5px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.umayuru-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.umayuru-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Кнопка синхронизации иконок с GameTora */
.sync-char-icons-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(139, 92, 246, 0.22));
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sync-char-icons-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #ffffff;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.sync-char-icons-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==== СТИЛИ ВКЛАДОК ПАНЕЛИ УПРАВЛЕНИЯ (ADMIN HUB) ==== */
.admin-hub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.admin-hub-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}
.admin-hub-tab-btn.active {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.admin-hub-tab-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.25);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ============================================================ */
/* ==== СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (ВЕРСИЯ 1.1.0) ==== */
/* ============================================================ */
.home-hero {
  background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
              radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 60%),
              var(--panel-bg) !important;
  border: 1px solid var(--panel-border) !important;
}

.home-mascot-col {
  width: 280px;
  max-width: 100%;
  flex: 0 0 280px;
}

.home-mascot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-mascot-glow {
  position: absolute;
  inset: -16px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(236, 72, 153, 0.16) 50%, transparent 75%);
  filter: blur(20px);
  z-index: 1;
  pointer-events: none;
}

.home-mascot-img {
  width: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
  user-select: none;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.7));
  animation: mascotFloat 4.5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.home-nav-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  width: 100%;
  text-decoration: none;
}

.home-nav-card:hover {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.5);
}

.home-nav-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.home-nav-title {
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.3;
}

.home-nav-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.home-nav-arrow {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.home-nav-card:hover .home-nav-arrow {
  color: #60a5fa;
  transform: translateX(3px);
}

@media (max-width: 768px) {
  .home-hero {
    padding: 16px 14px !important;
  }
  .home-mascot-col {
    width: 150px;
    flex: 0 0 auto;
  }
  .home-mascot-img {
    max-height: 185px;
  }
  .home-nav-card {
    padding: 10px 12px;
    border-radius: 13px;
    gap: 10px;
  }
  .home-nav-icon {
    font-size: 20px;
  }
  .home-nav-title {
    font-size: 13px;
  }
  .home-nav-sub {
    font-size: 10.5px;
  }
}

/* ============================================================ */
/* ==== КОЛОКОЛЬЧИК УВЕДОМЛЕНИЙ В ШАПКЕ ==== */
/* ============================================================ */
.header-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  color: #f8fafc;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.header-notif-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
}

.header-notif-btn.has-unread {
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.35);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #ec4899);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  padding: 1.5px 5px;
  border-radius: 999px;
  line-height: 1;
  border: 1.5px solid #070a12;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Адаптивная нижняя панель навигации (автоматическое число равных колонок для любого числа кнопок) */
.bottom-nav-inner,
.bottom-nav-inner--v11 {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: 1fr !important;
  grid-template-columns: none !important;
  max-width: 720px !important;
  padding: 0 4px !important;
}

@media (max-width: 480px) {
  .bottom-nav-inner,
  .bottom-nav-inner--v11 {
    padding: 0 2px !important;
  }
  .bottom-nav-inner .bottom-nav-btn,
  .bottom-nav-inner--v11 .bottom-nav-btn {
    padding: 3px 0 !important;
    min-width: 0 !important;
  }
  .bottom-nav-inner .bottom-nav-label,
  .bottom-nav-inner--v11 .bottom-nav-label {
    font-size: 9px !important;
    letter-spacing: -0.3px !important;
    white-space: nowrap !important;
  }
  .bottom-nav-inner .bottom-nav-icon-wrap,
  .bottom-nav-inner--v11 .bottom-nav-icon-wrap {
    width: 36px !important;
    height: 24px !important;
  }
  .bottom-nav-inner .bottom-nav-icon,
  .bottom-nav-inner--v11 .bottom-nav-icon {
    font-size: 16px !important;
  }
}

/* ==== ЗАМЕТНАЯ КНОПКА ОТВЕТА НА КОММЕНТАРИИ ==== */
.reply-comment-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #93c5fd !important;
  background: rgba(59, 130, 246, 0.16) !important;
  border: 1px solid rgba(59, 130, 246, 0.38) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.reply-comment-btn:hover {
  background: rgba(37, 99, 235, 0.35) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
}

.reply-comment-btn:active {
  transform: translateY(0) scale(0.96) !important;
}

.reply-target-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  background: rgba(37, 99, 235, 0.18) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  font-size: 11.5px !important;
  margin-bottom: 8px !important;
  box-sizing: border-box !important;
}

.reply-target-cancel {
  background: transparent !important;
  border: none !important;
  color: #f87171 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  transition: background-color 0.15s ease !important;
}

.reply-target-cancel:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
}

/* ==== ВЛОЖЕННЫЕ ОТВЕТЫ ПРЯМО РЯДОМ С ИСХОДНЫМ КОММЕНТАРИЕМ ==== */
.comment-item.is-reply {
  margin-left: 24px !important;
  margin-top: 8px !important;
  margin-bottom: 6px !important;
  background: rgba(24, 34, 53, 0.75) !important;
  border-left: 3px solid #3b82f6 !important;
  border-radius: 12px !important;
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 4px !important;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.comment-item.is-reply::before {
  content: '';
  position: absolute;
  left: -15px;
  top: -12px;
  width: 12px;
  height: 28px;
  border-left: 2px solid rgba(59, 130, 246, 0.5);
  border-bottom: 2px solid rgba(59, 130, 246, 0.5);
  border-bottom-left-radius: 6px;
  pointer-events: none;
}

.comment-reply-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  font-size: 10.5px;
  color: #93c5fd;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .comment-item.is-reply {
    margin-left: 14px !important;
    margin-top: 7px !important;
    margin-bottom: 5px !important;
  }
  .comment-item.is-reply::before {
    left: -10px;
    top: -10px;
    width: 8px;
    height: 24px;
  }
}

/* ============================================================ */
/* ==== ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ О КОММЕНТАРИЯХ СЛЕВА СВЕРХУ ==== */
/* ============================================================ */
.reply-popup-container {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100050;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  max-width: calc(100vw - 36px);
  pointer-events: none;
}

.reply-popup-card {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(13, 19, 34, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.75), 0 0 24px rgba(59, 130, 246, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.reply-popup-card:hover {
  transform: translateY(-2px);
  border-color: #60a5fa;
  box-shadow: 0 20px 48px -6px rgba(0, 0, 0, 0.85), 0 0 30px rgba(59, 130, 246, 0.35);
}

.reply-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reply-popup-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.reply-popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #60a5fa;
  animation: pulse 1.8s infinite;
}

.reply-popup-time {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin-left: auto;
}

.reply-popup-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.reply-popup-close:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.reply-popup-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reply-popup-sender {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reply-popup-avatar {
  font-size: 13px;
  line-height: 1;
}

.reply-popup-sender-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.reply-popup-chapter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #60a5fa;
}

.reply-popup-book-icon {
  font-size: 11px;
}

.reply-popup-chapter-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-popup-page {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: normal;
}

.reply-popup-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 7px 10px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.reply-popup-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #34d399;
  opacity: 0.85;
}

.reply-popup-arrow {
  transition: transform 0.15s ease;
}

.reply-popup-card:hover .reply-popup-arrow {
  transform: translateX(3px);
}

.reply-popup-anim-enter-active,
.reply-popup-anim-leave-active {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.reply-popup-anim-enter-from {
  opacity: 0;
  transform: translate3d(-30px, -15px, 0) scale(0.9);
}

.reply-popup-anim-leave-to {
  opacity: 0;
  transform: translate3d(-20px, 0, 0) scale(0.95);
}

@media (max-width: 640px) {
  .reply-popup-container {
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* ============================================================ */
/* ==== ВЫПАДАЮЩИЙ ПОПОВЕР УВЕДОМЛЕНИЙ В ШАПКЕ (КАК У ПРОФИЛЯ) ==== */
/* ============================================================ */
.header-notif-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

.header-notif-btn.is-open {
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
  background: rgba(59, 130, 246, 0.25) !important;
  color: #ffffff !important;
}

.notif-popover {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 350px !important;
  max-width: calc(100vw - 20px) !important;
  max-height: min(520px, calc(100vh - 76px)) !important;
  max-height: min(520px, calc(100dvh - 76px)) !important;
  background: linear-gradient(165deg, rgba(17, 25, 44, 0.98) 0%, rgba(11, 15, 27, 0.98) 100%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  border-radius: 16px !important;
  padding: 13px !important;
  z-index: 10030 !important;
  box-shadow:
    0 20px 48px -6px rgba(0, 0, 0, 0.85),
    0 0 20px rgba(59, 130, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  transform-origin: top right !important;
  box-sizing: border-box !important;
}

/* Светлая тема для поповеров уведомлений и профиля Telegram */
html[data-theme="light"] .notif-popover,
html[data-theme="light"] .tg-profile-popover {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%) !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 20px 48px -6px rgba(15, 23, 42, 0.12), 0 0 20px rgba(59, 130, 246, 0.08) !important;
}

html[data-theme="light"] .notif-popover .text-white,
html[data-theme="light"] .tg-profile-popover .text-white,
html[data-theme="light"] .tg-profile-name {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .notif-popover .border-white\/10,
html[data-theme="light"] .tg-profile-popover .border-white\/10 {
  border-color: var(--card-border) !important;
}

html[data-theme="light"] .notif-card-item {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .notif-card-item.is-unread {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, #ffffff 100%) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  border-left: 3.5px solid #2563eb !important;
}

html[data-theme="light"] .notif-card-quote {
  background: rgba(241, 245, 249, 0.9) !important;
  color: #334155 !important;
  border-color: var(--card-border) !important;
}

/* Высокий контраст текста плашки бота в уведомлениях */
html[data-theme="light"] .notif-popover .bg-sky-500\/10 {
  background-color: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.28) !important;
}
html[data-theme="light"] .notif-popover .text-sky-300 {
  color: #0369a1 !important;
}
html[data-theme="light"] .notif-popover .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .notif-popover .text-slate-300 b {
  color: #0f172a !important;
}

/* Заголовок «Настройки» в верхней части шторки */
html[data-theme="light"] .tools-sheet-header h3.text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .tools-sheet-close {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .tools-sheet-close:hover {
  color: var(--text-primary) !important;
}

/* Кнопки и карточка полезных сайтов */
html[data-theme="light"] .site-visit-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(79, 70, 229, 0.12)) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}
html[data-theme="light"] .site-visit-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  color: #ffffff !important;
}
html[data-theme="light"] .site-card .bg-slate-800\/80,
html[data-theme="light"] .site-card button[class*="bg-slate-800"] {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .site-card .bg-slate-800\/80:hover {
  background-color: #ffffff !important;
  color: var(--accent) !important;
}

/* Окно детального просмотра полезного сайта (галерея) */
html[data-theme="light"] .site-gallery-modal {
  background: rgba(15, 23, 42, 0.78) !important;
}
html[data-theme="light"] .site-gallery-info {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15) !important;
}
html[data-theme="light"] .site-gallery-info h3,
html[data-theme="light"] .site-gallery-info .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .site-gallery-info .site-desc-text {
  color: #334155 !important;
}
html[data-theme="light"] .site-gallery-info .border-slate-800 {
  border-color: var(--card-border) !important;
}

html[data-theme="light"] .tg-profile-stat {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .tg-profile-id {
  background: rgba(15, 23, 42, 0.05) !important;
  color: var(--text-muted) !important;
  border-color: var(--card-border) !important;
}

/* Плотный непрозрачный фон окна профиля (устраняет просвечивание кнопок сзади) */
html[data-theme="light"] .tg-profile-popover {
  background: #ffffff !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: 0 20px 48px -6px rgba(15, 23, 42, 0.18), 0 0 1px 1px rgba(15, 23, 42, 0.08) !important;
}

/* Четкие контрастные цвета для кнопок «Синхронизация» и «Выйти» */
html[data-theme="light"] .tg-profile-action-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(79, 70, 229, 0.12)) !important;
  border: 1px solid rgba(37, 99, 235, 0.35) !important;
  color: #1d4ed8 !important; /* глубокий контрастный синий цвет */
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1) !important;
}

html[data-theme="light"] .tg-profile-action-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

html[data-theme="light"] .tg-profile-action-btn--danger {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #dc2626 !important; /* четкий читаемый красный цвет */
  box-shadow: none !important;
}

html[data-theme="light"] .tg-profile-action-btn--danger:hover {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
}

@media (max-width: 480px) {
  .notif-popover {
    width: min(320px, calc(100vw - 16px)) !important;
    right: -48px !important;
  }
}

.notif-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(96, 165, 250, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.notif-mark-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}
.notif-mark-read-btn:hover {
  background: rgba(59, 130, 246, 0.26);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

.notif-card-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.notif-card-item:hover {
  transform: translateX(2px); /* Сдвиг вправо вместо сдвига вверх, карточка больше не наползает на плашку бота */
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(24, 34, 53, 0.9);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(59, 130, 246, 0.2);
}
.notif-card-item:active {
  transform: translateX(1px) scale(0.99);
}

/* Непрочитанное уведомление — яркая синяя полоса слева и мягкое свечение */
.notif-card-item.is-unread {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.22) 0%, rgba(15, 23, 42, 0.88) 100%);
  border-color: rgba(59, 130, 246, 0.45);
  border-left: 3.5px solid #3b82f6;
  box-shadow: 0 4px 18px -2px rgba(37, 99, 235, 0.2);
}

.notif-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.notif-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid rgba(96, 165, 250, 0.4);
  display: block;
}

.notif-card-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.notif-card-subicon {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  border: 1.5px solid #0d1322;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notif-card-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  flex-shrink: 0;
  animation: pulse 1.8s infinite;
}

.notif-card-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  max-width: 100%;
}

.notif-card-quote {
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  background: rgba(11, 15, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2.5px solid #3b82f6;
  border-radius: 8px;
  padding: 6px 9px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-card-action-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #60a5fa;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.notif-card-item:hover .notif-card-action-hint {
  opacity: 1;
  transform: translateX(2px);
}

@media (max-width: 640px) {
  .notif-card-item {
    padding: 10px 11px;
    gap: 10px;
    border-radius: 12px;
  }
  .notif-card-avatar,
  .notif-card-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
  }
  .notif-card-chapter-pill {
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .notif-card-quote {
    font-size: 11.5px;
    padding: 5px 8px;
  }
}

/* ============================================================ */
/* ==== КРИТИЧЕСКИЙ ФИКС КАРКАСА СТРАНИЦЫ (ДЕСКТОП) ==== */
/* ============================================================ */

/* 1. Центрируем основной контейнер контента по ширине профиля */
.max-w-6xl {
  max-width: 72rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

/* 2. Возвращаем отступы для контента (чтобы не прилипало к краям) */
.px-4 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}
@media (min-width: 640px) {
  .sm\:px-6 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

/* 3. Принудительно делаем шапку и подвал фиксированной ширины,
      чтобы они не растягивались на 2000px на широких мониторах */
.sticky-header-inner,
.page-with-fixed-header > footer {
  max-width: 72rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

/* 4. Защита от растягивания картинок и блоков на ПК */
.page-with-fixed-header {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* 5. ИСПРАВЛЕНИЕ ГЛАВНОЙ СТРАНИЦЫ (Маскот и Hero-блок) */
.home-hero {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 2rem !important;
  padding: 2rem !important;
}

.home-mascot-col {
  flex: 0 0 280px !important;
  max-width: 280px !important;
  width: 100% !important;
}

.home-mascot-img {
  width: 100% !important;
  height: auto !important;
  max-height: 380px !important;
  object-fit: contain !important;
}

.home-content-col {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

@media (max-width: 768px) {
  .home-hero {
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 1rem !important;
  }
  .home-mascot-col {
    flex: 0 0 auto !important;
    max-width: 160px !important;
  }
  .home-mascot-img {
    max-height: 180px !important;
  }
}

/* Общее улучшение контрастности приглушенного текста в светлой теме */
html[data-theme="light"] .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .text-slate-200 {
  color: var(--text-primary) !important;
}

/* 1. Модальное окно Чейнджлога */
html[data-theme="light"] .changelog-hero {
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.08), rgba(37, 99, 235, 0.06) 55%, transparent 100%) !important;
}
html[data-theme="light"] .changelog-hero h3.text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .changelog-hero .text-slate-300 {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .changelog-release-card {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .changelog-release-card h4.text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .changelog-change-row {
  color: #334155 !important;
}
html[data-theme="light"] .changelog-timeline::before {
  background: linear-gradient(to bottom, #f59e0b 0%, #3b82f6 50%, rgba(148, 163, 184, 0.3) 100%) !important;
}
html[data-theme="light"] .changelog-node-dot {
  background: #ffffff !important;
}
html[data-theme="light"] .bg-slate-900\/75 {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}

/* 2. Модальное окно Команды UmaCity */
html[data-theme="light"] .bg-purple-500\/15 {
  background-color: rgba(147, 51, 234, 0.12) !important;
  border-color: rgba(147, 51, 234, 0.28) !important;
}
html[data-theme="light"] .text-purple-300 {
  color: #7e22ce !important;
}
html[data-theme="light"] .bg-slate-900\/60 {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}

/* 3. Модальное окно Панели управления (Admin Hub) */
html[data-theme="light"] .bg-slate-900\/90,
html[data-theme="light"] .bg-slate-950\/60 {
  background-color: var(--muted-bg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] .admin-hub-tab-btn:not(.active) {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .admin-hub-tab-btn:not(.active):hover {
  color: var(--text-primary) !important;
  background-color: rgba(15, 23, 42, 0.05) !important;
}

/* 4. Заявки тренеров в клуб */
html[data-theme="light"] div[class*="bg-slate-900/80"] {
  background-color: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] div[class*="bg-slate-900/80"] .text-white {
  color: var(--text-primary) !important;
}
html[data-theme="light"] div[class*="bg-slate-900/80"] .text-slate-300 {
  color: #334155 !important;
}

/* 5. Виджет прогресса UmaYuru в шапке раздела */
html[data-theme="light"] .umayuru-progress-widget {
  background: #ffffff !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.12) !important;
}
html[data-theme="light"] .umayuru-progress-label {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .umayuru-progress-numbers {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .umayuru-progress-numbers .text-slate-300 {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .umayuru-progress-track {
  background: rgba(15, 23, 42, 0.08) !important;
}

/* ============================================================ */
/* ==== ИГРОВОЙ ПРОФИЛЬ ТРЕНЕРА (UMADUMP STATS & HALL OF FAME) === */
/* ============================================================ */

.trainer-modal-dialog {
  max-width: 960px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 20%, rgba(20, 26, 45, 0.98), rgba(10, 14, 25, 0.99));
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
  border-radius: 20px;
  overflow: hidden;
}

.trainer-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.55);
}

.hero-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #38bdf8, #a855f7, #ec4899);
  opacity: 0.95;
  z-index: 1;
}

.stat-hero-box {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-hero-box:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.4);
}

.stat-hero-lbl { color: #94a3b8; }
.stat-hero-val { color: #ffffff; }
.stat-hero-sub { color: #64748b; }
.stat-winrate-num { color: #34d399; }
.stat-winrate-pct { color: #34d399; }
.stat-vet-num { color: #6ee7b7; }
.stat-vet-badge { color: #34d399; }
.stat-vet-star { color: #34d399; }

.stat-badge-chara {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.stat-badge-ssr {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.stat-badge-sr {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}
.stat-badge-r {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: #cbd5e1;
}

/* Кнопки и бейджи Hero-карточки */
.hero-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #020617;
  border: 1px solid rgba(253, 230, 138, 0.4);
  box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.35);
}
.hero-btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 10px 24px -4px rgba(245, 158, 11, 0.5);
}
.hero-btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.hero-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.hero-tg-badge {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #6ee7b7;
}
.hero-max-rank-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.hero-rank-tag {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
}
.hero-rank-score {
  color: #fcd34d;
}

/* Общие стили для плиток распределения рангов и значений карьеры */
.rank-dist-tile {
  transition: transform 0.15s ease;
}
.rank-dist-tile:hover {
  transform: translateY(-1px);
}
.rank-dist-count {
  color: #ffffff;
}

.rank-tile-uf { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); }
.rank-tile-uf .rank-tile-hdr { color: #f87171; }
.rank-tile-uf .rank-tile-pct { color: rgba(252, 165, 165, 0.8); }

.rank-tile-ug { background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.25); }
.rank-tile-ug .rank-tile-hdr { color: #c084fc; }
.rank-tile-ug .rank-tile-pct { color: rgba(216, 180, 254, 0.8); }

.rank-tile-ss { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25); }
.rank-tile-ss .rank-tile-hdr { color: #60a5fa; }
.rank-tile-ss .rank-tile-pct { color: rgba(147, 197, 253, 0.8); }

.rank-tile-s  { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); }
.rank-tile-s .rank-tile-hdr { color: #34d399; }
.rank-tile-s .rank-tile-pct { color: rgba(110, 231, 183, 0.8); }

.rank-tile-a  { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); }
.rank-tile-a .rank-tile-hdr { color: #fbbf24; }
.rank-tile-a .rank-tile-pct { color: rgba(253, 230, 138, 0.8); }

.rank-tile-b  { background: rgba(30, 41, 59, 0.7); border: 1px solid rgba(255, 255, 255, 0.08); }
.rank-tile-b .rank-tile-hdr { color: #94a3b8; }
.rank-tile-b .rank-tile-pct { color: #64748b; }

.career-hero-number { color: #ffffff; }
.career-stat-value { color: #ffffff; }
.career-max-score { color: #fcd34d; }

.trainer-hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.14), transparent 70%);
  pointer-events: none;
}

.trainer-hero-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08), transparent 70%);
  pointer-events: none;
}

.trainer-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 29, 35, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 3px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  cursor: pointer;
  transition: all 0.15s ease;
}
.trainer-id-pill:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.rank-pill.rank-uf {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}
.rank-pill.rank-ug {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.35);
}
.rank-pill.rank-ss {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
}
.rank-pill.rank-s {
  background: linear-gradient(135deg, #eab308, #84cc16);
  color: #1e293b;
}
.rank-pill.rank-a {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
}
.rank-pill.rank-b {
  background: linear-gradient(135deg, #475569, #64748b);
  color: #ffffff;
}

.horse-hall-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.horse-hall-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
}

.stat-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  flex: 1;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.stat-bar-fill.speed { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-bar-fill.stamina { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-bar-fill.power { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-bar-fill.guts { background: linear-gradient(90deg, #ec4899, #f472b6); }
.stat-bar-fill.wiz { background: linear-gradient(90deg, #10b981, #34d399); }

.spark-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.support-card-card {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.support-card-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
}
.support-card-card.ssr {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}
.support-card-card.ssr.is-mlb {
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}
.support-card-card.sr {
  border-color: rgba(148, 163, 184, 0.3);
}
.support-card-card.r {
  border-color: rgba(100, 116, 139, 0.2);
}

.support-card-card {
  cursor: pointer;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.support-card-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.support-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #090d16;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.support-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.support-card-card:hover .support-card-media img {
  transform: scale(1.04);
}

.support-card-tag {
  display: none;
}
.support-card-tag.ssr {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: 1px solid rgba(254, 240, 138, 0.6);
}
.support-card-tag.sr {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.support-card-tag.r {
  background: #475569;
  color: #cbd5e1;
}

.support-card-footer {
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(4px);
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.horse-hall-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.horse-hall-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chara-roster-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.chara-roster-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(15, 23, 42, 0.98);
}
.chara-roster-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  background: #1e293b;
  border: 1.5px solid rgba(245, 158, 11, 0.3);
}
.chara-roster-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-diamonds {
  display: inline-flex;
  gap: 3px;
}
.lb-diamond {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
}
.lb-diamond.active {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.dump-drop-zone {
  border: 2px dashed rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.03);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dump-drop-zone:hover, .dump-drop-zone.is-dragover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  transform: scale(1.01);
}

.costume-pill {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
}
.costume-pill:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
.costume-pill.active {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  border-color: #f59e0b;
}

/* =========================================================
   СТИЛИ КАРТОЧЕК ВЕТЕРАНОВ И НАВЫКОВ (UmaCity / uma.moe)
   ========================================================= */
.rank-badge-wrap {
  min-height: 40px;
}
.rank-badge-img {
  height: 40px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
  transition: transform 0.2s ease;
  display: inline-block;
}
.rank-crisp {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}
.horse-hall-card:hover .rank-badge-img {
  transform: scale(1.05);
}
@media (max-width: 640px) {
  .rank-badge-img {
    height: 34px;
    max-width: 80px;
  }
  .rank-badge-wrap {
    min-height: 34px;
  }
}

.scenario-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1.4;
}
.scenario-badge.sc-ura {
  background: rgba(132, 204, 22, 0.2);
  color: #bef264;
  border-color: rgba(132, 204, 22, 0.35);
}
.scenario-badge.sc-aoharu {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.35);
}
.scenario-badge.sc-gl {
  background: rgba(234, 179, 8, 0.2);
  color: #fef08a;
  border-color: rgba(234, 179, 8, 0.35);
}
.scenario-badge.sc-climax {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.35);
}
.scenario-badge.sc-gm {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.35);
}
.scenario-badge.sc-larc {
  background: rgba(236, 72, 153, 0.2);
  color: #fbcfe8;
  border-color: rgba(236, 72, 153, 0.35);
}
.scenario-badge.sc-uaf {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}
.scenario-badge.sc-default {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.35);
}

.stat-col-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 3px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(38, 53, 69, 0.65));
  background: rgba(20, 29, 35, 0.8);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.stat-col-box:hover {
  transform: translateY(-1px);
}
.stat-col-speed {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.14), rgba(20, 29, 35, 0.85));
  border-color: rgba(14, 165, 233, 0.25);
}
.stat-col-stamina {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.14), rgba(20, 29, 35, 0.85));
  border-color: rgba(244, 63, 94, 0.25);
}
.stat-col-power {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(20, 29, 35, 0.85));
  border-color: rgba(245, 158, 11, 0.25);
}
.stat-col-guts {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.14), rgba(20, 29, 35, 0.85));
  border-color: rgba(236, 72, 153, 0.25);
}
.stat-col-wit {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(20, 29, 35, 0.85));
  border-color: rgba(16, 185, 129, 0.25);
}
/* Компактный режим для карточек нераскрытых Ум во "Все ветераны" */
.stat-col-compact {
  padding: 3.5px 2px !important;
  border-radius: 9px !important;
}
.stat-col-compact .stat-col-hdr {
  font-size: 8px !important;
  gap: 1.5px !important;
  line-height: 1 !important;
}
.stat-col-compact .stat-col-val {
  font-size: 11px !important;
  margin: 1.5px 0 1px 0 !important;
}
.stat-col-compact .stat-rank-wrap {
  min-height: 17px !important;
}
.stat-col-compact .stat-rank-img {
  height: 16px !important;
  max-width: 32px !important;
}
.stat-col-compact .stat-col-rank {
  font-size: 8px !important;
  padding: 0.5px 3.5px !important;
}
@media (min-width: 640px) {
  .stat-col-compact {
    padding: 5px 3px !important;
    border-radius: 11px !important;
  }
  .stat-col-compact .stat-col-hdr {
    font-size: 8.5px !important;
  }
  .stat-col-compact .stat-col-val {
    font-size: 13.5px !important;
    margin: 2px 0 1px 0 !important;
  }
  .stat-col-compact .stat-rank-wrap {
    min-height: 20px !important;
  }
  .stat-col-compact .stat-rank-img {
    height: 18px !important;
    max-width: 36px !important;
  }
}
.stat-col-hdr {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  opacity: 0.9;
}
.stat-col-speed .stat-col-hdr { color: #34d399; }
.stat-col-stamina .stat-col-hdr { color: #fb7185; }
.stat-col-power .stat-col-hdr { color: #fbbf24; }
.stat-col-guts .stat-col-hdr { color: #f472b6; }
.stat-col-wit .stat-col-hdr { color: #34d399; }
.stat-col-val {
  font-family: ui-monospace, monospace;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  line-height: 1.1;
  margin: 3px 0 2px 0;
}
@media (min-width: 640px) {
  .stat-col-val {
    font-size: 15px;
  }
}
.stat-rank-wrap {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-rank-img {
  height: 22px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  transition: transform 0.15s ease;
  display: inline-block;
}
.horse-hall-card:hover .stat-rank-img {
  transform: scale(1.1);
}
@media (max-width: 640px) {
  .stat-rank-img {
    height: 19px;
    max-width: 38px;
  }
  .stat-rank-wrap {
    min-height: 20px;
  }
}
.stat-col-rank {
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-col-rank.sr-uf {
  background: linear-gradient(135deg, #06b6d4, #a855f7);
  color: #fff;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}
.stat-col-rank.sr-ug {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
}
.stat-col-rank.sr-ss {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.stat-col-rank.sr-s {
  background: linear-gradient(135deg, #eab308, #f59e0b);
  color: #1e1b4b;
}
.stat-col-rank.sr-a {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #fff;
}
.stat-col-rank.sr-b {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.stat-col-rank.sr-c {
  background: #0284c7;
  color: #fff;
}
.stat-col-rank.sr-d {
  background: #64748b;
  color: #fff;
}

.aptitudes-panel {
  border: 1px solid var(--border-subtle, rgba(38, 53, 69, 0.65));
  background: rgba(20, 29, 35, 0.88);
}
.apt-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.apt-letter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: -0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.apt-pill-s { background: #f59e0b; color: #1e1b4b; }
.apt-pill-a { background: #ea580c; color: #ffffff; }
.apt-pill-b { background: #eab308; color: #1c1917; }
.apt-pill-c { background: #10b981; color: #ffffff; }
.apt-pill-d { background: #0284c7; color: #ffffff; }
.apt-pill-e { background: #8b5cf6; color: #ffffff; }
.apt-pill-f { background: #475569; color: #cbd5e1; }
.apt-pill-g { background: #1e293b; color: #64748b; }

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 4px;
  border-radius: 7px;
  font-size: 11px;
  background: rgba(20, 29, 35, 0.9);
  border: 1px solid var(--border-subtle, rgba(38, 53, 69, 0.75));
  color: #f1f5f9;
  transition: transform 0.15s ease, border-color 0.15s ease;
  max-width: 100%;
}
.skill-chip:hover {
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}
.skill-chip-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(20, 29, 35, 0.95));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
}
.skill-chip-unique {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.16), rgba(20, 29, 35, 0.95));
  border-color: rgba(236, 72, 153, 0.5);
  color: #fbcfe8;
}
.skill-chip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
.skill-chip-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
@media (min-width: 640px) {
  .skill-chip-name {
    max-width: 190px;
  }
}
.skill-chip-lv {
  font-size: 9px;
  font-weight: 800;
  font-family: ui-monospace, monospace;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.chara-roster-card {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.chara-roster-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
\n

/* ========================================================================== */
/* ==== СВЕТЛАЯ ТЕМА: КЛУБ, ПРОФИЛЬ ТРЕНЕРА, ЗАЛ СЛАВЫ, 3D И МОДАЛКИ ======= */
/* ========================================================================== */

/* 1. Глобальный фон страницы профиля и шапка */
html[data-theme="light"] body {
  background-color: var(--bg-color, #f1f5f9) !important;
  color: var(--text-primary, #0f172a) !important;
}

html[data-theme="light"] .profile-nav-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .profile-nav-header .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .profile-nav-header .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .profile-nav-header .theme-toggle-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}
html[data-theme="light"] .profile-nav-header .theme-toggle-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 2. Сетка вкладок профиля тренера */
html[data-theme="light"] .profile-tabs-grid {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .profile-tab-btn {
  color: #64748b !important;
}
html[data-theme="light"] .profile-tab-btn:hover {
  color: #0f172a !important;
  background: rgba(37, 99, 235, 0.07) !important;
}
html[data-theme="light"] .profile-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #6366f1) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}
html[data-theme="light"] .profile-subfilter-btn {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .profile-subfilter-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .profile-subfilter-btn.active {
  background: linear-gradient(135deg, #2563eb, #6366f1) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

/* 3. Hero-карточка профиля тренера и диалог модалки */
html[data-theme="light"] .trainer-modal-dialog {
  background: radial-gradient(circle at 10% 20%, #ffffff, #f8fafc) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.2), 0 0 30px rgba(245, 158, 11, 0.1) !important;
}
html[data-theme="light"] .trainer-modal-dialog > div:first-child {
  background: #ffffff !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .trainer-modal-dialog .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .trainer-modal-dialog .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .trainer-modal-dialog button[class*="bg-slate-800"] {
  background: #f1f5f9 !important;
  color: #475569 !important;
}
html[data-theme="light"] .trainer-modal-dialog button[class*="bg-slate-800"]:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .trainer-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.07) !important;
}
html[data-theme="light"] .trainer-hero-card .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .trainer-hero-card .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .trainer-hero-card .trainer-id-pill {
  background: #eff6ff !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #1d4ed8 !important;
}
html[data-theme="light"] .trainer-hero-card .trainer-id-pill:hover {
  background: #dbeafe !important;
}

/* Кнопки и бейджи Hero-карточки в светлой теме */
html[data-theme="light"] .hero-btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .hero-btn-secondary:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .hero-tg-badge {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .hero-max-rank-pill {
  background: #ffffff !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12) !important;
}
html[data-theme="light"] .hero-rank-tag {
  background: #f1f5f9 !important;
  color: #475569 !important;
}
html[data-theme="light"] .hero-rank-score {
  color: #b45309 !important;
}

html[data-theme="light"] .trainer-hero-card div[class*="bg-slate-900/60"],
html[data-theme="light"] .trainer-hero-card .stat-hero-box {
  background-color: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
html[data-theme="light"] .trainer-hero-card .stat-hero-box:hover {
  background-color: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .trainer-hero-card div[class*="bg-slate-900/60"] .text-white,
html[data-theme="light"] .trainer-hero-card .stat-hero-box .text-white,
html[data-theme="light"] .stat-hero-val {
  color: #0f172a !important;
}
html[data-theme="light"] .trainer-hero-card div[class*="bg-slate-900/60"] .text-slate-400,
html[data-theme="light"] .trainer-hero-card .stat-hero-box .text-slate-400,
html[data-theme="light"] .stat-hero-lbl,
html[data-theme="light"] .stat-hero-sub {
  color: #64748b !important;
}
html[data-theme="light"] .stat-winrate-num,
html[data-theme="light"] .stat-winrate-pct {
  color: #059669 !important;
}
html[data-theme="light"] .stat-vet-num {
  color: #0284c7 !important;
}
html[data-theme="light"] .stat-vet-badge {
  color: #0369a1 !important;
}
html[data-theme="light"] .stat-vet-star {
  color: #0284c7 !important;
}
html[data-theme="light"] .stat-badge-chara {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}
html[data-theme="light"] .stat-badge-ssr {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}
html[data-theme="light"] .stat-badge-sr {
  background: #f3e8ff !important;
  border-color: #d8b4fe !important;
  color: #7e22ce !important;
}
html[data-theme="light"] .stat-badge-r {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .trainer-hero-card button[class*="bg-slate-800"] {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
html[data-theme="light"] .trainer-hero-card button[class*="bg-slate-800"]:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 4. Карточки выращенных умамусумэ (Зал Славы / Hall of Fame) */
html[data-theme="light"] .horse-hall-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .horse-hall-card:hover {
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] .horse-hall-card .text-white,
html[data-theme="light"] .horse-hall-card h4 {
  color: #0f172a !important;
}
html[data-theme="light"] .horse-hall-card .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .horse-hall-card .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .horse-hall-avatar {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

/* Статистика ветеранов в карточках (Speed, Stamina, Power, Guts, Wit) */
html[data-theme="light"] .stat-col-box {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .stat-col-speed {
  background: linear-gradient(180deg, #e0f2fe 0%, #f8fafc 100%) !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
}
html[data-theme="light"] .stat-col-stamina {
  background: linear-gradient(180deg, #ffe4e6 0%, #f8fafc 100%) !important;
  border-color: rgba(244, 63, 94, 0.35) !important;
}
html[data-theme="light"] .stat-col-power {
  background: linear-gradient(180deg, #fef3c7 0%, #f8fafc 100%) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="light"] .stat-col-guts {
  background: linear-gradient(180deg, #fce7f3 0%, #f8fafc 100%) !important;
  border-color: rgba(236, 72, 153, 0.35) !important;
}
html[data-theme="light"] .stat-col-wit {
  background: linear-gradient(180deg, #d1fae5 0%, #f8fafc 100%) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
html[data-theme="light"] .stat-col-speed .stat-col-hdr { color: #0284c7 !important; }
html[data-theme="light"] .stat-col-stamina .stat-col-hdr { color: #e11d48 !important; }
html[data-theme="light"] .stat-col-power .stat-col-hdr { color: #d97706 !important; }
html[data-theme="light"] .stat-col-guts .stat-col-hdr { color: #db2777 !important; }
html[data-theme="light"] .stat-col-wit .stat-col-hdr { color: #059669 !important; }
html[data-theme="light"] .stat-col-val {
  color: #0f172a !important;
}

/* Панель пригодностей (Aptitudes) */
html[data-theme="light"] .aptitudes-panel {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #334155 !important;
}
html[data-theme="light"] .apt-badge-item {
  color: #475569 !important;
}

/* Чипы навыков в карточках ветеранов */
html[data-theme="light"] .skill-chip {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #1e293b !important;
}
html[data-theme="light"] .skill-chip:hover {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
}
html[data-theme="light"] .skill-chip-gold {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}
html[data-theme="light"] .skill-chip-unique {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%) !important;
  border-color: #ec4899 !important;
  color: #9d174d !important;
}
html[data-theme="light"] .skill-chip-lv {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .spark-badge {
  background: #eff6ff !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #1d4ed8 !important;
}
html[data-theme="light"] .stat-bar-track {
  background: rgba(15, 23, 42, 0.08) !important;
}

/* 5. Карточки поддержки (Support Cards) */
html[data-theme="light"] .support-card-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .support-card-media {
  background: #f8fafc !important;
}
html[data-theme="light"] .support-card-footer {
  background: #f8fafc !important;
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .support-card-footer .text-white {
  color: #0f172a !important;
}

/* 6. Карточки персонажей тренера (Roster) */
html[data-theme="light"] .chara-roster-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .chara-roster-card:hover {
  background: #f8fafc !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .chara-roster-card .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .chara-roster-avatar {
  background: #f1f5f9 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="light"] .costume-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
html[data-theme="light"] .costume-pill:hover {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #f59e0b !important;
}
html[data-theme="light"] .costume-pill.active {
  background: #f59e0b !important;
  color: #ffffff !important;
}
html[data-theme="light"] .dump-drop-zone {
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: rgba(245, 158, 11, 0.04) !important;
}
html[data-theme="light"] .dump-drop-zone:hover,
html[data-theme="light"] .dump-drop-zone.is-dragover {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: #f59e0b !important;
}
html[data-theme="light"] .dump-drop-zone .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .dump-drop-zone .text-slate-400 {
  color: #64748b !important;
}

/* 7. Вкладка карьеры тренера (Career & Trophies) */
html[data-theme="light"] .career-tab-content .theme-card,
html[data-theme="light"] div[v-show*="career"] .theme-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .career-tab-content .text-white,
html[data-theme="light"] div[v-show*="career"] .theme-card .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .career-hero-number {
  color: #0f172a !important;
}
html[data-theme="light"] .career-stat-value {
  color: #0f172a !important;
}
html[data-theme="light"] .career-max-score {
  color: #b45309 !important;
}
html[data-theme="light"] .career-tab-content .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] .career-tab-content .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .career-tab-content .text-slate-200 {
  color: #1e293b !important;
}
html[data-theme="light"] .career-tab-content div[class*="bg-slate-900/60"],
html[data-theme="light"] div[v-show*="career"] div[class*="bg-slate-900/60"] {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .career-tab-content div[class*="bg-slate-800"],
html[data-theme="light"] div[v-show*="career"] div[class*="bg-slate-800"] {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .career-tab-content div[class*="bg-slate-800"] .text-white,
html[data-theme="light"] div[v-show*="career"] div[class*="bg-slate-800"] .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .career-tab-content .text-amber-400 {
  color: #b45309 !important;
}
html[data-theme="light"] .career-tab-content .text-purple-400 {
  color: #7e22ce !important;
}
html[data-theme="light"] .career-tab-content .text-sky-400 {
  color: #0284c7 !important;
}
html[data-theme="light"] .career-tab-content .text-emerald-400 {
  color: #059669 !important;
}

/* Плитки распределения по рангам в светлой теме */
html[data-theme="light"] .rank-dist-count {
  color: #0f172a !important;
}
html[data-theme="light"] .rank-tile-uf {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
html[data-theme="light"] .rank-tile-uf .rank-tile-hdr { color: #dc2626 !important; }
html[data-theme="light"] .rank-tile-uf .rank-tile-pct { color: #b91c1c !important; }

html[data-theme="light"] .rank-tile-ug {
  background: #faf5ff !important;
  border-color: #d8b4fe !important;
}
html[data-theme="light"] .rank-tile-ug .rank-tile-hdr { color: #9333ea !important; }
html[data-theme="light"] .rank-tile-ug .rank-tile-pct { color: #7e22ce !important; }

html[data-theme="light"] .rank-tile-ss {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}
html[data-theme="light"] .rank-tile-ss .rank-tile-hdr { color: #2563eb !important; }
html[data-theme="light"] .rank-tile-ss .rank-tile-pct { color: #1d4ed8 !important; }

html[data-theme="light"] .rank-tile-s {
  background: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
}
html[data-theme="light"] .rank-tile-s .rank-tile-hdr { color: #059669 !important; }
html[data-theme="light"] .rank-tile-s .rank-tile-pct { color: #047857 !important; }

html[data-theme="light"] .rank-tile-a {
  background: #fffbeb !important;
  border-color: #fde047 !important;
}
html[data-theme="light"] .rank-tile-a .rank-tile-hdr { color: #d97706 !important; }
html[data-theme="light"] .rank-tile-a .rank-tile-pct { color: #b45309 !important; }

html[data-theme="light"] .rank-tile-b {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .rank-tile-b .rank-tile-hdr { color: #475569 !important; }
html[data-theme="light"] .rank-tile-b .rank-tile-pct { color: #64748b !important; }

/* 8. Игровой клуб UmaCity (Gaming Club Tab) */
html[data-theme="light"] .tab-intro-panel {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .tab-intro-panel .site-title {
  color: #0f172a !important;
}
html[data-theme="light"] .tab-intro-panel button[class*="bg-slate-800"] {
  background: #f1f5f9 !important;
  color: #b45309 !important;
  border: 1px solid #e2e8f0 !important;
}
html[data-theme="light"] .tab-intro-panel button[class*="bg-slate-800"]:hover {
  background: #e2e8f0 !important;
}

/* Сводные стат-плитки клуба */
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card.border-amber-500\/30 {
  background: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card.border-blue-500\/30 {
  background: #eff6ff !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card.border-emerald-500\/30 {
  background: #ecfdf5 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card.border-purple-500\/30 {
  background: #faf5ff !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card .text-slate-400 {
  color: #475569 !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card h3.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-card .text-slate-300 {
  color: #334155 !important;
}

/* Состав клуба и карточки участников */
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-panel {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-panel h3.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-panel .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] button:not(.bg-blue-600) {
  color: #64748b !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] button:not(.bg-blue-600):hover {
  color: #0f172a !important;
}

/* Карточки участников клуба */
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/70"] {
  background-color: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/70"]:hover {
  background-color: #f8fafc !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/70"] .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/70"] .text-slate-400 {
  color: #64748b !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-red-950/20"] {
  background-color: #fef2f2 !important;
  border-color: #fecaca !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-red-950/20"] .text-white {
  color: #991b1b !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-white/5"] {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

/* Поля формы заявки в клуб */
html[data-theme="light"] div[v-if*="currentTab === 'club'"] label.text-slate-400 {
  color: #334155 !important;
  font-weight: 600 !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] .theme-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] label.ripple-btn.theme-input {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* Поданные заявки в клуб */
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] div[v-if*="currentTab === 'club'"] div[class*="bg-slate-900/80"] .text-slate-400 {
  color: #64748b !important;
}

/* 9. Модалка персонажа с 3D анимацией (showCharaModal) */
html[data-theme="light"] div[class*="z-[100050]"] > div[class*="relative bg-gradient-to-b"] {
  background: #ffffff !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #0f172a !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="shrink-0 p-4 sm:p-5 border-b"] {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
}
html[data-theme="light"] div[class*="z-[100050]"] button[class*="rounded-full bg-white/10"] {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
html[data-theme="light"] div[class*="z-[100050]"] button[class*="rounded-full bg-white/10"]:hover {
  background: #e2e8f0 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] h2.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-slate-800"][class*="border-white/15"] {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-slate-950/60"] {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] button[class*="bg-slate-800"] {
  background: #e2e8f0 !important;
  color: #334155 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] button[class*="bg-slate-800"]:hover {
  background: #cbd5e1 !important;
  color: #0f172a !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="min-h-[200px]"][class*="rounded-2xl"] {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-black/70"] {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #b45309 !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] h3.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-gradient-to-r from-pink-950/40"] {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%) !important;
  border-color: #f43f5e !important;
}
html[data-theme="light"] div[class*="z-[100050]"] .text-pink-200 {
  color: #9f1239 !important;
  font-weight: 800 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-gradient-to-r from-pink-950/40"] .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-amber-950/30"] {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%) !important;
  border-color: #f59e0b !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-slate-900/80"] {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="bg-slate-950/50"] {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] .text-amber-300 {
  color: #b45309 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] .text-slate-400 {
  color: #475569 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] span[class*="bg-slate-800/80"] {
  background: #e2e8f0 !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] div[class*="z-[100050]"] div[class*="shrink-0 p-3 sm:p-4 border-t border-white/10 bg-slate-950/80"] {
  background: #ffffff !important;
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] div[class*="z-[100050]"] a[class*="bg-slate-800"] {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}
html[data-theme="light"] div[class*="z-[100050]"] button[class*="bg-slate-800"][class*="text-slate-300"] {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

/* Дополнительные точечные уточнения для светлой темы */
.trainer-modal-header {
  background: rgba(15, 23, 42, 0.9);
}
html[data-theme="light"] .trainer-modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .horse-hall-card span[class*="bg-slate-800"] {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}
html[data-theme="light"] .horse-hall-card div[class*="bg-slate-950/90"] {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .horse-hall-card div[class*="bg-slate-950/70"] {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .horse-hall-card div[class*="border-t border-white/10"] {
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .horse-hall-card span.font-mono.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .chara-roster-card div[class*="bg-purple-950/40"] {
  background: #faf5ff !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
  color: #7e22ce !important;
}
html[data-theme="light"] .lb-diamond:not(.active) {
  background: rgba(15, 23, 42, 0.15) !important;
}
html[data-theme="light"] .trainer-modal-dialog button[class*="bg-slate-800"]:not(.bg-amber-500):not(.bg-emerald-500):not(.bg-blue-600) {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Кнопки переключения костюмов в модальном окне персонажа */
.chara-modal-costume-btn {
  transition: all 0.15s ease;
}
.chara-modal-costume-btn:active {
  transform: scale(0.96);
}
html[data-theme="light"] .chara-modal-costume-btn:not(.active-cos):not(.active-casual) {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .chara-modal-costume-btn:not(.active-cos):not(.active-casual):hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .chara-modal-costume-btn.active-cos {
  background: #f59e0b !important;
  color: #0f172a !important;
}
html[data-theme="light"] .chara-modal-costume-btn.active-casual {
  background: #ec4899 !important;
  color: #ffffff !important;
}

/* ==== СТАТИСТИКА ПРОСМОТРОВ ГЛАВ И ТАЙТЛОВ ==== */
.chapter-views-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.2;
  white-space: nowrap;
}

html[data-theme="light"] .chapter-views-pill {
  color: #475569 !important;
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.comic-views-badge {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 2px 7.5px;
  border-radius: 9999px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #34d399;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.28);
  line-height: 1.2;
  white-space: nowrap;
}

html[data-theme="light"] .comic-views-badge {
  color: #0284c7 !important;
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
}

.reader-top-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Общая визуальная система сайта: карточки, заголовки разделов и навигация */
.theme-card {
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.7), inset 0 1px rgba(255, 255, 255, 0.045);
}
.theme-panel {
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.72), inset 0 1px rgba(255, 255, 255, 0.055);
}
.tab-intro-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.18) !important;
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.11), transparent 52%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 58%) !important;
  box-shadow: 0 14px 32px -20px rgba(0, 0, 0, 0.72), inset 0 1px rgba(255, 255, 255, 0.06);
}
.tab-intro-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #38bdf8, #8b5cf6, #ec4899);
  opacity: 0.82;
  pointer-events: none;
}
.filter-pill-btn {
  min-height: 34px;
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.88));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}
.filter-pill-btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.8);
  outline-offset: 2px;
}
.bottom-nav-bar {
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.94), rgba(7, 10, 18, 0.98)) !important;
  border-top-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.42);
}
html[data-theme="light"] .theme-card {
  box-shadow: 0 10px 26px -16px rgba(15, 23, 42, 0.22), inset 0 1px rgba(255, 255, 255, 0.85);
}
html[data-theme="light"] .theme-panel {
  box-shadow: 0 16px 36px -22px rgba(15, 23, 42, 0.2), inset 0 1px rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] .tab-intro-panel {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.08), transparent 52%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.45)) !important;
}
html[data-theme="light"] .filter-pill-btn:not(.is-active-blue):not(.is-active-amber) {
  background: linear-gradient(145deg, #ffffff, #f1f5f9) !important;
}
html[data-theme="light"] .bottom-nav-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.99)) !important;
}
.sticky-header {
  background: linear-gradient(180deg, rgba(8, 11, 19, 0.94), rgba(8, 11, 19, 0.84));
  border-bottom-color: rgba(148, 163, 184, 0.16);
}
.header-donate-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.24);
}
.header-donate-btn:hover {
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.34);
}
.translations-tabs-bar {
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.7), inset 0 1px rgba(255, 255, 255, 0.055);
}
.trans-tab-btn.active {
  background: linear-gradient(120deg, #2563eb, #4f46e5 68%, #7c3aed);
  box-shadow: 0 5px 16px rgba(79, 70, 229, 0.3), inset 0 1px rgba(255, 255, 255, 0.16);
}
.trans-tab-btn.active .icon {
  color: #ffffff !important;
}
.chapter-compact-row {
  border-color: rgba(148, 163, 184, 0.15);
  background-image: linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 48%);
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.75), inset 0 1px rgba(255, 255, 255, 0.045);
}
.chapter-compact-row:hover {
  border-color: rgba(96, 165, 250, 0.48);
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.8), inset 0 1px rgba(255, 255, 255, 0.075);
}
.meta-card-row {
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.8), inset 0 1px rgba(255, 255, 255, 0.05);
}
.meta-card-row:hover {
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.85), inset 0 1px rgba(255, 255, 255, 0.08);
}
.site-card {
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.78), inset 0 1px rgba(255, 255, 255, 0.045);
}
.site-card:hover {
  border-color: rgba(96, 165, 250, 0.48);
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.82), inset 0 1px rgba(255, 255, 255, 0.075);
}
.support-card-card {
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 60%);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.8), inset 0 1px rgba(255, 255, 255, 0.05);
}
.support-card-card:hover {
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.82), inset 0 1px rgba(255, 255, 255, 0.08);
}
.support-card-footer {
  background: rgba(8, 11, 19, 0.88);
}
html[data-theme="light"] .sticky-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)) !important;
}
html[data-theme="light"] .header-donate-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2) !important;
}
html[data-theme="light"] .chapter-compact-row {
  border-color: rgba(148, 163, 184, 0.22);
  background-image: linear-gradient(115deg, rgba(255, 255, 255, 0.9), transparent 55%);
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, 0.25), inset 0 1px #ffffff;
}
html[data-theme="light"] .chapter-compact-row:hover {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.28), inset 0 1px #ffffff;
}
html[data-theme="light"] .meta-card-row {
  box-shadow: 0 12px 26px -18px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] .meta-card-row:hover {
  box-shadow: 0 16px 30px -18px rgba(15, 23, 42, 0.28), inset 0 1px #ffffff;
}
html[data-theme="light"] .site-card {
  box-shadow: 0 12px 26px -18px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] .support-card-card {
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.85), transparent 60%);
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] .support-card-footer {
  background: rgba(248, 250, 252, 0.96);
}
@media (prefers-reduced-motion: reduce) {
  .filter-pill-btn,
  .chapter-compact-row,
  .meta-card-row,
  .site-card,
  .support-card-card {
    transition: none;
  }
  .filter-pill-btn:hover,
  .chapter-compact-row:hover,
  .meta-card-row:hover,
  .site-card:hover,
  .support-card-card:hover {
    transform: none;
  }
}

.home-hero {
  isolation: isolate;
  background-image:
    radial-gradient(ellipse at 12% 8%, rgba(59, 130, 246, 0.14), transparent 46%),
    radial-gradient(ellipse at 92% 88%, rgba(168, 85, 247, 0.12), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 58%) !important;
  box-shadow: 0 22px 54px -30px rgba(0, 0, 0, 0.8), inset 0 1px rgba(255, 255, 255, 0.065);
}
.home-mascot-wrap {
  width: 100%;
  min-height: 260px;
}
.home-mascot-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #bfdbfe;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.home-mascot-wrap:has(.home-mascot-img[hidden]) .home-mascot-fallback {
  opacity: 1;
  transform: scale(1);
}
.home-mascot-fallback-icon {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.16));
  box-shadow: 0 16px 34px -18px rgba(59, 130, 246, 0.65), inset 0 1px rgba(255, 255, 255, 0.12);
  font-size: 48px;
  letter-spacing: 0;
}
.home-nav-grid {
  gap: 12px;
}
.home-nav-card {
  position: relative;
  min-height: 72px;
  padding: 12px 14px;
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.72));
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.82), inset 0 1px rgba(255, 255, 255, 0.055);
}
.home-nav-card::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #60a5fa, #a78bfa);
  content: "";
  opacity: 0;
  transition: opacity 0.18s ease;
}
.home-nav-card:hover,
.home-nav-card:focus-visible {
  border-color: rgba(96, 165, 250, 0.46);
  background: linear-gradient(145deg, rgba(37, 52, 77, 0.94), rgba(18, 28, 49, 0.92));
  box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.82), inset 0 1px rgba(255, 255, 255, 0.09);
}
.home-nav-card:hover::before,
.home-nav-card:focus-visible::before {
  opacity: 1;
}
.home-nav-card:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 3px;
}
.home-nav-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}
.home-nav-card--club::before {
  background: linear-gradient(180deg, #fbbf24, #f97316);
}
.home-nav-card--club:hover,
.home-nav-card--club:focus-visible {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.28), rgba(30, 41, 59, 0.78));
}
html[data-theme="light"] .home-hero {
  background-image:
    radial-gradient(ellipse at 12% 8%, rgba(59, 130, 246, 0.09), transparent 46%),
    radial-gradient(ellipse at 92% 88%, rgba(168, 85, 247, 0.08), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.55)) !important;
  box-shadow: 0 20px 44px -30px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] .home-mascot-fallback {
  color: #1d4ed8;
}
html[data-theme="light"] .home-nav-card {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.3), inset 0 1px #ffffff;
}
html[data-theme="light"] .home-nav-card:hover,
html[data-theme="light"] .home-nav-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(145deg, #ffffff, #eff6ff);
}
html[data-theme="light"] .home-nav-icon {
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(145deg, #ffffff, #eff6ff);
}
html[data-theme="light"] .home-nav-title {
  color: #0f172a;
}
html[data-theme="light"] .home-nav-card--club .home-nav-title {
  color: #b45309;
}
html[data-theme="light"] .home-nav-card--club:hover,
html[data-theme="light"] .home-nav-card--club:focus-visible {
  border-color: rgba(217, 119, 6, 0.45);
  background: linear-gradient(145deg, #fffbeb, #fff7ed);
}
@media (max-width: 768px) {
  .home-mascot-wrap {
    min-height: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-mascot-img,
  .home-mascot-fallback,
  .home-nav-card,
  .home-nav-card::before {
    animation: none;
    transition: none;
  }
  .home-nav-card:hover {
    transform: none;
  }
}

.club-page {
  --club-accent: #fbbf24;
}
.club-page .club-intro-panel {
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(245, 158, 11, 0.1), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 58%) !important;
}
.club-page .club-stat-card {
  min-width: 0;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-width: 1px;
  box-shadow: 0 12px 26px -20px rgba(0, 0, 0, 0.78), inset 0 1px rgba(255, 255, 255, 0.06);
}
.club-page .club-stat-card--rank {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.11), rgba(120, 53, 15, 0.08));
}
.club-page .club-stat-card--fans {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.11), rgba(30, 64, 175, 0.07));
}
.club-page .club-stat-card--members {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.11), rgba(6, 95, 70, 0.07));
}
.club-page .club-stat-card--minimum {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.11), rgba(88, 28, 135, 0.07));
}
.club-page .club-stat-value {
  overflow-wrap: anywhere;
  line-height: 1.35;
  white-space: normal;
}
.club-page .club-leaderboard-banner {
  background-image: linear-gradient(110deg, rgba(245, 158, 11, 0.16), rgba(234, 179, 8, 0.08) 55%, rgba(245, 158, 11, 0.035));
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 14px 30px -22px rgba(245, 158, 11, 0.28), inset 0 1px rgba(255, 255, 255, 0.055);
}
.club-page .club-tabs-nav {
  width: fit-content;
  max-width: 100%;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}
.club-page .club-subtab-button {
  min-height: 40px;
}
html[data-theme="light"] .club-page .club-intro-panel {
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(245, 158, 11, 0.08), transparent 48%),
    linear-gradient(145deg, #ffffff, rgba(248, 250, 252, 0.7)) !important;
}
html[data-theme="light"] .club-page .club-stat-card {
  box-shadow: 0 12px 24px -20px rgba(15, 23, 42, 0.26), inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-stat-card--rank {
  background: linear-gradient(145deg, #fffbeb, #fff7ed);
  border-color: rgba(217, 119, 6, 0.28);
}
html[data-theme="light"] .club-page .club-stat-card--fans {
  background: linear-gradient(145deg, #eff6ff, #f8fafc);
  border-color: rgba(37, 99, 235, 0.24);
}
html[data-theme="light"] .club-page .club-stat-card--members {
  background: linear-gradient(145deg, #ecfdf5, #f8fafc);
  border-color: rgba(5, 150, 105, 0.24);
}
html[data-theme="light"] .club-page .club-stat-card--minimum {
  background: linear-gradient(145deg, #faf5ff, #f8fafc);
  border-color: rgba(147, 51, 234, 0.24);
}
html[data-theme="light"] .club-page .club-leaderboard-banner {
  background-image: linear-gradient(110deg, #fffbeb, #fff7ed 58%, #ffffff);
  border-color: rgba(217, 119, 6, 0.25);
  box-shadow: 0 14px 28px -22px rgba(180, 83, 9, 0.2), inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-leaderboard-title {
  color: #92400e;
}
html[data-theme="light"] .club-page .club-leaderboard-description {
  color: #475569;
}
html[data-theme="light"] .club-page .club-find-trainer-btn {
  background: #e0f2fe;
  border-color: #6ee7b7;
  color: #075985;
}
html[data-theme="light"] .club-page .club-find-trainer-btn:hover {
  background: #bae6fd;
}
html[data-theme="light"] .club-page .club-tabs-nav {
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="light"] .club-page .club-subtab-button:not(.bg-gradient-to-r) {
  color: #475569;
}
html[data-theme="light"] .club-page .club-subtab-button:not(.bg-gradient-to-r):hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}
@media (max-width: 480px) {
  .club-page .club-stat-card {
    min-height: 96px;
    padding: 10px;
  }
  .club-page .club-leaderboard-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .club-page .club-leaderboard-actions button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .club-page .club-stat-card,
  .club-page .club-subtab-button {
    transition: none;
  }
}
.club-page .club-description-card {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 60%);
  box-shadow: 0 12px 26px -20px rgba(0, 0, 0, 0.78), inset 0 1px rgba(255, 255, 255, 0.055);
}
.club-page .club-description-card::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #60a5fa, #818cf8);
  content: "";
}
.club-page .club-description-card--rules::before {
  background: linear-gradient(180deg, #fbbf24, #f97316);
}
.club-page .club-description-card h3,
.club-page .club-description-card p {
  position: relative;
}
.club-page .club-roster-panel {
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 58%);
}
.club-page .club-member-controls select {
  min-height: 36px;
  max-width: 100%;
}
.club-page .club-member-search-wrap input {
  min-height: 42px;
}
.club-page .club-member-row {
  min-width: 0;
  border-color: rgba(148, 163, 184, 0.16);
  background-image: linear-gradient(110deg, rgba(255, 255, 255, 0.03), transparent 65%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}
.club-page .club-member-row:hover {
  border-color: rgba(96, 165, 250, 0.38);
  box-shadow: 0 8px 20px -16px rgba(0, 0, 0, 0.8), inset 0 1px rgba(255, 255, 255, 0.06);
}

/* ============================================================
   ==== СОСТАВ КЛУБА: ВИТРИНА УЧАСТНИКОВ (РЕДИЗАЙН 2026) =====
   ============================================================ */
.club-page .club-roster-panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.club-page .club-roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.club-page .club-roster-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.club-page .club-roster-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 13px;
  color: #bfdbfe;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.32), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 0 8px 18px -14px rgba(37, 99, 235, 0.6);
}
.club-page .club-roster-glyph .icon {
  width: 19px;
  height: 19px;
}
.club-page .club-roster-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.club-page .club-roster-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.35);
  white-space: nowrap;
}
.club-page .club-roster-hint {
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}
.club-page .club-member-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.club-page .club-member-segment {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.club-page .club-member-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.club-page .club-member-segment-btn b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: inherit;
}
.club-page .club-member-segment-btn:hover {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.1);
}
.club-page .club-member-segment-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.65);
}
.club-page .club-member-segment-btn.is-active b {
  background: rgba(255, 255, 255, 0.22);
}
.club-page .club-member-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  transition: border-color 0.16s ease;
}
.club-page .club-member-sort:focus-within {
  border-color: rgba(96, 165, 250, 0.55);
}
.club-page .club-member-sort .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.club-page .club-member-sort select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  outline: none;
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 2px;
  cursor: pointer;
}
.club-page .club-member-sort-caret {
  font-size: 9px;
  line-height: 1;
  color: #94a3b8;
  flex-shrink: 0;
  pointer-events: none;
}
.club-page .club-member-sort select option {
  background: #0f172a;
  color: #e2e8f0;
}
.club-page .club-roster-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.club-page .club-roster-metric {
  position: relative;
  min-width: 0;
  padding: 9px 11px 10px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.52));
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.club-page .club-roster-metric::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 2px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #60a5fa, #6366f1);
  content: "";
  opacity: 0.8;
}
.club-page .club-roster-metric--emerald::before {
  background: linear-gradient(180deg, #34d399, #059669);
}
.club-page .club-roster-metric--sky::before {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
}
.club-page .club-roster-metric--amber::before {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}
.club-page .club-roster-metric-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-page .club-roster-metric-value {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-page .club-roster-metric-value small {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}
.club-page .club-roster-metric--emerald .club-roster-metric-value {
  color: #34d399;
}
.club-page .club-roster-metric--sky .club-roster-metric-value {
  color: #6ee7b7;
}
.club-page .club-roster-metric--amber .club-roster-metric-value {
  color: #fbbf24;
}
.club-page .club-roster-metric-value--name {
  font-size: 12.5px;
  color: #fde68a;
}
.club-page .club-roster-metric-sub {
  display: block;
  margin-top: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #f59e0b;
}
.club-page .club-member-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.club-page .club-member-search {
  width: 100%;
  min-height: 42px;
  padding: 10px 38px 10px 38px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(2, 6, 23, 0.55);
}
.club-page .club-member-search::-webkit-search-cancel-button,
.club-page .club-member-search::-webkit-search-decoration {
  display: none;
}
.club-page .club-member-search-icon {
  position: absolute;
  left: 13px;
  width: 15px;
  height: 15px;
  color: #64748b;
  pointer-events: none;
}
.club-page .club-member-search:focus + .club-member-search-clear {
  opacity: 1;
}
.club-page .club-member-search-clear {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.club-page .club-member-search-clear:hover {
  background: rgba(148, 163, 184, 0.3);
  color: #ffffff;
}
.club-page .club-member-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}
.club-page .club-member-list::-webkit-scrollbar {
  width: 5px;
}
.club-page .club-member-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}
.club-page .club-member-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px 9px 9px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(110deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.5));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.club-page .club-member-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: transparent;
  content: "";
  transition: background 0.18s ease;
}
.club-page .club-member-card:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.9), inset 0 1px rgba(255, 255, 255, 0.07);
}
.club-page .club-member-card.is-top-1 {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(110deg, rgba(69, 46, 12, 0.55), rgba(15, 23, 42, 0.6));
}
.club-page .club-member-card.is-top-1::before {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}
.club-page .club-member-card.is-top-2::before {
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
}
.club-page .club-member-card.is-top-3::before {
  background: linear-gradient(180deg, #fb923c, #c2410c);
}
.club-page .club-member-card.is-inactive {
  opacity: 0.62;
  border-color: rgba(248, 113, 113, 0.22);
  background: linear-gradient(110deg, rgba(69, 10, 10, 0.24), rgba(15, 23, 42, 0.5));
}
.club-page .club-member-card.is-inactive:hover {
  opacity: 0.85;
}
.club-page .club-member-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.club-page .club-member-medal {
  font-size: 13px;
  line-height: 1;
}
.club-page .club-member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.34), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
}
.club-page .club-member-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}
.club-page .club-member-avatar.has-photo {
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.club-page .club-member-card.is-top-1 .club-member-avatar {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.18));
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}
.club-page .club-member-card.is-top-2 .club-member-avatar {
  background: linear-gradient(145deg, rgba(203, 213, 225, 0.3), rgba(148, 163, 184, 0.14));
  border-color: rgba(226, 232, 240, 0.4);
  color: #f1f5f9;
}
.club-page .club-member-card.is-top-3 .club-member-avatar {
  background: linear-gradient(145deg, rgba(251, 146, 60, 0.34), rgba(194, 65, 12, 0.16));
  border-color: rgba(251, 146, 60, 0.45);
  color: #fed7aa;
}
.club-page .club-member-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.club-page .club-member-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.club-page .club-member-name {
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-page .club-member-badge {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: nowrap;
}
.club-page .club-member-badge--leader {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.34);
}
.club-page .club-member-badge--left {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.club-page .club-member-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: nowrap;
}
.club-page .club-member-id {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.club-page .club-member-id > span:not(.club-member-id-label) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.club-page .club-member-id-label {
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.18);
  color: #6ee7b7;
  font-size: 8px;
  font-weight: 800;
}
.club-page .club-member-id .icon {
  width: 10px;
  height: 10px;
  opacity: 0.7;
}
.club-page .club-member-id:hover {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.26);
  color: #f1f5f9;
}
.club-page .club-member-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  color: #6ee7b7;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.club-page .club-member-link .icon {
  width: 10px;
  height: 10px;
}
.club-page .club-member-link:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(56, 189, 248, 0.45);
}
.club-page .club-member-meter {
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  margin-top: 1px;
}
.club-page .club-member-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.35s ease;
}
.club-page .club-member-card.is-top-1 .club-member-meter span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.club-page .club-member-card.is-inactive .club-member-meter span {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.club-page .club-member-gain {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 74px;
  text-align: right;
}
.club-page .club-member-gain-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #34d399;
}
.club-page .club-member-gain-label {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  line-height: 1.3;
}
.club-page .club-member-gain-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  line-height: 1.35;
}
.club-page .club-member-gain-daily {
  color: #6ee7b7;
  font-weight: 700;
}
.club-page .club-member-gain-total {
  color: #64748b;
}
html[data-theme="light"] .club-page .club-roster-heading .club-roster-title {
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-roster-tag {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}
html[data-theme="light"] .club-page .club-roster-hint {
  color: #64748b;
}
html[data-theme="light"] .club-page .club-member-segment,
html[data-theme="light"] .club-page .club-member-sort {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.3);
}
html[data-theme="light"] .club-page .club-member-segment-btn {
  color: #64748b;
}
html[data-theme="light"] .club-page .club-member-segment-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .club-page .club-member-segment-btn.is-active {
  color: #ffffff;
}
html[data-theme="light"] .club-page .club-member-sort select {
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-member-sort select option {
  background: #ffffff;
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-roster-metric {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(148, 163, 184, 0.26);
  box-shadow: inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-roster-metric-value {
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-roster-metric--emerald .club-roster-metric-value {
  color: #047857;
}
html[data-theme="light"] .club-page .club-roster-metric--sky .club-roster-metric-value {
  color: #0369a1;
}
html[data-theme="light"] .club-page .club-roster-metric--amber .club-roster-metric-value {
  color: #b45309;
}
html[data-theme="light"] .club-page .club-member-search {
  background: #ffffff;
}
html[data-theme="light"] .club-page .club-member-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-member-card.is-top-1 {
  background: linear-gradient(110deg, #fffbeb, #ffffff);
  border-color: rgba(217, 119, 6, 0.3);
}
html[data-theme="light"] .club-page .club-member-card.is-inactive {
  background: #fef2f2;
  border-color: rgba(248, 113, 113, 0.28);
}
html[data-theme="light"] .club-page .club-member-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 22px -18px rgba(15, 23, 42, 0.35), inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-member-name {
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-member-id {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.3);
  color: #475569;
}
html[data-theme="light"] .club-page .club-member-id:hover {
  background: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .club-page .club-member-id-label {
  background: #e0f2fe;
  color: #0369a1;
}
html[data-theme="light"] .club-page .club-member-link {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #bae6fd;
}
html[data-theme="light"] .club-page .club-member-link:hover {
  color: #075985;
  background: #bae6fd;
  border-color: #6ee7b7;
}
html[data-theme="light"] .club-page .club-member-gain-value {
  color: #047857;
}
html[data-theme="light"] .club-page .club-member-gain-label {
  color: #64748b;
}
html[data-theme="light"] .club-page .club-member-gain-daily {
  color: #0369a1;
}
html[data-theme="light"] .club-page .club-member-gain-total {
  color: #94a3b8;
}
html[data-theme="light"] .club-page .club-member-rank {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.3);
  color: #475569;
}
html[data-theme="light"] .club-page .club-roster-glyph {
  color: #1d4ed8;
  background: linear-gradient(145deg, #dbeafe, #eef2ff);
  border-color: #bfdbfe;
  box-shadow: inset 0 1px #ffffff, 0 8px 18px -16px rgba(37, 99, 235, 0.5);
}
html[data-theme="light"] .club-page .club-member-avatar {
  color: #1d4ed8;
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  border-color: #93c5fd;
  box-shadow: inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-member-card.is-top-1 .club-member-avatar {
  color: #92400e;
  background: linear-gradient(145deg, #fef3c7, #fffbeb);
  border-color: #fbbf24;
}
html[data-theme="light"] .club-page .club-member-card.is-top-2 .club-member-avatar {
  color: #334155;
  background: linear-gradient(145deg, #f1f5f9, #ffffff);
  border-color: #cbd5e1;
}
html[data-theme="light"] .club-page .club-member-card.is-top-3 .club-member-avatar {
  color: #9a3412;
  background: linear-gradient(145deg, #ffedd5, #fff7ed);
  border-color: #fdba74;
}
html[data-theme="light"] .club-page .club-member-badge--leader {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}
html[data-theme="light"] .club-page .club-member-badge--left {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}
@media (max-width: 900px) {
  .club-page .club-roster-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .club-page .club-member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 400px) {
  .club-page .club-member-link span {
    display: none;
  }
  .club-page .club-member-link {
    padding: 3px 6px;
  }
}
@media (max-width: 767px) {
  .club-page .club-member-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 62vh;
  }
}
@media (max-width: 480px) {
  .club-page .club-roster-panel {
    padding: 14px;
    gap: 12px;
  }
  .club-page .club-roster-metric-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
  }
  .club-page .club-roster-header {
    align-items: stretch;
  }
  .club-page .club-member-controls {
    width: 100%;
    align-items: stretch;
  }
  .club-page .club-member-segment {
    flex: 1 1 auto;
  }
  .club-page .club-member-segment-btn {
    flex: 1;
    justify-content: center;
  }
  .club-page .club-member-sort {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  .club-page .club-member-sort select {
    flex: 1;
  }
  .club-page .club-member-card {
    padding: 9px 10px 9px 8px;
    gap: 8px;
  }
  .club-page .club-member-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }
  .club-page .club-member-gain {
    min-width: 66px;
  }
  .club-page .club-member-gain-value {
    font-size: 12.5px;
  }
  .club-page .club-member-gain-sub .club-member-gain-total {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .club-page .club-member-card,
  .club-page .club-member-meter span,
  .club-page .club-member-segment-btn {
    transition: none;
  }
}
.club-page .club-application-panel {
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(16, 185, 129, 0.065), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 60%);
}
.club-page .club-application-header {
  gap: 12px;
}
.club-page .club-application-header h3 {
  line-height: 1.35;
}
.club-page .club-application-spots {
  flex-shrink: 0;
  white-space: nowrap;
}
.club-page .club-application-panel label {
  color: var(--text-muted);
  font-weight: 650;
  line-height: 1.4;
}
.club-page .club-application-panel input:not([type="file"]),
.club-page .club-application-panel textarea {
  min-height: 42px;
}
.club-page .club-application-panel textarea {
  min-height: 76px;
  resize: vertical;
}
.club-page .club-application-panel input:focus-visible,
.club-page .club-application-panel textarea:focus-visible,
.club-page .club-member-search-wrap input:focus-visible,
.club-page .club-member-controls select:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.78);
  outline-offset: 2px;
}
.club-page .club-application-upload-row > input {
  min-width: 0;
}
html[data-theme="light"] .club-page .club-description-card,
html[data-theme="light"] .club-page .club-roster-panel,
html[data-theme="light"] .club-page .club-application-panel {
  background-color: #ffffff;
  box-shadow: 0 12px 26px -20px rgba(15, 23, 42, 0.22), inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-description-card {
  background-image: linear-gradient(145deg, #ffffff, #f8fafc);
}
html[data-theme="light"] .club-page .club-roster-panel {
  background-image: linear-gradient(145deg, #ffffff, #f8fafc);
}
html[data-theme="light"] .club-page .club-member-row {
  background-color: #f8fafc;
  background-image: linear-gradient(110deg, #ffffff, transparent 70%);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-member-row:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, 0.26), inset 0 1px #ffffff;
}
html[data-theme="light"] .club-page .club-application-panel {
  background-image:
    radial-gradient(ellipse at 100% 0%, rgba(16, 185, 129, 0.06), transparent 48%),
    linear-gradient(145deg, #ffffff, #f8fafc);
}
html[data-theme="light"] .club-page .club-application-spots {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
@media (max-width: 480px) {
  .club-page .club-description-card {
    padding: 14px 16px 14px 18px;
  }
  .club-page .club-roster-panel {
    padding: 14px;
  }
  .club-page .club-roster-header {
    align-items: stretch;
  }
  .club-page .club-application-panel {
    padding: 16px;
  }
  .club-page .club-application-header {
    align-items: flex-start;
  }
  .club-page .club-application-upload-row {
    flex-wrap: wrap;
  }
  .club-page .club-application-upload-row > input {
    flex: 1 1 100%;
  }
  .club-page .club-application-upload-row > label {
    justify-content: center;
    width: 100%;
  }
  .club-page .club-application-submit-row,
  .club-page .club-application-submit {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .club-page .club-member-row,
  .club-page .club-description-card {
    transition: none;
  }
}

/* Site-wide visual system for every content tab and shared interaction. */
#app .theme-panel {
  border-radius: 20px;
  box-shadow: 0 18px 42px -28px rgba(0, 0, 0, 0.78), inset 0 1px rgba(255, 255, 255, 0.055);
}
#app .theme-card {
  border-radius: 16px;
  box-shadow: 0 12px 28px -22px rgba(0, 0, 0, 0.76), inset 0 1px rgba(255, 255, 255, 0.045);
}
#app .page-with-fixed-header button:focus-visible,
#app .page-with-fixed-header a:focus-visible,
#app .bottom-nav-btn:focus-visible,
#profile-app button:focus-visible,
#profile-app a:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.82);
  outline-offset: 3px;
}
#app .theme-input,
#profile-app .theme-input {
  min-height: 40px;
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
#app .theme-input:focus,
#profile-app .theme-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
#app .tab-intro-panel {
  border-radius: 20px;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.76), inset 0 1px rgba(255, 255, 255, 0.06);
}
#app .tab-intro-panel h2 {
  line-height: 1.2;
  letter-spacing: -0.025em;
}
#app .tab-intro-panel p {
  max-width: 62ch;
  line-height: 1.55;
}
#app .translations-tabs-bar,
#app .club-tabs-nav {
  padding: 5px;
  border-radius: 16px;
}
#app .trans-tab-btn,
#app .filter-pill-btn {
  min-height: 38px;
  border-radius: 12px;
}
#app .cards-filter-panel {
  border-radius: 20px;
}
#app .chapter-compact-row,
#app .meta-card-row,
#app .site-card,
#app .artday-compact-row,
#app .author-card,
#app .support-card-card,
#app .umayuru-page .grid > .theme-card {
  border-radius: 16px;
  box-shadow: 0 12px 28px -22px rgba(0, 0, 0, 0.78), inset 0 1px rgba(255, 255, 255, 0.045);
}
#app .chapter-compact-row:hover,
#app .meta-card-row:hover,
#app .site-card:hover,
#app .artday-compact-row:hover,
#app .author-card:hover,
#app .support-card-card:hover,
#app .umayuru-page .grid > .theme-card:hover {
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: 0 18px 34px -24px rgba(0, 0, 0, 0.82), inset 0 1px rgba(255, 255, 255, 0.075);
}
#app .artday-compact-row {
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.035), transparent 68%);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
#app .artday-compact-row:hover {
  transform: translateY(-1px);
}
#app .umayuru-progress-widget {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.055));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}
#app .article-promo-card {
  border-radius: 20px;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.72), inset 0 1px rgba(255, 255, 255, 0.06);
}
#app .catalog-page > .text-center,
#app .cards-page > .text-center,
#app .umayuru-page > .text-center,
#app .artdays-page > .text-center {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.08), transparent 60%),
    var(--panel-bg);
  box-shadow: var(--panel-shadow);
}
#app footer {
  border-color: var(--card-border);
}
html[data-theme="light"] #app .theme-panel {
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px -30px rgba(15, 23, 42, 0.2), inset 0 1px #ffffff;
}
html[data-theme="light"] #app .theme-card {
  box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] #app .tab-intro-panel {
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.2), inset 0 1px #ffffff;
}
html[data-theme="light"] #app .chapter-compact-row,
html[data-theme="light"] #app .meta-card-row,
html[data-theme="light"] #app .site-card,
html[data-theme="light"] #app .artday-compact-row,
html[data-theme="light"] #app .author-card,
html[data-theme="light"] #app .support-card-card,
html[data-theme="light"] #app .umayuru-page .grid > .theme-card {
  box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] #app .chapter-compact-row:hover,
html[data-theme="light"] #app .meta-card-row:hover,
html[data-theme="light"] #app .site-card:hover,
html[data-theme="light"] #app .artday-compact-row:hover,
html[data-theme="light"] #app .author-card:hover,
html[data-theme="light"] #app .support-card-card:hover,
html[data-theme="light"] #app .umayuru-page .grid > .theme-card:hover {
  box-shadow: 0 18px 34px -24px rgba(15, 23, 42, 0.28), inset 0 1px #ffffff;
}
html[data-theme="light"] #app .artday-compact-row {
  background: linear-gradient(110deg, #ffffff, #f8fafc 68%);
}
html[data-theme="light"] #app .umayuru-progress-widget {
  background: linear-gradient(145deg, #eff6ff, #f5f3ff);
}
html[data-theme="light"] #app .catalog-page > .text-center,
html[data-theme="light"] #app .cards-page > .text-center,
html[data-theme="light"] #app .umayuru-page > .text-center,
html[data-theme="light"] #app .artdays-page > .text-center {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.07), transparent 60%),
    #ffffff;
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.18), inset 0 1px #ffffff;
}
@media (max-width: 640px) {
  #app .theme-panel {
    border-radius: 18px;
  }
  #app .tab-intro-panel {
    gap: 12px;
    padding: 16px;
  }
  #app .tab-intro-panel h2 {
    font-size: 1.2rem;
  }
  #app .filter-pill-btn,
  #app .trans-tab-btn {
    min-height: 40px;
  }
  #app .artday-compact-row {
    align-items: flex-start;
    gap: 8px;
  }
  #app .article-promo-card,
  #app .support-card-card {
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  #app .theme-input,
  #app .artday-compact-row {
    transition: none;
  }
  #app .artday-compact-row:hover {
    transform: none;
  }
}

@media (min-width: 900px) {
  .site-gallery-modal {
    align-items: center;
    overflow: hidden;
    padding: 24px 32px;
  }
  .site-gallery-container {
    width: min(100%, 1440px);
    max-width: 1440px;
    height: calc(100dvh - 48px);
    max-height: 900px;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    align-items: stretch;
    gap: 20px;
  }
  .site-gallery-viewport {
    min-width: 0;
    min-height: 0;
    height: 100%;
  }
  .site-gallery-img-wrap {
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .site-gallery-img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .site-gallery-info {
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    align-self: stretch;
  }

  .meta-card-detail-modal {
    width: min(92vw, 1280px);
    height: min(92dvh, 900px);
    max-height: 92dvh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .meta-card-detail-header {
    flex: 0 0 auto;
  }
  .meta-card-detail-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, min(32vw, 380px)) minmax(0, 1fr) !important;
    align-items: stretch;
  }
  .meta-card-detail-grid .card-detail-imgbox {
    align-self: center;
    aspect-ratio: 3 / 4;
    width: 100%;
    max-height: min(100%, 68dvh);
  }
  .meta-card-detail-info {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
  }
  .meta-card-detail-info .card-skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .meta-card-detail-info .card-skills-list .card-skill-row {
    min-width: 0;
    padding: 5px 7px;
  }
  .meta-card-detail-info .card-skill-row-top {
    gap: 7px;
  }
  .meta-card-detail-info .card-skill-row-img,
  .meta-card-detail-info .card-skill-row-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }
  .meta-card-detail-info .card-skill-row-name {
    font-size: 12px;
  }
  .meta-card-detail-info .card-skill-row-badge {
    font-size: 8px;
    padding: 1px 4px;
  }
}

/* Trainer profile collections and compact veteran stat previews */
.veteran-item {
  border-color: var(--border-subtle, #263545) !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(16, 185, 129, 0.08), transparent 42%),
    linear-gradient(145deg, rgba(20, 29, 35, 0.98), rgba(11, 17, 20, 0.96)) !important;
  box-shadow: 0 12px 26px -20px rgba(0, 0, 0, 0.9), inset 0 1px rgba(255, 255, 255, 0.045) !important;
}
.veteran-item:hover {
  border-color: rgba(16, 185, 129, 0.38) !important;
}
.veteran-quick-stats {
  border-color: var(--border-subtle, rgba(38, 53, 69, 0.65)) !important;
  background: rgba(11, 17, 20, 0.75) !important;
}
.veteran-quick-stat {
  min-width: 0;
  min-height: 54px;
  padding: 5px 3px !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}
.veteran-quick-stat .stat-col-hdr {
  gap: 3px;
  font-size: 8px !important;
  letter-spacing: 0.045em;
}
.veteran-quick-stat .stat-col-val {
  font-size: clamp(12px, 2vw, 15px) !important;
  margin: 3px 0 1px !important;
}
.veteran-quick-stat .stat-rank-wrap {
  min-height: 18px !important;
}
.veteran-quick-stat .stat-rank-img {
  height: 17px !important;
  max-width: 34px !important;
}
.support-card-card {
  position: relative;
  isolation: isolate;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.09), transparent 58%),
    #0b1120;
}
.support-card-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  content: "";
  pointer-events: none;
}
.support-card-card.ssr {
  border-color: rgba(251, 191, 36, 0.62);
}
.support-card-card.ssr.is-mlb {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.28), 0 10px 24px -14px rgba(245, 158, 11, 0.55);
}
.support-card-card.sr {
  border-color: rgba(203, 213, 225, 0.48);
}
.support-card-media {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(96, 165, 250, 0.13), transparent 68%),
    #080d18;
}
.support-card-type-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.support-card-type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 11, 19, 0.76);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.support-card-footer {
  min-height: 28px;
  padding: 6px 7px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.97));
}
.support-card-footer .lb-diamond {
  width: 6px;
  height: 6px;
}
.chara-roster-card {
  position: relative;
  min-height: 188px;
  padding: 10px 9px;
  gap: 7px;
  border-color: rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.09), transparent 56%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.96), rgba(8, 11, 19, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}
.chara-roster-card:hover {
  border-color: rgba(251, 191, 36, 0.48);
  box-shadow: 0 12px 25px -17px rgba(245, 158, 11, 0.42), inset 0 1px rgba(255, 255, 255, 0.08);
}
.chara-roster-avatar {
  width: 60px;
  height: 60px;
  border-radius: 17px;
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(145deg, #1e293b, #0b1120);
  box-shadow: 0 5px 14px -8px rgba(0, 0, 0, 0.9), inset 0 1px rgba(255, 255, 255, 0.1);
}
.chara-roster-avatar img {
  transition: transform 0.2s ease;
}
.chara-roster-card:hover .chara-roster-avatar img {
  transform: scale(1.06);
}
.chara-roster-card .costume-pill {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 7px;
}
.chara-roster-card .text-amber-400 {
  filter: drop-shadow(0 1px 4px rgba(245, 158, 11, 0.25));
}
.profile-roster-grid {
  align-items: stretch;
}
.profile-roster-card {
  min-width: 0;
  min-height: 208px;
  padding: 12px 10px;
  gap: 8px;
  border-color: rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.12), transparent 56%),
    linear-gradient(155deg, rgba(17, 24, 39, 0.98), rgba(7, 11, 20, 0.98));
}
.profile-roster-avatar {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border-radius: 19px;
  border-width: 1px;
  box-shadow: 0 7px 18px -10px rgba(0, 0, 0, 0.9), inset 0 1px rgba(255, 255, 255, 0.12);
}
.profile-roster-card > .w-full {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
}
.profile-roster-name {
  min-height: 1.1rem;
  letter-spacing: -0.01em;
}
.profile-roster-costumes {
  min-height: 25px;
}
.profile-roster-rarity {
  min-height: 17px;
  text-shadow: 0 1px 7px rgba(245, 158, 11, 0.3);
}
.profile-roster-talent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 2px auto 0;
  padding: 3px 8px;
  border: 1px solid rgba(52, 211, 153, 0.16);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
}
.profile-roster-acquired {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.3;
}
.profile-roster-skill {
  width: 100%;
  min-width: 0;
  min-height: 27px;
  border-radius: 9px;
  background: linear-gradient(100deg, rgba(88, 28, 135, 0.36), rgba(49, 46, 129, 0.2));
}
.profile-roster-skill img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
.profile-roster-action {
  width: 100%;
  margin-top: auto;
  padding-top: 3px;
  letter-spacing: 0.025em;
}
html[data-theme="light"] .veteran-item {
  border-color: rgba(148, 163, 184, 0.24) !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(59, 130, 246, 0.07), transparent 42%),
    linear-gradient(145deg, #ffffff, #f8fafc) !important;
  box-shadow: 0 10px 24px -19px rgba(15, 23, 42, 0.3), inset 0 1px #ffffff !important;
}
html[data-theme="light"] .veteran-quick-stats {
  border-color: rgba(15, 23, 42, 0.11) !important;
  background: #eef2f7 !important;
}
html[data-theme="light"] .veteran-quick-stat {
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
}
html[data-theme="light"] .support-card-card {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.08), transparent 58%),
    #ffffff !important;
}
html[data-theme="light"] .support-card-card.ssr {
  border-color: rgba(217, 119, 6, 0.72) !important;
}
html[data-theme="light"] .support-card-card.sr {
  border-color: rgba(100, 116, 139, 0.52) !important;
}
html[data-theme="light"] .support-card-media {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(59, 130, 246, 0.1), transparent 68%),
    #f1f5f9 !important;
}
html[data-theme="light"] .support-card-type-badge {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22), inset 0 1px #ffffff;
}
html[data-theme="light"] .support-card-footer {
  background: linear-gradient(180deg, #f8fafc, #eef2f7) !important;
}
html[data-theme="light"] .chara-roster-card {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.07), transparent 56%),
    linear-gradient(155deg, #ffffff, #f8fafc) !important;
  box-shadow: 0 5px 14px -10px rgba(15, 23, 42, 0.25), inset 0 1px #ffffff !important;
}
html[data-theme="light"] .chara-roster-card:hover {
  box-shadow: 0 12px 22px -16px rgba(180, 83, 9, 0.25), inset 0 1px #ffffff !important;
}
html[data-theme="light"] .chara-roster-avatar {
  background: linear-gradient(145deg, #f8fafc, #e2e8f0) !important;
  box-shadow: 0 5px 14px -8px rgba(15, 23, 42, 0.24), inset 0 1px #ffffff;
}
html[data-theme="light"] .support-card-type-badge {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(255, 255, 255, 0.28);
}
html[data-theme="light"] .profile-roster-card {
  border-color: rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.1), transparent 56%),
    linear-gradient(155deg, #ffffff, #f6f8fc) !important;
}
html[data-theme="light"] .profile-roster-talent {
  border-color: rgba(5, 150, 105, 0.2);
  background: rgba(16, 185, 129, 0.07);
}
html[data-theme="light"] .profile-roster-acquired {
  color: #64748b;
}
html[data-theme="light"] .profile-roster-skill {
  background: linear-gradient(100deg, #f5f0ff, #f1f2ff) !important;
  border-color: rgba(124, 58, 237, 0.24) !important;
  color: #6b21a8 !important;
}
@media (max-width: 640px) {
  .veteran-quick-stat {
    min-height: 49px;
    padding: 4px 1px !important;
  }
  .veteran-quick-stat .stat-col-hdr {
    font-size: 7px !important;
  }
  .chara-roster-card {
    min-height: 180px;
    padding: 8px 6px;
  }
  .profile-roster-card {
    min-height: 196px;
    padding: 10px 7px;
    gap: 7px;
  }
  .profile-roster-avatar {
    width: 60px;
    height: 60px;
    border-radius: 17px;
  }
  .chara-roster-avatar {
    width: 54px;
    height: 54px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chara-roster-avatar img {
    transition: none;
  }
}

@media (max-width: 640px) {
  .profile-hero-card {
    padding: 16px 13px 14px;
    border-radius: 18px;
    background:
      radial-gradient(ellipse at 100% 0%, rgba(56, 189, 248, 0.09), transparent 42%),
      linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(8, 13, 24, 0.99));
    box-shadow: 0 14px 32px -22px rgba(0, 0, 0, 0.88), inset 0 1px rgba(255, 255, 255, 0.07);
  }
  .profile-hero-layout {
    gap: 13px !important;
  }
  .profile-hero-main {
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .profile-hero-avatar-shell {
    margin-top: 2px;
  }
  .profile-hero-avatar-frame {
    width: 68px !important;
    height: 68px !important;
    padding: 2px !important;
    border-radius: 17px !important;
    box-shadow: 0 8px 18px -8px rgba(245, 158, 11, 0.45) !important;
  }
  .profile-hero-avatar-frame > div {
    border-radius: 15px !important;
  }
  .profile-hero-avatar-shell > div:last-child {
    right: -4px;
    bottom: -5px;
    padding: 2px 5px;
    font-size: 7px;
    letter-spacing: 0.06em;
  }
  .profile-hero-details {
    display: flex;
    flex-direction: column;
    gap: 9px !important;
  }
  .profile-hero-title-row {
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .profile-hero-title-row h1 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 18px;
    line-height: 1.15;
  }
  .profile-hero-rank {
    gap: 6px !important;
    max-width: 100%;
    padding: 5px 8px !important;
    border-radius: 10px !important;
  }
  .profile-hero-rank img {
    max-height: 25px;
  }
  .profile-hero-rank .hero-rank-score {
    font-size: 12px !important;
  }
  .profile-hero-honor {
    gap: 5px !important;
  }
  .profile-hero-honor img {
    max-width: min(150px, 52vw);
  }
  .profile-hero-meta {
    gap: 6px !important;
    font-size: 10px !important;
  }
  .profile-hero-meta .trainer-id-pill {
    max-width: 100%;
    gap: 4px;
    padding: 4px 7px;
    font-size: 10px;
  }
  .profile-hero-meta .hero-tg-badge {
    padding: 4px 7px !important;
    font-size: 10px !important;
  }
  .profile-hero-actions {
    gap: 7px !important;
    padding-top: 2px !important;
  }
  .profile-hero-actions > * {
    min-height: 42px;
    border-radius: 12px !important;
    box-shadow: 0 5px 12px -8px rgba(0, 0, 0, 0.65);
  }
  .profile-hero-actions > :first-child:not(.hero-btn-primary) {
    min-width: 0;
  }
  .profile-roster-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.56);
  }
  .profile-roster-view-controls,
  .profile-roster-sort-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px !important;
  }
  .profile-roster-toolbar .profile-subfilter-btn {
    min-width: 0;
    min-height: 38px;
    padding: 7px 6px;
    text-align: center;
    line-height: 1.2;
  }
  .profile-roster-toolbar > .text-slate-400 {
    line-height: 1.4;
  }
}
@media (max-width: 380px) {
  .profile-hero-card {
    padding: 14px 10px 12px;
  }
  .profile-hero-main {
    gap: 9px !important;
  }
  .profile-hero-avatar-frame {
    width: 60px !important;
    height: 60px !important;
  }
  .profile-hero-title-row h1 {
    font-size: 16px;
  }
  .profile-hero-rank {
    gap: 4px !important;
    padding: 4px 6px !important;
  }
  .profile-hero-rank .hero-rank-tag {
    font-size: 8px !important;
  }
  .profile-hero-rank .hero-rank-score {
    font-size: 11px !important;
  }
}
html[data-theme="light"] .profile-roster-toolbar {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.86);
}

/* ============================================================
   РЕКОМЕНДАЦИЯ (под шапкой «Каталог переводов»)
   ============================================================ */
.recommend-panel {
  position: relative;
  overflow: visible;
  isolation: isolate;
  padding: 0 !important;
}
.recommend-backdrop-wrap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.12), transparent 70%);
}
.recommend-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 5%, rgba(168, 85, 247, 0.7) 35%, rgba(59, 130, 246, 0.7) 65%, transparent 95%);
  opacity: .95;
  z-index: 2;
  pointer-events: none;
}
.recommend-backdrop {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  object-fit: cover;
  filter: blur(34px) saturate(1.3);
  opacity: .28;
  z-index: -1;
  pointer-events: none;
}
/* затемнение справа, чтобы блюр не давал светлых пятен под текстом */
.recommend-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 15, 25, .25) 0%, rgba(11, 15, 25, .78) 45%, rgba(11, 15, 25, .92) 100%);
}
.recommend-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 24px;
}
.recommend-cover {
  position: relative;
  flex: 0 0 auto;
  width: 138px;
  aspect-ratio: 5 / 7;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, .6);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .04);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}
.recommend-cover:disabled { cursor: default; }
.recommend-cover:not(:disabled):hover {
  transform: translateY(-2px) rotate(-.6deg);
  box-shadow: 0 16px 34px -8px rgba(99, 102, 241, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.recommend-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recommend-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 34px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .25), rgba(236, 72, 153, .2));
}
.recommend-cover-new {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 6px;
  color: #34d399;
  background: rgba(2, 44, 34, .85);
  border: 1px solid rgba(52, 211, 153, .45);
}
.recommend-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.recommend-kicker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.recommend-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.recommend-kicker.is-manual {
  color: #f9a8d4;
  background: rgba(236, 72, 153, .14);
  border-color: rgba(236, 72, 153, .38);
}
.recommend-kicker.is-daily {
  color: #fcd34d;
  background: rgba(245, 158, 11, .13);
  border-color: rgba(245, 158, 11, .36);
}
.recommend-hint {
  font-size: 10.5px;
  color: var(--text-muted);
}
.recommend-title-row {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.recommend-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.25;
  font-weight: 900;
  color: #f8fafc;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recommend-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.recommend-meta-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.recommend-meta-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.01em;
  user-select: none;
}
.recommend-chip {
  display: inline-block;
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #cbd5e1;
  background: rgba(148, 163, 184, .1);
  border: 1px solid rgba(148, 163, 184, .2);
}
.recommend-chip--char {
  color: #fbbf24;
  background: rgba(245, 158, 11, .1);
  border-color: rgba(245, 158, 11, .3);
}
.recommend-chip--read {
  color: #34d399;
  background: rgba(16, 185, 129, .1);
  border-color: rgba(16, 185, 129, .3);
}
.recommend-note {
  margin: 0;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.45;
  color: #cbd5e1;
  padding-left: 10px;
  border-left: 2px solid rgba(168, 85, 247, 0.35);
  overflow-wrap: anywhere;
}
.recommend-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.recommend-read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 4px 16px rgba(79, 70, 229, .4);
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.recommend-read-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.recommend-read-btn:active { transform: scale(.97); }
.recommend-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(30, 41, 59, .7);
  border: 1px solid rgba(148, 163, 184, .22);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.recommend-ghost-btn:hover { background: rgba(51, 65, 85, .85); border-color: rgba(148, 163, 184, .4); }
.recommend-ghost-btn:active { transform: scale(.96); }
.recommend-icon-btn { width: 36px; padding: 0; font-size: 14px; }
.recommend-admin-sep {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, .25);
  margin: 0 2px;
}
.recommend-admin-btn { color: #fcd34d; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
.recommend-admin-btn:hover { background: rgba(245, 158, 11, .2); border-color: rgba(245, 158, 11, .55); }
.recommend-admin-btn--danger { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); }
.recommend-admin-btn--danger:hover { background: rgba(239, 68, 68, .2); border-color: rgba(239, 68, 68, .55); }

/* Модалка выбора рекомендации */
.recommend-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  color: inherit;
  background: rgba(15, 23, 42, .45);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.recommend-pick-row:hover { border-color: rgba(99, 102, 241, .55); background: rgba(30, 41, 59, .6); }
.recommend-pick-row.is-selected { border-color: rgba(52, 211, 153, .6); background: rgba(16, 185, 129, .1); }
.recommend-pick-thumb {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(30, 41, 59, .8);
  border: 1px solid var(--card-border);
}
.recommend-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 640px) {
  .recommend-panel {
    position: relative;
    overflow: visible !important;
  }
  .recommend-panel .related-comics-wrap {
    position: static;
  }
  .recommend-panel .related-comics-dropdown {
    position: absolute;
    top: 44px;
    left: 12px;
    right: 12px;
    width: auto;
    min-width: 0;
    max-width: none;
    z-index: 40;
    max-height: 240px;
    background: rgba(18, 19, 31, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
    padding: 8px;
    display: flex;
    flex-direction: column;
  }
  .recommend-panel .related-dropdown-list {
    flex: 1 1 auto;
    max-height: 185px;
    overflow-y: auto;
  }
  .recommend-inner { gap: 14px; padding: 14px; align-items: flex-start; }
  .recommend-cover { width: 96px; border-radius: 10px; }
  .recommend-title { font-size: 1.05rem; -webkit-line-clamp: 4; }
  .recommend-read-btn { height: 36px; padding: 0 14px; flex: 1 1 auto; min-width: 130px; }
  .recommend-ghost-btn { height: 36px; padding: 0 10px; }
  .recommend-icon-btn { width: 36px; }
  .recommend-admin-sep { display: none; }
}
@media (max-width: 380px) {
  .recommend-cover { width: 82px; }
  .recommend-inner { gap: 11px; padding: 12px; }
}

/* Светлая тема */
html[data-theme="light"] .recommend-title { color: #0f172a; }
html[data-theme="light"] .recommend-note { color: #475569; }
html[data-theme="light"] .recommend-meta-label { color: #64748b; }
html[data-theme="light"] .recommend-chip { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
html[data-theme="light"] .recommend-chip--char { color: #b45309; background: #fef3c7; border-color: #fcd34d; }
html[data-theme="light"] .recommend-chip--read { color: #047857; background: #d1fae5; border-color: #6ee7b7; }
html[data-theme="light"] .recommend-kicker.is-manual { color: #be185d; background: #fce7f3; border-color: #f9a8d4; }
html[data-theme="light"] .recommend-kicker.is-daily { color: #b45309; background: #fef3c7; border-color: #fcd34d; }
html[data-theme="light"] .recommend-ghost-btn { color: #334155; background: #f1f5f9; border-color: #e2e8f0; }
html[data-theme="light"] .recommend-ghost-btn:hover { background: #e2e8f0; }
html[data-theme="light"] .recommend-admin-btn { color: #b45309; background: #fef3c7; border-color: #fcd34d; }
html[data-theme="light"] .recommend-admin-btn--danger { color: #b91c1c; background: #fee2e2; border-color: #fca5a5; }
html[data-theme="light"] .recommend-backdrop { opacity: .14; }
html[data-theme="light"] .recommend-pick-row { background: #f8fafc; }
html[data-theme="light"] .recommend-pick-row.is-selected { background: #d1fae5; }
html[data-theme="light"] .recommend-panel::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .8) 45%, rgba(255, 255, 255, .92) 100%);
}

/* ==== SVG-ИКОНКИ (СПРАЙТ) ==== */
.icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.5em; height: 1.5em; }

/* Правка: иконки внутри кнопок шторки настроек */
.tools-item-btn,
.tools-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tools-item-btn .icon,
.tools-auth-btn .icon {
  flex-shrink: 0;
}

/* ============================================================
   СВЯЗАННЫЕ ТАЙТЛЫ (RELATED COMICS POPUP & BADGE)
   ============================================================ */
.related-comics-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.related-comics-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.related-comics-trigger:hover {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.related-comics-wrap.is-active .related-comics-trigger {
  background: rgba(168, 85, 247, 0.26);
  border-color: rgba(192, 132, 252, 0.75);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.42), inset 0 0 6px rgba(168, 85, 247, 0.2);
}

.related-icon {
  font-size: 11px;
  opacity: 0.9;
}

.related-badge-text {
  letter-spacing: 0.02em;
}

.related-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  background: rgba(59, 130, 246, 0.35);
  border-radius: 9999px;
  font-size: 9.5px;
  font-weight: 800;
  color: #dbeafe;
}

.related-comics-wrap.is-active .related-badge-count {
  background: rgba(168, 85, 247, 0.6);
  color: #ffffff;
}

.related-comics-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 250;
  min-width: 250px;
  max-width: 320px;
  width: max-content;
  background: rgba(18, 19, 31, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 6px 8px;
  animation: relatedFadeIn 0.15s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes relatedFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.related-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #c4b5fd;
}

.related-dropdown-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  padding: 0 4px;
  line-height: 1;
}

.related-dropdown-close:hover {
  color: #ffffff;
}

.related-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
  padding-top: 4px;
  overscroll-behavior: contain;
}

.related-dropdown-list::-webkit-scrollbar {
  width: 4px;
}
.related-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}
.related-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.related-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  transition: all 0.12s ease;
}

.related-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.18);
  transform: translateX(3px);
}

.related-item-thumb {
  width: 28px;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.related-item-thumb-placeholder {
  width: 28px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  flex-shrink: 0;
}

.related-item-info {
  flex: 1;
  min-width: 0;
}

.related-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.related-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.related-item-section {
  color: #60a5fa;
  font-weight: 600;
}

.related-item-arrow {
  color: #60a5fa;
  font-weight: 800;
  font-size: 13px;
  opacity: 0.7;
  transition: transform 0.12s ease;
  flex-shrink: 0;
}

.related-dropdown-item:hover .related-item-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.related-order-badge {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.related-dropdown-item:hover .related-order-badge {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.15);
}

.comic-target-highlight {
  animation: comicTargetPulse 2.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 12px;
}

html[data-theme="light"] .related-comics-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] .related-dropdown-header {
  color: #6366f1;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .related-dropdown-close {
  color: #64748b;
}
html[data-theme="light"] .related-dropdown-close:hover {
  color: #0f172a;
}
html[data-theme="light"] .related-item-title {
  color: #0f172a;
}
html[data-theme="light"] .related-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.08);
}
html[data-theme="light"] .related-order-badge {
  color: #64748b;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .related-dropdown-item:hover .related-order-badge {
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
}

@keyframes comicTargetPulse {
  0% {
    background-color: rgba(59, 130, 246, 0.32);
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.55);
  }
  50% {
    background-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

/* ========================================================
   REFACTORED TRAINER LEADERBOARD COMPONENT
   ======================================================== */

.leaderboard-podium-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.leaderboard-podium-divider::before,
.leaderboard-podium-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.leaderboard-table-wrap {
  width: 100%;
  position: relative;
}

/* Sticky Header Row */
.leaderboard-table-header {
  display: grid;
  grid-template-columns: 44px minmax(200px, 1.5fr) 130px 90px 85px 85px 100px 85px;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  margin-bottom: 6px;
}

.leaderboard-th-cell {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  user-select: none;
}
.leaderboard-th-cell--sortable {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  color: #94a3b8;
  transition: color 150ms ease;
  gap: 4px;
  justify-content: flex-end;
}
.leaderboard-th-cell--sortable:hover {
  color: #f1f5f9;
}
.leaderboard-th-cell--sortable.is-active {
  color: #f59e0b;
}
.leaderboard-th-icon {
  width: 11px;
  height: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.leaderboard-th-icon .icon {
  width: 11px;
  height: 11px;
}

/* Table Rows List */
.leaderboard-rows-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Row Item */
.leaderboard-row {
  display: grid;
  grid-template-columns: 44px minmax(200px, 1.5fr) 130px 90px 85px 85px 100px 85px;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 23, 42, 0.65);
  box-sizing: border-box;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  width: 100%;
}
.leaderboard-row:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.72);
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.6);
}

/* Top 3 Accents */
.leaderboard-row--top1 {
  border-left: 3px solid #F59E0B !important;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, rgba(15, 23, 42, 0.72) 100%) !important;
  box-shadow: inset 1px 0 0 rgba(245, 158, 11, 0.3);
}
.leaderboard-row--top1:hover {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  border-left-color: #F59E0B !important;
  box-shadow: 0 8px 24px -6px rgba(245, 158, 11, 0.25);
}

.leaderboard-row--top2 {
  border-left: 3px solid #94A3B8 !important;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, rgba(15, 23, 42, 0.72) 100%) !important;
  box-shadow: inset 1px 0 0 rgba(148, 163, 184, 0.2);
}
.leaderboard-row--top2:hover {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
  border-left-color: #94A3B8 !important;
}

.leaderboard-row--top3 {
  border-left: 3px solid #D97706 !important;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.08) 0%, rgba(15, 23, 42, 0.72) 100%) !important;
  box-shadow: inset 1px 0 0 rgba(217, 119, 6, 0.2);
}
.leaderboard-row--top3:hover {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.14) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  border-left-color: #D97706 !important;
}

/* Position cell (#) */
.leaderboard-pos {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: #64748b;
  line-height: 1;
}
.leaderboard-row--top1 .leaderboard-pos {
  color: #fbbf24;
  font-size: 15px;
}
.leaderboard-row--top2 .leaderboard-pos {
  color: #cbd5e1;
  font-size: 14px;
}
.leaderboard-row--top3 .leaderboard-pos {
  color: #f59e0b;
  font-size: 14px;
}

/* Player Info Cell */
.leaderboard-player-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: border-color 150ms ease;
}
.leaderboard-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  font-size: 16px;
  color: #94a3b8;
}
.leaderboard-row--top1 .leaderboard-avatar {
  border-color: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.leaderboard-row--top2 .leaderboard-avatar {
  border-color: #94A3B8;
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.3);
}
.leaderboard-row--top3 .leaderboard-avatar {
  border-color: #D97706;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.3);
}

.leaderboard-player-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  flex: 1;
}

.leaderboard-player-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.leaderboard-player-name {
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.leaderboard-crown-badge {
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  flex-shrink: 0;
  line-height: 1.2;
}
.leaderboard-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #34d399;
  opacity: 0.85;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-player-line2 {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Trainer ID Pill */
.leaderboard-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  user-select: none;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.leaderboard-id-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
}
.leaderboard-id-pill.is-copied {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #34d399 !important;
}
.leaderboard-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: opacity 150ms ease, color 150ms ease;
}
.leaderboard-id-pill:hover .leaderboard-copy-icon {
  opacity: 1;
}
.leaderboard-id-pill.is-copied .leaderboard-copy-icon {
  opacity: 1;
  color: #34d399;
}
.leaderboard-copy-icon .icon {
  width: 12px;
  height: 12px;
}

/* Rank Glassmorphism Pill */
.leaderboard-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 8px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.leaderboard-rank-pill.is-sort-active {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(168, 85, 247, 0.14));
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.leaderboard-rank-img {
  width: 32px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.leaderboard-rank-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Stats Values */
.leaderboard-stat-cell {
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.leaderboard-stat-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.leaderboard-stat-sub {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Action button */
.leaderboard-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #34d399;
  background: rgba(56, 189, 248, 0.06);
  text-decoration: none;
  transition: all 150ms ease;
  white-space: nowrap;
}
.leaderboard-row:hover .leaderboard-profile-btn,
.leaderboard-profile-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
  transform: scale(1.02);
}

.leaderboard-mobile-label {
  display: none;
}

.leaderboard-stats-group {
  display: contents !important;
}

@media (min-width: 768px) {
  .leaderboard-stat-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
  }
}

/* ========================================================
   RESPONSIVE (MOBILE < 768px)
   ======================================================== */
@media (max-width: 767px) {
  .leaderboard-table-header {
    display: none !important;
  }
  .leaderboard-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  .leaderboard-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .leaderboard-stats-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
  }
  .leaderboard-mobile-label {
    display: block;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 2px;
  }
  .leaderboard-stat-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
  }
  .leaderboard-rank-pill {
    padding: 3px 6px;
    border-radius: 8px;
  }
  .leaderboard-rank-img {
    width: 26px;
    height: 16px;
  }
  .leaderboard-rank-score {
    font-size: 11px;
  }
  .leaderboard-stat-num {
    font-size: 0.95rem;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .leaderboard-stats-group {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Light Theme overrides */
html[data-theme="light"] .leaderboard-table-header {
  background: rgba(248, 250, 252, 0.94);
  border-bottom-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .leaderboard-th-cell {
  color: #64748b;
}
html[data-theme="light"] .leaderboard-th-cell--sortable:hover {
  color: #0f172a;
}
html[data-theme="light"] .leaderboard-row {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .leaderboard-row:hover {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .leaderboard-row--top1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, #ffffff 100%) !important;
}
html[data-theme="light"] .leaderboard-row--top2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 0%, #ffffff 100%) !important;
}
html[data-theme="light"] .leaderboard-row--top3 {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.1) 0%, #ffffff 100%) !important;
}
html[data-theme="light"] .leaderboard-player-name {
  color: #0f172a;
}
html[data-theme="light"] .leaderboard-rank-score {
  color: #0f172a;
}
html[data-theme="light"] .leaderboard-id-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}
html[data-theme="light"] .leaderboard-id-pill:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
html[data-theme="light"] .leaderboard-podium-divider::before,
html[data-theme="light"] .leaderboard-podium-divider::after {
  background: rgba(148, 163, 184, 0.25);
}

/* Кнопка быстрого поиска в шапке: просторная на ПК и компактная на мобильных */
.header-quick-search-btn {
  min-height: 36px;
  height: 36px;
}
@media (min-width: 641px) {
  .header-quick-search-btn {
    flex: 1;
    max-width: 460px;
    margin: 0 16px;
  }
}
@media (min-width: 1024px) {
  .header-quick-search-btn {
    max-width: 520px;
    margin: 0 24px;
  }
}
@media (max-width: 640px) {
  .header-quick-search-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 13px;
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(129, 140, 248, 0.38);
    color: #c7d2fe;
  }
  .header-quick-search-btn:hover,
  .header-quick-search-btn:active {
    background: rgba(99, 102, 241, 0.26);
    border-color: rgba(165, 180, 252, 0.6);
    color: #ffffff;
  }
  .header-quick-search-btn .icon {
    width: 20px;
    height: 20px;
  }
}
html[data-theme="light"] .header-quick-search-btn {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

/* Унификация мобильных кнопок в шапке (равная высота 38px, аккуратные иконки без переполнения) */
@media (max-width: 640px) {
  .header-donate-btn {
    display: none !important;
  }
}

.header-trainer-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.header-trainer-search-btn:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}
@media (max-width: 640px) {
  .header-trainer-search-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
  }
}
html[data-theme="light"] .header-trainer-search-btn {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
}
.header-trainer-search-btn svg,
.header-trainer-search-btn .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

/* На ПК (от 768px) оценка карты всегда раскрыта полностью */
@media (min-width: 768px) {
  .card-note-text.is-collapsed {
    max-height: none !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  .card-note-box .site-desc-expand-btn {
    display: none !important;
  }
}

/* Редизайн настроек (группировка и улучшение читабельности) */
.settings-section-wrap {
  margin-bottom: 14px;
}
.settings-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0 4px;
  margin-bottom: 6px;
}
.settings-group-card {
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.settings-group-card > * + * {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-row-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 48px;
}
.settings-row-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}
.settings-row-item:active {
  background: rgba(255, 255, 255, 0.09);
}
.settings-row-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.settings-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-row-icon .icon {
  width: 16px;
  height: 16px;
}
.settings-row-label {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.settings-row-label > * {
  text-align: left;
}
.settings-row-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 1px;
  text-align: left;
}
.settings-row-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: inherit;
  flex-shrink: 0;
}
.settings-row-arrow {
  font-size: 14px;
  color: #64748b;
  flex-shrink: 0;
}
html[data-theme="light"] .settings-group-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .settings-group-card > * + * {
  border-top-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .settings-row-item {
  color: #0f172a;
}
html[data-theme="light"] .settings-row-label {
  color: #0f172a;
}
html[data-theme="light"] .settings-row-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="light"] .settings-section-title {
  color: #64748b;
}
html[data-theme="light"] .settings-row-badge {
  background: #f1f5f9;
  color: #475569;
}

.pp-banner-title { white-space: pre-line; }
.pp-catalog-banner-title { white-space: pre-line; }

.pp-scenario-header {
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-left: 3px solid rgba(129, 140, 248, 0.75);
  border-radius: 12px;
  background: linear-gradient(110deg, rgba(30, 41, 79, 0.9), rgba(15, 23, 42, 0.94) 70%);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.18);
  text-align: left;
}
.pp-scenario-header:hover {
  border-color: rgba(129, 140, 248, 0.38);
  border-left-color: rgba(165, 180, 252, 0.95);
}
.pp-scenario-icon {
  background: rgba(129, 140, 248, 0.12);
  box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.16);
}
.pp-scenario-count {
  background: rgba(129, 140, 248, 0.12);
  color: #c7d2fe;
}
.pp-feature-locked {
  opacity: 0.52;
}
.pp-feature-locked button,
.pp-feature-locked select {
  cursor: not-allowed !important;
}

.pp-plan-stepper {
  grid-template-columns: 38px minmax(0, 1fr) 38px;
}
.pp-plan-stepper button {
  min-height: 38px;
  touch-action: manipulation;
}
@media (max-width: 640px) {
  .pp-plan-stepper {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
  .pp-plan-stepper button {
    min-height: 44px;
  }
}
.pp-plan-control-grid > * {
  width: 100%;
  min-width: 0;
}
#app .pp-plan-control-grid .theme-input {
  height: 36px;
  min-height: 36px;
}
.pp-plan-number-input {
  appearance: textfield;
  -moz-appearance: textfield;
  padding-right: 4px !important;
  padding-left: 4px !important;
}
.pp-plan-number-input::-webkit-inner-spin-button,
.pp-plan-number-input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.home-planner-promo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background:
    radial-gradient(ellipse at 0% 50%, rgba(99, 102, 241, 0.2), transparent 55%),
    linear-gradient(110deg, rgba(20, 28, 57, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.2);
}
.home-planner-promo-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.14);
}
.home-planner-promo-content { min-width: 0; flex: 1; }
.home-planner-promo-kicker {
  margin-bottom: 3px;
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.home-planner-promo-title { color: #f8fafc; font-size: 18px; font-weight: 850; line-height: 1.25; }
.home-planner-promo-description { margin-top: 4px; color: #cbd5e1; font-size: 13px; line-height: 1.5; }
.home-planner-promo-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(165, 180, 252, 0.35);
  border-radius: 12px;
  background: linear-gradient(120deg, #4f46e5, #4338ca);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: filter 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.home-planner-promo-button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.home-login-promo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(14, 165, 233, 0.13), rgba(15, 23, 42, 0.96) 58%);
}
.home-login-promo-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 13px;
  background: rgba(14, 165, 233, 0.14);
  font-size: 19px;
}
.home-login-promo-content { min-width: 0; flex: 1; }
.home-login-promo-title { color: #e0f2fe; font-size: 14px; font-weight: 850; }
.home-login-promo-description { margin-top: 3px; color: #cbd5e1; font-size: 11px; line-height: 1.5; }
.home-login-promo-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 12px;
  background: linear-gradient(120deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  transition: filter 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.home-login-promo-button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.home-hachimi-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d4ed8, #312e81);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #dbeafe;
  font-size: 24px;
  font-weight: 900;
}
.home-hachimi-icon span { transform: skew(-8deg); }
html[data-theme="light"] .home-login-promo {
  border-color: rgba(2, 132, 199, 0.24);
  background: linear-gradient(110deg, rgba(14, 165, 233, 0.1), #f8fafc 58%);
}
html[data-theme="light"] .home-login-promo-title { color: #0c4a6e; }
html[data-theme="light"] .home-login-promo-description { color: #475569; }
html[data-theme="light"] .home-planner-promo {
  border-color: rgba(79, 70, 229, 0.24);
  background:
    radial-gradient(ellipse at 0% 50%, rgba(99, 102, 241, 0.12), transparent 55%),
    linear-gradient(110deg, #eef2ff, #f8fafc);
}
html[data-theme="light"] .home-planner-promo-title { color: #1e1b4b; }
html[data-theme="light"] .home-planner-promo-description { color: #475569; }
@media (max-width: 639px) {
  .home-planner-promo { flex-wrap: wrap; gap: 12px; }
  .home-planner-promo-icon { width: 44px; height: 44px; border-radius: 13px; }
  .home-planner-promo-title { font-size: 15px; }
  .home-planner-promo-description { font-size: 12px; }
  .home-planner-promo-button { width: 100%; }
  .home-login-promo { flex-wrap: wrap; gap: 10px; padding: 13px; }
  .home-login-promo-content { flex: 1 1 calc(100% - 55px); }
  .home-login-promo-button { width: 100%; }
}

@media (min-width: 640px) {
  .pp-banner-title {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.04));
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.16);
    color: #f8fafc;
    font-weight: 750;
  }
  .pp-plan-control-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
  .pp-plan-desktop-left { text-align: center; }
  .pp-plan-desktop-start,
  .pp-plan-desktop-between { justify-content: center; }
  .pp-plan-desktop-stretch { align-items: center; }
  .pp-plan-desktop-header { align-items: center; }
  .pp-plan-desktop-header-content { align-items: center; }
  .pp-plan-desktop-header-info { text-align: center; }
  .pp-plan-desktop-header-title,
  .pp-plan-desktop-header-date { justify-content: center; }
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 1: CATALOG & HERO SPOTLIGHT
   ========================================================================== */
.recommend-panel {
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.recommend-read-btn {
  background: linear-gradient(135deg, #10b981 0%, #0284c7 100%) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  transition: filter 0.18s ease, transform 0.18s ease !important;
}

.recommend-read-btn:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-1px) !important;
}

.recommend-cover {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.8), 0 0 20px -4px rgba(16, 185, 129, 0.2) !important;
}

.read-check-btn {
  width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
  font-size: 11px !important;
  color: transparent !important;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.18s ease !important;
}

.read-check-btn:hover {
  border-color: #10b981 !important;
  color: rgba(16, 185, 129, 0.6) !important;
}

.read-check-btn.is-active {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.16) !important;
  color: #10b981 !important;
  font-weight: 900 !important;
}

.chapter-compact-row {
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease !important;
}

.chapter-compact-row:hover {
  border-color: rgba(16, 185, 129, 0.35) !important;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 40%) !important;
  transform: translateX(2px) !important;
}

.chapter-card {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

.chapter-card:hover {
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 10px 24px -10px rgba(16, 185, 129, 0.25) !important;
  transform: translateY(-1.5px) !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 2: PULL PLANNER INVENTORY & SPARK GAUGE
   ========================================================================== */
.pp-inventory-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.25);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.pp-inventory-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(245, 158, 11, 0.15);
}

.pp-inventory-card .theme-input {
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pp-inventory-card .theme-input:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}

html[data-theme="light"] .pp-inventory-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .pp-inventory-card:hover {
  border-color: #f59e0b !important;
  box-shadow: 0 6px 16px -4px rgba(245, 158, 11, 0.2) !important;
}

html[data-theme="light"] .pp-inventory-card .theme-input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .pp-inventory-card span {
  color: #334155 !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 3: TRAINER PROFILE & TRACEN LICENSE
   ========================================================================== */
.trainer-hero-card {
  background: linear-gradient(135deg, rgba(24, 33, 47, 0.96) 0%, rgba(13, 20, 34, 0.98) 100%) !important;
  border: 1px solid rgba(251, 191, 36, 0.22) !important;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 30px -10px rgba(245, 158, 11, 0.1) !important;
}

.trainer-hero-card .hero-accent-bar {
  height: 3px !important;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #38bdf8, #10b981) !important;
}

.trainer-id-pill {
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  background: rgba(14, 165, 233, 0.1) !important;
  box-shadow: 0 2px 8px -2px rgba(56, 189, 248, 0.25) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.trainer-id-pill:hover {
  background: rgba(14, 165, 233, 0.2) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px -2px rgba(56, 189, 248, 0.4) !important;
}

.horse-hall-card {
  transition: border-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.horse-hall-card:hover {
  border-color: rgba(245, 158, 11, 0.45) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(245, 158, 11, 0.18) !important;
}

.horse-hall-avatar {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.horse-hall-card:hover .horse-hall-avatar {
  transform: scale(1.05) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 4: GLOBAL POLISH & SMOOTH TRANSITIONS
   ========================================================================== */
.bottom-nav-bar {
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.bottom-nav-btn {
  transition: color 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.bottom-nav-btn.active .bottom-nav-icon-wrap {
  animation: none !important;
}

.scenario-badge {
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 5: COMPREHENSIVE LIGHT THEME & SETTINGS HARMONY
   ========================================================================== */

/* --- 1. ПЛАНИРОВЩИК КРУТОК: ШКАЛА ГАРАНТА И СВОДКА В СВЕТЛОЙ ТЕМЕ --- */
html[data-theme="light"] .planner-summary {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #f8fafc 100%) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .planner-summary .text-slate-400 {
  color: #475569 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .planner-summary .text-slate-100 {
  color: #0f172a !important;
  font-weight: 900 !important;
}

html[data-theme="light"] .planner-summary .text-slate-300 {
  color: #1e293b !important;
}

html[data-theme="light"] .planner-summary .divide-white\/5 {
  border-color: rgba(16, 185, 129, 0.15) !important;
}

html[data-theme="light"] .planner-summary .bg-black\/30 {
  background: rgba(241, 245, 249, 0.85) !important;
  border-top-color: rgba(16, 185, 129, 0.2) !important;
}

html[data-theme="light"] .planner-summary .bg-slate-800\/80 {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .planner-summary .border-white\/5,
html[data-theme="light"] .planner-summary .border-white\/10 {
  border-color: rgba(16, 185, 129, 0.2) !important;
}

/* --- 2. ПРЕСЕТЫ ПЛАНИРОВЩИКА (.pp-preset-btn) --- */
.pp-preset-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.pp-preset-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.pp-preset-btn--max.is-active {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
}

.pp-preset-btn--standard.is-active {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25) !important;
}

.pp-preset-btn--casual.is-active {
  background: rgba(14, 165, 233, 0.18) !important;
  color: #7dd3fc !important;
  border-color: rgba(14, 165, 233, 0.6) !important;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25) !important;
}

.pp-preset-btn--noevents.is-active {
  background: rgba(244, 63, 94, 0.18) !important;
  color: #fda4af !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25) !important;
}

html[data-theme="light"] .pp-preset-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .pp-preset-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .pp-preset-btn--max.is-active {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #f59e0b !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2) !important;
}

html[data-theme="light"] .pp-preset-btn--standard.is-active {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #10b981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

html[data-theme="light"] .pp-preset-btn--casual.is-active {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="light"] .pp-preset-btn--noevents.is-active {
  background: #fff1f2 !important;
  color: #be123c !important;
  border-color: #f43f5e !important;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.2) !important;
}

/* --- 3. ПЕРЕКЛЮЧАТЕЛИ ДОХОДА (.pp-toggle-switch) --- */
.pp-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #334155;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.pp-toggle-switch.is-active {
  background: #10b981 !important;
}

.pp-toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pp-toggle-switch.is-active .pp-toggle-switch-thumb {
  transform: translateX(16px);
}

html[data-theme="light"] .pp-toggle-switch {
  background: #cbd5e1;
}

html[data-theme="light"] .pp-toggle-switch.is-active {
  background: #059669 !important;
}

/* --- 4. КАРТОЧКА БАЛАНСА И ДОХОДА В СВЕТЛОЙ ТЕМЕ --- */
html[data-theme="light"] .theme-panel h4.text-white {
  color: #0f172a !important;
}

html[data-theme="light"] .theme-panel .text-slate-300 {
  color: #1e293b !important;
}

html[data-theme="light"] .theme-panel .text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] .theme-panel .text-slate-500 {
  color: #64748b !important;
}

html[data-theme="light"] .theme-panel .border-white\/5,
html[data-theme="light"] .theme-panel .border-white\/10 {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .theme-panel .bg-white\/\[0\.02\] {
  background: #f8fafc !important;
}

html[data-theme="light"] .theme-panel .hover\:bg-white\/\[0\.03\]:hover {
  background: rgba(16, 185, 129, 0.05) !important;
}

html[data-theme="light"] .theme-panel span[class*="text-amber-300"] {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

html[data-theme="light"] .theme-panel span[class*="text-emerald-300"] {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

html[data-theme="light"] button[class*="text-red-300"] {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

html[data-theme="light"] button[class*="text-red-300"]:hover {
  background: #fecaca !important;
}

html[data-theme="light"] select.theme-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* --- 5. ШТОРКА НАСТРОЕК (ГАРМОНИЗАЦИЯ С ПАЛИТРОЙ САЙТА) --- */
.tools-sheet-tab-switcher {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 3px;
}

.tools-sheet-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.tools-sheet-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.tools-sheet-tab-btn.is-active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4) !important;
}

.tools-sheet-tab-btn--leaderboard.is-active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4) !important;
}

.tools-sheet-tab-count {
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

html[data-theme="light"] .tools-sheet {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .tools-sheet-header {
  border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .tools-sheet-tab-switcher {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .tools-sheet-tab-btn {
  color: #64748b !important;
}

html[data-theme="light"] .tools-sheet-tab-btn:hover {
  color: #0f172a !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .tools-sheet-tab-btn.is-active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="light"] .tools-sheet-tab-btn--leaderboard.is-active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="light"] .tools-sheet-tab-count {
  background: rgba(0, 0, 0, 0.14) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .tools-sheet-close {
  color: #64748b !important;
}

html[data-theme="light"] .tools-sheet-close:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

/* Разделы и карточки настроек */
.settings-section-title {
  color: #34d399;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .settings-section-title {
  color: #047857 !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .settings-group-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .settings-group-card > * + * {
  border-top-color: #f1f5f9 !important;
}

html[data-theme="light"] .settings-row-item {
  color: #0f172a !important;
}

html[data-theme="light"] .settings-row-item:hover {
  background: rgba(16, 185, 129, 0.04) !important;
}

html[data-theme="light"] .settings-row-label {
  color: #0f172a !important;
}

html[data-theme="light"] .settings-row-sub {
  color: #64748b !important;
}

html[data-theme="light"] .settings-row-badge {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

html[data-theme="light"] .settings-row-arrow {
  color: #94a3b8 !important;
}

/* Карточка синхронизации чтения в светлой теме */
html[data-theme="light"] .sync-status-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}

html[data-theme="light"] .sync-status-card .text-slate-100 {
  color: #0f172a !important;
}

html[data-theme="light"] .sync-status-card .text-slate-400 {
  color: #64748b !important;
}

html[data-theme="light"] .sync-badge--active {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
}

html[data-theme="light"] .sync-badge--active .text-emerald-300 {
  color: #047857 !important;
}

/* Лидерборд в светлой теме */
html[data-theme="light"] .tools-sheet .text-white {
  color: #0f172a !important;
}

html[data-theme="light"] .tools-sheet .text-slate-400 {
  color: #64748b !important;
}

html[data-theme="light"] .tools-sheet .text-slate-300 {
  color: #334155 !important;
}

html[data-theme="light"] .tools-sheet .border-white\/10 {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .tools-sheet .theme-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .tools-sheet button.bg-slate-800 {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .tools-sheet button.bg-slate-800:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Кнопки сортировки лидерборда в светлой теме */
html[data-theme="light"] .tools-sheet button.border-slate-800 {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .tools-sheet button.border-slate-800:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Пьедестал топ-3 лидерборда в светлой теме */
html[data-theme="light"] .tools-sheet div[class*="bg-slate-400/5"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Чекбоксы прочтения глав и ховеры карточек в светлой теме */
html[data-theme="light"] .read-check-btn {
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .read-check-btn:hover {
  border-color: #059669 !important;
  color: rgba(5, 150, 105, 0.7) !important;
}

html[data-theme="light"] .read-check-btn.is-active {
  border-color: #059669 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  color: #059669 !important;
}

html[data-theme="light"] .chapter-compact-row:hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, transparent 45%) !important;
}

html[data-theme="light"] .chapter-card:hover {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 10px 24px -10px rgba(16, 185, 129, 0.2) !important;
}

html[data-theme="light"] .recommend-panel {
  background: #ffffff !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

html[data-theme="light"] .recommend-panel h2,
html[data-theme="light"] .recommend-panel h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .recommend-panel p {
  color: #475569 !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 6: DEEP AUDIT & PRECISION LIGHT THEME
   ========================================================================== */

/* 1. Планнер: Шкала гаранта и карточки баннеров */
html[data-theme="light"] .planner-summary div[class*="bg-black/30"] {
  background: #f1f5f9 !important;
  border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] .planner-summary div[class*="bg-black/30"] .text-slate-300 {
  color: #1e293b !important;
}

html[data-theme="light"] .planner-summary div[class*="bg-slate-800"] {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .planner-summary b.text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] .planner-summary .text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] .pp-plan-grid > div {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px -3px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .pp-plan-grid > div .pp-banner-title {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-grid > div div[class*="bg-white/[0.03]"] {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .pp-plan-grid > div div[class*="bg-white/[0.02]"] {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .pp-plan-grid > div div[class*="bg-white/[0.02]"] .text-white,
html[data-theme="light"] .pp-plan-grid > div div[class*="bg-white/[0.02]"] .text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-grid > div div[class*="bg-white/[0.02]"] .text-slate-400 {
  color: #64748b !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .pp-plan-grid > div .text-slate-300 {
  color: #475569 !important;
}

html[data-theme="light"] .pp-plan-grid > div .text-slate-400 {
  color: #64748b !important;
}

html[data-theme="light"] .pp-plan-grid > div b.text-slate-200,
html[data-theme="light"] .pp-plan-grid > div strong.text-white {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-grid > div .pp-plan-stepper button {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .pp-plan-grid > div .pp-plan-stepper button:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-grid > div .pp-plan-stepper div {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .pp-plan-progress-wrap {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .pp-plan-progress-wrap .text-slate-300 {
  color: #475569 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .pp-plan-progress-wrap strong.text-white {
  color: #0f172a !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .pp-plan-progress-wrap div[class*="bg-slate-900"] {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .pp-plan-desktop-left b.text-slate-200,
html[data-theme="light"] .pp-plan-item b.text-slate-200,
html[data-theme="light"] .pp-plan-item strong.text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-item div[class*="bg-white/[0.02]"] {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .pp-plan-item div[class*="bg-white/[0.02]"] .text-white {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-item div[class*="bg-white/[0.02]"] .text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] .pp-plan-item div[class*="bg-white/[0.02]"] .text-slate-400 {
  color: #64748b !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .pp-plan-status-pill.is-covered {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

html[data-theme="light"] .pp-plan-status-pill.is-deficit {
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
}

/* 2. Статистика ветеранов: рамка 5 колонок и иконки-фоллбеки */
.stat-hdr-fallback {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
}

.stat-col-speed .stat-hdr-fallback { color: #0284c7; }
.stat-col-stamina .stat-hdr-fallback { color: #e11d48; }
.stat-col-power .stat-hdr-fallback { color: #d97706; }
.stat-col-guts .stat-hdr-fallback { color: #db2777; }
.stat-col-wit .stat-hdr-fallback { color: #059669; }

html[data-theme="light"] div[class*="bg-black/40"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* 3. Фильтры и поиск в разделе «Все ветераны» */
html[data-theme="light"] input[class*="bg-slate-950"],
html[data-theme="light"] select[class*="bg-slate-950"] {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] button[class*="bg-slate-950"] {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] button[class*="bg-slate-950"]:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

html[data-theme="light"] .profile-chip-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

/* 4. Раздел «Титулы» (Honors): карточки плашек, фильтры и дата */
html[data-theme="light"] .honor-plate-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .honor-plate-card:hover {
  background: #f8fafc !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.12) !important;
}

html[data-theme="light"] .honor-plate-card.is-active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), 0 6px 18px rgba(245, 158, 11, 0.15) !important;
  background: #fffbeb !important;
}

html[data-theme="light"] .honor-filter-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .honor-filter-chip:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

html[data-theme="light"] .honor-filter-chip.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: #047857 !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3) !important;
}

html[data-theme="light"] div[class*="bg-purple-950/40"] {
  background: #f3e8ff !important;
  border: 1px solid #d8b4fe !important;
  color: #6b21a8 !important;
}

html[data-theme="light"] div[class*="bg-purple-950/40"] b {
  color: #581c87 !important;
}

html[data-theme="light"] div[class*="bg-slate-900/90"],
html[data-theme="light"] div[class*="bg-slate-900/60"],
html[data-theme="light"] div[class*="bg-slate-900/70"] {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] div[class*="bg-slate-800/80"],
html[data-theme="light"] div[class*="bg-slate-800/90"] {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] input[class*="bg-slate-800/90"],
html[data-theme="light"] select[class*="bg-slate-800"] {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 7: MICRO-ANIMATIONS & MOBILE ERGONOMICS
   ========================================================================== */

/* 1. Плавный переход Vue (fade-slide) при смене вкладок */
.tab-viewport {
  width: 100%;
  min-height: calc(100vh - 180px);
}

.bottom-nav-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.tab-fade-slide-enter-active {
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-fade-slide-leave-active {
  transition: opacity 0.14s ease-out,
              transform 0.14s ease-out;
}

.tab-fade-slide-enter-from {
  opacity: 0;
  transform: translateY(10px) scale(0.996);
}

.tab-fade-slide-leave-to {
  opacity: 0;
  transform: translateY(-8px) scale(0.996);
}

/* 2. Плавающий индикатор нижней навигационной панели («живая точка» и капсула) */
.bottom-nav-inner {
  position: relative !important;
  padding: 0 !important;
}

.bottom-nav-indicator-track {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / 6);
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 1px;
  box-sizing: border-box;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  will-change: transform;
}

.bottom-nav-indicator-capsule {
  position: relative;
  width: 44px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.16));
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.bottom-nav-indicator-spacer {
  height: 13px;
  width: 1px;
  visibility: hidden;
}

html[data-theme="light"] .bottom-nav-indicator-capsule {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.08));
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.18);
}

.bottom-nav-live-dot {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 6px #10b981, 0 0 12px rgba(16, 185, 129, 0.6);
  animation: liveDotPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

html[data-theme="light"] .bottom-nav-live-dot {
  background: #059669;
  box-shadow: 0 0 5px #059669, 0 0 10px rgba(5, 150, 105, 0.45);
}

@keyframes liveDotPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) scale(1.3);
    opacity: 1;
    box-shadow: 0 0 8px #10b981, 0 0 16px rgba(16, 185, 129, 0.8);
  }
}

.bottom-nav-btn {
  position: relative !important;
  z-index: 2 !important;
  transition: color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.bottom-nav-btn:active {
  transform: scale(0.92) !important;
}

.bottom-nav-btn .bottom-nav-icon-wrap,
.bottom-nav-btn.active .bottom-nav-icon-wrap {
  background: transparent !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  animation: none !important;
}

.bottom-nav-btn.active {
  color: #34d399 !important;
}

html[data-theme="light"] .bottom-nav-btn.active {
  color: #059669 !important;
}

.bottom-nav-btn.active .bottom-nav-icon {
  transform: scale(1.15) translateY(-1px) !important;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.5)) !important;
  color: #34d399 !important;
}

html[data-theme="light"] .bottom-nav-btn.active .bottom-nav-icon {
  color: #059669 !important;
  filter: drop-shadow(0 2px 6px rgba(5, 150, 105, 0.35)) !important;
}

.bottom-nav-btn.active .bottom-nav-label {
  color: #34d399 !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .bottom-nav-btn.active .bottom-nav-label {
  color: #047857 !important;
  font-weight: 800 !important;
}

@media (max-width: 420px) {
  .bottom-nav-indicator-capsule {
    width: 36px !important;
    height: 24px !important;
  }
  .bottom-nav-indicator-spacer {
    height: 11px !important;
  }
  .bottom-nav-live-dot {
    top: -2.5px !important;
    width: 3.5px !important;
    height: 3.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-fade-slide-enter-active,
  .tab-fade-slide-leave-active,
  .bottom-nav-indicator-track,
  .bottom-nav-btn,
  .bottom-nav-icon,
  .bottom-nav-live-dot {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ==========================================================================
   FLAWLESS UI/UX DESIGN SYSTEM — PHASE 8: MOBILE 120 FPS & TACTILE ERGONOMICS
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. ПОЛНОЕ ОТКЛЮЧЕНИЕ ТЯЖЁЛЫХ GPU-БЛЮРОВ НА ТЕЛЕФОНАХ (УСТРАНЕНИЕ ЛАГОВ СКРОЛЛА) */
  .sticky-header,
  .bottom-nav-bar,
  .theme-panel,
  .theme-card,
  .uma-card,
  .glass-panel,
  .tag-tooltip-box,
  .chapter-compact-row,
  .section-block,
  .section-block.open,
  .home-nav-card,
  .club-stat-card,
  .club-description-card,
  .tools-sheet,
  .settings-group-card,
  .sync-status-card,
  .card-note-box,
  .profile-section-card,
  .home-login-promo,
  .home-planner-promo,
  .article-promo-card,
  .translations-tabs-bar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .sticky-header,
  .bottom-nav-bar {
    background: rgba(7, 10, 18, 0.96) !important;
  }

  html[data-theme="light"] .sticky-header,
  html[data-theme="light"] .bottom-nav-bar {
    background: rgba(255, 255, 255, 0.98) !important;
  }

  .tab-viewport {
    min-height: auto !important;
  }

  /* 2. МГНОВЕННОЕ ПЕРЕКЛЮЧЕНИЕ ВКЛАДОК НА МОБИЛЬНЫХ (0ms LAG) */
  .tab-fade-slide-enter-active,
  .tab-fade-slide-leave-active {
    transition: none !important;
    animation: none !important;
  }

  .tab-fade-slide-enter-from,
  .tab-fade-slide-leave-to {
    opacity: 1 !important;
    transform: none !important;
  }

  /* 3. УСТРАНЕНИЕ АНИМАЦИИ ПОЯВЛЕНИЯ ПРИ СКРОЛЛЕ (КАРТОЧКИ ГОТОВЫ СРАЗУ) */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* 4. ВИРТУАЛИЗАЦИЯ И РАЗГРУЗКА DOM ДЛЯ СКОРОСТИ 120 FPS */
  article.reveal,
  .comic-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 110px;
  }

  .veteran-card,
  .support-card-item,
  .honor-pill-item,
  .meta-card-row,
  .fanart-grid-item,
  .useful-site-card,
  .character-card-clean {
    content-visibility: auto;
    contain-intrinsic-size: 1px 80px;
  }

  /* 5. ОТКЛЮЧЕНИЕ БЕСКОНЕЧНЫХ ФОНОВЫХ АНИМАЦИЙ НА МОБИЛЬНЫХ ДЛЯ ЭКОНОМИИ GPU/БАТАРЕИ */
  .bottom-nav-live-dot,
  .home-mascot-img,
  .changelog-new-dot,
  .site-title {
    animation: none !important;
  }
}

article.reveal:active {
  transform: scale(0.985);
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.tools-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: 0.35;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.skeleton,
.skeleton-card {
  background: linear-gradient(90deg, var(--muted-bg) 25%, var(--card-border) 37%, var(--muted-bg) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
}

/* ==== КНОПКА И КОНТЕЙНЕР ПРОГРЕССИВНОЙ ПОДГРУЗКИ КАТАЛОГА (MOBILE CHUNKING) ==== */
.section-load-more {
  position: relative;
  z-index: 2;
}

.load-more-btn {
  background: var(--muted-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.load-more-btn:hover {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.2);
}

.load-more-btn:active {
  transform: scale(0.96);
}
