body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, rgba(173, 216, 230, 0.8), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #1c1c1e;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    

    animation: backgroundGradientShift 30s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}


@keyframes backgroundGradientShift {
    0%, 100% {
        background-image: linear-gradient(135deg, rgba(173, 216, 230, 0.8), rgba(255, 255, 255, 0.9));
    }
    25% {
        background-image: linear-gradient(135deg, rgba(168, 216, 230, 0.8), rgba(255, 255, 255, 1.0));
    }
    50% {
        background-image: linear-gradient(135deg, rgba(145, 216, 230, 0.8), rgba(255, 255, 255, 1.3));
    }
    75% {
        background-image: linear-gradient(135deg, rgba(155, 216, 230, 0.8), rgba(255, 255, 255, 1.1));
    }
}

/* Дополнительный эффект мягкости через псевдоэлемент: */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    filter: blur(15px);
    z-index: -2;
    opacity: 0.15;
    transition: opacity 2s ease;
}

    /* Top bar */
    .top-bar {
      position: fixed;
      top: 20px;
      right: 20px;
      display: flex;
      align-items: center;
      gap: 15px;
      z-index: 100;
      left: 20px;
      justify-content: space-between;
      transition: opacity 0.3s ease;
    }
    .top-buttons {
        display: flex;
        gap: 15px;
    }
/* Кнопка выхода из режима для слабовидящих */
.exit-low-vision-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  gap: 10px;
  transition: all 0.3s ease;
}

.exit-low-vision-button:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

body.low-vision .exit-low-vision-button {
  display: flex;
  font-size: 1.8em !important;
  padding: 18px 30px !important;
}

/* Дополнительно для мобильных устройств */
@media (max-width: 768px) {
  .exit-low-vision-button {
    top: 15px;
    right: 15px;
    padding: 12px 20px;
    font-size: 1em;
  }
  
  body.low-vision .exit-low-vision-button {
    font-size: 1.5em !important;
    padding: 15px 25px !important;
  }
}
    /* Оставшаяся кнопка меню вверху */
    .menu-button {
      width: 45px;
      height: 45px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(255, 255, 255, 0.3);
      backdrop-filter: blur(10px);
      border: none;
      border-radius: 50%;
      cursor: pointer;
      font-size: 1.2em;
      color: #1c1c1e;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
    }
    .menu-button:hover {
      background: rgba(255, 255, 255, 0.5);
    }
    /* Wallpaper button */
    #wallpaper-button {
      width: 40px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(255, 255, 255, 0.3);
      backdrop-filter: blur(10px);
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 1.2em;
      color: #1c1c1e;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
    }
    #wallpaper-button:hover {
      background: rgba(255, 255, 255, 0.5);
    }
    /* Weather Widget and Universal Menu Container */
    .right-container {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px; /* 1 cm = 10px */
    }
    .weather-widget {
        width: 58px;
        height: 58px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 9px;
        border-radius: 14px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transition: background 0.5s ease, backdrop-filter 0.5s ease;
        cursor: pointer;
        color: #1c1c1e;
        position: relative;
        overflow: hidden;
    }
    .weather-widget::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: inherit;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: -1;
    }
.weather-widget.partly-cloudy { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(230, 230, 230, 0.75), rgba(200, 200, 200, 0.6));
    position: relative;
}

.weather-widget.partly-cloudy::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.3) 60%, transparent 100%);
    opacity: 0.7;
    z-index: 0;
    transform: rotate(15deg);
}

.weather-widget.partly-cloudy .weather-emoji,
.weather-widget.partly-cloudy .weather-temp {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
    .weather-emoji {
        font-size: 1.8em;
        line-height: 1;
        margin-bottom: 5px;
    }
    .weather-temp {
        font-size: 1.1em;
        font-weight: bold;
    }
    .weather-widget.clear { background: rgba(255, 223, 186, 0.7); }
    .weather-widget.clouds { background: rgba(200, 200, 200, 0.7); }
    .weather-widget.rain { background: rgba(173, 216, 230, 0.7); }
    .weather-widget.thunderstorm { background: rgba(100, 100, 100, 0.7); color: #fff; }
    .weather-widget.snow { background: rgba(240, 248, 255, 0.7); }
    .weather-widget.default { background: rgba(255, 255, 255, 0.3); }
.weather-widget.partly-cloudy-day {
    /* Используем относительное позиционирование для родителя,
       чтобы правильно позиционировать псевдоэлемент */
    position: relative;
    overflow: hidden; /* Обрезаем возможные выступающие части градиента */
}
    /* Universal Menu Button under Weather */
    .universal-menu-button {
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  

  background: rgba(255, 255, 255, 0.2); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18); 
  
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2em;
  color: #1c1c1e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}


.universal-menu-button:hover {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}


.big-text {
    font-size: 1.1em;
    font-weight: bold;
    display: inline-block;
    margin: 5px 0;
}

.microphone-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
-45deg,
#1E90FF 0%,
#4169E1 10%,
#5a52d5 20%,
#6a4dd9 30%,
#7B68EE 40%,
#9370DB 50%,
#8B6BC7 60%,
#6A5ACD 70%,
#4169E1 80%,
#1E90FF 90%,
#00BFFF 100%
);
background-size: 400% 400%;
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
display: none;
justify-content: center;
align-items: center;
z-index: 200;
opacity: 0;
transition: opacity 0.5s ease;
flex-direction: column;
text-align: center;
}

@keyframes gradientFlow {
0% { background-position: 0% 50%; }
25% { background-position: 50% 100%; }
50% { background-position: 100% 50%; }
75% { background-position: 50% 0%; }
100% { background-position: 0% 50%; }
}

