

   



body {
      background: var(--bg-primary);
      color: var(--text-primary);
      transition: background 0.3s ease, color 0.3s ease;
    }
    
    .dashboard-container {
      display: flex;
      gap: 20px;
      margin-top: 20px;
    }



    .channel-main {
      flex-grow: 1; /* правая колонка занимает оставшееся место */
        }

    @media (max-width: 768px) {
      .dashboard-container {
        flex-direction: column; /* колонки будут сверху вниз */
      }
      
      

    }
     
    .channel-side, 
    .channel-main, 
    .side-card, 
    .message-card, 
    .pct-table {
      border-radius: var(--border-radius);
    }

    .channel-side {
      width: 300px;
      flex-shrink: 0;
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      padding: 15px;
      border-radius: var(--border-radius);
      box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    }



    @media (max-width: 768px) {
  .channel-dashboard {
    flex-direction: column;
  }

  .channel-side,
  .channel-main {
    width: 100%;
  }

  /* Скрываем основной блок на мобильных */
  .channel-main {
    display: none;
  }
}

    .channel-side:hover {
      background: var(--bg-secondary); /* при наведении фон слегка меняется */
    }

    .channel-main {
      flex-grow: 1;
      background: var(--card-bg);
      padding: 15px;
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius);
    }

    /* Разделение для панелей */
    .dashboard-container {
      display: flex;
      gap: 20px;
      margin-top: 20px;
    }

    .channel-dashboard {
      display: flex;          /* добавляем flex */
      flex-direction: row;    /* колонки слева направо */
      gap: 20px;              /* расстояние между колонками */
    }

    /* === FIX: убираем жёсткий белый фон (rgba(255,255,255...)) === */
      .channel-side, .channel-main,
      .side-card,
      .message-card {
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 10px;
      }

      .message-card:hover{
        background: var(--bg-secondary) !important;
      }

      /* === Новый layout справа: проценты слева + график справа === */
      .message-mini{
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 24px;
        align-items: start;
      }

      @media (max-width: 768px) {
      .message-mini {
        width: 100%; /* растягиваем на всю ширину */
        justify-content: flex-start; /* или по центру */
      }

      .message-mini canvas {
        width: 100% !important;
        height: 56px !important; /* можно увеличить, если нужно */
      }
    }

    .side-card {
      border: 1px solid rgba(0,0,0,0.08);
      border-radius: 12px;
      padding: 10px;
      background: rgba(255,255,255,0.9);
    }
    .side-card {
      margin-bottom: 10px;
    }

    @media (max-width: 768px) {
      #channel-side-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
      }
    }

    .side-card-title {
      font-size: 12px;
      opacity: 0.75;
      margin-bottom: 6px;
    }

    .side-card-value {
      font-size: 20px;
      font-weight: 700;
      line-height: 1.1;
    }

    .side-card-sub {
      margin-top: 6px;
      font-size: 12px;
      opacity: 0.75;
    }

    /* шкала аудитории */
    .audience-bar {
      margin-top: 10px;
      height: 10px;
      border-radius: 999px;
      overflow: hidden;
      display: flex;
      background: rgba(0,0,0,0.06);
    }
    .audience-seg {
      height: 100%;
    }
    .audience-legend {
      margin-top: 8px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 12px;
      opacity: 0.8;
    }
    .audience-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
      margin-right: 6px;
    }

    
    /* На ПК: показываем правую колонку, скрываем мобильную версию сообщений */
    @media (min-width: 769px) {
      #messages-section-mobile { display: none; }
      #messages-section-desktop { display: block; }
    }

    /* На мобилке: показываем сообщения внутри левой колонки, скрываем правую */
    @media (max-width: 768px) {
      #messages-section-mobile { display: block; margin-top: 15px; }
      #messages-section-desktop { display: none; }
    }
 
    .channel-main, 
    .side-card, 
    .message-card {
      box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); 
    }

    html.theme-anim body,
    html.theme-anim .channel-card,
    html.theme-anim .search-dropdown,
    html.theme-anim .search-item {
      transition: background-color .22s ease, color .22s ease, border-color .22s ease;
    }

    .header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .theme-toggle {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 999px;
      width: 44px;
      height: 44px;
      font-size: 20px;
      cursor: pointer;
      transition: transform .15s ease, background .2s ease, border-color .2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-primary);
      user-select: none;
      padding: 0;
    }

    .theme-toggle:hover { transform: translateY(-1px); }
    .theme-toggle:active { transform: translateY(0px) scale(.98); }

    .top-channels {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      scrollbar-width: none;
      scroll-behavior: smooth;
    }

    .channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease, transform .15s ease;
  width: 100%; /* Ensure full width on all devices */
  text-align: left;
  min-height: 100px; /* Ensures card maintains a minimum height */
}

