
/* ============================================================
   ВОРОТА — пошаговый выбор этажа и комнаты
   ============================================================ */
.gate-modal{
  width: min(900px, 100%);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #F0F7F4;
  text-align: left;
  border-radius: 20px;
}
.gate-head{
  padding: 22px 30px 18px;
  background: linear-gradient(135deg, #E4F0EC, #F0F7F4);
  border-bottom: 1px solid #C8DFD6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-shrink: 0;
}
.gate-head h2{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 30px);
  color: #1E3330;
  margin: 0 0 4px;
  font-weight: 700;
}
.gate-head p{
  font-family: 'Philosopher', serif;
  font-style: italic;
  color: #2F4A44;
  font-size: 14.5px;
  margin: 0;
}
.gate-back{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid #C8DFD6;
  background: #fff;
  color: #2F4A44;
  font-size: 16px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: .18s;
  flex-shrink: 0;
  margin-right: 8px;
}
.gate-back:hover{ border-color: #4A9E8E; color: #357A6E; background: rgba(74,158,142,.08); }

.gate-close{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid #C8DFD6;
  background: #fff;
  color: #2F4A44;
  font-size: 16px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: .18s;
  flex-shrink: 0;
}
.gate-close:hover{ border-color: #4A9E8E; color: #357A6E; background: rgba(74,158,142,.08); }

/* Прогресс шагов */
.gate-steps{
  display: flex;
  gap: 6px;
  padding: 14px 30px 0;
}
.gate-steps .s{
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #C8DFD6;
  transition: background .3s;
}
.gate-steps .s.on{ background: linear-gradient(90deg, #7FB89C, #4A9E8E); }

/* Тело */
.gate-body{
  flex: 1;
  overflow-y: auto;
  padding: 26px 30px 32px;
  background: #F0F7F4;
}
.gate-body::-webkit-scrollbar{ width: 8px }
.gate-body::-webkit-scrollbar-thumb{ background: #C8DFD6; border-radius: 4px }

/* Схема замка */
.gate-schema{
  margin-bottom: 22px;
  padding: 16px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  text-align: center;
}
.gate-schema svg{
  max-width: 100%;
  height: auto;
  max-height: 180px;
}

/* Сетка этажей / комнат */
/* Большие карточки этажей */
/* Комнаты внутри этажа */
/* Финальный экран */
.gate-final{
  text-align: center;
  padding: 30px 20px;
}
.gate-final .ico{
  font-size: 96px;
  line-height: 1;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 30px rgba(74,158,142,.35));
}
.gate-final h3{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 26px;
  color: #1E3330;
  margin: 0 0 12px;
}
.gate-final p{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15.5px;
  color: #2F4A44;
  line-height: 1.6;
  margin: 0 auto 24px;
  max-width: 480px;
}
.gate-final .btn{
  padding: 14px 32px;
  font-size: 16px;
}

/* Мини-инфо о комнате */
.gate-room-info{
  padding: 14px 20px;
  background: rgba(74,158,142,.08);
  border: 1px solid rgba(74,158,142,.22);
  border-radius: 12px;
  margin-bottom: 18px;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14.5px;
  color: #2F4A44;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.gate-room-info b{ color: #357A6E; font-weight: 700; }

/* Адаптив */
@media (max-width: 620px){
  .gate-head{ padding: 18px 20px 14px; }
  .gate-body{ padding: 20px 20px 26px; }
  }


/* ============================================================
   ВОРОТА — КРАСИВЫЕ КНОПКИ-КАРТОЧКИ
   ============================================================ */

.gate-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.gate-grid-floors{
  grid-template-columns: repeat(2, 1fr);
}

/* ============ КАРТОЧКА-КНОПКА ЭТАЖА ============ */
.gate-btn{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 2px solid #C8DFD6;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.gate-btn::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(74,158,142,.06), rgba(74,158,142,.02));
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
}
.gate-btn:hover{
  border-color: #4A9E8E;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(74,158,142,.16);
}
.gate-btn:hover::before{ opacity: 1; }

.gate-btn-ico{
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, rgba(74,158,142,.14), rgba(74,158,142,.06));
  border: 1px solid rgba(74,158,142,.20);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform .22s;
}
.gate-btn:hover .gate-btn-ico{
  transform: scale(1.08);
  background: linear-gradient(135deg, rgba(74,158,142,.22), rgba(74,158,142,.10));
}

.gate-btn-content{
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.gate-btn-name{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 19px;
  font-weight: 700;
  color: #1E3330;
  line-height: 1.15;
  margin-bottom: 4px;
  letter-spacing: .005em;
}
.gate-btn-desc{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #5A7A74;
  line-height: 1.4;
  margin-bottom: 8px;
}

.gate-btn:hover 

.gate-btn:hover 

/* Заблокированная (18+) */
.gate-btn.disabled{
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.7);
}
.gate-btn.disabled:hover{
  transform: none;
  box-shadow: none;
  border-color: #C8DFD6;
}
.gate-btn.disabled 

/* Бейдж «18+» */
.gate-btn-badge{
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #C08878;
  color: #F0F7F4;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ============ КОМНАТЫ ВНУТРИ ЭТАЖА ============ */
.gate-room-btn{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fff;
  border: 2px solid #C8DFD6;
  border-radius: 14px;
  cursor: pointer;
  transition: all .22s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.gate-room-btn:hover{
  border-color: #4A9E8E;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(74,158,142,.14);
}
.gate-room-btn .gate-btn-ico{
  width: 52px;
  height: 52px;
  font-size: 24px;
}
.gate-room-btn .gate-btn-name{
  font-size: 17px;
}
.gate-room-btn .gate-btn-desc{
  font-size: 13px;
}

/* ============ ИНФО-ПОЛОСА ЭТАЖА ============ */
.gate-zone-head{
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(74,158,142,.10), rgba(74,158,142,.04));
  border: 1px solid rgba(74,158,142,.22);
  border-radius: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gate-zone-head .ico{
  font-size: 32px;
  flex-shrink: 0;
}
.gate-zone-head b{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 18px;
  color: #1E3330;
  font-weight: 700;
  margin-bottom: 2px;
}
.gate-zone-head span{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #5A7A74;
}

/* Адаптив */
@media (max-width: 640px){
  .gate-grid-floors{ grid-template-columns: 1fr; }
  .gate-btn{ padding: 16px; gap: 12px; }
  .gate-btn-ico{ width: 48px; height: 48px; font-size: 24px; }
  .gate-btn-name{ font-size: 17px; }
  .gate-btn-desc{ font-size: 13px; }
  
}


/* ============================================================
   ВОРОТА — CTA КНОПКА С ЖИРНОЙ СТРЕЛКОЙ И МИГАЮЩЕЙ РУКОЙ
   ============================================================ */



/* Текст внутри CTA */


/* ============ СТРЕЛКА — ЖИРНАЯ, МИГАЮЩАЯ ============ */


/* ============ РУКА — МИГАЮЩАЯ, ПОСЛЕ СТРЕЛКИ ============ */


/* ============ HOVER — усиление ============ */
.gate-btn:hover 

.gate-btn:hover 

.gate-btn:hover 

/* ============ DISABLED — без руки ============ */
.gate-btn.disabled 
.gate-btn.disabled 
.gate-btn.disabled 

/* ============ СТРУКТУРА КАРТОЧКИ (ФИКС СЛИПАНИЯ) ============ */
.gate-btn-content{
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}
.gate-btn-name{
  display: block !important;
  margin: 0 !important;
}
.gate-btn-desc{
  display: block !important;
  margin: 0 0 4px !important;
}

/* Мобильный */
@media (max-width: 640px){
  
  
  
}


/* ============================================================
   КАРТОЧКА ЭТАЖА / КОМНАТЫ — ЧИСТАЯ СТРУКТУРА
   ============================================================ */

.gate-btn{
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  grid-template-rows: auto auto !important;
  gap: 14px 16px !important;
  padding: 18px 20px 20px !important;
  background: #fff !important;
  border: 2px solid #C8DFD6 !important;
  border-radius: 16px !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all .22s ease !important;
  width: 100% !important;
  align-items: flex-start !important;
  position: relative !important;
}

.gate-btn:hover{
  border-color: #4A9E8E !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 14px 32px rgba(74,158,142,.16) !important;
}

.gate-btn.disabled{
  opacity: .45 !important;
  cursor: not-allowed !important;
  filter: grayscale(.7) !important;
}
.gate-btn.disabled:hover{
  transform: none !important;
  box-shadow: none !important;
}

/* Иконка слева */
.gate-btn-ico{
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 26px !important;
  background: linear-gradient(135deg, rgba(74,158,142,.14), rgba(74,158,142,.06)) !important;
  border: 1px solid rgba(74,158,142,.20) !important;
  grid-row: span 2 !important;
  grid-column: 1 !important;
  flex-shrink: 0 !important;
  transition: transform .22s !important;
}
.gate-btn:hover .gate-btn-ico{
  transform: scale(1.08) !important;
}

/* Контент справа от иконки */
.gate-btn-content{
  grid-column: 2 !important;
  display: block !important;
  min-width: 0 !important;
}

.gate-btn-name{
  display: block !important;
  font-family: 'Philosopher', serif !important;
  font-style: italic !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #1E3330 !important;
  line-height: 1.15 !important;
  margin: 0 0 6px !important;
}

.gate-btn-desc{
  display: block !important;
  font-family: 'Philosopher', serif !important;
  font-style: italic !important;
  font-size: 13.5px !important;
  color: #5A7A74 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* ============ CTA — ОТДЕЛЬНОЙ КНОПКОЙ ВНИЗУ ============ */
.gate-btn-cta-wrap{
  grid-column: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 8px !important;
  position: relative !important;
}

/* Рука — слева от кнопки, смотрит вправо */
.gate-hand{
  display: inline-block !important;
  font-size: 22px !important;
  line-height: 1 !important;
  animation: hand-flash 1s ease-in-out infinite !important;
  filter: drop-shadow(0 0 6px rgba(255,180,80,.8)) !important;
  flex-shrink: 0 !important;
  transform-origin: left center !important;
}

@keyframes hand-flash{
  0%, 100%{
    opacity: 0.3;
    transform: translateX(-3px) scale(1);
  }
  50%{
    opacity: 1;
    transform: translateX(2px) scale(1.15);
  }
}

/* Кнопка */
.gate-btn-cta{
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #5FB3A2, #4A9E8E) !important;
  color: #FFFFFF !important;
  font-family: 'Philosopher', serif !important;
  font-style: italic !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  line-height: 1 !important;
  box-shadow: 0 6px 16px rgba(74,158,142,.30) !important;
  white-space: nowrap !important;
  transition: .2s !important;
}

.gate-btn:hover .gate-btn-cta{
  box-shadow: 0 10px 24px rgba(74,158,142,.55),
              0 0 0 3px rgba(74,158,142,.20) !important;
  transform: translateX(3px) !important;
}

.cta-text{
  display: inline-block !important;
  color: #FFFFFF !important;
}

/* Жирная мигающая стрелка справа от текста, с отступом */
.gate-btn-cta .arr{
  display: inline-block !important;
  font-family: Arial, sans-serif !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  color: #FFFFFF !important;
  margin-left: 8px !important;
  -webkit-text-stroke: 1px #1E3330 !important;
  text-shadow:
    0 0 10px rgba(255,255,255,.9),
    0 0 18px rgba(255,255,255,.6),
    0 2px 4px rgba(0,0,0,.4) !important;
  animation: arrow-pulse 1.2s ease-in-out infinite !important;
  transform-origin: left center !important;
}

@keyframes arrow-pulse{
  0%, 100%{
    transform: translateX(0) scale(1);
    text-shadow:
      0 0 10px rgba(255,255,255,.9),
      0 0 18px rgba(255,255,255,.6),
      0 2px 4px rgba(0,0,0,.4);
  }
  50%{
    transform: translateX(6px) scale(1.25);
    text-shadow:
      0 0 16px rgba(255,255,255,1),
      0 0 32px rgba(255,255,255,.95),
      0 0 48px rgba(255,255,255,.7),
      0 2px 4px rgba(0,0,0,.4);
  }
}

/* Бейдж 18+ */
.gate-btn-badge{
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: #C08878 !important;
  color: #F0F7F4 !important;
  font-family: 'Inter', sans-serif !important;
  font-style: normal !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
}

/* Disabled — без руки */
.gate-btn.disabled .gate-hand{ display: none !important; }
.gate-btn.disabled .gate-btn-cta{
  background: #B8D0C9 !important;
  color: #6A8078 !important;
  box-shadow: none !important;
  transform: none !important;
}
.gate-btn.disabled .gate-btn-cta .arr{
  animation: none !important;
  color: #6A8078 !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}

/* Адаптив */
@media (max-width: 640px){
  .gate-btn{
    padding: 16px !important;
    gap: 12px !important;
  }
  .gate-btn-ico{
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
  }
  .gate-btn-name{ font-size: 17px !important; }
  .gate-btn-desc{ font-size: 13px !important; }
  .gate-hand{ font-size: 19px !important; }
  .gate-btn-cta{
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
  .gate-btn-cta .arr{ font-size: 20px !important; }
}

/* ============================================================
   CTA — ЯВНАЯ РАМКА, ЧТОБЫ БЫЛО ВИДНО, ЧТО ЭТО КНОПКА
   ============================================================ */

.gate-btn-cta{
  /* Рамка вокруг кнопки */
  border: 2px solid #FFFFFF !important;
  outline: 2px solid #357A6E !important;
  outline-offset: 2px !important;

  /* Заливка + градиент */
  background: linear-gradient(135deg, #5FB3A2 0%, #4A9E8E 100%) !important;

  /* Тень — чтобы «отрывалась» от карточки */
  box-shadow:
    0 4px 0 #357A6E,
    0 8px 18px rgba(74,158,142,.45),
    0 0 0 1px rgba(255,255,255,.6) inset !important;

  /* Внутренний отступ побольше */
  padding: 11px 22px !important;

  /* Курсор и позиционирование */
  cursor: pointer !important;
  position: relative !important;
  border-radius: 999px !important;
  transition: all .15s ease !important;
  transform: translateY(0) !important;
}

/* Текст внутри кнопки — белый жирный */
.gate-btn-cta .cta-text{
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  letter-spacing: .03em !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.25) !important;
}

/* Стрелка — тоже с усилением */
.gate-btn-cta .arr{
  color: #FFFFFF !important;
  text-shadow:
    0 0 10px rgba(255,255,255,.9),
    0 0 18px rgba(255,255,255,.6),
    0 1px 2px rgba(0,0,0,.35) !important;
}

/* Hover — «вдавливание» */
.gate-btn:hover .gate-btn-cta{
  transform: translateY(2px) !important;
  box-shadow:
    0 2px 0 #357A6E,
    0 4px 12px rgba(74,158,142,.55),
    0 0 0 1px rgba(255,255,255,.7) inset !important;
  outline-color: #1E3330 !important;
}

/* Клик — совсем вдавить */
.gate-btn-cta:active{
  transform: translateY(4px) !important;
  box-shadow:
    0 0 0 #357A6E,
    0 2px 6px rgba(74,158,142,.5),
    0 0 0 1px rgba(255,255,255,.7) inset !important;
}

/* ============================================================
   HERO КНОПКИ — тоже явная рамка
   ============================================================ */

.hero .btn-primary{
  border: 2px solid #FFFFFF !important;
  outline: 2px solid #6B2434 !important;
  outline-offset: 2px !important;
  box-shadow:
    0 4px 0 #6B2434,
    0 10px 24px rgba(107,36,52,.4) !important;
}

.hero .btn-ghost{
  border: 2px solid #357A6E !important;
  background: rgba(240,247,244,.6) !important;
  color: #1E3330 !important;
  box-shadow:
    0 4px 0 rgba(53,122,110,.35),
    0 8px 18px rgba(53,122,110,.15) !important;
}

.hero .btn-ghost:hover{
  background: rgba(240,247,244,.9) !important;
  border-color: #1E3330 !important;
}

/* ============================================================
   ОБЩИЕ КНОПКИ — .btn в hero/cta
   ============================================================ */

.cta .btn-primary{
  border: 2px solid #FFFFFF !important;
  outline: 2px solid #357A6E !important;
  outline-offset: 2px !important;
  box-shadow:
    0 4px 0 #357A6E,
    0 10px 24px rgba(74,158,142,.4) !important;
}

.cta .btn-ghost{
  border: 2px solid #357A6E !important;
  background: rgba(240,247,244,.5) !important;
  color: #1E3330 !important;
  box-shadow:
    0 4px 0 rgba(53,122,110,.35),
    0 8px 18px rgba(53,122,110,.15) !important;
}

/* Адаптив */
@media (max-width: 640px){
  .gate-btn-cta{
    padding: 10px 18px !important;
    outline-offset: 1px !important;
    border-width: 2px !important;
  }
  .gate-btn-cta .cta-text{
    font-size: 13.5px !important;
  }
}

/* ============================================================
   HERO — одна кнопка «Осмотреть замок»
   ============================================================ */

.hero-btns{
  display: flex !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  margin-bottom: 34px !important;
  /* По умолчанию слева. Если хочешь по центру — раскомментируй: */
  /* justify-content: center !important; */
}

.hero-btns .btn-ghost{
  border: 2px solid #357A6E !important;
  outline: 2px solid rgba(53,122,110,.35) !important;
  outline-offset: 2px !important;
  background: rgba(240,247,244,.7) !important;
  color: #1E3330 !important;
  font-weight: 700 !important;
  padding: 15px 30px !important;
  box-shadow:
    0 4px 0 rgba(53,122,110,.4),
    0 10px 22px rgba(53,122,110,.18) !important;
  transition: all .15s ease !important;
}

.hero-btns .btn-ghost:hover{
  background: rgba(240,247,244,1) !important;
  border-color: #1E3330 !important;
  outline-color: #1E3330 !important;
  transform: translateY(2px) !important;
  box-shadow:
    0 2px 0 rgba(53,122,110,.5),
    0 6px 14px rgba(53,122,110,.25) !important;
}

.hero-btns .btn-ghost:active{
  transform: translateY(4px) !important;
  box-shadow:
    0 0 0 rgba(53,122,110,.4),
    0 2px 8px rgba(53,122,110,.3) !important;
}

/* ============================================================
   МОБИЛЬНАЯ ШАПКА — иконки видны и не сжимаются
   ============================================================ */

@media (max-width: 820px){

  /* Шапка — компактная, но все иконки на месте */
  .header-in{
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 8px 0 !important;
    min-height: 60px !important;
  }

  .logo{
    flex: 0 0 auto !important;
  }
  .logo b{
    font-size: 18px !important;
    letter-spacing: .08em !important;
  }
  .logo span{
    font-size: 7px !important;
    letter-spacing: .22em !important;
  }

  /* Меню — прячем (есть бургер) */
  .nav{
    display: none !important;
  }

  /* Правый блок — все иконки в ряд */
  .header-act{
    display: flex !important;
    gap: 2px !important;
    flex-wrap: nowrap !important;
    margin-left: auto !important;
  }

  /* Иконки — компактные */
  .header-act .icon-btn{
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    display: grid !important;
    place-items: center !important;
  }

  /* Кнопка профиля — компактная */
  .header-act .user-btn{
    padding: 6px 10px !important;
    font-size: 13px !important;
  }

  /* Бургер */
  .header-act .burger{
    display: grid !important;
    place-items: center !important;
    width: 38px !important;
    height: 38px !important;
    font-size: 20px !important;
  }

  /* Кнопка темы — точно видна */
  #themeToggle{
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Скрываем только те иконки, которые реально не помещаются */
  /* Например: adминка, поиск, ачивки, сообщения, избранное */
  /* Раскомментируй, если что-то лишнее: */
  /*
  #adminLink,
  #achBtn,
  #headerMsgBtn{
    display: none !important;
  }
  */
}

/* Очень узкий экран (≤480px) — иконки ещё компактнее */
@media (max-width: 480px){
  .header-in{ gap: 4px !important; }
  .logo b{ font-size: 15px !important; }
  .logo span{ font-size: 6.5px !important; }
  .header-act .icon-btn{
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
  .header-act .user-btn{
    padding: 5px 8px !important;
    font-size: 12px !important;
  }
  .header-act .user-btn .desk{
    display: none !important;
  }
  .header-act .burger{
    width: 34px !important;
    height: 34px !important;
  }
}

/* ============================================================
   МЕССЕНДЖЕР — ПОЛНОЦЕННАЯ СТРАНИЦА
   ============================================================ */
.mess-app{
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 120px);
  min-height: 600px;
  margin: 20px 0;
  border: 1px solid #C8DFD6;
  border-radius: 18px;
  overflow: hidden;
  background: #F0F7F4;
  box-shadow: 0 20px 50px rgba(42,37,32,.08);
}

/* ===== ЛЕВОЕ МЕНЮ ===== */
.mess-side{
  background: #E4F0EC;
  border-right: 1px solid #C8DFD6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mess-side-head{
  padding: 18px 20px 14px;
  border-bottom: 1px solid #C8DFD6;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mess-side-head .ava-mini{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5FB3A2, #357A6E);
  display: grid;
  place-items: center;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  color: #F0F7F4;
  flex-shrink: 0;
  overflow: hidden;
}
.mess-side-head .ava-mini img{ width: 100%; height: 100%; object-fit: cover; }
.mess-side-head .name-mini{
  flex: 1;
  min-width: 0;
}
.mess-side-head .name-mini b{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  color: #1E3330;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mess-side-head .name-mini span{
  display: block;
  font-size: 12px;
  color: #5A7A74;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.mess-side-head .status-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7BC97E;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(123,201,126,.3);
}

/* Поиск в мессенджере */
.mess-search{
  padding: 12px 14px;
  border-bottom: 1px solid #C8DFD6;
}
.mess-search input{
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #C8DFD6;
  border-radius: 10px;
  background: #fff;
  color: #1E3330;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.mess-search input:focus{ border-color: #4A9E8E; }

/* Меню разделов */
.mess-nav{
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.mess-nav::-webkit-scrollbar{ width: 6px }
.mess-nav::-webkit-scrollbar-thumb{ background: #C8DFD6; border-radius: 3px }

.mess-nav-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15px;
  color: #2F4A44;
  cursor: pointer;
  transition: .15s;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.mess-nav-item:hover{
  background: rgba(74,158,142,.10);
  color: #1E3330;
}
.mess-nav-item.is-active{
  background: linear-gradient(135deg, #5FB3A2, #4A9E8E);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(74,158,142,.28);
}
.mess-nav-item .ico{
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.mess-nav-item .cnt{
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 8px;
  background: #C08878;
  color: #fff;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.mess-nav-item.is-active .cnt{
  background: rgba(255,255,255,.3);
}

.mess-nav-sep{
  height: 1px;
  background: #C8DFD6;
  margin: 8px 12px;
}

/* ===== ПРАВАЯ ОБЛАСТЬ ===== */
.mess-main{
  display: flex;
  flex-direction: column;
  background: #F0F7F4;
  overflow: hidden;
}

.mess-main-head{
  padding: 16px 24px;
  border-bottom: 1px solid #C8DFD6;
  background: #E4F0EC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mess-main-head h2{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 700;
  color: #1E3330;
  margin: 0;
}
.mess-main-head p{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #5A7A74;
  margin: 2px 0 0;
}

.mess-content{
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.mess-content::-webkit-scrollbar{ width: 8px }
.mess-content::-webkit-scrollbar-thumb{ background: #C8DFD6; border-radius: 4px }

/* ===== ДИАЛОГИ ===== */

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.mess-empty{
  text-align: center;
  padding: 60px 20px;
  color: #5A7A74;
}
.mess-empty .big-ico{
  font-size: 72px;
  line-height: 1;
  margin-bottom: 20px;
  opacity: .5;
}
.mess-empty b{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 20px;
  color: #1E3330;
  margin-bottom: 10px;
}
.mess-empty p{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 20px;
}

/* ===== КАРТОЧКИ (друзья, сообщества, публикации) ===== */
.mess-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.mess-card{
  padding: 16px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  transition: .2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.mess-card:hover{
  border-color: #4A9E8E;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(74,158,142,.10);
}
.mess-card .mc-ico{
  font-size: 28px;
  margin-bottom: 10px;
}
.mess-card .mc-name{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 16px;
  font-weight: 700;
  color: #1E3330;
  margin-bottom: 4px;
}
.mess-card .mc-desc{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13px;
  color: #5A7A74;
  line-height: 1.45;
}
.mess-card .mc-meta{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #C8DFD6;
}
.mess-card .mc-meta span{
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(74,158,142,.10);
  color: #357A6E;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}

/* ===== СТАТУС ===== */
.status-block{
  padding: 20px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  margin-bottom: 16px;
}
.status-block h3{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 18px;
  color: #1E3330;
  margin: 0 0 14px;
}
.status-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed #C8DFD6;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14.5px;
  color: #2F4A44;
}
.status-row:last-child{ border-bottom: 0 }
.status-row .val{
  color: #357A6E;
  font-weight: 700;
}
.status-badge{
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.status-badge.ok{ background: rgba(107,122,80,.18); color: #4A5E38 }
.status-badge.no{ background: rgba(192,136,120,.15); color: #A05B48 }
.status-badge.wait{ background: rgba(200,155,90,.18); color: #8B6B2A }

/* ===== МОБИЛЬНЫЙ ===== */
@media (max-width: 820px){
  .mess-app{
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    margin: 10px 0;
    border-radius: 14px;
  }
  .mess-side{
    border-right: 0;
    border-bottom: 1px solid #C8DFD6;
    max-height: 260px;
  }
  .mess-nav{
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    flex: 0 0 auto;
  }
  .mess-nav::-webkit-scrollbar{ height: 4px }
  .mess-nav-item{
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13.5px;
    white-space: nowrap;
    margin-bottom: 0;
  }
  .mess-nav-item .ico{ font-size: 15px; }
  .mess-nav-item .cnt{ font-size: 10px; padding: 1px 6px; }
  .mess-nav-sep{ display: none }
  .mess-content{ padding: 16px }
  .mess-grid{ grid-template-columns: 1fr }
}

/* ============================================================
   СТЕНА, ПОСТЫ, КАНАЛЫ
   ============================================================ */

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

.wall-post{
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  padding: 18px 20px;
  transition: .2s;
}
.wall-post:hover{
  border-color: #4A9E8E;
  box-shadow: 0 8px 20px rgba(74,158,142,.08);
}

.wall-head{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.wall-ava{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5FB3A2, #357A6E);
  display: grid;
  place-items: center;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  color: #F0F7F4;
  flex-shrink: 0;
  overflow: hidden;
}
.wall-ava img{ width: 100%; height: 100%; object-fit: cover; }
.wall-meta{
  flex: 1;
  min-width: 0;
}
.wall-meta b{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15px;
  font-weight: 700;
  color: #1E3330;
}
.wall-meta span{
  font-size: 12px;
  color: #7A9690;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.wall-delete{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #C08878;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.wall-post:hover .wall-delete{ opacity: 1; }
.wall-delete:hover{ background: rgba(192,136,120,.1); border-color: rgba(192,136,120,.3); }

.wall-body{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15.5px;
  color: #2F4A44;
  line-height: 1.6;
  margin-bottom: 12px;
  word-wrap: break-word;
}

.wall-attach{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.wall-attach img{
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
}
.wall-attach a{
  padding: 8px 12px;
  background: rgba(74,158,142,.08);
  border-radius: 8px;
  color: #357A6E;
  font-size: 13px;
  text-decoration: none;
}

.wall-actions{
  display: flex;
  gap: 16px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed #C8DFD6;
}
.wall-like{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #C8DFD6;
  background: transparent;
  color: #2F4A44;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}
.wall-like:hover{
  border-color: #C08878;
  background: rgba(192,136,120,.06);
}
.wall-like.liked{
  background: linear-gradient(135deg, #C08878, #A05B48);
  color: #fff;
  border-color: #C08878;
}
.wall-stat{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #7A9690;
}

/* Адаптив */
@media (max-width: 640px){
  .wall-post{ padding: 14px 16px; }
  .wall-body{ font-size: 14.5px; }
  .wall-attach{ grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ============================================================
   ПОСЛЕДНИЕ ПУБЛИКАЦИИ НА ГЛАВНОЙ
   ============================================================ */
.latest-posts-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media(max-width: 820px){
  .latest-posts-grid{ grid-template-columns: 1fr; }
}
.lp-card{
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  padding: 18px;
  transition: .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lp-card:hover{
  border-color: #4A9E8E;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(74,158,142,.12);
}
.lp-head{
  display: flex;
  align-items: center;
  gap: 10px;
}
.lp-ava{
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg,#5FB3A2,#357A6E);
  display: grid; place-items: center;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  color: #F0F7F4;
  flex-shrink: 0;
  overflow: hidden;
}
.lp-ava img{ width: 100%; height: 100%; object-fit: cover; }
.lp-meta{ flex: 1; min-width: 0; }
.lp-meta b{
  display: block;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
  color: #1E3330;
}
.lp-meta span{
  display: block;
  font-size: 11.5px;
  color: #7A9690;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.lp-tag{
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(74,158,142,.10);
  color: #357A6E;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}
.lp-body{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15px;
  color: #2F4A44;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lp-img{
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(74,158,142,.08);
}
.lp-img img{ width: 100%; height: 100%; object-fit: cover; }
.lp-foot{
  display: flex;
  gap: 14px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed #C8DFD6;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 12px;
  color: #7A9690;
}

/* ============================================================
   ЭМОДЗИ-ПАНЕЛЬ И СТИКЕРЫ
   ============================================================ */
.emoji-panel{
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(42,37,32,.15);
  max-height: 340px;
  overflow: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.emoji-panel.is-open{ display: flex; }

.emoji-tabs{
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid #C8DFD6;
  background: #F0F7F4;
  overflow-x: auto;
  flex-shrink: 0;
}
.emoji-tabs::-webkit-scrollbar{ height: 4px }
.emoji-tabs button{
  padding: 8px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  border-radius: 8px;
  transition: .15s;
  flex-shrink: 0;
}
.emoji-tabs button:hover{ background: rgba(74,158,142,.10); }
.emoji-tabs button.is-active{ background: linear-gradient(135deg, #5FB3A2, #4A9E8E); }
.emoji-tabs button.is-active *{ filter: brightness(2); }

.emoji-grid{
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 2px;
}
.emoji-grid::-webkit-scrollbar{ width: 6px }
.emoji-grid::-webkit-scrollbar-thumb{ background: #C8DFD6; border-radius: 3px }

.emoji-btn{
  width: 100%;
  aspect-ratio: 1/1;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  border-radius: 8px;
  transition: transform .15s, background .15s;
  display: grid;
  place-items: center;
}
.emoji-btn:hover{
  background: rgba(74,158,142,.10);
  transform: scale(1.25);
}

/* Анимированные эмодзи — пульсация */
.emoji-btn.animated{
  animation: emoji-pulse 1.2s ease-in-out infinite;
}
@keyframes emoji-pulse{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.12); }
}
.emoji-btn.animated:hover{
  animation: none;
  transform: scale(1.35) rotate(8deg);
}

/* Анимированные эмодзи с эффектами */
.emoji-btn.heart{
  animation: heart-beat 0.8s ease-in-out infinite;
}
@keyframes heart-beat{
  0%, 100%{ transform: scale(1); }
  25%{ transform: scale(1.15); }
  50%{ transform: scale(0.95); }
  75%{ transform: scale(1.12); }
}
.emoji-btn.fire{
  animation: fire-flicker 0.6s ease-in-out infinite alternate;
}
@keyframes fire-flicker{
  from{ transform: scale(1) rotate(-3deg); filter: hue-rotate(0deg); }
  to{ transform: scale(1.15) rotate(3deg); filter: hue-rotate(-10deg); }
}
.emoji-btn.sparkle{
  animation: sparkle 1.5s ease-in-out infinite;
}
@keyframes sparkle{
  0%, 100%{ transform: scale(1) rotate(0deg); opacity: 1; }
  50%{ transform: scale(1.2) rotate(180deg); opacity: .8; }
}
.emoji-btn.moon{
  animation: moon-glow 2s ease-in-out infinite;
}
@keyframes moon-glow{
  0%, 100%{ filter: drop-shadow(0 0 4px #F0D080); }
  50%{ filter: drop-shadow(0 0 12px #F0D080); }
}

/* ============================================================
   СТИКЕРЫ
   ============================================================ */
.sticker-panel{
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(42,37,32,.15);
  max-height: 360px;
  overflow: hidden;
  z-index: 100;
  flex-direction: column;
}
.sticker-panel.is-open{ display: flex; }

.sticker-tabs{
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid #C8DFD6;
  background: #F0F7F4;
  overflow-x: auto;
  flex-shrink: 0;
}
.sticker-tabs::-webkit-scrollbar{ height: 4px }
.sticker-tabs button{
  padding: 8px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  color: #2F4A44;
  border-radius: 8px;
  transition: .15s;
  flex-shrink: 0;
}
.sticker-tabs button:hover{ background: rgba(74,158,142,.10); }
.sticker-tabs button.is-active{ background: linear-gradient(135deg, #5FB3A2, #4A9E8E); color: #fff; }

.sticker-grid{
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.sticker-grid::-webkit-scrollbar{ width: 6px }
.sticker-grid::-webkit-scrollbar-thumb{ background: #C8DFD6; border-radius: 3px }

.sticker-btn{
  aspect-ratio: 1/1;
  border: 1px solid #C8DFD6;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  padding: 8px;
  transition: .2s;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.sticker-btn:hover{
  border-color: #4A9E8E;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 24px rgba(74,158,142,.15);
}
.sticker-btn svg{
  width: 100%;
  height: 100%;
}

/* Анимированные стикеры */
.sticker-btn.anim-1 svg .eye{ animation: blink 3s ease-in-out infinite; }
@keyframes blink{
  0%, 90%, 100%{ transform: scaleY(1); }
  95%{ transform: scaleY(0.1); }
}
.sticker-btn.anim-2 svg .mouth{ animation: smile 2s ease-in-out infinite; }
@keyframes smile{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.15); }
}
.sticker-btn.anim-3 svg{ animation: shake 1.5s ease-in-out infinite; }
@keyframes shake{
  0%, 100%{ transform: rotate(-3deg); }
  50%{ transform: rotate(3deg); }
}
.sticker-btn.anim-4 svg{ animation: bounce-sticker 1s ease-in-out infinite; }
@keyframes bounce-sticker{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}

/* Меню вложений (плюс) */
.attach-menu{
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #C8DFD6;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(42,37,32,.15);
  padding: 8px;
  min-width: 220px;
  z-index: 100;
}
.attach-menu.is-open{ display: block; }
.attach-menu button{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 15px;
  color: #2F4A44;
  text-align: left;
  transition: .15s;
}
.attach-menu button:hover{ background: rgba(74,158,142,.10); }
.attach-menu button .ico{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(135deg, #5FB3A2, #4A9E8E);
  color: #fff;
  flex-shrink: 0;
}

/* ============================================================
   ЗВОНКИ (audio/video)
   ============================================================ */
.call-modal{
  position: fixed;
  inset: 0;
  z-index: 300;
  background: linear-gradient(135deg, #1A2F2C, #0F1F1D);
  display: none;
  flex-direction: column;
  color: #F0F7F4;
}
.call-modal.is-open{ display: flex; }

.call-header{
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,.2);
}
.call-header b{
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 20px;
  color: #F0F7F4;
}
.call-header span{ color: #B8D0C9; font-size: 14px; }

.call-stage{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px;
}
.call-avatar{
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5FB3A2, #357A6E);
  display: grid;
  place-items: center;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 80px;
  color: #F0F7F4;
  box-shadow: 0 0 80px rgba(95,179,162,.4);
  animation: call-pulse 2s ease-in-out infinite;
}
@keyframes call-pulse{
  0%, 100%{ box-shadow: 0 0 80px rgba(95,179,162,.4); }
  50%{ box-shadow: 0 0 120px rgba(95,179,162,.7); }
}

.call-video-remote{
  width: 100%;
  height: 100%;
  max-width: 800px;
  aspect-ratio: 16/10;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.call-video-remote video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-video-local{
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 160px;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 2px solid #5FB3A2;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.call-video-local video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.call-actions{
  padding: 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,.3);
}
.call-btn{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 26px;
  display: grid;
  place-items: center;
  transition: .2s;
  background: rgba(255,255,255,.15);
  color: #F0F7F4;
}
.call-btn:hover{ background: rgba(255,255,255,.25); transform: scale(1.06); }
.call-btn.danger{ background: #C08878; }
.call-btn.danger:hover{ background: #A05B48; }
.call-btn.active{ background: #7BC97E; color: #1A2F2C; }
.call-btn.small{
  width: 52px;
  height: 52px;
  font-size: 20px;
}

/* ============================================================
   КРУЖКИ (видео-сообщения)
   ============================================================ */
.circle-record{
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(15,31,29,.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #F0F7F4;
}
.circle-record.is-open{ display: flex; }

.circle-preview{
  width: min(340px, 80vw);
  aspect-ratio: 1/1;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  position: relative;
  border: 4px solid #C08878;
  box-shadow: 0 0 60px rgba(192,136,120,.5);
  animation: circle-pulse 1.5s ease-in-out infinite;
}
@keyframes circle-pulse{
  0%, 100%{ border-color: #C08878; box-shadow: 0 0 60px rgba(192,136,120,.5); }
  50%{ border-color: #E8B888; box-shadow: 0 0 100px rgba(232,184,136,.7); }
}
.circle-preview video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.circle-timer{
  margin-top: 24px;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 28px;
  font-weight: 700;
  color: #F0F7F4;
}
.circle-hint{
  margin-top: 12px;
  font-size: 14px;
  color: #B8D0C9;
  font-family: 'Philosopher', serif;
  font-style: italic;
}
.circle-actions{
  margin-top: 32px;
  display: flex;
  gap: 16px;
}

/* Кружок в ленте сообщений */
.msg.circle{
  padding: 4px;
  background: transparent !important;
  border: 0 !important;
  max-width: 260px;
}
.msg.circle video{
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #4A9E8E;
  display: block;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(74,158,142,.3);
  transition: .2s;
}
.msg.circle video:hover{
  border-color: #7FB89C;
  transform: scale(1.03);
}
.msg.circle .circle-progress{
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #7FB89C;
  animation: spin 1.5s linear infinite;
  pointer-events: none;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Мини-плеер кружка */
.circle-viewer{
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(15,31,29,.95);
  display: none;
  align-items: center;
  justify-content: center;
}
.circle-viewer.is-open{ display: flex; }
.circle-viewer video{
  width: min(400px, 80vw);
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #7FB89C;
}
.circle-viewer .close{
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 0;
  font-size: 20px;
  cursor: pointer;
}

/* Индикатор звонка входящего */
.incoming-call{
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  background: linear-gradient(135deg, #4A9E8E, #357A6E);
  color: #fff;
  padding: 16px 24px;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(74,158,142,.5);
  display: none;
  align-items: center;
  gap: 16px;
  animation: incoming-slide 0.4s ease-out;
}
@keyframes incoming-slide{
  from{ transform: translate(-50%, -120%); }
  to{ transform: translate(-50%, 0); }
}
.incoming-call.is-open{ display: flex; }
.incoming-call .ava{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-family: 'Philosopher', serif;
}
.incoming-call .info{ flex: 1; }
.incoming-call .info b{ display: block; font-size: 15px; }
.incoming-call .info span{ font-size: 12.5px; opacity: .85; }
.incoming-call button{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  color: #fff;
}
.incoming-call .accept{ background: #7BC97E; color: #1A2F2C; }
.incoming-call .decline{ background: #C08878; }

/* Кнопки звонков в чате */
.chat-actions{
  display: flex;
  gap: 4px;
}
.chat-actions button{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #C8DFD6;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #2F4A44;
  transition: .15s;
}
.chat-actions button:hover{
  border-color: #4A9E8E;
  background: rgba(74,158,142,.08);
  color: #357A6E;
}

/* ============================================================
   ФИКС: ЭМОДЗИ-ПАНЕЛИ И ПОДЛОЖКА ПОД НИХ
   ============================================================ */

/* Форма чата — всегда relative, чтобы панели позиционировались от неё */
.mess-input,
#chatForm{
  position: relative !important;
}

/* Перебиваем старые правила */
.emoji-panel,
.sticker-panel,
.attach-menu{
  display: none !important;
  position: absolute !important;
  bottom: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  margin-bottom: 0 !important;
  background: #fff !important;
  border: 1px solid #C8DFD6 !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 50px rgba(42,37,32,.18) !important;
  z-index: 200 !important;
  overflow: hidden !important;
}
.emoji-panel{
  flex-direction: column !important;
  max-height: 340px !important;
}
.sticker-panel{
  flex-direction: column !important;
  max-height: 380px !important;
}
.attach-menu{
  left: 0 !important;
  right: auto !important;
  min-width: 240px !important;
  padding: 8px !important;
}

/* Класс .is-open — открывает */
.emoji-panel.is-open,
.sticker-panel.is-open,
.attach-menu.is-open{
  display: flex !important;
}
.attach-menu.is-open{
  display: block !important;
}

/* Табы */
.emoji-tabs,
.sticker-tabs{
  display: flex !important;
  gap: 2px !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #C8DFD6 !important;
  background: #F0F7F4 !important;
  overflow-x: auto !important;
  flex-shrink: 0 !important;
}
.emoji-tabs button,
.sticker-tabs button{
  cursor: pointer !important;
}
.emoji-tabs button.is-active{
  background: linear-gradient(135deg, #5FB3A2, #4A9E8E) !important;
}
.sticker-tabs button.is-active{
  background: linear-gradient(135deg, #5FB3A2, #4A9E8E) !important;
  color: #fff !important;
}

/* Гриды */
.emoji-grid{
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)) !important;
  gap: 2px !important;
  padding: 10px !important;
  overflow-y: auto !important;
  max-height: 280px !important;
}
.sticker-grid{
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
  gap: 8px !important;
  padding: 10px !important;
  overflow-y: auto !important;
  max-height: 320px !important;
}

/* Кнопки — базовое */
.emoji-btn{
  width: 100% !important;
  aspect-ratio: 1/1 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  font-size: 24px !important;
  border-radius: 8px !important;
  display: grid !important;
  place-items: center !important;
  transition: transform .15s, background .15s !important;
}
.emoji-btn:hover{
  background: rgba(74,158,142,.10) !important;
  transform: scale(1.25) !important;
}
.sticker-btn{
  aspect-ratio: 1/1 !important;
  border: 1px solid #C8DFD6 !important;
  background: #fff !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  padding: 8px !important;
  display: grid !important;
  place-items: center !important;
  transition: .2s !important;
}
.sticker-btn:hover{
  border-color: #4A9E8E !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 10px 24px rgba(74,158,142,.15) !important;
}
.sticker-btn svg{
  width: 100% !important;
  height: 100% !important;
}

/* Меню вложений */
.attach-menu button{
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  border-radius: 10px !important;
  font-family: 'Philosopher', serif !important;
  font-style: italic !important;
  font-size: 15px !important;
  color: #2F4A44 !important;
  text-align: left !important;
}
.attach-menu button:hover{ background: rgba(74,158,142,.10) !important; }

/* Мини-рейтинг рядом с именем мастера */
.mini-rating{
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  font-size: 12px;
  color: #F5C842;
  font-family: Inter, sans-serif;
  font-style: normal;
}
.mini-rating b{ color: #5A7A74; font-weight: 600; font-size: 11.5px; margin-left: 3px; }

/* ============================================================
   ОТВЕТ НА СООБЩЕНИЕ (reply)
   ============================================================ */
.msg-reply-quote{
  padding: 6px 10px;
  margin-bottom: 6px;
  border-left: 3px solid #4A9E8E;
  background: rgba(74,158,142,.08);
  border-radius: 6px;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.4;
  color: #2F4A44;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.msg-reply-quote b{
  color: #357A6E;
  margin-right: 4px;
  font-weight: 700;
}

.msg-reply-bar{
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(74,158,142,.10);
  border-top: 1px solid #C8DFD6;
  font-family: 'Philosopher', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #2F4A44;
}
.msg-reply-bar.is-open{ display: flex; }
.msg-reply-bar .reply-icon{
  color: #357A6E;
  font-size: 16px;
  flex-shrink: 0;
}
.msg-reply-bar .reply-text{
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-reply-bar .reply-text b{ color: #357A6E; }
.msg-reply-bar .reply-close{
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(192,136,120,.15);
  color: #C08878;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.msg-reply-bar .reply-close:hover{ background: #C08878; color: #fff; }

/* Кнопка ответа на сообщении */
.msg-action-btn{
  position: absolute;
  top: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #C8DFD6;
  background: #fff;
  color: #5A7A74;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: .18s;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(42,37,32,.08);
}
.msg:hover .msg-action-btn{ opacity: 1; }
.msg.me .msg-action-btn{ left: -42px; }
.msg.peer .msg-action-btn{ right: -42px; }
.msg-action-btn:hover{
  background: #4A9E8E;
  color: #fff;
  border-color: #4A9E8E;
}
.msg-highlight{
  animation: msg-flash 1.2s ease-in-out;
}
@keyframes msg-flash{
  0%, 100%{ background-color: transparent; }
  50%{ background-color: rgba(74,158,142,.15); }
}

/* Отступ снизу под reply bar */
.mess-input{ padding-top: 0; }

/* ============================================================
   МЕССЕНДЖЕР ART — чистовая вёрстка (адаптив + Telegram-стиль)
   ============================================================ */

/* --- Страница messenger.html --- */
.mess-page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 90px;
  box-sizing: border-box;
}

.mess-app {
  display: flex;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.mess-side {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #E8DFD0;
  box-sizing: border-box;
}

.mess-main {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #E8DFD0;
  position: relative;
  box-sizing: border-box;
}

/* --- Шапка --- */
.mess-head-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mess-head-top h2 {
  font-family: 'Philosopher', serif;
  font-size: 26px;
  color: #2F4F48;
  margin: 0;
  line-height: 1.2;
}
.mess-head-top p {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #5A7A74;
  margin: 4px 0 0;
}
.mess-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.mess-head-actions .icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #E8DFD0;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.mess-head-actions .icon-btn:hover {
  border-color: #4A9E8E;
  background: rgba(74,158,142,.06);
}

/* --- Табы --- */
.mess-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mess-tabs::-webkit-scrollbar { display: none; }
.mess-tab {
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid #E8DFD0;
  background: #fff;
  color: #4A6B65;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.mess-tab:hover { border-color: #4A9E8E; color: #357A6E; }
.mess-tab.is-active {
  background: #4A9E8E;
  color: #fff;
  border-color: #4A9E8E;
  font-weight: 600;
}

/* --- Список диалогов --- */
.dlg-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dlg-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.dlg-item:hover { background: rgba(74,158,142,.05); }
.dlg-item.unread { background: rgba(200,155,90,.04); }

.dlg-ava {
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #C8DFD6, #A8C8BC);
  color: #2F4F48;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
  font-family: 'Philosopher', serif;
}
.dlg-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-ava .online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #4CAF50;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(76,175,80,.35);
}

.dlg-body { flex: 1; min-width: 0; }
.dlg-line1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.dlg-name {
  font-family: 'Philosopher', serif;
  font-size: 16px;
  color: #2F4F48;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dlg-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #8AA39C;
  white-space: nowrap;
  flex-shrink: 0;
}
.dlg-check {
  font-size: 14px;
  color: #8AA39C;
  font-weight: 600;
  letter-spacing: -2px;
}
.dlg-check.read { color: #4A9E8E; }

.dlg-line2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dlg-preview {
  font-size: 14px;
  color: #5A7A74;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.dlg-badge {
  background: #4A9E8E;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 11px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Плавающая кнопка --- */
.mess-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  background: #4A9E8E;
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(74,158,142,.45), 0 2px 6px rgba(0,0,0,.12);
  transition: transform .15s, box-shadow .15s;
  z-index: 90;
}
.mess-fab:hover { transform: scale(1.06); }
.mess-fab:active { transform: scale(.96); }

/* --- Нижнее меню для мобильных --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: none;
  background: #fff;
  border-top: 1px solid #E8DFD0;
  z-index: 100;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.04);
}
.mobile-bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  text-decoration: none;
  color: #5A7A74;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}
.mobile-bottom-nav a .ico { font-size: 22px; line-height: 1; }
.mobile-bottom-nav a.is-active { color: #4A9E8E; font-weight: 600; }

/* ============================================================
   chat.html — страница одного диалога
   ============================================================ */
.chat-page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 20px 20px;
  box-sizing: border-box;
}
.chat-page-app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 420px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E8DFD0;
  overflow: hidden;
  box-sizing: border-box;
}
.chat-page-app .mess-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
}
.chat-page-app .mess-main-head {
  padding: 14px 18px;
  border-bottom: 1px solid #E8DFD0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: #fff;
}
.chat-page-app .mess-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  background: #F0F7F4;
  min-height: 0;
}
.chat-page-app .mess-input {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid #E8DFD0;
  background: #fff;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */
@media(max-width: 768px){
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
  }

  .mess-page-wrap {
    padding: 10px 10px 90px;
    max-width: 100%;
  }
  .mess-app { display: block; gap: 0; }
  .mess-side { display: none !important; }

  .mess-main {
    border-radius: 12px;
    border: 1px solid #E8DFD0;
    padding: 14px 12px 16px;
    width: 100%;
  }

  .mess-head-top {
    gap: 8px;
    margin-bottom: 10px;
  }
  .mess-head-top h2 { font-size: 20px; }
  .mess-head-top p { font-size: 12px; }
  .mess-head-actions { gap: 6px; }
  .mess-head-actions .icon-btn { width: 38px; height: 38px; font-size: 16px; }

  .mess-tabs {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    margin-bottom: 10px;
  }
  .mess-tab { padding: 7px 14px; font-size: 13px; }

  .dlg-item { padding: 10px 8px; gap: 10px; border-radius: 10px; }
  .dlg-ava { width: 48px; height: 48px; font-size: 19px; }
  .dlg-name { font-size: 15px; }
  .dlg-preview { font-size: 13px; }
  .dlg-time { font-size: 11.5px; }
  .dlg-check { font-size: 13px; }
  .dlg-badge { font-size: 10.5px; padding: 2px 7px; min-width: 18px; }

  .mess-fab {
    bottom: 84px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  .mobile-bottom-nav { display: flex; }

  /* chat.html на мобильном */
  .chat-page-wrap {
    padding: 8px 8px 82px;
  }
  .chat-page-app {
    height: calc(100dvh - 130px);
    min-height: 400px;
    border-radius: 12px;
  }
  .chat-page-app .mess-main-head {
    padding: 10px 12px;
  }
  .chat-page-app .mess-body {
    padding: 12px;
  }
  .chat-page-app .mess-input {
    padding: 8px 10px;
  }
}

@media(max-width: 480px){
  .mess-head-actions .icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .dlg-ava { width: 44px; height: 44px; font-size: 18px; }
}

/* --- Тёмная тема --- */
html.dark .mess-side,
html.dark .mess-main,
html.dark .chat-page-app { background: #1E2A27; border-color: #2F4A44; }
html.dark .mess-head-top h2 { color: #E8DFD0; }
html.dark .mess-head-top p { color: #A8BCB6; }
html.dark .mess-head-actions .icon-btn { background: #1E2A27; border-color: #2F4A44; color: #E8DFD0; }
html.dark .mess-tab { background: #1E2A27; border-color: #2F4A44; color: #B8D0C9; }
html.dark .mess-tab.is-active { background: #4A9E8E; border-color: #4A9E8E; color: #fff; }
html.dark .dlg-name { color: #E8DFD0; }
html.dark .dlg-preview { color: #A8BCB6; }
html.dark .dlg-item:hover { background: rgba(74,158,142,.1); }
html.dark .dlg-time { color: #7A9490; }
html.dark .dlg-check { color: #7A9490; }
html.dark .dlg-check.read { color: #6AB8A8; }
html.dark .mobile-bottom-nav { background: #1E2A27; border-top-color: #2F4A44; }
html.dark .mobile-bottom-nav a { color: #A8BCB6; }
html.dark .mobile-bottom-nav a.is-active { color: #6AB8A8; }
html.dark .chat-page-app .mess-main-head { background: #1E2A27; border-bottom-color: #2F4A44; }
html.dark .chat-page-app .mess-body { background: #16211E; }
html.dark .chat-page-app .mess-input { background: #1E2A27; border-top-color: #2F4A44; }

/* ====== Модалка поиска пользователей ====== */
.usr-search-ov {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.usr-search-ov.is-open { display: flex; }

.usr-search-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  margin-top: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  animation: usrSearchIn .2s ease-out;
}
@keyframes usrSearchIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.usr-search-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #E8DFD0;
}
.usr-search-head input {
  flex: 1;
  border: 0;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  background: transparent;
  outline: none;
  color: #2F4F48;
  padding: 8px 0;
}
.usr-search-head input::placeholder { color: #A8BCB6; }
.usr-search-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #E8DFD0;
  background: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 16px;
  color: #5A7A74;
  flex-shrink: 0;
}
.usr-search-close:hover { border-color: #4A9E8E; color: #357A6E; }

.usr-search-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}
.usr-search-body::-webkit-scrollbar { width: 6px; }
.usr-search-body::-webkit-scrollbar-thumb { background: #C8DFD6; border-radius: 3px; }

.usr-search-empty {
  padding: 40px 20px;
  text-align: center;
  color: #8AA39C;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.usr-search-empty .ico {
  display: block;
  font-size: 42px;
  margin-bottom: 8px;
  opacity: .5;
}

/* Карточка пользователя */
.usr-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background .12s;
}
.usr-card:hover { background: rgba(74,158,142,.06); }

.usr-card-ava {
  width: 48px; height: 48px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #C8DFD6, #A8C8BC);
  color: #2F4F48;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
  font-family: 'Philosopher', serif;
}
.usr-card-ava img { width: 100%; height: 100%; object-fit: cover; }
.usr-card-ava .online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4CAF50;
  border: 2px solid #fff;
}

.usr-card-info { flex: 1; min-width: 0; }
.usr-card-name {
  font-family: 'Philosopher', serif;
  font-size: 15.5px;
  font-weight: 600;
  color: #2F4F48;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.usr-card-nick {
  font-size: 13px;
  color: #5A7A74;
  margin-top: 2px;
  font-family: 'Inter', sans-serif;
}
.usr-card-status {
  font-size: 12px;
  color: #4A9E8E;
  font-family: 'Inter', sans-serif;
  margin-top: 2px;
}
.usr-card-status.off { color: #8AA39C; }

.usr-card-go {
  font-size: 18px;
  color: #C8DFD6;
  flex-shrink: 0;
}

/* Тёмная тема */
html.dark .usr-search-modal { background: #1E2A27; }
html.dark .usr-search-head { border-bottom-color: #2F4A44; }
html.dark .usr-search-head input { color: #E8DFD0; }
html.dark .usr-search-close { background: #1E2A27; border-color: #2F4A44; color: #A8BCB6; }
html.dark .usr-card-name { color: #E8DFD0; }
html.dark .usr-card-nick { color: #A8BCB6; }
html.dark .usr-card:hover { background: rgba(74,158,142,.1); }
html.dark .usr-card-ava .online-dot { border-color: #1E2A27; }

/* ====== Мета-строка сообщения: [галочка] [время] внизу справа ====== */
.msg { display: flex; flex-direction: column; gap: 0; }
.msg .msg-body { word-wrap: break-word; }

.msg .msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  line-height: 1;
  min-height: 12px;
}

.msg .msg-time {
  font-size: 10.5px;
  opacity: .7;
  margin: 0;
  padding: 0;
  text-align: right;
  font-family: 'Inter', sans-serif;
}

/* Галочки — маленькие, компактные */
.msg .msg-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 14px;
  height: 10px;
  flex-shrink: 0;
}
.msg .msg-status .tick {
  display: block;
  width: 13px;
  height: 9px;
}
.msg .msg-status .tick svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

/* Отправлено — одна галочка */
.msg .msg-status.sent .tick svg { opacity: .55; }

/* Доставлено — двойная галочка через ::before + SVG */
.msg .msg-status.delivered {
  width: 18px;
  position: relative;
}
.msg .msg-status.delivered .tick {
  width: 13px;
  margin-right: 5px;
}
.msg .msg-status.delivered .tick svg { opacity: .85; }
.msg .msg-status.delivered::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  width: 13px;
  height: 9px;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 12 11' fill='%238AA39C' xmlns='http://www.w3.org/2000/svg'><path d='M11.07 1.19a.75.75 0 0 1 1.06 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0L1.7 5.38a.75.75 0 0 1 1.06-1.06l2.59 2.59 5.72-5.72Z'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: .85;
}

/* Прочитано — маленький кружок */
.msg .msg-status .dot-read {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4A9E8E;
  box-shadow: 0 0 0 1px rgba(74, 158, 142, 0.3);
}
.msg .msg-status.read { width: 10px; }

/* Мои сообщения — белые */
.msg.me .msg-status.sent .tick svg { color: #FAF6F0; opacity: .55; }
.msg.me .msg-status.delivered .tick svg { color: #FAF6F0; opacity: .85; }
.msg.me .msg-status.delivered::after {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 12 11' fill='%23FAF6F0' xmlns='http://www.w3.org/2000/svg'><path d='M11.07 1.19a.75.75 0 0 1 1.06 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0L1.7 5.38a.75.75 0 0 1 1.06-1.06l2.59 2.59 5.72-5.72Z'/></svg>");
  opacity: .85;
}
.msg.me .msg-status .dot-read {
  background: #FAF6F0;
  box-shadow: 0 0 0 1px rgba(250, 246, 240, 0.35);
}

/* Тёмная тема */
html.dark .msg .msg-status.delivered::after {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 12 11' fill='%237A9490' xmlns='http://www.w3.org/2000/svg'><path d='M11.07 1.19a.75.75 0 0 1 1.06 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0L1.7 5.38a.75.75 0 0 1 1.06-1.06l2.59 2.59 5.72-5.72Z'/></svg>");
}

/* ====== Кнопка «вверх» ====== */
.chat-scroll-top {
  position: absolute;
  top: 78px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #E8DFD0;
  background: #fff;
  color: #4A9E8E;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  z-index: 20;
  font-size: 20px;
  font-weight: 700;
}
.chat-scroll-top.on { display: flex; }
.chat-scroll-top:hover { background: #F0F7F4; }
html.dark .chat-scroll-top {
  background: #1E2A27;
  border-color: #2F4A44;
  color: #6AB8A8;
}

/* ====== Свайп-ответ ====== */
.msg {
  position: relative;
  transition: transform .18s ease-out;
  touch-action: pan-y;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.msg.swiping {
  transition: none;
}

/* Индикатор ответа справа (для свайпа вправо) */
.msg-reply-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) scale(.6);
  opacity: 0;
  font-size: 24px;
  color: #4A9E8E;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 2;
}
.msg.swiping.swipe-right .msg-reply-hint {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Индикатор ответа слева (для свайпа влево) */
.msg-reply-hint-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%) scale(.6);
  opacity: 0;
  font-size: 24px;
  color: #4A9E8E;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 2;
}
.msg.swiping.swipe-left .msg-reply-hint-left {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Когда сдвинули — подсветка фона */
.msg.swiping {
  background: rgba(74,158,142,.05);
}

/* === Превью ответа в форме ввода === */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(74,158,142,.08);
  border-left: 3px solid #4A9E8E;
  border-radius: 8px;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #2F4F48;
  animation: replyIn .2s ease-out;
}
@keyframes replyIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reply-preview-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.reply-preview-body b {
  color: #4A9E8E;
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
  font-family: 'Philosopher', serif;
}
.reply-preview-body span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #5A7A74;
}
.reply-preview-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(192,136,120,.15);
  color: #C08878;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.reply-preview-close:hover {
  background: rgba(192,136,120,.3);
}

/* Тёмная тема */
html.dark .reply-preview {
  background: rgba(74,158,142,.15);
  color: #E8DFD0;
}
html.dark .reply-preview-body span { color: #A8BCB6; }

/* ====== Контекстное меню сообщения ====== */
.msg-ctx-menu {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
  padding: 6px;
  z-index: 350;
  min-width: 200px;
  animation: ctxIn .15s ease-out;
}
@keyframes ctxIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: #2F4F48;
  cursor: pointer;
  transition: background .12s;
}
.msg-ctx-menu button:hover { background: rgba(74,158,142,.08); }
.msg-ctx-menu button .ico { font-size: 17px; width: 20px; text-align: center; }
.msg-ctx-menu button.danger { color: #C08878; }
.msg-ctx-menu button.danger:hover { background: rgba(192,136,120,.1); }
.msg-ctx-menu hr { border: 0; border-top: 1px solid #E8DFD0; margin: 4px 8px; }

html.dark .msg-ctx-menu { background: #1E2A27; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
html.dark .msg-ctx-menu button { color: #E8DFD0; }
html.dark .msg-ctx-menu button:hover { background: rgba(74,158,142,.15); }
html.dark .msg-ctx-menu hr { border-top-color: #2F4A44; }

/* Индикатор "изменено" */
.msg-edited {
  font-size: 10px;
  opacity: .6;
  margin-left: 4px;
  font-style: italic;
}

/* ====== Гарантированное отображение превью ответа ====== */
#chatForm {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}

#chatForm .reply-preview {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  box-sizing: border-box;
  order: -1;  /* всегда первым */
  flex-shrink: 0;
}

/* Прячем пустые контейнеры, чтобы не занимали место */
#chatForm .mess-upload-preview:empty {
  display: none !important;
}

/* ====== Модалка настроек ====== */
.settings-ov {
  position: fixed; inset: 0;
  background: rgba(20,30,28,.55);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.settings-ov.is-open { display: flex; }

.settings-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%; max-width: 520px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  animation: settingsIn .2s ease-out;
}
@keyframes settingsIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.settings-head {
  padding: 16px 20px;
  border-bottom: 1px solid #E8DFD0;
  display: flex; justify-content: space-between; align-items: center;
}
.settings-head h3 {
  font-family: 'Philosopher', serif;
  font-size: 22px; color: #2F4F48; margin: 0;
}
.settings-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #E8DFD0; background: transparent;
  cursor: pointer; display: grid; place-items: center;
  font-size: 16px; color: #5A7A74;
}
.settings-close:hover { border-color: #4A9E8E; color: #357A6E; }

.settings-tabs {
  display: flex; gap: 6px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid #E8DFD0;
  overflow-x: auto;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid #E8DFD0; background: transparent;
  color: #4A6B65; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.settings-tab.is-active {
  background: #4A9E8E; color: #fff; border-color: #4A9E8E;
}

.settings-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px 20px;
}
.settings-pane { display: none; }
.settings-pane.is-active { display: block; }

.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 0;
  border-bottom: 1px solid #F0EFE9;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row label {
  font-family: 'Inter', sans-serif;
  font-size: 14px; color: #2F4F48;
}
.settings-row select {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid #E8DFD0; background: #fff;
  font-family: 'Inter', sans-serif; font-size: 13px;
  color: #2F4F48; min-width: 170px;
  cursor: pointer;
}

/* Свотчи фона */
.bg-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.bg-swatch {
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer; padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .15s;
}
.bg-swatch:hover { transform: scale(1.08); }
.bg-swatch.is-active { border-color: #4A9E8E; }

/* Переключатель */
.switch {
  position: relative; display: inline-block;
  width: 46px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #C8DFD6; border-radius: 26px;
  cursor: pointer; transition: .2s;
}
.slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .slider { background: #4A9E8E; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Чёрный список */
.bl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #F0EFE9;
}
.bl-item:last-child { border-bottom: 0; }
.bl-ava {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg,#C8DFD6,#A8C8BC);
  display: grid; place-items: center;
  font-family: 'Philosopher', serif;
  font-size: 18px; color: #2F4F48;
  flex-shrink: 0;
}
.bl-body { flex: 1; min-width: 0; }
.bl-name { font-size: 14.5px; color: #2F4F48; font-weight: 600; font-family: 'Philosopher', serif; }
.bl-nick { font-size: 12px; color: #8AA39C; }
.bl-unblock {
  padding: 6px 14px; border-radius: 8px;
  background: transparent; border: 1px solid #C08878;
  color: #C08878; cursor: pointer; font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.bl-unblock:hover { background: rgba(192,136,120,.1); }

/* Тёмная тема */
html.dark .settings-modal { background: #1E2A27; }
html.dark .settings-head, html.dark .settings-tabs { border-color: #2F4A44; }
html.dark .settings-head h3 { color: #E8DFD0; }
html.dark .settings-close { background: #1E2A27; border-color: #2F4A44; color: #A8BCB6; }
html.dark .settings-tab { background: #1E2A27; border-color: #2F4A44; color: #B8D0C9; }
html.dark .settings-tab.is-active { background: #4A9E8E; color: #fff; }
html.dark .settings-row label { color: #E8DFD0; }
html.dark .settings-row select { background: #1E2A27; color: #E8DFD0; border-color: #2F4A44; }
html.dark .settings-row { border-color: #2F4A44; }
html.dark .bl-item { border-color: #2F4A44; }
html.dark .bl-name { color: #E8DFD0; }

/* Фоны чата — применяются к #chatBody */
.chatBody-default { background: #F0F7F4 !important; }
.chatBody-dark    { background: linear-gradient(135deg,#1E2A27,#0F1614) !important; }
.chatBody-warm    { background: linear-gradient(135deg,#FDF6E3,#F5E6C8) !important; }
.chatBody-blue    { background: linear-gradient(135deg,#E3F2FD,#BBDEFB) !important; }
.chatBody-pink    { background: linear-gradient(135deg,#FCE4EC,#F8BBD0) !important; }

/* ====== Панель быстрых реакций ====== */
.msg-ctx-reacts {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid #E8DFD0;
  margin-bottom: 4px;
}
.msg-ctx-reacts button {
  width: 38px; height: 38px;
  border: 0; background: transparent;
  font-size: 22px; border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, background .12s;
  display: grid; place-items: center;
}
.msg-ctx-reacts button:hover {
  background: rgba(74,158,142,.1);
  transform: scale(1.15);
}

/* Чипы реакций под сообщением */
.msg-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.react-chip {
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(200,155,90,.2);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Inter', sans-serif;
  transition: all .12s;
}
.react-chip:hover { transform: scale(1.08); }
.react-chip b {
  font-weight: 600;
  font-size: 11px;
  color: #5A7A74;
}
.react-chip.mine {
  background: rgba(74,158,142,.25);
  border-color: rgba(74,158,142,.6);
}
.react-chip.mine b { color: #2F4F48; }

/* На тёмных "моих" сообщениях */
.msg.me .react-chip {
  background: rgba(250,246,240,.2);
}
.msg.me .react-chip.mine {
  background: rgba(250,246,240,.35);
  border-color: rgba(250,246,240,.6);
}
.msg.me .react-chip b { color: #FAF6F0; }

html.dark .msg-ctx-reacts { border-bottom-color: #2F4A44; }
html.dark .msg-ctx-reacts button:hover { background: rgba(74,158,142,.2); }

/* ====== Панель быстрых реакций ====== */
.msg-ctx-reacts {
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid #E8DFD0;
  margin-bottom: 4px;
}
.msg-ctx-reacts button {
  width: 38px; height: 38px;
  border: 0; background: transparent;
  font-size: 22px; border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, background .12s;
  display: grid; place-items: center;
  line-height: 1;
}
.msg-ctx-reacts button:hover {
  background: rgba(74,158,142,.12);
  transform: scale(1.18);
}

/* Чипы реакций под сообщением */
.msg-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.react-chip {
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(200,155,90,.2);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Inter', sans-serif;
  transition: all .12s;
  line-height: 1.3;
}
.react-chip:hover { transform: scale(1.08); }
.react-chip b {
  font-weight: 600;
  font-size: 11px;
  color: #5A7A74;
}
.react-chip.mine {
  background: rgba(74,158,142,.25);
  border-color: rgba(74,158,142,.6);
}
.react-chip.mine b { color: #2F4F48; }

.msg.me .react-chip { background: rgba(250,246,240,.2); }
.msg.me .react-chip.mine {
  background: rgba(250,246,240,.4);
  border-color: rgba(250,246,240,.7);
}
.msg.me .react-chip b { color: #FAF6F0; }

html.dark .msg-ctx-reacts { border-bottom-color: #2F4A44; }
html.dark .msg-ctx-reacts button:hover { background: rgba(74,158,142,.2); }

/* ====== Меню диалога (long-tap) ====== */
.dlg-item {
  position: relative;
  touch-action: pan-y;
  transition: transform .15s ease-out, background .15s;
  will-change: transform;
}
.dlg-item.dlg-swiping {
  transition: none;
  background: rgba(74,158,142,.08);
}

.dlg-ctx-menu {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
  padding: 6px;
  z-index: 350;
  min-width: 220px;
  animation: dlgCtxIn .15s ease-out;
}
@keyframes dlgCtxIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dlg-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: #2F4F48;
  cursor: pointer;
  transition: background .12s;
}
.dlg-ctx-menu button:hover { background: rgba(74,158,142,.08); }
.dlg-ctx-menu button .ico { font-size: 18px; width: 22px; text-align: center; }
.dlg-ctx-menu button.danger { color: #C08878; }
.dlg-ctx-menu button.danger:hover { background: rgba(192,136,120,.1); }
.dlg-ctx-menu hr { border: 0; border-top: 1px solid #E8DFD0; margin: 4px 8px; }

/* Закреплённый диалог — иконка */
.dlg-item.pinned::after {
  content: '📌';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  opacity: .7;
}

html.dark .dlg-ctx-menu { background: #1E2A27; }
html.dark .dlg-ctx-menu button { color: #E8DFD0; }
html.dark .dlg-ctx-menu button:hover { background: rgba(74,158,142,.15); }
html.dark .dlg-ctx-menu hr { border-top-color: #2F4A44; }

/* ====== Нижняя панель настроек ====== */
.settings-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #E8DFD0;
  background: #FAFAF7;
  flex-shrink: 0;
}
.settings-btn-cancel {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid #E8DFD0;
  background: #fff;
  color: #5A7A74;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.settings-btn-cancel:hover { border-color: #C08878; color: #C08878; }

.settings-btn-apply {
  flex: 1.4;
  padding: 12px 20px;
  border-radius: 12px;
  border: 0;
  background: #C8DFD6;
  color: #5A7A74;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.settings-btn-apply.is-dirty {
  background: #4A9E8E;
  color: #fff;
  box-shadow: 0 4px 14px rgba(74,158,142,.35);
}
.settings-btn-apply.is-dirty:hover { background: #3F8A7C; }
.settings-btn-apply.is-saved {
  background: #4CAF50;
  color: #fff;
}
.settings-btn-apply:disabled { cursor: default; }

.apply-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C08878;
  display: none;
  animation: pulseDot 1.4s infinite;
}
.settings-btn-apply.is-dirty .apply-dot { display: block; }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

html.dark .settings-footer {
  background: #16211E;
  border-top-color: #2F4A44;
}
html.dark .settings-btn-cancel {
  background: #1E2A27;
  border-color: #2F4A44;
  color: #A8BCB6;
}
html.dark .settings-btn-apply { background: #2F4A44; color: #7A9490; }
html.dark .settings-btn-apply.is-dirty { background: #4A9E8E; color: #fff; }

/* ====== Меню вложений ====== */
.attach-menu {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 340;
  min-width: 180px;
  animation: ctxIn .15s ease-out;
}
.attach-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: #2F4F48;
  cursor: pointer;
  transition: background .12s;
}
.attach-menu button:hover { background: rgba(74,158,142,.08); }
html.dark .attach-menu { background: #1E2A27; }
html.dark .attach-menu button { color: #E8DFD0; }
html.dark .attach-menu button:hover { background: rgba(74,158,142,.15); }

/* Превью загружаемых файлов */
#chatPreview > div { margin-bottom: 6px; }

/* ====== Меню вложений ====== */
.attach-menu {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 340;
  min-width: 180px;
  animation: ctxIn .15s ease-out;
}
.attach-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: #2F4F48;
  cursor: pointer;
  transition: background .12s;
}
.attach-menu button:hover { background: rgba(74,158,142,.08); }
html.dark .attach-menu { background: #1E2A27; }
html.dark .attach-menu button { color: #E8DFD0; }
html.dark .attach-menu button:hover { background: rgba(74,158,142,.15); }

/* Превью загружаемых файлов */
#chatPreview > div { margin-bottom: 6px; }