.microphone-overlay.active {
display: flex;
opacity: 1;
animation: gradientFlow 6s ease infinite;
}
    .microphone-overlay.white-background .subtitle-box {
        background: rgba(0, 0, 0, 0.2);
    }
    .microphone-icon {
      font-size: 5em;
      color: #fff;
      margin-bottom: 20px;
    }
    .wave-container {
      position: relative;
      width: 200px;
      height: 100px;
    }
    .wave {
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 5px;
      height: 5px;
      background: #0000ff;
      border-radius: 50%;
      opacity: 0;
      animation: waveAnimation 1.5s ease-in-out infinite;
    }
    .wave:nth-child(2) { animation-delay: 0.3s; background: #00008b; }
    .wave:nth-child(3) { animation-delay: 0.6s; background: #0000ff; }
    @keyframes waveAnimation {
      0% { transform: translate(-50%, 0) scale(1); opacity: 0.5; }
      50% { transform: translate(-50%, -50px) scale(3); opacity: 1; }
      100% { transform: translate(-50%, -100px) scale(5); opacity: 0; }
    }
    .mic-instructions {
        color: #fff;
        font-size: 1.2em;
        margin-top: 20px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
    /* New subtitle box */
    .subtitle-box {
      position: absolute;
      bottom: 50px;
      width: 80%;
      max-width: 600px;
      padding: 15px;
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(10px);
      border-radius: 15px;
      color: #fff;
      font-size: 1.1em;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
      min-height: 80px;
      display: flex;
      justify-content: center;
      align-items: center;
      opacity: 0;
      transition: opacity 0.5s ease;
      line-height: 1.5;
      text-align: center;
    }
    .subtitle-box.active {
        opacity: 1;
    }
    .mic-close-button {
    position: absolute;
    top: 30px;
    right: 30px;
    /* Используем rgba для белого цвета с прозрачностью */
    color: #1c1c1e; /* Цвет символа (крестика), затемненный серый */
    font-size: 2em;
    cursor: pointer;
    /* --- Начало стилей для матового стекла --- */
    /* Фон с прозрачностью и белым оттенком */
    background: rgba(255, 255, 255, 0.4); /* 40% непрозрачности для более белого, но просвечивающего фона */
    /* Эффект размытия фона родителя (microphone-overlay) */
    backdrop-filter: blur(15px);
    /* Округление углов */
    border-radius: 50%;
    /* Граница (по желанию, можно опустить или изменить) */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* --- Конец стилей для матового стекла --- */
    /* --- Начало стилей объема и теней --- */
    box-shadow:
        /* Внутренняя тень (легкая) - имитирует изгиб */
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        /* Основная тень - отбрасывается вниз/в сторону */
        0 4px 6px rgba(0, 0, 0, 0.1),
        /* Более широкая и размытая тень - "фундамент" объема */
        0 8px 12px rgba(0, 0, 0, 0.1),
        /* (Опционально) Ещё одна тень для усиления эффекта */
        0 6px 8px rgba(0, 0, 0, 0.05);
    /* --- Конец стилей объема и теней --- */
    /* Плавный переход для hover-эффекта */
    transition: all 0.3s ease;
    /* Убираем стандартные отступы и границы */
    padding: 0;
    width: 50px; /* Пример размера, можно регулировать */
    height: 50px;
    display: flex; /* Центрирование содержимого (иконки) */
    justify-content: center;
    align-items: center;
    /* Текстовая тень для лучшей читаемости иконки на фоне */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Легкая тень вокруг текста */
}

/* (Опционально) Hover-эффект */
.mic-close-button:hover {
    /* Увеличиваем непрозрачность фона при наведении */
    background: rgba(255, 255, 255, 0.6);
    /* Увеличиваем тени для усиления объема */
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        0 6px 8px rgba(0, 0, 0, 0.15),
        0 10px 16px rgba(0, 0, 0, 0.15),
        0 8px 12px rgba(0, 0, 0, 0.08);
}
    .mic-controls {
      position: absolute;
      top: 30px;
      left: 30px;
      display: flex;
      gap: 15px;
    }
    .mic-controls .color-picker-button {
      width: 45px;
      height: 45px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(255, 255, 255, 0.3);
      backdrop-filter: blur(10px);
      border: none;
      border-radius: 50%;
      cursor: pointer;
      font-size: 1.2em;
      color: #7B68EE;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
    }
    .mic-controls .color-picker-button {
        color: #fff;
        background: rgba(255, 255, 255, 0.2);
    }
    .color-picker-menu {
        position: absolute;
        top: 80px;
        left: 30px;
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 15px;
        padding: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: none;
        flex-direction: column;
        gap: 10px;
        z-index: 201;
    }
    .color-picker-menu.active {
        display: flex;
    }
    .color-picker-menu button {
        padding: 10px 15px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        transition: background 0.3s ease;
        font-size: 1em;
        color: #1c1c1e;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .color-picker-menu button:hover {
        background: rgba(255, 255, 255, 0.9);
    }
/* Стили для модального окна выбора модели */
.model-select-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.model-select-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.model-select-modal-box {

  
       background: rgba(255, 255, 255, 0.3);
       -webkit-backdrop-filter: blur(25px);
       backdrop-filter: blur(25px);
       padding: 30px;
       border-radius: 20px;
       width: 90%;
       max-width: 700px;
       color: #1c1c1e;
       box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
       0 12px 24px rgba(0, 0, 0, 0.3),
       0 16px 32px rgba(0, 0, 0, 0.25),
       inset 0 2px 4px rgba(255, 255, 255, 0.3);
       text-align: center;
max-width: 500px;
width: 90%;
display: flex;
flex-direction: column;
       gap: 20px;
  
}

.model-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.model-button {
  padding: 15px;
  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.8);
  color: #1c1c1e;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.model-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.model-button.professional-model {
  background: linear-gradient(135deg, #1E90FF, #4682B4);
  color: white;
}

.model-button.professional-model:hover {
  background: linear-gradient(135deg, #104E8B, #1E90FF);
}

.model-description {
  font-size: 0.95em;
  color: #1c1c1e;
  text-align: left;
  line-height: 1.5;
}

#cancel-model-select {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
  color: white;
  background: #6c757d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: background 10.s ease;
  
}

#cancel-model-select:hover {
  background: #5a6268;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
    /* NEW: Language selector in mic overlay */
    .mic-language-select {
      position: absolute;
      top: 80px;
      left: 30px;
      background: rgba(255, 255, 255, 0.4);
      backdrop-filter: blur(15px);
      border-radius: 15px;
      padding: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      display: none;
      flex-direction: column;
      gap: 10px;
      z-index: 201;
    }
    .mic-language-select.active {
        display: flex;
    }
    .mic-language-select select {
        padding: 10px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.7);
        color: #1c1c1e;
        font-size: 1em;
    }
    /* Chat Menu */
    .chat-menu {
      position: fixed;
      top: 0;
      left: -300px;
      height: 100vh;
      width: 280px;
      background: rgba(255, 255, 255, 0.25);
      backdrop-filter: blur(25px);
      box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
      transition: left 0.4s ease-in-out;
      z-index: 99;
      padding: 20px;
      display: flex;
      flex-direction: column;
    }
    .chat-menu.active {
      left: 0;
    }
    .menu-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }
    .menu-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    #low-vision-button {
        width: 100%;
        padding: 10px 15px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, #28a745, #218838);
        color: #fff;
        cursor: pointer;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.3s ease, transform 0.2s ease;
        justify-content: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    #low-vision-button:hover {
        background: linear-gradient(135deg, #218838, #1e7e34);
        transform: translateY(-1px);
    }
    #project-menu-button {
        width: 100%;
        padding: 10px 15px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, #FF6B6B, #FF8E53);
        color: #fff;
        cursor: pointer;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.3s ease, transform 0.2s ease;
        justify-content: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    #project-menu-button:hover {
        background: linear-gradient(135deg, #FF8E53, #FF6B6B);
        transform: translateY(-1px);
    }
    /* НОВАЯ КНОПКА СОЗДАНИЯ QR-КОДА */
    #qrcode-menu-button {
        width: 100%;
        padding: 10px 15px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, #1E90FF, #4682B4);
        color: #fff;
        cursor: pointer;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.3s ease, transform 0.2s ease;
        justify-content: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    #qrcode-menu-button:hover {
        background: linear-gradient(135deg, #4682B4, #1E90FF);
        transform: translateY(-1px);
    }
    /* 💥 НОВЫЕ СТИЛИ ДЛЯ ВЫБОРА ЯЗЫКА 💥 */
    #language-menu-item {
        width: 1%;
        padding: 10px 3px;
        border: none;
        border-radius: 4px;
        background: rgba(108, 117, 125, 0.7);
        color: #fff;
        cursor: pointer;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.3s ease;
        justify-content: space-between;
        position: relative;
    }
    #language-menu-item:hover {
        background: rgba(108, 117, 125, 1);
    }
    .language-submenu {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 10px;
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 15px;
        padding: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: none;
        flex-direction: column;
        gap: 8px;
        min-width: 100%;
        z-index: 101;
    }
    .language-submenu.active {
        display: flex;
    }
    .language-submenu button {
        padding: 8px 12px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.7);
        color: #1c1c1e;
        cursor: pointer;
        font-size: 0.9em;
        transition: background 0.3s ease;
        text-align: left;
    }
    .language-submenu button:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    /* ----------------------------------------------------- */
    .new-chat-button, .albums-menu-button, .speak-button {
      padding: 8px 12px;
      border: none;
      border-radius: 10px;
      background: rgba(30, 144, 255, 0.7);
      color: #fff;
      cursor: pointer;
      display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.3s ease;
    }
    .albums-menu-button {
        background: rgba(147, 112, 219, 0.8);
    }
    .new-chat-button:hover {
      background: rgba(16, 78, 139, 0.8);
    }
    .albums-menu-button:hover {
        background: rgba(147, 112, 219, 1);
    }
    /* New styles for the speak button */
    .speak-button {
      background: #6c757d;
      font-weight: bold;
      margin-bottom: 10px;
    }
    .speak-button.active {
      background: #28a745;
    }
    .speak-button:hover {
      background: #5a6268;
    }
    .speak-button.active:hover {
      background: #218838;
    }
    .chat-list {
      list-style: none;
      padding: 0;
      margin: 10px 0;
      overflow-y: auto;
      flex-grow: 1;
    }
    .chat-list li {
      padding: 12px 10px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 12px;
      margin-bottom: 10px;
      cursor: pointer;
      font-size: 0.9em;
      transition: background 0.3s ease;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-list li:hover {
      background: rgba(255, 255, 255, 0.4);
    }
    /* Chat container and messages */
    .chat-container {
      width: 90%;
      max-width: 800px;
      height: 80vh;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 24px;
      box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.2);
      display: flex;
      flex-direction: column;
      padding: 20px;
      backdrop-filter: blur(25px);
      -webkit-backdrop-filter: blur(25px);
    
    /* 3. Рамка для выделения границ стекла */
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    
    /* 4. Скругление и тень для объема */
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Для корректного отображения внутри */
    padding: 20px;
      position: relative;
      z-index: 50;
      transition: opacity 0.3s ease;
    }
    /* 💥 НОВАЯ КНОПКА "ЗАМЕТКА" В ЧАТЕ 💥 - СМЕЩЕНА ВНИЗ НА 2.5 СМ (94.5px) */
    #quick-note-button {
        position: absolute;
        top: 114.5px;
        right: 20px;
        width: 45px;
        height: 45px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(255, 193, 7, 0.8);
        color: #1c1c1e;
        backdrop-filter: blur(10px);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.3em;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
        z-index: 55;
    }
    #quick-note-button:hover {
        background: rgba(255, 193, 7, 1);
        transform: scale(1.05);
    }
    /* ---------------------------------- */
    .chat-box {
      flex: 1;
      overflow-y: auto;
      padding: 10px;
      margin-bottom: 15px;
      border-radius: 16px;
      background: rgba(240, 248, 255, 0.4);
      backdrop-filter: blur(15px);
    }
    .chat-message {
      margin-bottom: 12px;
      padding: 12px 16px;
      border-radius: 18px;
      max-width: 70%;
      line-height: 1.4;
      font-size: 0.95em;
      word-wrap: break-word;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
      animation: fadeIn 0.3s ease;
      white-space: pre-wrap
    }
    .chat-message img {
      max-width: 100%;
      border-radius: 12px;
      display: block;
      margin-top: 10px;
      cursor: pointer;
    }
    .user-message {
      margin-left: auto;
      background:linear-gradient(135deg,  #1E90FF,  #4169E1);
      color: #fff;
    }
    .assistant-message {
      padding-top: 1.6em;
      margin-right: auto;
      background: rgba(255, 255, 255, 0.8);
      color: #1c1c1e;
    /* --- Новые/Обновленные стили для объёма --- */
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(0, 0, 0, 0.15); /* Добавляет "вес" и "отделение" от фона */



    }

    /* PM Header Style */
    .pm-header {
      font-size: 2em;
      font-weight: bold;
      color: #1E90FF;
      margin: 10px 0;
      display: block;
@media (max-width: 768px) {
font-size: 2.1em;
}
   }

    /* Input field and buttons */
    .input-container {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
    }
    .input-container input[type="text"] {
      flex: 1;
      padding: 12px 16px;
      font-size: 1em;
      border-radius: 20px;
      border: none;
      outline: none;
      background: rgba(255, 255, 255, 0.7);
      backdrop-filter: blur(10px);
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
      transition: all 0.2s ease;
    }
    .input-container input[type="text"]:focus {
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.4);
    }
    .input-button {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    font-size: 1.2em;
    color: white;
    border: none;
    /* Убедитесь, что border-radius 50% для круглой формы */
    border-radius: 50%;
    cursor: pointer;
    /* Плавный переход для фона при наведении */
    transition: background 0.3s ease;
    /* --- НАЧАЛО СТИЛЕЙ ОБЪЁМА --- */
    /* Основной цвет фона кнопки (может быть градиентом, как у вас) */
    background:linear-gradient(135deg, #1E90FF, #4169E1);/* Замените на ваш основной цвет или градиент */
    /* Очень важная часть - создание объёма через тени */
    box-shadow:
        /* Внутренняя тень (легкая) - имитирует изгиб */
        inset 0 4px 8px rgba(255, 255, 255, 0.3),
        /* Основная тень - отбрасывается вниз/в сторону */
        0 6px 12px rgba(0, 0, 0, 0.3),
        /* Более широкая и размытая тень - "фундамент" объёма */
        0 12px 24px rgba(0, 0, 0, 0.2),
        /* (Опционально) Ещё одна тень для усиления эффекта */
        0 8px 16px rgba(0, 0, 0, 0.2);
    /* (Опционально) Поднятие кнопки над поверхностью */
    /* transform: translateY(-2px); */
    /* --- КОНЕЦ СТИЛЕЙ ОБЪЁМА --- */
}


.input-button:hover {
    /* Увеличиваем масштаб чуть-чуть */
    transform: scale(1.05);
    
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 16px 32px rgba(0, 0, 0, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.2);
    /* Если использовали transform: translateY(-2px); выше, можно изменить на -3px */
    /* transform: scale(1.05) translateY(-3px); */
}

/* (Опционально) Эффект "нажатия" */
.input-button:active {
    transform: scale(0.98); /* Лёгкая "прессия" */
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2), /* Внутренняя тень при нажатии */
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15);
}
.input-menu-button {
    overflow-x: hidden;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    color: #1c1c1e;
    transition: all 0.3s ease;
    
    
    animation: buttonShimmer 2s infinite alternate;
}

@keyframes buttonShimmer {
    0% { 
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3),
                    0 12px 24px rgba(0, 0, 0, 0.2),
                    0 8px 16px rgba(0, 0, 0, 0.2),
                    0 0 10px #1E90FF, 
                    0 0 15px #1E90FF, 
                    0 0 20px #7B68EE; 
    }
    50% { 
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3),
                    0 12px 24px rgba(0, 0, 0, 0.2),
                    0 8px 16px rgba(0, 0, 0, 0.2),
                    0 0 10px #1E90FF, 
                    0 0 20px #1E90FF, 
                    0 0 30px #1E90FF, 
                    0 0 40px #7B68EE; 
    }
    100% { 
        
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3),
                    0 12px 24px rgba(0, 0, 0, 0.2),
                    0 8px 16px rgba(0, 0, 0, 0.2),
                    0 0 5px #1E90FF, 
                    0 0 10px #1E90FF, 
                    0 0 15px #1E90FF, 
                    0 0 20px #7B68EE; 
    }
}
    /* 💥 НОВАЯ КНОПКА МИКРОФОНА В INPUT-КОНТЕЙНЕРЕ 💥 */
.mic-button {
width: 45px;
height: 45px;
overflow-x: hidden;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #ffffff, #f0f0f0);
backdrop-filter: blur(10px);
border: none;
border-radius: 50%;
cursor: pointer;
font-size: 1.2em;
color: #1E90FF; /* Тёмно-синий цвет для иконки */
box-shadow:
inset 0 4px 8px rgba(255, 255, 255, 0.5),
0 6px 12px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.15),
0 8px 16px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
flex-shrink: 0;
position: relative;
}

.mic-button:hover {
transform: scale(1.05);
box-shadow:
inset 0 4px 8px rgba(255, 255, 255, 0.6),
0 8px 16px rgba(0, 0, 0, 0.25),
0 16px 32px rgba(0, 0, 0, 0.2),
0 10px 20px rgba(0, 0, 0, 0.15);
}

.mic-button:active {
transform: scale(0.95);
box-shadow:
inset 0 2px 4px rgba(0, 0, 0, 0.2),
0 4px 8px rgba(0, 0, 0, 0.15),
0 8px 12px rgba(0, 0, 0, 0.1);
}

.mic-button i {
position: relative;
transition: all 0.3s ease;
}

.mic-button.active {
background: linear-gradient(135deg, #1E90FF, #4169E1);
color: #fff;
}

.mic-button.active i {
text-shadow:
0 2px 6px rgba(255, 255, 255, 0.5),
0 4px 10px rgba(0, 0, 0, 0.3);
}
    .input-menu-button.active {
        background: #1E90FF;
        color: #fff;
    }
    .input-menu-button:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    .dropdown-menu {
        position: absolute;
        bottom: 60px;
        left: 0;
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 15px;
        padding: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: none;
        flex-direction: column;
        gap: 10px;
        z-index: 10;
        min-width: 20px;
    }
    .dropdown-menu.active {
        display: flex;
    }
    .dropdown-menu .menu-item {
        padding: 12px 15px;
        border: none;
        border-radius: 12px;
        background:linear-gradient(135deg, rgba(30, 144, 255, 1), rgba(65, 105, 225, 1));
        color: #fff;
        cursor: pointer;
        font-size: 1em;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        transition: background 0.3s ease;
    }
    .dropdown-menu .menu-item:hover {
        background: linear-gradient(135deg,  rgba(25, 120, 210, 1),  rgba(50, 85, 195, 1));
    }
    /* Sub-menu for modes */
    .modes-submenu {
        position: absolute;
        bottom: 0;
        left: 100%;
        margin-left: 10px;
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 15px;
        padding: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: none;
        flex-direction: column;
        gap: 8px;
        min-width: 200px;
    }
    .modes-submenu.active {
        display: flex;
    }
    .modes-submenu button {
        padding: 10px 15px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.7);
        color: #1c1c1e;
        cursor: pointer;
        font-size: 0.9em;
        transition: background 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
    }
    .modes-submenu button:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    .modes-submenu button.active-mode {
        background: #4682B4;
        color: #fff;
    }
