@font-face {
     font-family: 'Lato';
     src: url('../fonts/Lato-Bold.woff2') format('woff2');
     font-weight: bold;
     font-style: normal;
     font-display: swap;
   }
   @font-face {
     font-family: 'Lato';
     src: url('../fonts/Lato-Regular.woff2') format('woff2');
     font-weight: normal;
     font-style: normal;
     font-display: swap;
   }
    @font-face {
     font-family: 'WellwaitFree';
     src: url('../fonts/WellwaitFree-Regular.woff2') format('woff2');
     font-weight: normal;
     font-style: normal;
     font-display: swap;
   }

  html.theme-day body,
  body.theme-day {
    background-color: #cce7ff;
    color: black;
  }

  html.theme-night body,
  body.theme-night {
    background-color: #888;
    background: #888; /* чтобы 1:1 совпало с тем, что было в body.theme-night */
    color: white;
  }

  *, *::before, *::after {
    box-sizing: border-box;
  }
  
  body {
      font-family: 'Lato', sans-serif;
      transition: background-color 0.4s ease, color 0.4s ease;
    }

  main {
    max-width: 480px;
    margin: 30px auto;
    padding: 20px;
  }

  /* профильный режим (включаем из JS) */
  body.account-profile main {
    max-width: 900px;
  }

   h1 {
    font-family: 'WellwaitFree', sans-serif;
    font-size: clamp(48px, 6vw, 88px);
    line-height: 1.05;
    text-align: center;
    margin-bottom: 30px;
  }

  #acc-loading {
    display: block;
    text-align: center;
    padding: 18px 12px;
    margin-bottom: 16px;
    font-family: 'WellwaitFree', sans-serif;
    font-size: 22px;
    opacity: 0.9;
  }

  .tab-button {
    flex: 1;
    padding: 14px;
    font-size: 18px;
    font-family: 'WellwaitFree', sans-serif;
    background: #e5e5e5;
    border: 2px solid #bdbdbd;
    color: #111;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
  }

  .tab-button:hover{
    background:#d4d4d4;
    border-color:#a3a3a3;
  }

  .tab-button:focus-visible{
    outline:none;
    box-shadow:0 0 0 3px rgba(34,197,94,.35);
  }

  .tab-button.active-tab {
    border-radius: 16px 16px 0 0;
    background: #fdfdfd;              /* как у блока */
    border-top: 4px solid #15803D;    /* как у зелёных кнопок */
    border-left: 2px solid #aaa;
    border-right: 2px solid #aaa;
    border-bottom: none;
    font-weight: bold;
    position: relative;
    z-index: 5;
    color: #15803D;                   /* тот же зелёный */
  }

  body.theme-night .tab-button {
    background: #3a3a3a;
    color: #fff;
    border: 2px solid #555;
  }
  body.theme-night .tab-button:hover{
    background:#444;
    border-color:#666;
  }
  body.theme-night .tab-button:focus-visible{
    outline:none;
    box-shadow:0 0 0 3px rgba(34,197,94,.35);
  }

 .block-box {
  background: #fdfdfd;
  border: 2px solid #aaa;
  border-radius: 0 0 16px 16px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
  body.theme-night .block-box {
    background: #2b2b2b;
    border-color: #444;
    color: #fff;
  }

  label {
    display: block;
    margin-bottom: 16px;
    font-weight: bold;
    font-size: 15px;
  }

  input[type="text"],
  input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    background: #fff;
    border: 2px solid #aaa;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
  }

  body.theme-night input {
    background: #1f1f1f;
    color: #fff;
    border-color: #555;
  }

  input:focus {
    border-color: limegreen;
  }

  .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
  }

  /* password inline -> class */
  .pw-wrap { position: relative; }
  .pw-input { padding-right: 36px; }

  /* ВАЖНО: не стилизуем ВСЕ кнопки на странице.
     Иначе страдают системные кнопки (крестики, кнопки модалок, герой и т.п.).
     Большой зелёный стиль — только для основных кнопок аккаунта. */
  .form-block button[type="submit"],
  #profile-edit-open,
  #avatar-toggle,
  .profile-logout,
  a.back-button {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    font-family: 'WellwaitFree', sans-serif;
    background: #15803D; /* темнее = проходит контраст */
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
  }

  .form-block button[type="submit"]:hover,
  #profile-edit-open:hover,
  #avatar-toggle:hover,
  .profile-logout:hover,
  a.back-button:hover {
    background: #166534; /* темнее hover */
  }

   /* Жёлтая кнопка ТОЛЬКО в аккаунте (ID конкретного элемента) */
  #notif-toggle{
    display:block;
    width:100%;
    max-width:600px;
    margin:16px auto;
    padding:12px;
    font-size:18px;
    font-family:'WellwaitFree', sans-serif;
    background:#FACC15;
    color:#111;
    
    border-radius:12px;
    cursor:pointer;
    transition: background .25s ease, box-shadow .2s ease;
    text-align:center;               /* по центру, как у других кнопок */
    font-weight:600;
  }
  #notif-toggle:hover{ background:#EAB308; transform:none; }  /* без увеличения */
  #notif-toggle:active{ background:#CA8A04; transform:none; }
  #notif-toggle:focus-visible{
    outline:none;
    box-shadow:0 0 0 3px rgba(34,197,94,.35);
  }
  /* Только в профиле */
