:root {
  --bg-deep: #050a1c;
  --bg-mid: #0b1638;
  --bg-glow-a: #1c3d8f;
  --bg-glow-b: #2a5ad1;
  --surface: #fffdf9;
  --border: #dfe4ee;
  --border-soft: #e8ebf3;
  --ink: #eef2fb;
  --ink-soft: #cdd7ee;
  --ink-muted: #93a4cb;
  --ink-dark: #1c2338;
  --ink-dark-muted: #5a6789;
  --accent: #5b93ff;
  --accent-strong: #3d6fe0;
  --glass-bg: rgba(14, 26, 61, 0.55);
  --glass-border: rgba(150, 180, 240, 0.22);
  --green-bg: #e3f3ea;
  --green-ink: #2f6b46;
  --red-bg: #fbe4e6;
  --red-ink: #9c2b3a;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 34px rgba(4, 10, 30, 0.45);
  --shadow-lg: 0 30px 70px rgba(2, 6, 20, 0.55);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Тёмно-синий фон с диагональными световыми полосами и мягким свечением */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 85% -8%, rgba(74, 120, 220, 0.35), transparent 60%),
    radial-gradient(700px 460px at 8% 6%, rgba(58, 100, 200, 0.28), transparent 55%),
    linear-gradient(160deg, var(--bg-mid) 0%, var(--bg-deep) 55%, #030714 100%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 90px
  );
  mask-image: radial-gradient(1000px 700px at 60% 0%, black, transparent 75%);
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 44px 20px 72px;
  position: relative;
}

/* ---------- Header / hero ---------- */

.cal-header {
  text-align: center;
  padding: 6px 8px 0;
  margin-bottom: 26px;
}

.hero-badge {
  position: relative;
  padding: 14px 0 22px;
}

.hero-doodles {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  color: rgba(180, 200, 240, 0.4);
}
.doodle { position: absolute; }
.doodle--formula {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: rgba(190, 208, 245, 0.45);
  white-space: nowrap;
}
.doodle--right { text-align: right; }
.doodle--sqrt { font-size: 1.1rem; }
.doodle--sigma { font-size: 1rem; }
.doodle--svg { width: 74px; height: 74px; }
.doodle--axes { width: 90px; height: 90px; }
.doodle--cube { width: 70px; height: 70px; }

@media (max-width: 640px) {
  .hero-doodles { opacity: 0.6; }
  .doodle--formula { font-size: 0.62rem; }
  .doodle--svg { width: 50px; height: 50px; }
  .doodle--axes { width: 60px; height: 60px; }
}

.chrome-badge {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 16vw, 6.5rem);
  line-height: 1;
  margin-top: 4px;
}
.chrome-badge__depth,
.chrome-badge__face {
  display: block;
}
.chrome-badge__depth {
  position: absolute;
  inset: 0;
  color: #04081a;
  transform: translate(3px, 5px);
  filter: blur(0.5px);
  z-index: 0;
}
.chrome-badge__face {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffffff 0%, #d3ddec 28%, #7f93b8 48%, #eef2fb 62%, #a7b7d6 82%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 24px rgba(110, 160, 255, 0.55));
  background-size: 100% 220%;
  animation: chromeSheen 7s ease-in-out infinite alternate;
}
@keyframes chromeSheen {
  from { background-position: 0 0%; }
  to { background-position: 0 100%; }
}

.cal-eyebrow {
  margin: 10px 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.cal-subeyebrow {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
  font-family: var(--font-display);
}

/* :not([hidden]) — не unconditional display, потому что теперь этот блок
   скрывается в разделе «Расписание»; unconditional display здесь повторил
   бы баг, который раньше блокировал все клики через .modal-overlay. */
.cal-nav:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

.cal-nav h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 0;
  min-width: 230px;
  text-align: center;
  color: var(--ink);
}

.nav-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--ink-soft);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}
.nav-btn:hover {
  background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(91, 147, 255, 0.18), var(--shadow-md);
}
.nav-btn:active { transform: scale(0.92); }

/* ---------- View switch (используется и для "Мероприятия/Расписание",
   и для "Сетка/Список" — тот же компонент, разные кнопки внутри) ---------- */

/* :not([hidden]) — см. комментарий у .cal-nav выше: этот блок теперь
   тоже скрывается (переключатель Сетка/Список нужен только в разделе
   «Мероприятия»), unconditional display сломал бы скрытие. */