/* Кнопка закрытия в меню режимов — теперь как полноценная кнопка */
/* Кнопка закрытия в меню режимов — теперь как полноценная кнопка */
.close-modes-btn {
    width: 100%; /* как у .mode-button */
    padding: 10px 15px; /* как у .mode-button */
    border: none;
    border-radius: 10px; /* как у .mode-button */
    background: linear-gradient(135deg, #dc3545, #c82333); /* Красный градиент — НЕПРОЗРАЧНЫЙ */
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.3),
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.25);
    margin-bottom: 8px; /* небольшой отступ до следующей кнопки */
}

.close-modes-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130); /* Более тёмный красный при наведении */
    transform: translateY(-2px);
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.35),
        0 16px 32px rgba(0, 0, 0, 0.3);
}

.close-modes-btn i {
    font-size: 1.1em;
}
    /* Notes Container */
/* Notes Container */
.notes-container {
  width: 200%;
  max-width: 1000px;
  height: 80vh;
  background: linear-gradient(145deg,
      #ffffff 0%,
      #f0f7ff 40%,
      #dbe9ff 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
    0 12px 24px rgba(0, 0, 0, 0.3),
    0 16px 32px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  display: none;
  flex-direction: column;
  padding: 20px;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
}
@media (max-width: 768px) {
  .notes-container {
  width: 90%;
max-width: 810px;
}
}
.notes-container.active {
  display: flex;
}
    .notes-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .notes-header h2 {
        margin: 0;
        color: #1c1c1e;
        font-size: 1.8em;
    }
    .notes-header-buttons {
        display: flex;
        gap: 10px;
    }
    .add-note-button, .back-to-chat-button {
        padding: 10px 15px;
        border: none;
        border-radius: 12px;
        background: rgba(30, 144, 255, 0.7);
        color: #fff;
        cursor: pointer;
        transition: background 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .back-to-chat-button {
        background: rgba(255, 99, 71, 1);
        transition: 0.25s ease;
        box-shadow:
  0 6px 25px rgba(0, 0, 0, 0.35),
  inset 0 0 30px rgba(255, 255, 255, 0.20),
  inset 0 0 40px rgba(155, 216, 230, 0.25); 
    }
.add-note-button {
  
background: linear-gradient(135deg,
  #1E90FF 0%,
  #2A84F7 20%,
  #3379F0 40%,
  #3A72E8 55%,
  #4169E1 70%,
  #3F63D6 85%,
  #3C5DCB 100%
);


  
  
color: #fff;

background-color: rgba(0, 0, 0, 0.20); /* мягкое затемнение */
backdrop-filter: blur(22px);
-webkit-backdrop-filter: blur(22px);

border-radius: 22px;

/* стеклянная рамка + мягкое свечение */
box-shadow:
  0 6px 25px rgba(0, 0, 0, 0.35),
  inset 0 0 30px rgba(255, 255, 255, 0.20),
  inset 0 0 40px rgba(155, 216, 230, 0.25); /* лёгкое голубое свечение */
    }
    .back-to-chat-button:hover {
        background: rgba(200, 51, 71, 1);
    }
    .notes-list {
        list-style: none;
        padding: 0;
        margin: 0;
        overflow-y: auto;
        flex-grow: 1;
        background: rgba(240, 248, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        padding: 15px;
    }
    /* 💥 СТИЛИ ДЛЯ ОТДЕЛЬНОЙ ЗАМЕТКИ 💥 */
    .note-item {
        background: linear-gradient(135deg,
  #6EB8FF 0%,     /* светлый блик */
  #5AAEFF 15%,    /* мягкое свечение */
  #4CA2FA 30%,    /* плавный переход */
  #3F95F4 45%,    /* насыщение */
  #3A82EC 60%,    /* ближе к твоему стилю */
  #4169E1 75%,    /* основной глубокий синий */
  #3F63D6 88%,    /* затемнение */
  #3C5DCB 100%    /* финальная глубина */
);

        border-radius: 12px;
        padding: 15px;
        margin-bottom: 12px;
        display: flex;
        flex-direction: column;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        color: #fff;
    }
    .note-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
    .note-item-header {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-bottom: 10px;
    }
    .note-item-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding-top: 5px;
        font-size: 0.85em;
        color: #666;
    }
    .note-item.starred {
        border: 2px solid darkblue;
    }
    .note-content {
        flex-grow: 1;
        font-size: 1.05em;
        line-height: 1.4;
        white-space: pre-wrap;
        word-wrap: break-word;
        max-height: 100px;
        overflow: hidden;
    }
    .note-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    .note-actions button {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 1.2em;
        color: white;
        transition: color 0.3s ease, transform 0.2s ease;
    }
    .note-actions button:hover {
        color: #1c1c1e;
        transform: scale(1.1);
    }
    /* Стили для кнопки "Крестик" (Удаление) */
    .delete-note-button-inline {
        color: #dc3545;
        margin-left: 10px;
        font-size: 1.4em !important;
    }
    .delete-note-button-inline:hover {
        color: #c82333;
    }
    /* Стили для кнопки "Звезда" (Сохранение) */
    .star-button-inline {
        color: white;
    }
    .star-button-inline .far.fa-star {
        color: white;
    }
    .star-button-inline:hover {
        transform: scale(1.2);
    }
    /* ---------------------------------- */
    /* Note Editor */
    .note-editor {
        display: none;
        flex-direction: column;
        gap: 15px;
background: linear-gradient(135deg,
  #6EB8FF 0%,     /* светлый блик */
  #5AAEFF 15%,    /* мягкое свечение */
  #4CA2FA 30%,    /* плавный переход */
  #3F95F4 45%,    /* насыщение */
  #3A82EC 60%,    /* ближе к твоему стилю */
  #4169E1 75%,    /* основной глубокий синий */
  #3F63D6 88%,    /* затемнение */
  #3C5DCB 100%    /* финальная глубина */
);

        padding: 20px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    .note-editor.active {
        display: flex;
    }
    .note-editor textarea {
        width: calc(100% - 30px);
        height: 300px;
        padding: 15px;
        border: none;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.9);
        resize: none;
        font-family: inherit;
        font-size: 1em;
        color: #1c1c1e;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        outline: none;
    }
    .editor-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }
    .editor-buttons button {
        padding: 12px 20px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: #fff;
        transition: background 0.3s ease;
    }
    .save-note-button {
        background: linear-gradient(135deg, #28a745, #218838);
        box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.2);

    }
    .save-note-button:hover {
        background: linear-gradient(135deg, #218838, #1e7e34);
    }
    .delete-note-button {
        background: linear-gradient(135deg, #dc3545, #c82333);
        box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.2);

    }
    .delete-note-button:hover {
        background: linear-gradient(135deg, #c82333, #bd2130);
    }
    .cancel-note-button {
        background: #6c757d;
    }
    .cancel-note-button:hover {
        background: #5a6268;
    }
    @media (max-width: 375px) {
  .notes-container {
    width: 95% !important;
    height: 75vh !important;
    /* Позиционирование остается fixed, но размеры адаптируются */
  }
}
/* Эффект iPhone-style RGB смещения + HD резкость */
.ai-image-hd {
  /* RGB Chromatic Aberration - красный и синий каналы смещены */
  filter: drop-shadow(-3px 0 1px rgba(255, 0, 0, 0.35)) 
          drop-shadow(3px 0 1px rgba(0, 0, 255, 0.35))
          contrast(1.15) 
          saturate(1.2);
  
  /* Улучшенная резкость для HD */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  
  /* Плавное появление */
  animation: rgbShift 3s ease-in-out infinite alternate;
  border-radius: 12px;
}

/* Анимация микро-смещения для "живого" эффекта */
@keyframes rgbShift {
  0% { filter: drop-shadow(-2px 0 1px rgba(255,0,0,0.3)) drop-shadow(2px 0 1px rgba(0,0,255,0.3)) contrast(1.15); }
  100% { filter: drop-shadow(-4px 0 2px rgba(255,0,0,0.4)) drop-shadow(4px 0 2px rgba(0,0,255,0.4)) contrast(1.2); }
}
.message-disintegrating {
  animation: disintegrate 0.9s forwards !important;
  pointer-events: none;
}

@keyframes disintegrate {
  0% { 
    transform: translate(0, 0) rotate(0deg); 
    opacity: 1; 
  }
  20% { 
    transform: translate(var(--tx1), var(--ty1)) rotate(5deg); 
    opacity: 0.9; 
  }
  40% { 
    transform: translate(var(--tx2), var(--ty2)) rotate(-5deg); 
    opacity: 0.7; 
  }
  60% { 
    transform: translate(var(--tx3), var(--ty3)) rotate(10deg); 
    opacity: 0.5; 
  }
  80% { 
    transform: translate(var(--tx4), var(--ty4)) rotate(-10deg); 
    opacity: 0.3; 
  }
  100% { 
    transform: translate(var(--tx5), var(--ty5)) rotate(15deg) scale(0.5); 
    opacity: 0; 
  }
}

    /* Image Albums Container Styles */
    .albums-container {
        width: 90%;
        max-width: 800px;
        height: 80vh;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        padding: 20px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        position: relative;
        z-index: 60;
    }
    .albums-container.active {
        display: flex;
    }
    .albums-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .albums-header h2 {
        margin: 0;
        color: #1c1c1e;
        font-size: 1.8em;
    }
    .albums-list {
        list-style: none;
        padding: 0;
        margin: 0;
        overflow-y: auto;
        flex-grow: 1;
        background: rgba(240, 248, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        padding: 15px;
    }
    .album-item {
        background: rgba(255, 255, 255, 0.8);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        transition: background 0.3s ease;
    }
    .album-item:hover {
        background: rgba(255, 255, 255, 1);
    }
    .album-content {
        flex-grow: 1;
        font-size: 1.1em;
        padding-right: 10px;
    }
    .album-actions button {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 1.2em;
        color: #666;
        transition: color 0.3s ease;
    }
    /* Album Creator & Viewer */
    .album-creator, .album-viewer {
        display: none;
        flex-direction: column;
        gap: 15px;
    }
    .album-creator.active, .album-viewer.active {
        display: flex;
    }
    .album-creator .album-name-input {
        width: calc(100% - 30px);
        padding: 15px;
        border: none;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.8);
        font-size: 1.2em;
        color: #1c1c1e;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        outline: none;
    }
    .image-picker-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 16px;
        max-height: 400px;
        overflow-y: auto;
    }
    .image-picker-item {
        position: relative;
        cursor: pointer;
        border: 2px solid transparent;
        border-radius: 8px;
        transition: border 0.2s ease;
    }
    .image-picker-item img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 6px;
    }
    .image-picker-item.selected {
        border-color: #1E90FF;
    }
    .image-picker-item.selected::after {
        content: '✓';
        position: absolute;
        top: 5px;
        right: 5px;
        background-color: #1E90FF;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.8em;
    }
    /* Album Viewer */
    .album-viewer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        overflow-y: auto;
        padding: 15px;
        background: rgba(240, 248, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        flex-grow: 1;
    }
    .album-viewer-grid img {
        width: 100%;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    .album-title {
        font-size: 1.5em;
        font-weight: bold;
        color: #1c1c1e;
        text-align: center;
        margin-bottom: 10px;
    }
    /* ----------------------------------------------------- */
    /* 💥 НОВЫЙ КОНТЕЙНЕР "СОЗДАНИЕ ПОСТА/ИСТОРИИ" 💥 */
    .post-creator-container {
        width: 90%;
        max-width: 800px;
        height: 80vh;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.5));
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        padding: 20px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        position: relative;
        z-index: 60;
    }
    .post-creator-container.active {
        display: flex;
    }
    .post-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .post-header h2 {
        margin: 0;
        color: #1c1c1e;
        font-size: 1.8em;
    }
    /* Аватар и Имя/Псевдоним */
    .post-user-info {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 16px;
        background: rgba(240, 248, 255, 0.4);
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    #post-avatar-container {
        position: relative;
        width: 80px;
        height: 80px;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 0 0 4px #8A2BE2, 0 0 0 8px #4169E1;
        overflow: hidden;
        background: #ccc;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #post-avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        display: block;
    }
    #post-avatar-placeholder {
        position: absolute;
        font-size: 2.5em;
        color: #fff;
    }
    .post-user-details {
        flex-grow: 1;
    }
    /* УДАЛЕНА СТРОКА ВВОДА НАЗВАНИЯ ПОСТА */
    /* Выбор изображения для поста */
    #post-image-selection {
        flex-grow: 1;
        overflow-y: auto;
        padding: 15px;
        background: rgba(240, 248, 255, 0.6);
        border-radius: 16px;
        margin-bottom: 15px;
    }
    #post-images-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .post-image-item {
        position: relative;
        cursor: pointer;
        border: 3px solid transparent;
        border-radius: 10px;
        transition: border 0.3s ease;
        overflow: hidden;
        aspect-ratio: 1 / 1;
    }
    .post-image-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 8px;
    }
    .post-image-item.selected {
        border-color: #28a745;
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.8);
    }
    /* Поле ввода текста поста */
    #post-text-area {
        width: calc(100% - 30px);
        padding: 15px;
        height: 100px;
        border: none;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.8);
        resize: none;
        font-family: inherit;
        font-size: 1em;
        color: #1c1c1e;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        outline: none;
        margin-bottom: 15px;
    }
    /* Кнопка публикации */
    #publish-post-button {
        padding: 12px 25px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1.1em;
        color: #fff;
        background: linear-gradient(135deg, #1E90FF, #4682B4);
        font-weight: bold;
        transition: background 0.3s ease, transform 0.2s ease;
    }
    #publish-post-button:hover {
        background: linear-gradient(135deg, #104E8B, #1E90FF);
        transform: translateY(-1px);
    }
    /* --- Конец нового контейнера --- */
    /* ----------------------------------------------------- */
    /* 💥 НОВЫЕ СТИЛИ ДЛЯ ЛЕНТЫ ИСТОРИЙ ЗУБР 💥 */
    .story-feed-container {
        width: 90%;
        max-width: 800px;
        height: 80vh;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        padding: 20px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        position: relative;
        z-index: 60;
    }
    .story-feed-container.active {
        display: flex;
    }
    #story-feed-list {
        list-style: none;
        padding: 0;
        margin: 0;
        overflow-y: auto;
        flex-grow: 1;
        background: rgba(240, 248, 255, 0.4);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        padding: 15px;
    }
    .story-post-item {
        background: rgba(255, 255, 255, 0.85);
        border-radius: 16px;
        padding: 15px;
        margin-bottom: 20px;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
        position: relative;
        transition: transform 0.2s ease;
    }
    .story-post-item:hover {
        transform: translateY(-2px);
    }
    .post-user-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-bottom: 10px;
    }
    .post-user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #1E90FF;
    }
    .post-username {
        font-weight: bold;
        font-size: 1.1em;
        color: #1c1c1e;
    }
    .post-image-wrapper {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        margin-bottom: 15px;
        border-radius: 12px;
        overflow: hidden;
        cursor: pointer;
    }
    .post-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    /* НОВАЯ КНОПКА ПРОСМОТРА ПРОМТА */
    .view-prompt-button {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        display: none;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.2em;
        color: #1c1c1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        z-index: 5;
    }
    .post-image-wrapper:hover .view-prompt-button {
        display: flex;
    }
    .view-prompt-button:hover {
        background: rgba(255, 255, 255, 1);
        transform: scale(1.1);
    }
    .post-image-overlay-button {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 10px 15px;
        border: none;
        border-radius: 15px;
        background: rgba(220, 53, 69, 0.9);
        color: white;
        font-weight: bold;
        cursor: pointer;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease, background 0.3s ease;
        font-size: 1.1em;
        z-index: 10;
        pointer-events: all;
    }
    .post-image-wrapper.longpress .post-image-overlay-button {
        display: block;
        opacity: 1;
    }
    .post-text {
        font-size: 1em;
        line-height: 1.5;
        color: #333;
        white-space: pre-wrap;
    }
    /* Кнопка удаления для СВОЕГО поста */
    .delete-own-post-button {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        color: #dc3545;
        cursor: pointer;
        font-size: 1.5em;
        transition: color 0.2s ease;
        z-index: 5;
    }
    .delete-own-post-button:hover {
        color: #c82333;
    }
    .report-count {
        position: absolute;
        bottom: 15px;
        right: 15px;
        font-size: 0.85em;
        color: #6c757d;
    }