.account-page .back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.account-page .btn-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ===== Каркас кабинета (без дубля стилей модалок) ===== */
#user-profile-block { text-align: center; }

.acc-top-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:stretch;
  gap:10px;
  width:100%;
  margin: 0 auto 16px;
  max-width: 900px;          /* чтобы на ПК не растягивалось на всю ширину */
}

/* на ПК: ВСЕ верхние кнопки одинаковой ширины */
.acc-top-actions > a,
.acc-top-actions > button{
  width:280px;
  min-width:280px;
  max-width:280px;
  flex: 0 0 280px;
  margin:0;
}

/* фикс: #notif-toggle НЕ должен жить по своим width/max-width/margin — в профиле он как зелёная */
.acc-top-actions #notif-toggle{
  width:280px;
  min-width:280px;
  max-width:280px;
  flex: 0 0 280px;
  margin:0;
}
/* красная кнопка выхода */
.acc-top-actions .profile-logout{
  background:#DC2626; /* темнее по умолчанию = проходит контраст */
}
.acc-top-actions .profile-logout:hover{
  background:#B91C1C;
}
.acc-top-actions .profile-logout:active{
  background:#7F1D1D;
}
.block-box.acc-card{ text-align:left; }

.acc-head{
  display:flex;
  gap:16px;
  align-items:center;
  margin-bottom:14px;
}
.acc-head .profile-avatar{
  width:96px;
  height:96px;
  margin-bottom:0;
}
.acc-head-text .profile-name{ margin:0 0 6px; }
.acc-head-text .profile-poop{ margin:0; }

.acc-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:28px;
  min-width:28px;
  padding:0 10px;
  margin-left:10px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-family:'WellwaitFree', sans-serif;
  font-size:16px;
  line-height:1;
}
.theme-night .acc-badge{
  background:#e5e5e5;
  color:#111;
}
.acc-section-title{
  font-family:'WellwaitFree', sans-serif;
  font-size:18px;
  margin: 12px 0 10px;
}

.acc-limits-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:10px;
}
.acc-limit{
  border:2px solid #ddd;
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,0.65);
}
.theme-night .acc-limit{
  background: rgba(0,0,0,0.15);
  border-color:#555;
}
.acc-limit-name{ font-weight:700; margin-bottom:6px; }
.acc-limit-val{ font-family:'WellwaitFree', sans-serif; font-size:22px; }
.acc-limit-sub{ font-size:14px; opacity:0.85; }

.acc-limits-reset{
  margin-top:10px;
  font-size:14px;
  opacity:0.9;
  line-height:1.25;
  word-break:break-word;
}

.acc-info-row{ margin: 6px 0; }
.acc-info-pair{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-top:10px;
}
.acc-edit-btn{ margin-top:14px; }

