/* Палитра, шрифты и кегли — с утверждённого листа Дени
   (NED/design/Den-bez-roda.dc.html, NED0014). Тема всегда светлая: значения
   ниже фиксированы и не читают переменные темы Telegram (--tg-theme-*),
   которые клиент выставляет по теме пользователя, — раньше это и делало
   приложение тёмным при тёмном Telegram. */
:root {
  color-scheme: light;

  --font-sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ink: #1b1a18;
  --ink-2: #5d584f;
  --ink-3: #6a665e;
  --ink-4: #7a756c;
  --bg: #fdfcfa;
  --bg-muted: #f3f0ea;
  --accent: #a33a1f;
  --accent-soft: #d8a394;
  --border: #e9e4db;
  --border-2: #eae5dc;
  --dash: #c6c0b5;
  --dash-soft: #cfc9be;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Экран объяснения */

.screen-explain {
  justify-content: space-between;
  min-height: 100vh;
  padding: 24px 20px;
}

.explain-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  flex: 1;
}

.explain-p {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.explain-actions {
  padding-top: 8px;
}

/* Кнопки */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-disabled,
.btn-primary:disabled {
  background: var(--bg-muted);
  color: var(--ink-4);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--dash);
  font-weight: 500;
}

.btn-text {
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
}

.btn-danger {
  background: var(--accent);
  color: #ffffff;
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 16px;
  text-align: left;
  padding: 8px 0;
  min-height: 44px;
  cursor: pointer;
}

/* Раздел «Ребёнок» */

.screen-child {
  padding-bottom: 90px;
}

.empty-text,
.error-text {
  font-size: 16px;
  line-height: 1.4;
}

.error-text {
  color: #cc3333;
}

.child-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.child-card {
  flex: 1;
  text-align: left;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-sans);
  cursor: pointer;
}

.child-card-active {
  border-color: var(--ink);
  background: var(--bg-muted);
}

.child-name {
  font-size: 18px;
  font-weight: 600;
}

.child-hours {
  font-size: 16px;
  color: var(--ink-3);
  margin-top: 2px;
}

.child-active-mark {
  font-size: 14px;
  color: var(--accent);
  margin-top: 4px;
}

.child-delete {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--dash);
  border-radius: 12px;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 0 12px;
  cursor: pointer;
}

/* Классы рядом пилюлями (ClassSearch, NED0015 What.6) */

.class-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.class-pill {
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
}

/* Форма добавления ребёнка */

.add-child-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-2);
  padding-top: 16px;
}

.field-label {
  font-size: 16px;
  color: var(--ink-3);
}

.field {
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 17px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
}

.field-error {
  min-height: 20px;
  color: var(--accent);
  font-size: 16px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.confirm-text {
  font-size: 16px;
  line-height: 1.4;
}

/* Каркас с нижней навигацией (TabBar — Den-bez-roda.dc.html) */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
  overflow-y: auto;
}

.icon {
  display: flex;
  color: inherit;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border-2);
  background: var(--bg);
  padding: 6px 10px 12px;
}

.tab-item {
  flex: 1;
  min-height: 52px;
  border: none;
  border-radius: 12px;
  background: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.tab-item .icon {
  align-items: center;
  justify-content: center;
}

.tab-item-active {
  background: var(--bg-muted);
  color: var(--ink);
  font-weight: 600;
}

/* Раздел «День» — оболочка (DayHeader, DayProgress, DaysStrip) и экран дня
   (TimeSpan, LessonCard, RemovedLessonSlot, FreeGap, EmptyDay) с листа
   Den-bez-roda.dc.html (NED0014). */

.screen-day {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 90px;
}

.screen-day > .empty-text,
.screen-day > .error-text {
  padding: 20px;
}

.day-header {
  flex: none;
  padding: 15px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-header-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
}

.day-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex: none;
}

.day-child-name {
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-button {
  flex: none;
  min-height: 44px;
  padding: 0 15px 0 12px;
  border: none;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Полоса хода дня (DayProgress) */

.day-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-progress-track {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-muted);
  overflow: hidden;
}

.day-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.day-progress-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink-3);
}

/* Полоса из семи дней недели (DaysStrip) */

.day-strip {
  display: flex;
  gap: 6px;
}