/* Скрыть элемент на десктопах */
.mobile-universal-menu {
  display: none !important;
}

/* Показать элемент на мобильных устройствах и применить синий градиент */
@media (max-width: 768px) {
  .mobile-universal-menu {
    display: flex !important;
    background: linear-gradient(135deg, #1E90FF, #4682B4) !important;
    color: white !important;
  }
  
  .mobile-universal-menu:hover {
    background: linear-gradient(135deg, #104E8B, #1E90FF) !important;
  }
  
  /* Дополнительно: уменьшить отступы в выпадающем меню для мобильных */
  .dropdown-menu {
    gap: 5px !important;
    padding: 8px !important;
  }
}
    /* ----------------------------------------------------- */
    /* НОВЫЙ КОНТЕЙНЕР ДЛЯ СОЗДАНИЯ ПРОЕКТОВ */
    .project-container {
        width: 95%;
        max-width: 1200px;
        height: 85vh;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        padding: 20px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        position: relative;
        z-index: 60;
    }
    .project-container.active {
        display: flex;
    }
    .project-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .project-header h2 {
        margin: 0;
        color: #1c1c1e;
        font-size: 1.8em;
    }
    .project-toolbar {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: wrap;
        background: rgba(240, 248, 255, 0.4);
        padding: 15px;
        border-radius: 16px;
        backdrop-filter: blur(15px);
    }
    .toolbar-section {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-right: 20px;
    }
    .toolbar-section h4 {
        margin: 0 0 5px 0;
        font-size: 0.9em;
        color: #1c1c1e;
        opacity: 0.8;
    }
    .toolbar-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    .toolbar-button {
        padding: 8px 12px;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        font-size: 0.85em;
        color: #1c1c1e;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .toolbar-button:hover {
        background: rgba(255, 255, 255, 0.9);
        transform: translateY(-1px);
    }
    .toolbar-button.active {
        background: #1E90FF;
        color: white;
    }
    .color-option {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid transparent;
        transition: transform 0.2s ease;
    }
    .color-option:hover {
        transform: scale(1.2);
    }
    .color-option.selected {
        border-color: #1c1c1e;
        transform: scale(1.2);
    }
    .font-option {
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    .font-option:hover {
        background: rgba(255, 255, 255, 0.5);
    }
    .font-option.selected {
        background: #1E90FF;
        color: white;
    }
    .project-canvas {
        flex: 1;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 16px;
        position: relative;
        overflow: hidden;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        cursor: crosshair;
    }
    .canvas-element {
        position: absolute;
        cursor: move;
        user-select: none;
        transition: box-shadow 0.3s ease;
    }
    .canvas-element.selected {
        box-shadow: 0 0 0 2px #1E90FF;
    }
    .canvas-element.text {
        padding: 5px;
        min-width: 50px;
        min-height: 20px;
        resize: none;
        border: none;
        outline: none;
        background: transparent;
        overflow: hidden;
        font-family: inherit;
        font-size: 1em;
        line-height: 1.4;
        white-space: pre-wrap;
        word-wrap: break-word;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-radius: 4px;
        transition: all 0.2s ease;
    }
    .canvas-element.text:focus {
        background: rgba(255,255,255,0.9);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    .canvas-element.image {
        object-fit: contain;
    }
    .canvas-element.shape {
background: linear-gradient(135deg, #1E90FF, #4169E1);
    }
    .element-controls {
        position: absolute;
        top: -30px;
        left: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 5px;
        display: none;
        gap: 5px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 10;
    }
    .canvas-element.selected .element-controls {
        display: flex;
    }
    .control-button {
        width: 25px;
        height: 25px;
        border: none;
        border-radius: 4px;
        background: rgba(30, 144, 255, 0.7);
        color: white;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.8em;
        transition: background 0.3s ease;
    }
    .control-button:hover {
        background: #1E90FF;
    }
    .resize-handle {
        position: absolute;
        width: 10px;
        height: 10px;
        background: #1E90FF;
        border-radius: 50%;
        z-index: 10;
    }
    .resize-handle.top-left { top: -5px; left: -5px; cursor: nw-resize; }
    .resize-handle.top-right { top: -5px; right: -5px; cursor: ne-resize; }
    .resize-handle.bottom-left { bottom: -5px; left: -5px; cursor: sw-resize; }
    .resize-handle.bottom-right { bottom: -5px; right: -5px; cursor: se-resize; }
    .image-picker-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 300;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .image-picker-modal.active {
        display: flex;
        opacity: 1;
    }
    .image-picker-content {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(25px);
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        color: #1c1c1e;
        max-width: 800px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
    }
    .image-picker-grid-modal {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        margin: 20px 0;
        max-height: 400px;
        overflow-y: auto;
    }
    .image-picker-item-modal {
        cursor: pointer;
        border: 2px solid transparent;
        border-radius: 8px;
        transition: border 0.2s ease;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }
    .image-picker-item-modal img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 6px;
    }
    .image-picker-item-modal.selected {
        border-color: #1E90FF;
    }
    /* Show/Hide containers */
    .hidden {
        display: none;
        opacity: 0;
    }
    .visible {
        display: flex;
        opacity: 1;
    }
    @keyframes fadeIn {
      from {opacity: 0; transform: translateY(5px);}
      to {opacity: 1; transform: translateY(0);}
    }
    /* Стили для увеличенного текста */
.assistant-message.large-text {
    font-size: 1.4em !important;
    line-height: 1.5 !important;
    transition: font-size 0.3s ease;
}

/* Угловые зоны для касания (невидимые, но большие) */
.message-corner {
    position: absolute;
    width: 44px;
    height: 44px;
    z-index: 100;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    /* background: rgba(255,0,0,0.1); */ /* Раскомментируйте для отладки */
}

/* Позиционирование углов */
.message-corner.top-left { top: 0; left: 0; }
.message-corner.top-right { top: 0; right: 0; }
.message-corner.bottom-left { bottom: 0; left: 0; }
.message-corner.bottom-right { bottom: 0; right: 0; }

/* Для мобильных устройств увеличиваем зону касания */
@media (max-width: 768px) {
    .message-corner {
        width: 60px;
        height: 60px;
    }
}

/* Убираем выделение текста при тройном тапе */
.assistant-message {
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

/* Индикатор изменения размера (небольшая вибрация/вспышка) */
.assistant-message.font-changed {
    animation: fontPulse 0.3s ease;
}

@keyframes fontPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

    /* New styles for Test Dialog */
    .test-dialog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 200;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .test-dialog-overlay.active {
        display: flex;
        opacity: 1;
    }
    .test-dialog-box {
       background: rgba(255, 255, 255, 0.3);
backdrop-filter: blur(25px);
padding: 30px;
border-radius: 20px;
width: 90%;
max-width: 700px;
color: #1c1c1e;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
gap: 20px;
    }
    .test-dialog-box h3 {
        color: #1c1c1e;
        margin: 0;
        font-size: 1.5em;
    }
    .test-dialog-box p {
        color: #1c1c1e;
        font-size: 1.1em;
    }
    .test-dialog-box select,
    .test-dialog-box input[type="text"] {
        width: 100%;
        padding: 12px;
        border-radius: 10px;
        border: none;
        background: rgba(255, 255, 255, 0.8);
        color: #1c1c1e;
        font-size: 1em;
        margin-bottom: 5px;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    .test-dialog-box select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url('image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231c1c1e%22%20d%3D%22M287%20165.7c-4.3%204.3-11.4%204.3-15.7%200l-123%20-123L25.6%20165.7c-4.3%204.3-11.4%204.3-15.7%200-4.3-4.3-4.3-11.4%200-15.7l131.6-131.6c4.3-4.3%2011.4-4.3%2015.7%200l131.6%20131.6c4.3%204.3%204.3%2011.4%200%2015.7z%22%2F%3E%3C%2Fsvg%3E');
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px;
        cursor: pointer;
    }
    .test-dialog-box button {
        padding: 12px 20px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: white;
        background: #1E90FF;
        transition: background 0.3s ease;
    }
    .test-dialog-box button:hover {
        background: #104E8B;
    }
.close-test-btn {
display: flex;
  justify-content: center; 
  align-items: center;
height:20px;
width:20px;
border-radius: 20px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
.close-test-btn i {
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}


/* Только для экранов шире 769px (ПК и ноутбуки) */
@media (min-width: 769px) {
  
  /* --- 1. Растягиваем чат на всю ширину --- */
  div#chat-container.chat-container {
    width: 88% !important;
    max-width: 88% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
  
  /* --- 2. Красивый виджет куки на ПК --- */

.cookie-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-consent-overlay.active {
  display: flex;
  opacity: 1;
}

.cookie-consent-box {
  width: 550px;
  max-width: 90%;
  padding: 40px;
  border-radius: 24px;
      box-shadow:
0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.cookie-consent-box h3 {
  font-size: 26px;
  margin-bottom: 20px;
  color: #1c1c1e;
  font-weight: bold;
}

.cookie-consent-box p {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 25px;
}

/* Кнопки куки */
.cookie-consent-box button {
  padding: 14px 35px;
  font-size: 16px;
  border-radius: 12px;
  margin: 0 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  border: none;
}

.cookie-consent-box button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#accept-cookies {
  background: linear-gradient(135deg,
  #1E90FF 0%,
  #2A84F7 20%,
  #3379F0 40%,
  #3A72E8 55%,
  #4169E1 70%,
  #3F63D6 85%,
  #3C5DCB 100%
);

  color: white;
}

#accept-cookies:hover {
  background: linear-gradient(135deg, #104E8B, #1E90FF);
}

#reject-cookies {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
}

#reject-cookies:hover {
  background: linear-gradient(135deg, #5a6268, #495057);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .cookie-consent-box {
    width: 90%;
    padding: 30px 20px;
  }
  
  .cookie-consent-box h3 {
    font-size: 22px;
  }
  
  .cookie-consent-box p {
    font-size: 14px;
  }
  
  .cookie-consent-box button {
    padding: 12px 25px;
    font-size: 14px;
    margin: 5px 0;
    display: block;
    width: 100%;
  }
}


/* Контейнер сообщения с изображением от ассистента */
.chat-message.assistant-message {
  max-width: 85% !important;
  margin: 10px 0 !important;
  padding: 20px 21px !important;
}

/* Контейнер изображения - убираем лишние отступы */
.chat-message.assistant-message>div[style*="position: relative"] {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-block !important;
}

/* Само изображение */
.chat-message.assistant-message img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 12px !important;
}

/* Кнопки скачивания и редактирования */
.image-download-button,
.image-edit-button {
  margin: 5px !important;
  padding: 0 !important;
  width: 40px !important;
  height: 40px !important;
}
/* Центрирование изображения внутри контейнера */
.chat-message.assistant-message>div[style*="position: relative"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  
}

.chat-message.assistant-message img {
  margin: 0 auto !important;
  display: block !important;
}

/* Убираем лишние отступы у контейнера */



    /* NEW: Saved Tests Section in Test Dialog */
    .saved-tests-section {
        margin-top: 20px;
        background: rgba(255, 255, 255, 0.8);
        padding: 15px;
        border-radius: 15px;
        max-height: 200px;
        overflow-y: auto;
    }
    .saved-tests-section h4 {
        margin: 0 0 10px 0;
        font-size: 1.2em;
    }
    .saved-tests-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .saved-test-item {
        padding: 10px;
        background: rgba(240, 248, 255, 0.9);
        border-radius: 10px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    .saved-test-item:hover {
        background: rgba(240, 248, 255, 1);
    }
    /* Стили для модального окна просмотра промта */
    .prompt-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 300;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .prompt-modal-overlay.active {
        display: flex;
        opacity: 1;
    }
    .prompt-modal-box {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(25px);
        padding: 30px;
        border-radius: 20px;
              box-shadow:
0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
        color: #1c1c1e;
        text-align: center;
        max-width: 500px;
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .prompt-modal-box h3 {
        color: #1c1c1e;
        margin: 0;
        font-size: 1.5em;
        text-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),;
    }
    .prompt-modal-text {
        background: rgba(255, 255, 255, 0.3);
        padding: 20px;
        border-radius: 15px;
        font-size: 1.1em;
        line-height: 1.5;
        max-height: 300px;
        overflow-y: auto;
        text-align: left;
    }
    .prompt-modal-box button {
        padding: 12px 20px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: white;
        background: linear-gradient(135deg, #1E90FF, #4169E1);
        transition: background 0.3s ease;
    }
    .prompt-modal-box button:hover {
        background: #104E8B;
    }
    /* Стили для QR-КОДА */
    .qrcode-container {
        width: 95%;
        max-width: 1200px;
        height: 85vh;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        padding: 20px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        position: relative;
        z-index: 60;
    }
    .qrcode-container.active {
        display: flex;
    }
    .qrcode-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .qrcode-header h2 {
        margin: 0;
        color: #1c1c1e;
        font-size: 1.8em;
    }
    .qrcode-generator {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 15px;
        background: rgba(240, 248, 255, 0.4);
        padding: 20px;
        border-radius: 16px;
        backdrop-filter: blur(15px);
    }
    .qrcode-input-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .qrcode-input-group label {
        font-weight: bold;
        color: #1c1c1e;
    }
    .qrcode-input-group input, .qrcode-input-group select {
        width: calc(100% - 30px);
        padding: 12px 16px;
        border-radius: 12px;
        border: none;
        background: rgba(255, 255, 255, 0.8);
        font-size: 1em;
        color: #1c1c1e;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        outline: none;
    }
    .qrcode-options {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
    }
    .qrcode-color-picker, .qrcode-center-image {
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 1;
        min-width: 200px;
    }
    .qrcode-color-preview {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 2px solid #1c1c1e;
        cursor: pointer;
        background: #000000;
    }
    .qrcode-center-image-preview {
        width: 100px;
        height: 100px;
        border-radius: 8px;
        border: 2px dashed #1c1c1e;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        background: #f0f0f0;
        overflow: hidden;
    }
    .qrcode-center-image-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: none;
        border-radius: 6px;
    }
    .qrcode-center-image-preview i {
        font-size: 2em;
        color: #1c1c1e;
    }
    .qrcode-center-image-preview.has-image img {
        display: block;
    }
    .qrcode-center-image-preview.has-image i {
        display: none;
    }
    .qrcode-generate-button {
        padding: 15px 25px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1.1em;
        color: #fff;
        background: linear-gradient(135deg, #1E90FF, #4682B4);
        font-weight: bold;
        transition: background 0.3s ease, transform 0.2s ease;
        align-self: flex-start;
    }
    .qrcode-generate-button:hover {
        background: linear-gradient(135deg, #104E8B, #1E90FF);
        transform: translateY(-1px);
    }
    .qrcode-result {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 16px;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    .qrcode-result.active {
        display: flex;
    }
    .qrcode-display {
        max-width: 300px;
        max-height: 300px;
        border: 10px solid #1c1c1e;
        border-radius: 16px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }
    .qrcode-download-button {
        padding: 12px 25px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: #fff;
        background: linear-gradient(135deg, #28a745, #218838);
        font-weight: bold;
        transition: background 0.3s ease;
    }
    .qrcode-download-button:hover {
        background: linear-gradient(135deg, #218838, #1e7e34);
    }
    /* Стили для модального окна выбора изображения для QR-кода */
    .image-picker-modal-qrcode {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 400;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    .image-picker-modal-qrcode.active {
        display: flex;
        opacity: 1;
    }
    .image-picker-content-qrcode {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(25px);
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        color: #1c1c1e;
        max-width: 800px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
    }
    .image-picker-grid-qrcode {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        margin: 20px 0;
        max-height: 400px;
        overflow-y: auto;
    }
    .image-picker-item-qrcode {
        cursor: pointer;
        border: 2px solid transparent;
        border-radius: 8px;
        transition: border 0.2s ease;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }
    .image-picker-item-qrcode img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 6px;
    }
    .image-picker-item-qrcode.selected {
        border-color: #1E90FF;
    }
    /* File input for wallpaper */
    #wallpaper-upload-input {
      display: none;
    }
    /* NEW: Referral Program Overlay */
    .referral-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 500;
        opacity: 0;
        transition: opacity 0.5s ease;
    }
    .referral-overlay.active {
        display: flex;
        opacity: 1;
    }
    .referral-box {
        background: linear-gradient(135deg, #1E90FF, #4682B4);
        color: white;
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        text-align: center;
        max-width: 500px;
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .referral-box h3 {
        margin: 0;
        font-size: 1.8em;
    }
    .referral-box p {
        font-size: 1.2em;
        margin: 10px 0;
    }
    .referral-link {
        background: rgba(255, 255, 255, 0.2);
        padding: 15px;
        border-radius: 10px;
        font-size: 1.1em;
        word-break: break-all;
        margin: 10px 0;
    }
    .referral-link button {
        padding: 10px 20px;
        border: none;
        border-radius: 10px;
        background: #fff;
        color: #1E90FF;
        font-weight: bold;
        cursor: pointer;
        margin-top: 10px;
        transition: background 0.3s ease;
    }
    .referral-link button:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    .referral-box button {
        padding: 12px 20px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: white;
        background: rgba(255, 255, 255, 0.2);
        transition: background 0.3s ease;
        font-weight: bold;
    }
    .referral-box button:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    /* New input for activation code */
    .activation-code-input {
        width: calc(100% - 30px);
        padding: 15px;
        border: none;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.8);
        color: #1c1c1e;
        font-size: 1.1em;
        margin-bottom: 5px;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        outline: none;
    }
    .activation-code-input::placeholder {
        color: #999;
    }
    /* NEW: Bottom Navigation Buttons - Removed */
    .bottom-navigation {
        display: none; /* Hide bottom navigation as home button is removed and menu moved */
    }
    /* NEW: Secondary Menu Screen */
.secondary-menu-screen {
    position: fixed; /* Фиксируем на экране */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); /* Поддержка Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Очень высокий z-index, чтобы быть поверх всего */
    opacity: 0;
    visibility: hidden; /* Скрываем по умолчанию */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}


.secondary-menu-screen.active {
    opacity: 1;
    visibility: visible;
}
    .secondary-menu-content {
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(30px);
        padding: 40px;
        border-radius: 25px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
        color: #1c1c1e;
        text-align: center;
        max-width: 600px;
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 25px;
    }
    .secondary-menu-content h2 {
        margin: 0;
        font-size: 2em;
        color: #1c1c1e;
    }
.secondary-menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.secondary-menu-button {
    padding: 20px;
    border: none;
    border-radius: 15px;
    background: white;
    color: #1c1c1e;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.25),
        0 8px 16px rgba(0, 0, 0, 0.2);
}
.secondary-menu-button:hover {
    background: linear-gradient(135deg, #1E90FF, #4169E1);
    color: white;
    transform: translateY(-3px);
    box-shadow:
        inset 0 4px 8px rgba(255, 255, 255, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.35),
        0 16px 32px rgba(0, 0, 0, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.25);
}
.secondary-menu-button i {
    font-size: 2em;
}
    .close-secondary-menu {
        align-self: flex-end;
        background: none;
        border: none;
        color: #1c1c1e;
        cursor: pointer;
        font-size: 2em;
        transition: color 0.3s ease;
@media (max-width: 768px) {
  margin-top: 45px;
  text-shadow: 0px 5px 6px rgba(0, 0, 0, 0.3);
  }
    }
    .close-secondary-menu:hover {
        color: #1E90FF;
    }
    /* NEW: Custom Mode Settings Overlay */
    .custom-mode-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 300;
    }
    .custom-mode-overlay.active {
        display: flex;
    }
    .custom-mode-box {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(25px);
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        color: #1c1c1e;
        max-width: 500px;
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .custom-mode-box label {
        font-weight: bold;
    }
    .custom-mode-box select, .custom-mode-box input[type="text"] {
        padding: 10px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.8);
    }
    .custom-mode-box button {
        padding: 12px;
        border: none;
        border-radius: 20px;
        background: #1E90FF;
        color: white;
        cursor: pointer;
    }
    /* NEW: Music Composer Container */
    .music-composer-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(173, 216, 230, 0.8), rgba(255, 255, 255, 0.9));
        backdrop-filter: blur(20px);
        display: none;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        z-index: 300;
    }
    .music-composer-container.active {
        display: flex;
    }
    .instrument-select {
        margin-bottom: 20px;
    }
    .piano-keys {
        display: flex;
    }
    .key {
        width: 40px;
        height: 200px;
        border: 1px solid #ddd;
        margin: 2px;
        cursor: pointer;
        transition: all 0.1s;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        background: linear-gradient(to bottom, #fff 0%, #eee 100%);
    }
    .key.black {
        background: linear-gradient(to bottom, #333 0%, #000 100%);
        height: 120px;
        margin-left: -20px;
        margin-right: -20px;
        z-index: 2;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    .key:active {
        transform: scale(0.98);
        box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }
    .music-controls {
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }
    .music-controls button {
        padding: 10px 20px;
        background: #1E90FF;
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
    }
    .music-controls button:hover {
        background: #104E8B;
    }
    #music-message {
        margin-top: 10px;
        font-size: 1.2em;
        color: #1c1c1e;
    }
    .predefined-melodies {
        margin-top: 20px;
        width: 300px;
    }
    .predefined-melodies select {
        width: 100%;
        padding: 10px;
        margin-bottom: 10px;
    }
    .predefined-melodies button {
        width: 100%;
        padding: 10px;
        background: #28a745;
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
    }
    .predefined-melodies button:hover {
        background: #218838;
    }
    /* Close button for music composer */
    #close-music-button {
        position: absolute;
        top: 30px;
        right: 30px;
        color: #1c1c1e;
        font-size: 2em;
        cursor: pointer;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
    /* Стили для модального окна выбора стиля изображения */
    .style-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 300;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .style-modal-overlay.active {
        display: flex;
        opacity: 1;
    }
    .style-modal-box {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(25px);
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        color: #1c1c1e;
        text-align: center;
        max-width: 500px;
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .style-buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    .style-buttons button {
        padding: 12px;
        border: none;
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.8);
        color: #1c1c1e;
        cursor: pointer;
        font-size: 1em;
        transition: background 0.3s ease;
    }
    .style-buttons button:hover {
        background: rgba(255, 255, 255, 1);
    }
    #close-style-modal {
        padding: 12px 20px;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-size: 1em;
        color: white;
        background: #dc3545;
        transition: background 0.3s ease;
    }
    #close-style-modal:hover {
        background: #c82333;
    }
    /* NEW: Search Window Styles */
    #search-window {
      display: none;
      width: 189px; /* 5cm ≈ 189px */
      height: 37.8px; /* 1cm ≈ 37.8px */
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(10px);
      border-radius: 10px;
      padding: 5px;
      font-size: 0.8em;
      color: #1c1c1e;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      position: absolute;
      bottom: -45px;
      left: 50%;
      transform: translateX(-50%);
      text-align: center;
      line-height: 37.8px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    #search-window.active {
      display: block;
    }
    /* NEW: Magnifier Styles */
    #magnifier {
      display: none;
      position: absolute;
      top: 50%;
      left: 50%;
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.5);
      backdrop-filter: blur(5px);
      cursor: move;
      z-index: 999;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
      transform: translate(-50%, -50%);
    }
    #magnifier i {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 2em;
    }
    .magnifier-hover {
      font-size: 2em !important;
      transition: font-size 0.2s;
    }
    /* NEW: Low Vision Mode Styles */
    body.low-vision {
      font-size: 2em !important;
    }
    body.low-vision * {
      font-size: inherit !important;
    }
    .cookie-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.cookie-consent-overlay.active {
  display: flex;
}
.cookie-consent-box {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
}
    /* NEW: Image Modal Styles */
    .image-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(10px);
      display: none;
      justify-content: center;
      align-items: center;
      z-index: 300;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .image-modal-overlay.active {
      display: flex;
      opacity: 1;
    }
    .image-modal-box {
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(25px);
      padding: 20px;
      border-radius: 20px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      color: #1c1c1e;
      text-align: center;
      max-width: 600px;
      width: 90%;
      display: flex;
      flex-direction: column;
      gap: 15px;
    }
    #modal-image {
      max-width: 100%;
      max-height: 60vh;
      border-radius: 12px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    .image-modal-buttons {
      display: flex;
      gap: 10px;
      justify-content: center;
    }
    .image-modal-buttons button {
      padding: 10px 20px;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      font-size: 1em;
      color: white;
      background: linear-gradient(135deg, #1E90FF, #4169E1);
      transition: background 0.3s ease;
    }
    .image-modal-buttons button:hover {
      background: #104E8B;
    }
    /* NEW: Album Select Modal Styles */
    .album-select-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(10px);
      display: none;
      justify-content: center;
      align-items: center;
      z-index: 310;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .album-select-overlay.active {
      display: flex;
      opacity: 1;
    }
    .album-select-box {
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(25px);
      padding: 30px;
      border-radius: 20px;
      box-shadow:
0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
      color: #1c1c1e;
      max-width: 400px;
      width: 90%;
      display: flex;
      flex-direction: column;
      gap:20px;
    }
    #album-select-list {
      list-style: none;
      padding: 0;
      margin: 0;
      max-height: 200px;
      overflow-y: auto;
      background: rgba(255, 255, 255, 0.3);
      border-radius: 10px;
    }
    .album-select-item {
      padding: 10px;
      cursor: pointer;
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      transition: background 0.3s ease;
    }
    .album-select-item:hover {
      background: rgba(255, 255, 255, 0.5);
    }
    .album-select-box button {
      padding: 10px;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      font-size: 1em;
      color: white;
      background: linear-gradient(135deg, #1E90FF, #4169E1);
      transition: background 0.3s ease;
    }
    .album-select-box button:hover {
      background: #104E8B;
    }

/* Story Creator Modal */
.story-creator-overlay,
.story-viewer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 600;
}
.story-creator-overlay.active,
.story-viewer-overlay.active {
  display: flex;
}
.story-creator-box,
.story-viewer-box {
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(25px);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  color: #1c1c1e;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
}
.story-creator-box h2,
.story-viewer-box h2 {
  margin-top: 0;
}
#story-prompt-input {
  width: 100%;
  height: 100px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.8);
  margin: 10px 0 20px;
  resize: none;
}
.story-options {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.story-options div {
  flex: 1;
}
#generate-story-button,
#save-story-button,
#close-story-viewer-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1E90FF, #4169E1);
  text-shadow: 0 2px 6px 0 rgba (255, 255, 255, 0.5),
0 4px 10px rgba(0, 0, 0, 0.3);
  color: white;
  font-weight: bold;
  cursor: pointer;
}
#save-story-button {
  background: linear-gradient(135deg, #28a745, #218838);
}
.story-content {
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.6;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95); 
    border-radius: 15px;
    margin-bottom: 20px;
}
.close-story-modal,
.close-story-viewer {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.8em;
  background: none;
  border: none;
  color: #1c1c1e;
  cursor: pointer;
}
.story-viewer-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Story Loading Overlay */
.story-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.story-loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.story-loading-box {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(25px);
  padding: 30px 50px;
  border-radius: 20px;
  text-align: center;
  color: #1c1c1e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.loading-spinner {
  font-size: 3em;
  margin-bottom: 20px;
  color: #1E90FF;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.story-loading-box p {
  font-size: 1.3em;
  margin: 0;
  font-weight: bold;
}
/* Кнопка скачивания изображения */
.image-download-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.2);
    font-size: 1.2em;
    color: #1E90FF;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 15;
    backdrop-filter: blur(5px);
}