.acc-delete-btn{
  margin-top:10px;

  /* те же базовые размеры/шрифт, что у основных кнопок аккаунта */
  width:100%;
  padding:12px;
  font-size:18px;
  font-family:'WellwaitFree', sans-serif;
  color:#fff;
  border:none;
  border-radius:12px;
  cursor:pointer;
  transition: background 0.3s;

  /* красный как у logout (прошёл Lighthouse) */
  background:#DC2626;
}
.acc-delete-btn:hover{ background:#B91C1C; }
.acc-delete-btn:active{ background:#7F1D1D; }

.acc-avatars{ text-align:center; margin-top:14px; }

.back-button.acc-privacy-btn{
  background:#e5e5e5;
  color:#111;
  margin:14px 0 0;
}
.back-button.acc-privacy-btn:hover{ background:#d4d4d4; }
.theme-night .back-button.acc-privacy-btn{ background:#555; color:#fff; }
.theme-night .back-button.acc-privacy-btn:hover{ background:#666; }

/* форма в модалке "Редактировать" */
.pedit-form{ padding: 20px 0; }
.pedit-sep{
  border:none;
  border-top:1px solid #eee;
  margin: 10px 0 16px;
}
.theme-night .pedit-sep{ border-top-color:#333; }

/* ошибки в модалке профиля */
.pedit-err{
  margin-top:6px;
  font-size:13px;
  font-weight:700;
  color:#c00;
}
.theme-night .pedit-err{ color:#ff6b6b; }

@media (max-width: 700px){
  .acc-top-actions{ flex-direction:column; flex-wrap:nowrap; }
  .acc-top-actions > a,
  .acc-top-actions > button{
    width:100%;
    min-width:0;
    max-width:none;
    flex: 1 1 auto;

    /* мобилка: одинаковая высота всех верхних кнопок в колонке */
    min-height:64px;
    padding:14px 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1.1;
    box-sizing:border-box;
  }

  /* мобилка: отменяем “десктопный” фикс для #notif-toggle */
  .acc-top-actions #notif-toggle{
    width:100%;
    min-width:0;
    max-width:none;
    flex: 1 1 auto;
    margin:0;

    /* перебиваем id-стили по высоте/паддингам */
    min-height:64px;
    padding:14px 12px;
    line-height:1.1;
    box-sizing:border-box;
  }

  .acc-limits-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 480px){
  .acc-limits-grid{ grid-template-columns:1fr; }
  .acc-head{ flex-direction:column; }
  .block-box.acc-card{ text-align:center; }
}

 #reg-status {
  font-family: 'WellwaitFree', sans-serif;
  font-size: 16px;
  text-align: center;
  padding: 0 16px;
  margin: 24px 0;
  border-radius: 12px;
  font-weight: bold;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: transparent;
  border: 2px solid transparent;
  pointer-events: none;
  transition: all 0.3s ease;
  position: relative;
  z-index: 0;
}

#reg-status.error {
  background: #d40000;
  color: #fff;
  pointer-events: auto;
  z-index: 1;
}

#reg-status.success {
  background: #1ca700;
  color: #fff;
  pointer-events: auto;
  z-index: 1;
}
  .hidden {
    display: none !important;
  }

  #avatar-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;

    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    margin: 0;

    transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  }

  #avatar-select.is-open {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin: 10px 0 20px;
  }

  .avatar-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
  }

  .avatar-option:hover {
    transform: scale(1.05);
    border-color: gray;
  }

  .selected-avatar {
    border-color: limegreen;
    box-shadow: 0 0 6px limegreen;
  }

  /* Welcome-блок */
  #welcome-screen {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    width: 90%;
    max-width: 500px;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    font-family: 'WellwaitFree', sans-serif;
    text-align: center;
    animation: fadeInScale 0.4s ease-out;
  }

  body.theme-night #welcome-screen {
    background: #2b2b2b;
    color: #eee;
  }

  #welcome-screen img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin: 20px 0;
  }

  #welcome-screen .welcome-title {
    font-size: 28px; /* было инлайном */
    margin-bottom: 6px;
  }

  #welcome-screen .welcome-subtitle {
    font-weight: bold;
    margin: 10px 0 20px; /* было инлайном */
  }

  .welcome-note{
    font-size:18px;
    margin:10px 0;
  }
  .welcome-signature{
    font-style: italic;
    font-family: 'WellwaitFree', sans-serif;
  }

  #welcome-close {
    position: absolute;
    top: 10px;
    right: 12px; /* было инлайном */
    background: none;
    border: none;
    color: red;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
  }
  .profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  margin-bottom: 12px;
}
a.back-button {
  display: inline-block;   /* чтобы работали width/padding */
  text-align: center;
  text-decoration: none;
  margin: 30px 0 24px; /* верхний отступ */
}

/* Во время окна приветствия прячем нижнюю кнопку "на главную" */
#welcome-screen.show ~ #static-back-home {
  display: none !important;
}

/* ВЕРХНИЙ РЯД В АККАУНТЕ: убираем внешний отступ у зелёной, чтобы не растягивались жёлтая/красная */
#user-profile-block .acc-top-actions a.back-button{
  margin: 0;
}
#tabs-container {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}


  /* Анимации */
  @keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9) translate(-50%, -50%); }
    100% { opacity: 1; transform: scale(1) translate(-50%, -50%); }
  }

  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
  }

  #reg-status.animate-shake {
    animation: shake 0.4s ease;
  }

  @media (max-width: 480px) {
    main {
      margin: 20px 10px;
      padding: 10px;
    }

    .tab-button {
      font-size: 16px;
      padding: 10px;
    }

    .form-block button[type="submit"],
    #profile-edit-open,
    #avatar-toggle,
    .profile-logout {
      font-size: 16px;
      padding: 10px;
    }
/* h1 uses base clamp() */

  }
 