.view-switch:not([hidden]) {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  margin: 18px auto 0;
  padding: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.view-switch__btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.view-switch__btn:hover { color: var(--ink); }
.view-switch__btn.is-active {
  background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
}

/* Красная точка «есть непросмотренные обновления» на кнопке раздела. */
.update-dot {
  position: absolute;
  top: 3px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E23B3B;
  box-shadow: 0 0 0 2px var(--glass-bg);
}
.view-switch__btn.is-active .update-dot {
  box-shadow: 0 0 0 2px var(--accent-strong);
}

/* ---------- Banner ---------- */

.cal-banner {
  background: rgba(60, 45, 10, 0.55);
  border: 1px solid rgba(220, 170, 80, 0.4);
  color: #ffd889;
  backdrop-filter: blur(6px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 0.88rem;
  text-align: center;
}

/* :not([hidden]) — иначе unconditional display переопределит браузерное
   [hidden]{display:none} и баннер будет виден даже со скрытым атрибутом
   (см. README/историю багов с .modal-overlay). */
.cal-banner--action:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
}
.cal-banner--action {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--ink);
}
.cal-banner__text {
  margin: 0;
  font-size: 0.85rem;
}
.cal-banner__actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.banner-btn {
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.banner-btn:hover { color: var(--ink); }
.banner-btn--primary {
  border: none;
  background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
}
.banner-btn--primary:hover { color: #fff; }

/* ---------- Grid panel ---------- */

.cal-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}
.cal-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 2px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  transition: opacity 0.3s ease;
}

/* Пока первый (не из кэша) запрос месяца ещё не ответил — лёгкая пульсация,
   чтобы было видно, что события подгружаются, а не что страница зависла. */
.cal-grid.is-loading {
  animation: gridPulse 1.1s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes cellIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- List view (Список) ---------- */

/* Guarded by :not([hidden]) rather than an unconditional `display` on
   .cal-list itself — an unconditional display here would override the
   browser's default [hidden] { display: none } the same way it once did
   for .modal-overlay, permanently showing/blocking the panel. */
.cal-list:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-list.is-loading { animation: gridPulse 1.1s ease-in-out infinite; }
.schedule-panel.is-loading { animation: gridPulse 1.1s ease-in-out infinite; }

.list-day {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.list-day.is-today {
  border-color: #D6A400;
  box-shadow: inset 0 0 0 1.5px #D6A400;
}
.list-day__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-dark);
  margin-bottom: 8px;
}
.list-day__badge {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7A5900;
  background: #FFF3B8;
  padding: 2px 8px;
  border-radius: 999px;
}
.list-day__update-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E23B3B;
  flex-shrink: 0;
}
.list-day__badge--important {
  color: #fff;
  background: var(--red-ink);
}
.list-day__events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-event {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 3px solid var(--event-accent, var(--accent));
  background: #fbfbfd;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink-dark);
  transition: background 0.15s ease, transform 0.15s ease;
}
.list-event:hover { background: #f1f2f8; transform: translateX(2px); }
.list-event:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.list-event__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--ink-dark-muted);
  min-width: 42px;
  flex-shrink: 0;
}
.list-event__title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-event__kind {
  font-size: 0.66rem;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.list-event__participation {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.list-event__participation.yes { color: var(--green-ink); }
.list-event__participation.no { color: var(--red-ink); }

.list-empty {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
  padding: 24px 0;
  margin: 0;
}

/* ---------- Schedule (Расписание) — переиспользует .list-day/.cal-panel ---------- */

.schedule-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid var(--accent);
  background: #fbfbfd;
  border-radius: 8px;
  padding: 8px 10px;
}
/* Урок, идущий прямо сейчас (по часам) — см. currentLessonIndex в js/app.js. */
.lesson-row.is-current {
  border-left-color: #D6A400;
  background: #FFF8E1;
  box-shadow: inset 0 0 0 1px #F0D57A;
}
/* Заполнен столбец «Замена» на листе расписания — показываем её поверх
   обычного урока (важнее, чем просто «идёт сейчас», поэтому идёт после
   .is-current и перекрывает его фон/рамку при совпадении обоих классов). */
.lesson-row.has-substitution {
  border-left-color: var(--red-ink);
  background: #FBEAEA;
  box-shadow: inset 0 0 0 1px #EFC7C7;
}
.list-day__badge--substitution {
  color: #fff;
  background: var(--red-ink);
}
.lesson-row__meta--original {
  text-decoration: line-through;
  opacity: 0.7;
}
.lesson-row__num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--ink-dark-muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.lesson-row__main { flex: 1; min-width: 0; }
.lesson-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.lesson-row__subject {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-dark);
}
.lesson-row__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--ink-dark-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.lesson-row__meta {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--ink-dark-muted);
}