.image-download-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 
inset 0 2px 4px rgba(0, 0, 0, 0.2),
0 2px 4px rgba(0, 0, 0, 0.15),
0 4px 8px rgba(0, 0, 0, 0.2);
}

.chat-message:hover .image-download-button {
    opacity: 1;
}
/* Кнопка редактирования изображения */
.image-edit-button {
position: absolute;
bottom: 10px;
left: 10px;
background: linear-gradient(135deg, #FF6B6B, #FF8E53);
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.2);
font-size: 1.2em;
color: white;
opacity: 0;
transition: opacity 0.3s, transform 0.2s;
z-index: 15;
backdrop-filter: blur(5px);
}
.image-edit-button:hover {
background: linear-gradient(135deg, #FF8E53, #FF6B6B);
transform: scale(1.1);
box-shadow: 
inset 0 2px 4px rgba(255, 255, 255, 0.3),
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.3),
0 10px 20px rgba(0, 0, 0, 0.25);
}
.image-edit-button:active {
transform: scale(0.95);
box-shadow: 
inset 0 2px 4px rgba(0, 0, 0, 0.2),
0 2px 4px rgba(0, 0, 0, 0.15),
0 4px 8px rgba(0, 0, 0, 0.2);
}
.chat-message:hover .image-edit-button {
opacity: 1;
}