.day-strip-item {
  flex: 1;
  min-height: 50px;
  border: none;
  border-radius: 12px;
  background: var(--bg-muted);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.day-strip-weekday {
  font-size: 16px;
  color: var(--ink-3);
  text-transform: lowercase;
}

.day-strip-date {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}

.day-strip-item-today {
  box-shadow: inset 0 0 0 1px var(--dash);
}

.day-strip-item-active {
  background: var(--ink);
  box-shadow: none;
}

.day-strip-item-active .day-strip-weekday {
  color: var(--bg);
  opacity: 0.75;
}

.day-strip-item-active .day-strip-date {
  color: var(--bg);
  font-weight: 700;
}

/* Пустой день (EmptyDay) */

.empty-day {
  flex: 1;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
}

.empty-day-icon {
  color: var(--dash);
}

.empty-day-title {
  font-size: 22px;
  font-weight: 600;
  max-width: 320px;
}

.empty-day-cta {
  min-height: 52px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

/* Шкала дня: колонка времени отдельно от карточки (DayTimeline/TimeSpan) */

.day-timeline {
  flex: 1;
  padding: 6px 18px 0;
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 10px;
  row-gap: 5px;
  align-content: start;
}

.time-span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 9px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--ink-2);
}

.time-span-tick {
  width: 1px;
  height: 10px;
  background: var(--dash);
  margin: 2px 0;
}

.time-span-end {
  color: var(--ink-3);
}

.time-span-now {
  padding-top: 11px;
  color: var(--accent);
  font-weight: 700;
}

.time-span-now .time-span-tick {
  background: var(--accent-soft);
}

.time-span-now .time-span-end {
  font-weight: 400;
  color: var(--ink-3);
}

/* Карточка занятия (LessonCard): школьный урок и занятие родителя
   различаются происхождением (data-origin), не родом (NED0014 What.6). */

.lesson-card {
  min-height: 56px;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 9px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.lesson-card-school {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
}

.lesson-card-parent {
  border: none;
  padding: 11px 13px;
  gap: 1px;
  min-height: 78px;
  color: var(--bg);
}

.lesson-card-now {
  min-height: 90px;
  gap: 9px;
  border-color: var(--accent);
}

.lesson-card-title {
  font-size: 18px;
  font-weight: 600;
}

.lesson-card-note {
  font-size: 16px;
  color: var(--ink-3);
}

.lesson-card-parent .lesson-card-note {
  color: inherit;
  opacity: 0.85;
}

.struck {
  text-decoration: line-through;
}

.lesson-card-now-note {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}

.lesson-card-action {
  align-self: flex-end;
  margin-top: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 2px 8px;
  color: var(--ink);
  cursor: pointer;
}

/* Снятый урок с возвратом (RemovedLessonSlot) */

.removed-lesson-slot {
  grid-column: 1 / -1;
  box-sizing: border-box;
  border: 1px dashed var(--dash);
  border-radius: 14px;
  padding: 7px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.removed-lesson-slot-text {
  font-size: 16px;
  color: var(--ink-3);
  min-width: 0;
}

.removed-lesson-slot-return {
  min-height: 44px;
  flex: none;
  padding: 0 4px;
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

/* Подписанный промежуток (FreeGap) */

.free-gap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 2px 16px;
  font-size: 16px;
  color: var(--ink-4);
}

.free-gap-tick {
  width: 1px;
  height: 20px;
  background: repeating-linear-gradient(var(--dash-soft) 0 3px, transparent 3px 7px);
}

/* Форма занятия */

.lesson-form {
  padding-bottom: 40px;
}

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
}

.toggle-btn-active {
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
}

.color-swatch-active {
  border-color: #111111;
}

/* Шапка формы: стрелка назад + заголовок (FormHeader, Pyat-ekranov.dc.html,
   NED0015 What.1/5) — форма занятия и форма обращения. */

.form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -20px -20px 4px;
  padding: 15px 20px 6px;
}

.form-header-back {
  width: 44px;
  height: 44px;
  flex: none;
  border: none;
  background: none;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-header-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-form-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* DaysPicker: набор дней недели прямо в форме, четыре состояния
   (empty/one/many/once — NED0015 What.1). */

.days-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.days-picker-row {
  display: flex;
  gap: 5px;
}

.days-weekday-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  text-transform: lowercase;
}