.cal-cell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  min-height: 80px;
  padding: 9px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: cellIn 0.35s ease both;
}

.cal-cell--empty {
  background: transparent;
  border: none;
  animation: none;
}

.cal-cell.is-weekend {
  background: #f2f4fb;
}

/* Каникулы (лист «каникулы», apps-script/Code.gs) — красим серым только
   дни без мероприятий: инлайн-фон цвета категории (см. applyEventsToGrid
   в js/app.js) сильнее любого класса, так что реальное школьное событие в
   эти дни по-прежнему видно как обычно. .is-today объявлен ниже по файлу
   и поэтому перекрывает этот фон, если день одновременно и сегодня. */
.cal-cell.is-vacation:not(.has-event) {
  background: #D3D8E2;
}
.cal-cell.is-vacation:not(.has-event) .cal-daynum {
  color: var(--ink-dark-muted);
}
/* Значок прямо на ячейке — иначе серый цвет каникул слишком похож на
   серый цвет выходных (.is-weekend) и непонятно, что именно означает
   заливка (само слово «Каникулы» — в легенде под сеткой). Через ::after,
   а не обычный элемент, — тогда значок сам появляется/исчезает вместе с
   классом is-vacation, без лишней ручной синхронизации DOM в js/app.js
   (в т.ч. когда каникулы подгружаются уже после того, как сетка
   отрисована — см. applyVacationHighlighting). Именно значок, а не слово
   текстом: русский текст в узкой ячейке на маленьком экране переносится
   на две строки, а в Safari на iOS это (в отличие от Chrome) раздувает
   высоту всей строки сетки — один символ эмодзи никогда не переносится,
   такой баг просто неоткуда взяться. */
.cal-cell.is-vacation:not(.has-event)::after {
  content: '🏖';
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
}

.cal-cell.is-today {
  background: #FFF3B8;
  border-color: #D6A400;
  box-shadow: inset 0 0 0 1.5px #D6A400, 0 0 0 4px rgba(214, 164, 0, 0.18);
}
.cal-cell.is-today .cal-daynum {
  color: #7A5900;
}
.cal-cell.is-today .cal-daynum::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #D6A400;
  margin-left: 5px;
  vertical-align: middle;
}

.cal-daynum {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-dark);
}

.cal-cell.has-event {
  cursor: pointer;
}
.cal-cell.has-event:hover {
  transform: translateY(-3px) scale(1.035);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  z-index: 2;
}
.cal-cell.has-event:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* «Тревожный» вид — либо мероприятие новое/изменённое («есть
   обновление» — см. js/app.js, diffAndTrackUpdates), либо оно сегодня
   или в будущем (исход по нему ещё не известен — см. renderEventCell).
   Сплошной красный фон (инлайн-стилем в JS, чтобы точно перекрыть обычный
   цвет категории/участия), жирная белая дата и восклицательный знак
   через ::before. Для «нового» пропадает сразу же, как день открыли
   (см. acknowledgeDateSeen → renderEventCell); для «в будущем» — сам,
   как только день станет прошедшим. */
.cal-cell.is-alert .cal-daynum {
  color: #fff;
  font-weight: 800;
}
.cal-cell.is-alert::before {
  content: '!';
  position: absolute;
  top: 4px;
  right: 9px;
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  pointer-events: none;
}

/* Пометка «Важно» (7-й столбец на листе месяца) — красная подпись внизу
   ячейки. Через ::after, а не обычный элемент (та же логика, что и для
   значка каникул выше) — сам появляется/исчезает с классом has-important.
   nowrap + фиксированная высота — тот же приём, что и для «Каникулы»:
   без этого перенос текста на две строки в узкой ячейке на iPhone
   раздувает высоту всей строки сетки (это реальный баг Safari, не
   гипотетический — см. историю правок). Когда ячейка и так красная
   (is-alert), красный текст потерялся бы — тогда белый. */