/* Модальное окно редактирования изображения */
.image-edit-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(10px);
display: none;
justify-content: center;
align-items: center;
z-index: 400;
opacity: 0;
transition: opacity 0.3s ease;
}
.image-edit-modal-overlay.active {
display: flex;
opacity: 1;
}
.image-edit-modal-box {
  background: rgba(255, 255, 255, 0.3);
backdrop-filter: blur(25px);
padding: 30px;
border-radius: 20px;
box-shadow: 
0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
color: #1c1c1e;
text-align: center;
max-width: 500px;
width: 90%;
display: flex;
flex-direction: column;
gap: 20px;
position: relative;

}
.image-edit-modal-box h3 {
margin: 0;
font-size: 1.8em;
color: #1c1c1e;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.image-edit-modal-box textarea {
width: calc(100% - 30px);
height: 120px;
padding: 15px;
border: none;
border-radius: 16px;
background: rgba(255, 255, 255, 0.8);
resize: none;
font-family: inherit;
font-size: 1em;
color: #1c1c1e;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
outline: none;
}
.image-edit-modal-buttons {
display: flex;
gap: 15px;
justify-content: center;
margin-top: 10px;
}
.image-edit-modal-buttons button {
padding: 12px 25px;
border: none;
border-radius: 15px;
cursor: pointer;
font-size: 1em;
font-weight: bold;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
box-shadow: 
0 4px 8px rgba(0, 0, 0, 0.2),
0 6px 12px rgba(0, 0, 0, 0.25);
}
.image-edit-modal-buttons .edit-send-button {
background: linear-gradient(135deg, #1E90FF, #4682B4);
color: white;
}
.image-edit-modal-buttons .edit-send-button:hover {
background: linear-gradient(135deg, #104E8B, #1E90FF);
transform: translateY(-2px);
box-shadow: 
0 6px 12px rgba(0, 0, 0, 0.25),
0 8px 16px rgba(0, 0, 0, 0.3);
}
.image-edit-modal-buttons .edit-cancel-button {
background: linear-gradient(135deg, #6c757d, #5a6268);
color: white;
}
.image-edit-modal-buttons .edit-cancel-button:hover {
background: linear-gradient(135deg, #5a6268, #495057);
transform: translateY(-2px);
box-shadow: 
0 6px 12px rgba(0, 0, 0, 0.2),
0 8px 16px rgba(0, 0, 0, 0.25);
}
.image-edit-modal-buttons button:active {
transform: translateY(0);
box-shadow: 
inset 0 2px 4px rgba(0, 0, 0, 0.2),
0 2px 4px rgba(0, 0, 0, 0.15);
}
.site-footer {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #666;
  z-index: 5;
  font-family: Arial, sans-serif;
  pointer-events: auto !important; 
  cursor: pointer;
  user-select: none; 
  transition: transform 0.1s ease;
}

/* Кнопка в модальном окне просмотра */
.modal-download-button {
    background: linear-gradient(135deg, #1E90FF, #4682B4);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s;
}

.modal-download-button:hover {
    background: linear-gradient(135deg, #104E8B, #1E90FF);
}
/* ===== СТАРТОВЫЙ ЭКРАН - ПОЛНЫЕ СТИЛИ ===== */
.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(145, 216, 230, 0.85) 0%, 
    rgba(200, 235, 255, 0.9) 40%,
    rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
  animation: backgroundShift 8s ease-in-out infinite;
}

.start-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Анимация плавного перехода фона */
@keyframes backgroundShift {
  0%, 100% {
    background: linear-gradient(135deg, 
      rgba(145, 216, 230, 0.85) 0%, 
      rgba(220, 240, 255, 0.9) 50%,
      rgba(255, 255, 255, 0.95) 100%);
  }
  50% {
    background: linear-gradient(135deg, 
      rgba(155, 216, 230, 0.8) 0%, 
      rgba(235, 248, 255, 0.85) 50%,
      rgba(255, 255, 255, 0.9) 100%);
  }
}

/* Декоративные континенты */
.continent {
  position: absolute;
  border-radius: 50%;
  background: rgba(30, 144, 255, 0.05);
  box-shadow: 0 8px 32px rgba(65, 105, 225, 0.1);
  animation: float 20s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.continent-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, rgba(30, 144, 255, 0.15) 0%, transparent 70%);
  animation-delay: 0s;
}

.continent-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, rgba(65, 105, 225, 0.12) 0%, transparent 70%);
  animation-delay: -5s;
}

.continent-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 80%;
  background: radial-gradient(circle, rgba(100, 149, 237, 0.2) 0%, transparent 70%);
  animation-delay: -10s;
}

/* Контент */
.start-screen-content {
  position: relative;
  z-index: 10;
  text-align: center;
  width: 90%;
  max-width: 800px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 8px 32px rgba(30, 144, 255, 0.15),
    0 12px 24px rgba(65, 105, 225, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

/* Логотип ЗУБР ИИ */
.start-logo {
  font-family: 'Russo One', sans-serif;
  font-size: 6em;
  font-weight: 900;
  margin: 0 0 15px 0;
  background: linear-gradient(135deg, #1E90FF 0%, #4169E1 50%, #1E90FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(30, 144, 255, 0.4)) 
          drop-shadow(0 4px 6px rgba(65, 105, 225, 0.3));
  letter-spacing: 12px;
  text-transform: uppercase;
  animation: textShine 3s ease-in-out infinite;
  position: relative;
}

@keyframes textShine {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(30, 144, 255, 0.4)) 
            drop-shadow(0 4px 6px rgba(65, 105, 225, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(30, 144, 255, 0.6)) 
            drop-shadow(0 6px 12px rgba(65, 105, 225, 0.4));
  }
}

/* Подзаголовок */
.start-subtitle {
  color: #4169E1;
  font-size: 1.4em;
  margin-bottom: 40px;
  font-weight: 600;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
  font-family: 'Montserrat', sans-serif;
}

/* Поле ввода */
.start-input-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 25px;
  padding: 5px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.start-input-container:focus-within {
  transform: translateY(-2px);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#start-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 15px 20px;
  font-size: 1.1em;
  color: #1c1c1e;
  outline: none;
  font-family: inherit;
}

#start-input::placeholder {
  color: #8e8e93;
}

.start-send-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1E90FF, #4169E1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 144, 255, 0.4);
  margin-right: 5px;
}

.start-send-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(30, 144, 255, 0.6);
}

