.bell-btn { position: relative; }
.bell-btn.open { background: var(--surface-2); }

.notify-panel {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 60;
  width: 380px;
  max-width: calc(100vw - 20px);
  max-height: min(560px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow, 0 20px 50px rgba(0, 0, 0, .18));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  overflow: hidden;
}
.notify-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
}
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.notify-panel-head h3 { margin: 0; font-size: 15px; }
.notify-panel-readall {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
}
.notify-panel-readall:hover { background: var(--surface-2); }
.notify-panel-readall:disabled { opacity: .4; cursor: default; }
.notify-panel-list { overflow-y: auto; flex: 1; min-height: 0; }
.notify-panel-empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.notify-panel-empty svg { width: 26px; height: 26px; }
.notify-panel-empty p { margin: 0; font-size: 13px; }
.notify-panel-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.notify-panel-row:last-child { border-bottom: 0; }
.notify-panel-row:hover { background: var(--surface-2); }
.notify-panel-row.unread { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.notify-panel-row.unread:hover { background: color-mix(in srgb, var(--primary) 11%, transparent); }
.notify-panel-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--primary);
}
.notify-panel-row.unread .notify-panel-icon { background: var(--primary); color: #fff; }
.notify-panel-body { min-width: 0; flex: 1; }
.notify-panel-body small { display: block; color: var(--text-soft); font-size: 11px; margin-bottom: 2px; }
.notify-panel-body strong { display: block; font-size: 13px; line-height: 1.3; }
.notify-panel-body p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notify-panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.notify-panel-all {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}
.notify-panel-all:hover { background: var(--surface-2); }

@media (max-width: 1099px) {
  #notifyPanel { top: 66px; }
}
@media (max-width: 680px) {
  #notifyPanel { top: 68px; right: 10px; left: 10px; width: auto; max-width: none; }
}
@media (min-width: 1100px) {
  html[data-role="student"]:not(.embed-mode) #notifyPanel { top: 72px; }
}

/* =====================================================================
   Колокольчик: аватар автора изменений, точка «не прочитано»
   ===================================================================== */
.notify-panel-icon,
.notification-feed-icon { position: relative; overflow: hidden; }
.notify-panel-icon.has-avatar,
.notification-feed-icon.has-avatar { border-radius: 50%; }
/* Аватар лежит поверх иконки вида; если картинка не загрузилась, notify-ui.js / app.js её убирает. */
.notify-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: var(--surface-2);
}
.notify-panel-body { overflow-wrap: anywhere; }
.notify-panel-row.unread .notify-panel-body strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: middle;
}

/* =====================================================================
   Страница «Уведомления»: чипы-фильтры, дни, подсписок изменений курса
   ===================================================================== */
.notify-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.notify-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.notify-chip:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); color: var(--text); }
.notify-chip[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  color: var(--primary);
}

.notification-feed,
.notification-day-list,
.notification-changes { grid-template-columns: minmax(0, 1fr); }
.notification-day + .notification-day { margin-top: 20px; }
.notification-day-title { margin: 0 0 4px; color: var(--text-soft); font-size: 13px; font-weight: 800; }
.notification-day-list { display: grid; }

/* Строка ленты лежит внутри .notification-feed-item: рамка и подсветка «не прочитано» у обёртки,
   потому что под строкой может быть подсписок с собственными кнопками (кнопка в кнопке недопустима). */
.notification-feed-item { border-top: 1px solid var(--line); }
.notification-day-list > .notification-feed-item:first-child { border-top: 0; }
.notification-feed-item.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notification-feed-item > .notification-feed-row { padding: 12px 8px; border-top: 0; background: transparent; }
.notification-feed-item > .notification-feed-row:hover { background: var(--surface-3); }
.notification-feed-row > span:nth-child(2) { overflow-wrap: anywhere; }
/* Текст уведомления (например, сообщение преподавателя) показываем до трёх строк, а не одной. */
.notification-feed-row p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  text-overflow: clip;
}

.notification-changes { display: grid; gap: 2px; padding: 0 8px 12px 63px; }
.notification-change {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}
button.notification-change { cursor: pointer; }
button.notification-change:hover { background: var(--surface-3); }
button.notification-change:hover > span { text-decoration: underline; }
.notification-change > svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; color: var(--primary); }
.notification-change > span {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.notification-change.static { color: var(--text-soft); }
.notification-change.more { padding-left: 31px; }

/* =====================================================================
   Страница курса: «Что нового», бейджи уроков, «Результаты»
   ===================================================================== */
.course-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.course-hero-actions .course-practice-btn { margin-top: 0; }
.course-whatsnew-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  /* кнопка в шапке курса белая в обеих темах, поэтому цвет фиксированный, а не var(--primary) */
  background: #78258d;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.lesson-change-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}
.lesson-change-badge.new { background: var(--success-soft, #e8f8eb); color: #1b7a27; }
.lesson-change-badge.updated { background: var(--amber-soft); color: #8a5600; }
[data-theme="dark"] .lesson-change-badge.new { color: var(--success, #68d475); }
[data-theme="dark"] .lesson-change-badge.updated { color: var(--amber); }

.course-lesson-results { flex: 0 0 auto; white-space: nowrap; }

/* Окно «Что нового» (строки построены на .school-list-row) */
.course-changes-lead { margin: 0 0 8px; color: var(--text-soft); font-size: 13px; }
.course-changes { display: grid; }
.school-list-row.course-change-row { flex-wrap: nowrap; gap: 12px; min-height: 0; padding: 12px 10px; }
.course-change-row strong { font-size: 13px; line-height: 1.45; white-space: pre-line; }
.course-change-row small { margin-top: 3px; font-size: 11px; }
.course-changes > .course-change-row:last-child { border-bottom: 0; }
div.course-change-row:hover { background: var(--surface); transform: none; }

@media (max-width: 680px) {
  .course-hero-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .course-lesson-item { flex-wrap: wrap; }
  .course-lesson-item .course-lesson-row { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .notification-changes { padding-left: 59px; }
}

/* =====================================================================
   Кабинет школы: окно «Что нового» (переписать или удалить записи ленты курса)
   ===================================================================== */
.studio-changes-lead { margin: 0 0 8px; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.studio-changes-list { display: grid; }
.studio-changes-list.busy { opacity: .55; pointer-events: none; }
.studio-changes-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.studio-changes-row:last-child { border-bottom: 0; }
.studio-changes-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--primary);
}
.studio-changes-icon svg { width: 17px; height: 17px; }
.studio-changes-copy { flex: 1 1 auto; min-width: 0; }
.studio-changes-text {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.studio-changes-copy small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
}
.studio-changes-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; margin: -3px -4px 0 0; }
.studio-changes-actions .icon-btn { width: 34px; height: 34px; flex-basis: 34px; }
.studio-changes-actions .icon-btn svg { width: 17px; height: 17px; }
.studio-changes-input { min-height: 40px; font-size: 13px; }
.studio-changes-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.studio-changes-ask > span { margin-right: 4px; font-size: 13px; font-weight: 700; }
.studio-changes-ask-text { flex: 1 1 100%; color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.45; }
.studio-changes-empty { display: grid; justify-items: center; gap: 10px; padding: 34px 18px; }
.studio-changes-empty svg { width: 26px; height: 26px; }
.studio-changes-empty p { margin: 0; font-size: 13px; line-height: 1.5; }

@media (max-width: 480px) {
  .studio-changes-row { gap: 10px; }
  .studio-changes-icon { width: 30px; height: 30px; }
}