.channel-description {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .channel-card {
    width: 100%;  /* Ensures full width on mobile */
    padding: 12px 10px; /* Adjust padding for mobile */
    gap: 8px; /* Reduce the gap on smaller screens */
    min-height: 80px; /* Adjust minimum height on mobile */
  }
}

    .channel-card:hover { background: var(--bg-secondary); transform: translateY(-1px); }

    .channel-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      object-fit: cover;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      flex: 0 0 auto;
    }

    .channel-info {
      min-width: 0;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    
    .channel-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.2;
    }


    .channel-subscribers {
      font-size: 12px;
      color: var(--text-secondary);
      opacity: .85;
    }

    /* SEARCH */
    .search-wrap { position: relative; }

    .search-dropdown {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 1000;
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      box-shadow: 0 8px 20px rgba(0,0,0,.12);
      overflow: hidden;
    }

    .search-dropdown.hidden { display: none !important; }

    .search-dd-header {
      padding: 8px 10px;
      font-size: 12px;
      color: var(--text-secondary);
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border-color);
    }

    .search-dd-list {
      max-height: 216px; 
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .search-item {
      padding: 8px;
      border-bottom: 1px solid var(--border-color);
      background: var(--card-bg);
    }

    .search-item:last-child { border-bottom: none; }

    /* container placeholders */
    #stats-container { margin-top: 10px; }

    /* ===== Messages list cards ===== */
    .messages-list {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .message-card {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 12px;
      border-radius: 8px;
      background: var(--card-bg);
      border: 1px solid var(--border-color);
    }

    .content-container {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }

    .text-date-container {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      flex: 1;
    }

    .message-text {
      font-size: 0.9em;
      line-height: 1.4;
    }

    .message-date {
      font-size: 0.8em;
      font-weight: 600;
    }

    .chart-container {
      width: 10%;
      margin-top: 12px;
    }

    .hour-stats-container {
      width: 90%;
      display: flex;
      justify-content: flex-start;
      flex-direction: column;
    }

    .hour-stats-table {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .hours-row, .values-row, .views-row {
      display: flex;
      gap: 8px;
    }

    .hour-cell, .value-cell, .views-cell {
      padding: 4px;
      text-align: center;
    }

    /* For mobile */
    @media (max-width: 768px) {
      .content-container {
        flex-direction: column;
      }

      .chart-container {
        width: 100%;
        margin-bottom: 12px;
      }

      .text-date-container {
        flex-direction: column;
      }

      .message-date {
        margin-bottom: 8px;
      }

      .message-text {
        margin-bottom: 8px;
      }
      .messages-section-mobile{
        overflow-x: auto;
        white-space: nowrap;
      }
      .hour-stats-table {
        overflow-x: auto;
        white-space: nowrap;
      }
    }

    .message-deleted {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .delete-icon {
      font-size: 1.2em;
      color: #ff6b6b;
    }

    .delete-text {
      color: #ff6b6b;
      font-weight: 500;
      font-size: 0.9em;
    }

    .hour-stats-table {
      width: 100%;
      display: grid;
      grid-template-rows: repeat(3, 1fr);
      gap: 2px;
    }

    .hours-row, .values-row, .views-row {
      display: grid;
      grid-template-columns: repeat(24, 1fr);
      gap: 2px;
    }

    .hour-cell, .value-cell, .views-cell {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 2px 4px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      box-sizing: border-box;
      min-width: 30px;
      font-size: 0.7em;
    }

    .hour-cell {
      background: var(--bg-secondary);
      font-weight: bold;
    }

    .value-cell {
      background: var(--bg-primary);
    }

    .views-cell {
      background: var(--bg-tertiary);
      font-size: 0.6em;
    }

    .pct-row {
      display: flex;
      gap: 4px;
      align-items: center;
    }

    .pct-hour {
      width: 30px;
      text-align: center;
    }

    .pct-val {
      flex: 1;
      text-align: right;
    }

    @media (max-width: 768px) {
      .message-card {
        flex-direction: column;
      }

      .date-text-container,
      .mini-chart-container,
      .hour-stats-container {
        width: 100%;
      }
    }

    .message-meta {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .message-date {
      font-size: 12px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .message-text {
      font-size: 13px;
      color: var(--text-primary);
      line-height: 1.25;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .message-mini {
      width: 140px;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .message-mini canvas {
      width: 140px !important;
      height: 44px !important;
      display: block;
    }

    @media (max-width: 420px) {
      .message-card {
        grid-template-columns: 1fr 120px;
      }

      .message-mini {
        width: 120px;
      }

      .message-mini canvas {
        width: 120px !important;
      }
    }
    .mini-chart {
      width: 100%;
      height: 60px;
      display: block;
      margin-top: 8px;
    }

    #top-posts-list {
      display: grid;
      gap: 10px;
    }

    @media (min-width: 769px) {
      #top-posts-list {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (max-width: 768px) {
      #top-posts-list {
        grid-template-columns: 1fr;
      }
    }

    
    .random-channels {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      justify-content: center;
      padding: 20px 0;
    }

    .random-channel-card {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      padding: 15px;
      text-align: center;
      width: 200px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      transition: transform 0.3s ease;
    }

    .random-channel-card:hover {
      transform: translateY(-5px);
    }

    .random-channel-card img {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      object-fit: cover;
      margin: 0 auto 10px;
    }

    
    .name {
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      position: relative;
    }

    .text-content {
      display: inline-flex;
      gap: 20px; /* отступ между копиями текста */
    }

    /* Бесконечное дублирование текста для бесшовной анимации */
    .name.marquee .text-content::before,
    .name.marquee .text-content::after {
      content: attr(data-text);
    }

    .name.marquee .text-content {
      animation: marquee 60s linear infinite; /* очень медленная анимация: 60 секунд на цикл */
    }

    @keyframes marquee {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(-50%); /* сдвиг на половину ширины контейнера — бесшовный переход */
      }
    }

    /* Плавное затухание по краям */
    .name::before,
    .name::after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      width: 20px;
      pointer-events: none;
      z-index: 1;
    }

    .name::before {
      left: 0;
      background: linear-gradient(to right, var(--card-bg) 0%, transparent 100%);
    }

    .name::after {
      right: 0;
      background: linear-gradient(to left, var(--card-bg) 0%, transparent 100%);
    }



  
/* Основной контейнер */
.info-sections {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Карточки информации */
.info-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-primary);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Заголовки */
.info-card h2 {
  color: var(--text-primary);
  margin-top: 0;
  font-size: 1.5rem;
  margin-bottom: 16px;
  font-weight: 600;
}

/* Параграфы */
.info-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* Выделение текста */
.highlight {
  font-weight: 600;
  color: var(--accent);
}

/* Сетка характеристик */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.feature {
  text-align: center;
  padding: 16px;
  background: rgba(var(--accent-rgb, 0, 123, 255), 0.05);
  border-radius: 12px;
  transition: background-color 0.3s ease;
}

.feature:hover {
  background: rgba(var(--accent-rgb, 0, 123, 255), 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.feature h3 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.feature p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* Список FAQ */
.faq-list details {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.faq-list summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-list summary::after {
  content: '▶';
  color: var(--accent);
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.faq-list[open] summary::after {
  transform: rotate(90deg);
}

.faq-content {
  padding-left: 20px;
  margin-top: 8px;
  color: var(--text-secondary);
}

/* Кнопки */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--btn-secondary-color);
  border: 2px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
}

/* Специальный блок с ботом */
.bot-section {
  background: linear-gradient(135deg, var(--bot-bg-1), var(--bot-bg-2));
  color: white;
  border: none;
}

.bot-section .text-primary {
  color: var(--text-primary);
}

.bot-section .text-secondary {
  color: var(--text-primary);
}

.bot-section ul {
  list-style-type: none;
  padding-left: 0;
  margin: 16px 0;
}

.bot-section li {
  padding: 8px 0;
  color: var(--text-primary);
}

/* Адаптивность */
@media (max-width: 768px) {
  .info-sections {
    padding: 0 15px;
  }
  
  .info-card {
    padding: 20px 16px;
    margin-bottom: 20px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* Плавные переходы для всех элементов */
* {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Оформление блока с информацией о канале */
.channel-summary {
    margin-top: 20px;
    padding-left: 16px;
    padding-right: 16px;
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.summary-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.summary-list {
    font-size: 14px;
    color: var(--text-secondary);
    list-style-type: disc;
    margin-left: 20px;
}

.summary-list li {
    margin-bottom: 10px;
}

/* Описание канала */
.channel-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
    padding-left: 16px;
    padding-right: 16px;
    white-space: pre-wrap; /* Поддержка многострочного текста */
}