.cal-cell.has-important::after {
  content: 'Важно';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  height: 12px;
  line-height: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--red-ink);
  pointer-events: none;
}
.cal-cell.has-important.is-alert::after {
  color: #fff;
}
/* Подпись «Важно» занимает нижнюю полоску ячейки — сдвигаем счётчик
   количества мероприятий чуть выше, чтобы не спорить с ней за одно и то
   же место. */
.cal-cell.has-important .cal-count {
  bottom: 18px;
}

/* Фон ячейки с мероприятием красится инлайн-стилем в JS (цвет самой
   категории «Вид мероприятия» — см. applyEventsToGrid в js/app.js).
   Точки в углу — те же цвета, для точной идентификации, если категорий
   в этот день несколько (тогда фон делится на полосы по диагонали). */
.cal-dots {
  position: absolute;
  top: 10px;
  right: 9px;
  display: flex;
  gap: 3px;
}
.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Красная точка «новое/изменилось с прошлого раза, когда вы это видели» —
   сравнение хранится в localStorage браузера (см. js/app.js), поэтому это
   именно «на этом устройстве», а не общее для всех. Пропадает по клику на
   день (открытие карточки мероприятия = «посмотрел»). */
.cal-update-dot {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E23B3B;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.cal-count {
  position: absolute;
  bottom: 7px;
  right: 9px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink-dark-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Legend ---------- */

/* :not([hidden]) — см. комментарий у .cal-nav: легенда категорий теперь
   тоже скрывается в разделе «Расписание». */
.cal-legend:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  margin-top: 24px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- Footer ---------- */

.cal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 40px;
  font-size: 0.76rem;
  color: var(--ink-muted);
}
.cal-footer__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57d18a;
  box-shadow: 0 0 0 3px rgba(87, 209, 138, 0.2);
}

/* Кнопка-исключение из счётчика заходов — намеренно неброская (это для
   владельца сайта, не для родителей/детей): мелкий приглушённый текст
   под футером, без рамок/фона, пока не наведёшь курсор. :not([hidden]) —
   иначе unconditional display переопределит браузерное [hidden]{display:
   none} и кнопка останется видна даже со скрытым атрибутом (см. историю
   багов с .modal-overlay/.cal-nav и т.п. в этом же файле). */
.owner-exclude-btn:not([hidden]) { display: block; }
.owner-exclude-btn {
  margin: 10px auto 0;
  padding: 4px 10px;
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--ink-muted);
  opacity: 0.6;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.owner-exclude-btn:hover { opacity: 1; }
.owner-excluded-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  opacity: 0.6;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 10;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 30px 28px;
  position: relative;
  transform: scale(0.92) translateY(8px);
  transition: transform 0.24s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-overlay.is-open .modal-card { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-dark-muted);
  transition: color 0.15s ease;
}
.modal-close:hover { color: var(--ink-dark); }

.modal-date {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink-dark);
  padding-right: 24px;
}

.event-card {
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--event-accent, var(--accent-strong));
  border-radius: var(--radius-md);
  padding: 16px 16px 16px 15px;
  margin-bottom: 12px;
  background: #fbfbfd;
}
.event-card:last-child { margin-bottom: 0; }

.event-kind {
  display: inline-block;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.event-important-badge {
  display: inline-block;
  color: #fff;
  background: var(--red-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
  margin-bottom: 10px;
}

.event-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink-dark);
}

.event-rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0;
}
.event-rows dt {
  color: var(--ink-dark-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 1px;
}
.event-rows dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-dark);
}

.participation-tag.yes { color: var(--green-ink); font-weight: 600; }
.participation-tag.no { color: var(--red-ink); font-weight: 600; }

@media (max-width: 560px) {
  .page { padding: 32px 12px 56px; }
  .cal-panel { padding: 10px; border-radius: 16px; }
  .cal-grid { gap: 5px; }
  .cal-cell { min-height: 58px; padding: 6px; border-radius: 8px; }
  .cal-daynum { font-size: 0.85rem; }
  .cal-nav h1 { font-size: 1.25rem; min-width: 160px; }
  .cal-nav { gap: 12px; }
  .cal-count { font-size: 0.6rem; }
  .modal-card { padding: 24px 20px; }
  .list-event { flex-wrap: wrap; }
  .list-event__title { flex-basis: 100%; white-space: normal; order: 3; }
  .view-switch__btn { padding: 6px 15px; font-size: 0.75rem; }
  .lesson-row__top { flex-direction: column; align-items: flex-start; gap: 2px; }
}