body.theme-night .tab-button.active-tab {
  background: #2b2b2b;              /* как у .block-box в night */
  border-top: 4px solid #15803D;    /* как у зелёных кнопок */
  border-left: 2px solid #555;
  border-right: 2px solid #555;
  border-bottom: none;
  color: #fff;
  font-weight: bold;
  position: relative;
  z-index: 5;
}

/* ======================== УВЕДОМЛЕНИЯ (финальная версия) ======================== */
/* Все классы с префиксом notif- — нет конфликтов */

.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}

.notif-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 600px;
  max-height: 80vh;
  background: #FFFFFF;
  border: 1px solid #DDDDDD;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.theme-night .notif-container {
  background: #222;
  border-color: #444;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #EEEEEE;
}
.theme-night .notif-header {
  border-bottom-color: #333;
}

.notif-title {
  font-family: 'WellwaitFree', cursive;
  font-size: 22px;
  font-weight: 600;
  color: #22C55E;
  margin: 0;
}

.notif-btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #888;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.notif-btn-close:hover {
  background: #F0F0F0;
  color: #333;
}
.theme-night .notif-btn-close {
  color: #AAA;
}
.theme-night .notif-btn-close:hover {
  background: #333;
  color: #FFF;
}

.notif-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
  min-height: 240px;   /* одинаковая минимальная высота */
  overflow-y: auto;    /* прокрутка при переполнении */
}

.notif-item {
  padding: 16px;
  border: 2px solid #AAAAAA;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: default;
  overflow-x: hidden; /* подстраховка от горизонтального скролла */
}
.theme-night .notif-item {
  background: #333;
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
                     
/* Плавное исчезновение уведомления при пометке прочитанным */
.notif-item.notif-fade-out {
  overflow: hidden;
  animation: notifFadeOut 0.32s ease forwards;
}

@keyframes notifFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
}








/* «Мой комментарий» — серый, остаётся в одну строку с многоточием */
.notif-context {
  font-family: Lato, sans-serif;
  font-size: 15px;
  color: #666;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.notif-context.notif-expanded {
  white-space: pre-wrap;
  overflow: visible;
  text-overflow: clip;
}
.theme-night .notif-context {
  color: #E5E7EB;
}

/* Действие другого пользователя */
/* строка “ВАСЯ ответил …” */
.notif-action {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
/* важно: текст может ужиматься, иначе появится горизонтальный скролл */
.notif-action > * { min-width: 0; }


.notif-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notif-actor {
  flex: 1;
  min-width: 0;
}

.notif-actor-name {
  font-family: 'WellwaitFree', cursive;
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.theme-night .notif-actor-name {
  color: #FFFFFF;
}

/* Ответ — перенос вниз, крупнее и жирнее; применяем и к notif-reply-text */
.notif-actor-text, .notif-reply-text {
  display: block;
  max-width: 100%;
  font-family: Lato, sans-serif;
  font-size: 15px;           /* больше, чем контекст */
  font-weight: 600;          /* акцент на ответе */
  color: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
/* Ночная тема — текст уведомлений светлее */
.theme-night .notif-actor-text,
.theme-night .notif-reply-text {
  color: #E5E7EB;
}



.notif-actor-text.notif-expanded {
  white-space: pre-wrap;
  overflow: visible;
  text-overflow: clip;
}




/* Дата и кнопки */
.notif-footer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: #888;
}
/* Дата уведомления — второстепенная */
.notif-meta {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.notif-actions {
  display: flex;
  gap: 8px;
}

.notif-btn {
  padding: 6px 12px;
  border-radius: 14px;
  border: none;
  font-family: 'WellwaitFree', cursive;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.notif-btn:hover {
  transform: scale(1.05);
}

/* Красные кнопки — как в ТЗ */
/* Красные кнопки с корректным hover (темнеют, но не меняют гамму) */
.notif-btn-read,
.notif-btn-read-all {
  background: #EF4444;
  color: #FFFFFF;
  transition: all 0.2s;
}
.notif-btn-read:hover,
.notif-btn-read-all:hover {
  background: #D63A3A; /* чуть темнее на hover */
}


/* Подвал модалки */
.notif-footer {
  padding: 0 20px 20px;
  text-align: right;

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.notif-btn-read-all {
  padding: 10px 16px;
  font-size: 16px;
}

/* Кнопка "Показать ещё" */
.notif-btn-more{
  display:none; /* было инлайном на кнопке */
  background:#E5E7EB;
  color:#111827;
}
.theme-night .notif-btn-more{
  background:#374151;
  color:#F9FAFB;
}
.notif-btn-more:hover{ filter:brightness(0.95); }