.start-send-btn:active {
  transform: scale(0.95);
}

/* Кнопки действий */
.start-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.start-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.start-action-btn:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.start-action-btn:active {
  transform: translateY(-2px);
}

.action-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E90FF, #4169E1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4em;
  box-shadow: 
    0 4px 12px rgba(30, 144, 255, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
}

.start-action-btn:hover .action-icon {
  transform: scale(1.1) rotate(5deg);
}

.start-action-btn span {
  color: #1c1c1e;
  font-size: 0.85em;
  font-weight: 600;
  text-align: center;
  max-width: 100px;
  line-height: 1.2;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .start-logo {
    font-size: 3em;
    letter-spacing: 4px;
  }
  
  .start-subtitle {
    font-size: 1em;
    margin-bottom: 30px;
  }
  
  .start-actions {
    gap: 12px;
  }
  
  .start-action-btn {
    min-width: 80px;
    padding: 10px;
  }
  
  .action-icon {
    width: 45px;
    height: 45px;
    font-size: 1.2em;
  }
  
  .start-action-btn span {
    font-size: 0.75em;
  }
  
  .continent-1 { 
    width: 300px; 
    height: 300px; 
    top: -100px; 
    left: -100px; 
  }
  
  .continent-2 { 
    width: 200px; 
    height: 200px; 
    bottom: -50px; 
    right: -50px; 
  }
  
  .continent-3 { 
    display: none; 
  }
}

@media (max-width: 375px) {
  .start-logo {
    font-size: 2.5em;
  }
  
  .start-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .start-action-btn {
    min-width: auto;
  }
}
/* Сам тег details */
#modes-details {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 0; /* Убрали отступ */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}

/* Сам тег details */
#modes-details {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    /* Убираем отступы у контейнера, чтобы summary мог занять всю площадь */
    padding: 0 !important; 
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    /* Важно для позиционирования */
    display: block; 
}

/* Заголовок «Режимы» - делаем всю область кликабельной */
#modes-details summary {
    font-weight: bold;
    cursor: pointer; /* Курсор руки */
    list-style: none; /* Убираем стандартный треугольник */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Задаем отступы здесь, чтобы они были частью кликабельной области */
    padding: 100px  !important; 
    font-size: 16px;
    user-select: none; /* Чтобы текст не выделялся при частых кликах */
    width: 100%; /* Растягиваем на всю ширину */
    box-sizing: border-box; /* Чтобы padding не увеличивал ширину сверх 100% */
    border-radius: 12px; /* Скругление по углам контейнера */
    transition: background 0.2s ease; /* Плавный эффект при наведении */
}

/* Эффект при наведении (опционально) */
#modes-details summary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Убрать стандартную стрелку в Chrome/Safari */
#modes-details summary::-webkit-details-marker {
    display: none;
}
#modes-details summary i {
    transition: transform 0.3s ease;
}

/* Контейнер кнопок внутри */
.modes-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Кнопки режимов (берут стили .mode-button из вашего CSS, 
   но добавим адаптацию для вертикального списка) */
.modes-wrapper .mode-button {
    width: 100%;
    background: rgba(30, 144, 255, 0.1);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: all 0.2s;
}

.modes-wrapper .mode-button:hover {
    background: rgba(30, 144, 255, 0.25);
    transform: translateX(4px);
}

.modes-wrapper .mode-button.active-mode {
    background: rgba(30, 144, 255, 0.4);
    font-weight: bold;
}

/* Исправленные стили для modes-details - работают на 100% */
@media (min-width: 769px) {
#modes-details {
position: fixed !important;
top: 35px !important;
right: 48px !important;  /* ✅ Исправлено: ближе к краю */
width: 140px !important;  /* ✅ Увеличена ширина */
height: 50px !important;
min-width: 140px !important;
min-height: 50px !important;
padding: 1px!important;
margin: 0 !important;
background: rgba(255, 255, 255, 0.85) !important;
backdrop-filter: blur(10px) !important;
border-radius: 12px !important;
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
overflow: visible !important;
z-index: 150 !important;  /* ✅ Увеличен z-index */


}

#modes-details summary {
width: 140px !important;
height: 50px !important;
min-width: 140px !important;
min-height: 50px !important;
display: flex !important;
justify-content: center !important;
align-items: center !important;
background: rgba(255, 255, 255, 0.85) !important;
backdrop-filter: blur(10px) !important;
border-radius: 12px !important;
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
cursor: pointer !important;
pointer-events: auto !important;  /* ✅ Важно для клика */
user-select: none !important;
-webkit-user-select: none !important;
padding: 10px !important;
margin: 0 !important;
font-size: 14px !important;
font-weight: bold !important;
color: #1c1c1e !important;
text-align: center !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
list-style: none !important;
transition: all 0.3s ease !important;

}

/* Убираем стандартный маркер details */
#modes-details summary::-webkit-details-marker {
display: none !important;
}

#modes-details summary::marker {
display: none !important;
}

#modes-details summary:hover {
background: rgba(255, 255, 255, 1) !important;
transform: scale(1.05) !important;
}

/* Выпадающий список */
.modes-wrapper {
position: absolute !important;
top: 60px !important;
right: 4px !important;
width: 220px !important;  /* ✅ Увеличена ширина */
background: rgba(255, 255, 255, 0.95) !important;
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px) !important;
border-radius: 12px !important;
padding: 10px !important;
box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
flex-direction: column !important;
gap: 5px !important;
z-index: 160 !important;  /* ✅ Выше чем у summary */
display: none !important;
}

/* Показываем список ТОЛЬКО когда details открыт */
#modes-details[open] .modes-wrapper {
display: flex !important;
animation: fadeIn 0.3s ease !important;
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}

.modes-wrapper .mode-button {
width: 100% !important;
justify-content: flex-start !important;
padding: 8px 12px !important;
font-size: 13px !important;
background: rgba(30, 144, 255, 0.1) !important;

}
/* Плавный поворот стрелочки при открытии меню */
#modes-details summary i {
    transition: transform 0.3s ease;
    display: inline-block; /* Важно для корректной работы transform */
}

/* Поворот на 180° когда details открыт */
#modes-details[open] summary i {
    transform: rotate(180deg);
}
}
@media (max-width: 768px) {
  #modes-details {
    position: absolute !important;
    top: 55px !important;
    right: 15px !important;
    left: auto !important;
    width: auto !important;
    max-width: 140px !important;
    z-index: 60 !important;
    margin: 0 !important;
    /* ✅ Явный белый фон с высокой непрозрачностью */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
  }
  
  #modes-details summary {
    padding: 10px 15px !important;
    font-size: 13px !important;
    height: auto !important;
    min-height: auto !important;
    width: auto !important;
    justify-content: center !important;
    /* ✅ Белый фон для summary */
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 10px !important;
    color: #1c1c1e !important;
  }
  
  #modes-details[open] {
    /* ✅ Фон остаётся когда меню открыто */
    background: rgba(255, 255, 255, 0.95) !important;
  }
  
  #modes-details .modes-wrapper {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    width: 200px !important;
    z-index: 160 !important;
    margin-top: 5px !important;
    /* ✅ Белый фон для выпадающего списка */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
  }
  /* Плавный поворот стрелочки при открытии меню */
#modes-details summary i {
    transition: transform 0.3s ease;
    display: inline-block; /* Важно для корректной работы transform */
}

/* Поворот на 180° когда details открыт */
#modes-details[open] summary i {
    transform: rotate(180deg);
}/* Плавный поворот стрелочки при открытии меню */
#modes-details summary i {
    transition: transform 0.3s ease;
    display: inline-block; /* Важно для корректной работы transform */
}

/* Поворот на 180° когда details открыт */
#modes-details[open] summary i {
    transform: rotate(180deg);
}
}
/* Стили для модального окна пересказа */
.retell-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 700;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.retell-modal-overlay.active {
  display: flex;
  opacity: 1;
}
.retell-modal-box {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(25px);
        box-shadow:
0 8px 32px rgba(0, 0, 0, 0.2),
0 12px 24px rgba(0, 0, 0, 0.3),
0 16px 32px rgba(0, 0, 0, 0.25),
inset 0 2px 4px rgba(255, 255, 255, 0.3);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  color: #1c1c1e;
  text-align: left;
}
.retell-modal-box h3 {
  margin-top: 0;
  font-size: 1.6em;
  color: #1E90FF;
}
.retell-content {
  background: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 1.1em;
}
.retell-modal-box button {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1E90FF, #4682B4);
  color: white;
  font-weight: bold;
  cursor: pointer;
}
.retell-modal-box button:hover {
  background: linear-gradient(135deg, #104E8B, #1E90FF);
}
.close-retell-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.8em;
  background: none;
  border: none;
  color: #1c1c1e;
  cursor: pointer;
}

    /* Стили для модального окна создания эмодзи */
.emoji-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.emoji-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.emoji-modal-box {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(25px);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #1c1c1e;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.emoji-modal-box h3 {
  margin: 0;
  font-size: 1.8em;
  color: #1E90FF;
  text-align: center;
}

.close-emoji-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #1c1c1e;
  cursor: pointer;
  font-size: 2em;
  transition: color 0.3s ease;
}

.close-emoji-modal:hover {
  color: #dc3545;
}

.emoji-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emoji-input-group label {
  font-weight: bold;
  color: #1c1c1e;
}

.emoji-input-group textarea {
  width: calc(100% - 20px);
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1em;
  color: #1c1c1e;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.emoji-style-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emoji-style-group label {
  font-weight: bold;
  color: #1c1c1e;
}

.emoji-style-group select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: #1c1c1e;
  font-size: 1em;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  outline: none;
  cursor: pointer;
}

.emoji-generate-button {
  padding: 15px 25px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1.1em;
  color: #fff;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.emoji-generate-button:hover {
  background: linear-gradient(135deg, #FF8E53, #FF6B6B);
  transform: translateY(-1px);
}

.emoji-result-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  min-height: 300px;
  position: relative;
}

/* Стили для анимации загрузки */
.emoji-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  z-index: 10;
  animation: fadeIn 0.3s ease;
}

.emoji-loading.active {
  display: flex;
}

.loading-spinner {
  font-size: 3em;
  color: #1E90FF;
  margin-bottom: 20px;
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2em;
  font-weight: bold;
  color: #1c1c1e;
  margin-bottom: 10px;
  text-align: center;
}

.loading-subtext {
  font-size: 1em;
  color: #666;
  text-align: center;
  font-style: italic;
  margin-top: 10px;
}

.emoji-generated-image {
  max-width: 200px;
  max-height: 200px;
  border: 5px solid #1c1c1e;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: none;
}

.emoji-generated-image.active {
  display: block;
}

.emoji-generated-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.emoji-save-button {
  padding: 12px 25px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
  color: #fff;
  background: linear-gradient(135deg, #28a745, #218838);
  font-weight: bold;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.emoji-save-button:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
}

.saved-emojis-section {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.3);
  padding: 15px;
  border-radius: 15px;
}

.saved-emojis-section h4 {
  margin: 0 0 15px 0;
  font-size: 1.2em;
  text-align: center;
}