.days-weekday-btn-active {
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.days-weekday-btn-dim {
  opacity: 0.45;
}

.days-norepeat-btn {
  min-height: 44px;
  align-self: flex-start;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
}

.days-norepeat-btn-active {
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  padding: 11px 13px;
}

/* ScopeNote: сколько дней тронет правка/удаление (NED0015 What.1). */

.scope-note {
  border: 1px solid var(--border-2);
  background: var(--bg-muted);
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.45;
}

.scope-note-error {
  border-color: var(--accent-soft);
  background: #fbf0ed;
  color: var(--accent);
}

.scope-note-icon {
  flex: none;
  margin-top: 2px;
}

/* TimeField: часы и минуты — два окна, между ними двоеточие; час без минут
   не считается заполненным (NED0015 What.2). */

.time-field-row {
  display: flex;
  gap: 10px;
}

.time-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.time-field-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.time-field-box-invalid {
  border: 1.5px solid #b5462f;
  background: #fbf0ed;
}

.time-seg {
  width: 2.1ch;
  border: none;
  background: none;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  padding: 0;
}

.time-field-box-invalid .time-seg {
  color: #7a2a17;
}

.time-field-colon {
  color: #8a857c;
  font-family: var(--font-mono);
  font-size: 22px;
}

.time-field-hint {
  min-height: 20px;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 16px;
  color: var(--ink-4);
  line-height: 1.4;
}

.time-field-hint-error {
  color: var(--accent);
}

.time-field-hint-icon {
  flex: none;
  margin-top: 2px;
}

.time-quick-row {
  display: flex;
  gap: 6px;
}

.time-quick-btn {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--dash-soft);
  border-radius: 11px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

/* DeleteZone/DeleteButton/DeleteConfirm: удаление живёт внутри открытого
   занятия, по цене поступка (NED0015 What.3). */

.delete-zone {
  margin-top: 8px;
  border-top: 1px solid var(--border-2);
  padding: 14px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.delete-zone-note {
  font-size: 16px;
  color: var(--ink-4);
  line-height: 1.45;
}

.delete-button {
  min-height: 52px;
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 26, 24, 0.34);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.delete-confirm {
  width: 100%;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-confirm-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--dash);
  align-self: center;
}

.delete-confirm-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.delete-confirm-body {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Отмена удаления разового занятия — полоса внизу на несколько секунд
   (NED0015 What.3). */

.undo-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 84px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  /* Ниже modal-overlay (z-index 20) — подтверждение удаления другого занятия
     не должно прятаться под ещё не истёкшей полосой отмены предыдущего. */
  z-index: 15;
}

.undo-toast-btn {
  flex: none;
  border: none;
  background: none;
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* InviteCard/InviteRow/InviteLanding — приглашение называет класс и школу
   (Pyat-ekranov.dc.html, NED0015 What.4). */

.invite-card {
  background: var(--bg);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.invite-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 600;
}

.invite-card-check {
  flex: none;
  color: #2c5134;
}

.invite-row {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.invite-row-icon {
  flex: none;
  color: var(--ink);
}

.invite-row-body {
  min-width: 0;
  flex: 1;
}

.invite-row-title {
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row-subtitle {
  font-size: 16px;
  color: var(--ink-3);
}

.invite-landing {
  padding: 22px 20px 20px;
  gap: 14px;
}

.invite-landing-icon {
  color: var(--accent);
}

.invite-landing-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.invite-landing-info {
  border: 1px solid #cfd8c9;
  background: #f2f7f1;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 16px;
  color: #33503a;
  line-height: 1.45;
}

.invite-landing-school {
  font-size: 18px;
  color: var(--ink-2);
  font-weight: 500;
}

/* IdeaButton — вход в форму обращения кнопкой, не строкой текста
   (NED0015 What.5). */

.idea-button {
  min-height: 52px;
  border: 1px dashed var(--dash);
  border-radius: 14px;
  background: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* TopicPicker — вид обращения выбирается один раз, полосой из трёх
   (NED0015 What.5). */

.topic-picker {
  display: flex;
  gap: 7px;
}

.topic-picker-btn {
  flex: 1;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
}

.topic-picker-btn-active {
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.photo-attach {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-attach-name {
  font-size: 16px;
  color: var(--ink-3);
}

.field-warning {
  color: #cc7a00;
}

.screen-stub {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 56px);
}

.stub-title {
  font-size: 20px;
  margin: 0;
}

.stub-text {
  font-size: 15px;
  color: #666666;
  margin: 0;
}

/* Раздел «На печать» */

.screen-print {
  padding-bottom: 90px;
}

.print-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.print-range-row {
  display: flex;
  gap: 8px;
}

.print-range-row .field {
  flex: 1;
}

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

.print-range-actions .btn {
  width: auto;
  flex: 1;
}

.export-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.export-row {
  display: flex;
  gap: 8px;
}

.export-row .btn {
  width: auto;
  flex: 1;
}

/* Превью листа: страница сверстана в натуральную величину A4 (1123×794px
   при 96 DPI) и уменьшена transform: scale под ширину экрана — смотреть
   можно, внутри листа нет ни одного поля ввода (NED0007 Constraints). */

.sheet-preview-wrap {
  width: 100%;
  overflow: hidden;
}

.sheet-page {
  position: relative;
  background: #ffffff;
  border: 1px solid #d0d5db;
  transform-origin: top left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111111;
}

.sheet-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 2px solid #111111;
}

.sheet-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sheet-child-name {
  font-size: 28px;
  font-weight: 700;
}

.sheet-week-range {
  font-size: 16px;
  color: #555555;
}

.sheet-weekday-row {
  display: flex;
}

.sheet-weekday-cell {
  flex-shrink: 0;
  text-align: center;
}

.sheet-weekday-name {
  font-size: 14px;
  font-weight: 600;
}

.sheet-weekday-date {
  font-size: 12px;
  color: #666666;
}

.sheet-body {
  position: relative;
}

.sheet-time-col {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

.sheet-time-tick {
  position: absolute;
  left: 4px;
  transform: translateY(-50%);
  font-size: 11px;
  color: #888888;
  font-variant-numeric: tabular-nums;
}

.sheet-day-col {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid #e0e4e8;
}

.sheet-card {
  position: absolute;
  overflow: hidden;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  line-height: 1.2;
  text-align: left;
}

.sheet-card-school {
  background: #ffffff;
  border: 1px solid #444444;
  color: #111111;
}

.sheet-card-parent {
  color: #ffffff;
  border: none;
}

.sheet-card-no-color {
  background: #8a8a8a;
  color: #ffffff;
}

.sheet-card-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sheet-card-name {
  font-weight: 600;
}

/* Чёрно-белый режим: у каждого из шести цветов свой узор, пара
   «цвет — узор» берётся из набора NedLessons.LESSON_COLORS (NED-S001 §2.5). */

.sheet-pattern-diagonal,
.sheet-pattern-dots,
.sheet-pattern-grid,
.sheet-pattern-horizontal,
.sheet-pattern-vertical,
.sheet-pattern-cross,
.sheet-pattern-none {
  background-color: #ffffff;
  border: 1.5px solid #111111;
  color: #111111;
}

.sheet-pattern-diagonal {
  background-image: repeating-linear-gradient(45deg, #111111 0, #111111 2px, transparent 2px, transparent 7px);
}

.sheet-pattern-dots {
  background-image: radial-gradient(#111111 1.3px, transparent 1.4px);
  background-size: 7px 7px;
}

.sheet-pattern-grid {
  background-image: linear-gradient(#111111 1px, transparent 1px), linear-gradient(90deg, #111111 1px, transparent 1px);
  background-size: 7px 7px;
}

.sheet-pattern-horizontal {
  background-image: repeating-linear-gradient(0deg, #111111 0, #111111 2px, transparent 2px, transparent 7px);
}

.sheet-pattern-vertical {
  background-image: repeating-linear-gradient(90deg, #111111 0, #111111 2px, transparent 2px, transparent 7px);
}

.sheet-pattern-cross {
  background-image: linear-gradient(#111111 1.5px, transparent 1.5px), linear-gradient(90deg, #111111 1.5px, transparent 1.5px);
  background-size: 11px 11px;
}

.sheet-pattern-none {
  background-image: repeating-linear-gradient(45deg, #888888 0, #888888 1.5px, transparent 1.5px, transparent 6px);
  border-style: dashed;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body * {
    visibility: hidden;
  }

  .sheet-page,
  .sheet-page * {
    visibility: visible;
  }

  .sheet-page {
    position: absolute;
    top: 0;
    left: 0;
    transform: none !important;
    border: none;
  }
}