.saved-emojis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.saved-emoji-item {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.3s ease, transform 0.2s ease;
  position: relative;
}

.saved-emoji-item:hover {
  border-color: #1E90FF;
  transform: scale(1.05);
}

.saved-emoji-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.referral-prompt-content {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
}

.referral-prompt-content h4 {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: #dc3545;
}

.referral-prompt-content p {
  margin: 10px 0;
  font-size: 1.1em;
}
/* Welcome Modal Styles */
.welcome-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.welcome-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.welcome-modal-box {
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.9), rgba(70, 130, 180, 0.85));
  color: white;
  padding: 30px 40px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: fadeInScale 0.6s ease-out;
}
.welcome-modal-box h2 {
  margin: 0 0 15px 0;
  font-size: 1.8em;
}
.welcome-modal-box p {
  margin: 0;
  font-size: 1.2em;
  font-weight: 500;
}
@keyframes fadeInScale {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#menu-toggle-button {
  display: none;
}
/* Добавьте эти стили в ваш CSS */
.chat-message {
  position: relative;
  padding-right: 30px; /* отступ для кнопки */
}

.speak-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #1E90FF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.2s;
  z-index: 10;
  user-select: none;
}

.speak-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

.speak-btn.playing {
  color: #28a745;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.delete-msg-btn {
  position: absolute;
  top: 8px;
  right: 38px; /* Расположение слева от кнопки озвучки */
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #dc3545;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
  z-index: 10;
  user-select: none;
}
.delete-msg-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}
/* Скрываем кнопку меню и её фон */
#menu-toggle-button {
  display: none !important;
}

/* Скрываем виджет погоды на мобильных устройствах */
@media (max-width: 768px) {
  #weather-widget {
    display: none !important;
  }
  
  /* Также скрываем универсальное меню, если оно находится под виджетом */
  .universal-menu-button {
    margin-top: 0 !important;
  }
}
@media (max-width: 768px) {
  /* Перемещаем универсальное меню в левый верхний угол */
  .right-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  
  /* Скрываем стандартное меню на мобильных устройствах */
  #menu-toggle-button {
    display: none;
  }
  
  /* Позиционируем кнопку изменения фона */
  #wallpaper-button {
    position: fixed;
    top: 20px;
    left: 85px; /* Располагаем справа от универсального меню */
    z-index: 101;
  }
  
  /* Убираем стандартное расположение кнопки фона из родительского контейнера */
  .top-buttons {
    display: none;
  }
  
  /* Адаптируем погоду для мобильных устройств */
  #weather-widget {
    margin-bottom: 10px;
  }
  
  /* Фиксируем верхнюю панель, чтобы элементы не смещались при прокрутке */
  .top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
  }
}
.font-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    padding: 10px;
    background: rgba(240, 248, 255, 0.3);
    border-radius: 12px;
}

#font-select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    min-width: 200px;
}

#font-size-slider {
    flex: 1;
    height: 20px;
-webkit-appearance: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    outline: none;
}

#font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1E90FF;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(30, 144, 255, 0.5);
}

#font-size-display {
    min-width: 50px;
    font-weight: bold;
    color: #1c1c1e;
    text-align: center;
}

@media (max-width: 768px) {
  /* Изменяем порядок элементов внутри редактора заметок */
  .note-editor {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  /* Уменьшаем высоту текстового поля для мобильных */
  .note-editor textarea {
    height: 200px;
    font-size: 1.1em;
    margin-bottom: 0;
  }
  
  /* Перемещаем элементы управления с выбором шрифта под текстовое поле */
  .font-controls {
    order: 2; /* Перемещаем под текстовое поле */
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    margin-bottom: 20px; /* Отступ 20px перед кнопками */
    background: rgba(240, 248, 255, 0.4);
  }
  
  #font-select {
    width: 100%;
    min-width: auto;
  }
  
  #font-size-slider {
    width: 100%;
  }
  
  /* Перемещаем кнопки под ползунок выбора шрифта */
  .editor-buttons {
    order: 3; /* Перемещаем под элементы выбора шрифта */
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
  }
  
  .editor-buttons button {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    border-radius: 15px;
  }
  
  /* Увеличиваем размер ползунка для удобства */
  #font-size-slider {
    height: 12px;
  }
  
  #font-size-slider::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
  }
}

/* Скрываем абсолютно все элементы, связанные с меню слева */
.top-bar .top-buttons {
  display: none !important;
}

/* Также скрываем сам чат-меню, чтобы не было отступов */
#chat-menu {
  display: none !important;
  left: 0 !important;
  transform: translateX(-100%) !important;
}

/* Дополнительно убираем возможные отступы у контейнеров */
.chat-container {
  margin-left: 0 !important;
  left: 0 !important;
}

/* Для мобильных устройств тоже убираем все следы */
@media (max-width: 768px) {
  .top-bar .top-buttons {
    display: none !important;
  }
  
}

@media (max-width: 768px) {
.speak-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 50%;
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #1E90FF;
  box-shadow: 0 3px 3px rgba(0,0,0,0.4);
  transition: all 0.3s;
  z-index: 10;
  user-select: none;
}

.speak-btn.playing {
  color: #279A42;
  animation: pulse 1.5s infinite;
}

.delete-msg-btn {
  position: absolute;
  top: 8px;
  right: 42px; /* Расположение слева от кнопки озвучки */
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 50px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  color: #dc3545;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
  z-index: 10;
  user-select: none;
}

/* Эффект рассыпания для мобильных устройств */
@keyframes messageDisintegrate {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    30% {
        transform: translate(var(--tx1, 0), var(--ty1, 0)) scale(0.98);
        opacity: 0.9;
    }
    60% {
        transform: translate(var(--tx2, 0), var(--ty2, 0)) scale(0.9);
        opacity: 0.7;
        filter: blur(1px);
    }
    85% {
        transform: translate(var(--tx3, 0), var(--ty3, 0)) scale(0.8);
        opacity: 0.4;
        filter: blur(2px);
    }
    100% {
        transform: translate(var(--tx4, 0), var(--ty4, 0)) scale(0.6);
        opacity: 0;
        filter: blur(4px);
    }
}

.message-disintegrating {
    animation: messageDisintegrate 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    @keyframes messageDisintegrate {
        0% {
            transform: translate(0, 0) scale(1);
            opacity: 1;
            filter: blur(0);
            letter-spacing: 0;
        }
        20% {
            transform: translate(var(--tx1, 0), var(--ty1, 0)) scale(0.98);
            opacity: 0.95;
            filter: blur(0);
        }
        40% {
            transform: translate(var(--tx2, 0), var(--ty2, 0)) scale(0.95);
            opacity: 0.8;
            filter: blur(0.5px);
            letter-spacing: 1px;
        }
        60% {
            transform: translate(var(--tx3, 0), var(--ty3, 0)) scale(0.9);
            opacity: 0.6;
            filter: blur(1px);
            letter-spacing: 2px;
        }
        80% {
            transform: translate(var(--tx4, 0), var(--ty4, 0)) scale(0.8);
            opacity: 0.3;
            filter: blur(2px);
            letter-spacing: 3px;
        }
        100% {
            transform: translate(var(--tx5, 0), var(--ty5, 0)) scale(0.6);
            opacity: 0;
            filter: blur(5px);
            letter-spacing: 5px;
        }
    }
    
    .message-disintegrating {
        animation-duration: 0.9s;
        text-shadow: 0 0 5px rgba(0,0,0,0.3);
    }

@media (max-width: 768px) {
  .secondary-menu-screen {
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  
  .secondary-menu-content {
    max-height: calc(100vh - 40px); /* 100% высоты окна минус отступы */
    overflow-y: auto;
    width: 95%;
    max-width: none;
    padding: 20px;
    border-radius: 20px;
    margin: 0 auto;
    -webkit-overflow-scrolling: touch; /* Плавный скроллинг на iOS */
  }
  
  .secondary-menu-buttons {
    display: grid;
    grid-template-columns: 490px,170px; /* Вертикальное расположение кнопок */
    gap: 15px;
  justify-content: center ;
 align-content: center;
  }
  
  .secondary-menu-button {
    padding: 15px;
    font-size: 1em;
    height: auto;
  }
}

/* Стилизация скроллбара для WebKit браузеров */
.secondary-menu-content::-webkit-scrollbar {
  width: 8px;
}

.secondary-menu-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.secondary-menu-content::-webkit-scrollbar-thumb {
  background: rgba(30, 144, 255, 0.7);
  border-radius: 4px;
}

.secondary-menu-content::-webkit-scrollbar-thumb:hover {
  background: #1E90FF;
}

/* Дополнительные правила для очень маленьких экранов */
@media (max-width: 375px) {
  /* Универсальное меню */
  .secondary-menu-content {
    padding: 20px 15px !important;
    border-radius: 20px !important;
    max-width: 95% !important;
    width: 95% !important;
    gap: 15px !important;
  }
  
  .secondary-menu-content h2 {
    font-size: 1.5em !important;
    margin-bottom: 10px !important;
  }
  
  /* Кнопки меню в одну колонку */
  .secondary-menu-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .secondary-menu-button {
    padding: 14px !important;
    min-height: 60px !important;
    font-size: 0.95em !important;
    border-radius: 12px !important;
    gap: 8px !important;
  }
  
  .secondary-menu-button i {
    font-size: 1.7em !important;
  }
  
  /* Правый контейнер с виджетами */
  .right-container {
    gap: 8px !important;
  }
  
  /* Виджет погоды */
  .weather-widget {
    width: 50px !important;
    height: 50px !important;
    border-radius: 12px !important;
    padding: 7px !important;
  }
  
  .weather-emoji {
    font-size: 1.6em !important;
    margin-bottom: 3px !important;
  }
  
  .weather-temp {
    font-size: 0.95em !important;
    font-weight: 600 !important;
  }
  
  /* Кнопка универсального меню */
  .universal-menu-button {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.1em !important;
  }
  
  /* Верхняя панель */
  .top-bar {
    padding: 0 10px !important;
  }
  
  .top-buttons {
    gap: 10px !important;
  }
  
  .menu-button, #wallpaper-button {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1em !important;
  }
  
  /* Модальные окна */
  .image-modal-box, .emoji-modal-box, .style-modal-box {
    padding: 20px 15px !important;
    width: 95% !important;
    max-width: 95% !important;
    border-radius: 20px !important;
  }
  
  /* Контейнеры */
  .chat-container, .notes-container, .albums-container, 
  .post-creator-container, .story-feed-container, 
  .project-container, .qrcode-container {
    width: 95% !important;
    height: 75vh !important;
    padding: 15px !important;
    border-radius: 20px !important;
  }
  
  .notes-header, .albums-header, .project-header, .qrcode-header {
    margin-bottom: 15px !important;
  }
  
  .notes-header h2, .albums-header h2, .project-header h2, .qrcode-header h2 {
    font-size: 1.5em !important;
  }
  
  .notes-header-buttons {
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  
  .add-note-button, .back-to-chat-button {
    padding: 8px 12px !important;
    font-size: 0.9em !important;
    border-radius: 10px !important;
  }
  
  /* Кнопки ввода и меню */
  .input-container {
    gap: 8px !important;
  }
  
  .input-container input[type="text"] {
    font-size: 0.95em !important;
    padding: 10px 14px !important;
  }
  
  .input-button, .mic-button, .input-menu-button {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1em !important;
  }
  
  /* Скрыть ненужные элементы на очень маленьких экранах */
  #search-window {
    display: none !important;
  }
  
  /* Фон для лучшей видимости */
  body.low-vision .secondary-menu-button {
    padding: 16px !important;
  }
}

/* Дополнительные оптимизации для iPhone SE (320px) */
@media (max-width: 320px) {
  .secondary-menu-content {
    padding: 15px 10px !important;
  }
  
  .secondary-menu-button {
    padding: 12px !important;
    min-height: 55px !important;
    font-size: 0.85em !important;
  }
  
  .secondary-menu-button i {
    font-size: 1.5em !important;
  }
  
  .universal-menu-button {
    width: 55px !important;
    height: 55px !important;
  }
  
  /* Еще более компактный интерфейс */
  .chat-container, .notes-container, .albums-container {
    height: 70vh !important;
  }
  
  .notes-list, .albums-list {
    padding: 10px !important;
  }
  
  .note-item, .album-item {
    padding: 10px !important;
    font-size: 0.9em !important;
  }
  
  .note-content {
    max-height: 80px !important;
    font-size: 0.9em !important;
  }
}
@media (max-width: 768px) {
.universal-menu-button {
display:none;
}