/* ==========================================================================
   Расписание репетитора — оформление Mini App.

   Палитра своя (см. ниже), а у Telegram спрашивается только светлая
   сейчас тема или тёмная. Переключение делает `applyTheme()` в app.js,
   выставляя `data-theme` на корне документа.

   Правила, которые здесь соблюдаются везде:
   - ничего мельче 14px;
   - у всего, что нажимается, площадь не меньше 44×44;
   - никаких системных alert() — только свои шторки снизу.
   ========================================================================== */

/* Своя палитра вместо цветов темы Telegram.
   Раньше всё бралось из `--tg-theme-*`: приложение выглядело родным,
   но целиком зависело от того, какую тему поставил пользователь, —
   в части тем оно смотрится блёкло, и повлиять на это нельзя.
   Теперь цвета свои, а у Telegram спрашиваем только «светло или темно»
   (`colorScheme`), чтобы ночью приложение не било по глазам. */
:root {
  --page: #f4f5f7;        /* фон экрана */
  --section: #ffffff;     /* карточки */
  --bg: #ffffff;          /* поля ввода и шторки */
  --secondary: #f1f2f5;   /* мягкая подложка: строки списков, кнопки */

  --text: #14161a;
  --hint: #6c727f;
  --separator: rgba(20, 22, 26, 0.09);

  --link: #4c6ef5;
  --button: #4c6ef5;
  --button-text: #ffffff;
  --accent-soft: rgba(76, 110, 245, 0.1);

  --ok: #0e9f6e;
  --ok-soft: rgba(14, 159, 110, 0.12);
  --warn: #c2740a;
  --warn-soft: rgba(194, 116, 10, 0.13);
  --error: #dc4b4f;
  --error-soft: rgba(220, 75, 79, 0.12);

  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);

  --radius: 14px;
  --radius-sm: 10px;
  --tap: 44px;
  --gap: 12px;
  --pad: 16px;
  --tabbar-height: 58px;
}

/* Тёмная тема. Фон не чёрный, а тёмно-синий: чистый чёрный на телефоне
   даёт слишком резкую границу с белым текстом. */
:root[data-theme="dark"] {
  --page: #0f1116;
  --section: #1a1d24;
  --bg: #1a1d24;
  --secondary: #23272f;

  --text: #eceef2;
  --hint: #98a0ad;
  --separator: rgba(255, 255, 255, 0.1);

  --link: #8098ff;
  --button: #5b78f0;
  --button-text: #ffffff;
  --accent-soft: rgba(128, 152, 255, 0.16);

  --ok: #35c98f;
  --ok-soft: rgba(53, 201, 143, 0.16);
  --warn: #e0a13c;
  --warn-soft: rgba(224, 161, 60, 0.16);
  --error: #f0696d;
  --error-soft: rgba(240, 105, 109, 0.16);

  /* Тени в темноте не видно — их роль берут на себя сами поверхности. */
  --shadow: none;
}

/* Пока не отработал JS — и в обычном браузере — ориентируемся
   на настройку системы. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0f1116;
    --section: #1a1d24;
    --bg: #1a1d24;
    --secondary: #23272f;

    --text: #eceef2;
    --hint: #98a0ad;
    --separator: rgba(255, 255, 255, 0.1);

    --link: #8098ff;
    --button: #5b78f0;
    --accent-soft: rgba(128, 152, 255, 0.16);

    --ok: #35c98f;
    --ok-soft: rgba(53, 201, 143, 0.16);
    --warn: #e0a13c;
    --warn-soft: rgba(224, 161, 60, 0.16);
    --error: #f0696d;
    --error-soft: rgba(240, 105, 109, 0.16);

    --shadow: none;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior-y: contain;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  width: 100%;
  min-height: var(--tap);
}

textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--button);
  outline-offset: -1px;
}

/* ---------------------------------------------------------------- каркас */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#screen {
  flex: 1;
  padding: var(--pad);
  padding-bottom: calc(var(--tabbar-height) + 24px + env(safe-area-inset-bottom));
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.screen-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.muted {
  color: var(--hint);
}

.small {
  font-size: 14px;
}

.card {
  background: var(--section);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: var(--gap);
  box-shadow: var(--shadow);
}

/* Заголовок карточки — подпись раздела, а не крик: мелкий и приглушённый.
   Смысл несёт содержимое, а не название над ним. */
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--hint);
  margin: 0 0 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spacer {
  flex: 1;
}

/* ------------------------------------------------------------ нижние вкладки */

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--section);
  border-top: 1px solid var(--separator);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  min-height: var(--tabbar-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--hint);
  font-size: 11px;
  padding: 6px 2px;
}

.tab .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.tab[aria-current="page"] {
  color: var(--link);
}

/* --------------------------------------------------------- шапка календаря */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--gap);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  /* Колонки по содержимому, а свободное место делится поровну: с пятью
     вкладками равные колонки рвали слово «Расписание» на две строки.
     Если не влезает и так — полоса едет вбок, а не ломает вёрстку. */
  grid-auto-columns: minmax(max-content, 1fr);
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  min-height: 36px;
  border-radius: 8px;
  font-size: 15px;
  padding: 0 6px;
  white-space: nowrap;
  color: var(--hint);
}

/* Полоса из пяти вкладок в карточке ученика: на 375px пять слов
   помещаются в строку только шрифтом помельче и с тонкими полями.
   Замерено на живой странице: 327px из 343 доступных. */
.segmented.compact button {
  font-size: 14px;
  padding: 0 4px;
}

.segmented button[aria-pressed="true"] {
  background: var(--section);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.nav-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-line .period {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 600;
  /* Заголовок периода не переносится: иначе шапка прыгает по высоте
     при каждом переключении недели. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  min-width: var(--tap);
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--link);
  background: var(--section);
  box-shadow: var(--shadow);
}

.icon-button:active {
  background: var(--secondary);
}

.today-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--link);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

/* Строка итогов не в карточке: это подпись к календарю, а не раздел.
   Одна коробка на экране меньше. */
.totals {
  padding: 2px 2px 12px;
  font-size: 15px;
  color: var(--hint);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
}

.totals b {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ------------------------------------------------------------- неделя и день */

/* На узком экране — вертикальная лента по дням: семь колонок на телефоне
   дали бы по 50px на занятие, в них не помещается ни имя, ни сумма.
   На широком экране (десктопный Telegram) это настоящие семь колонок. */
.week {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 760px) {
  .week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  /* В колонке около 140px каждый лишний отступ на счету. */
  .week .day-column {
    padding: 8px;
  }

  .week .lesson-card {
    padding: 8px;
    gap: 8px;
  }

  .week .day-head .day-sum {
    font-size: 12px;
  }
}

.day-column {
  background: var(--section);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
  box-shadow: var(--shadow);
}

.day-column.is-today {
  outline: 1px solid var(--button);
}

.day-column.is-empty {
  opacity: 0.55;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}

.day-head .weekday {
  font-weight: 600;
  text-transform: capitalize;
}

.day-head .daynum {
  color: var(--hint);
}

.day-head .day-sum {
  margin-left: auto;
  color: var(--hint);
  font-size: 13px;
  white-space: nowrap;
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-card {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: var(--tap);
  transition: background 0.12s ease;
}

.lesson-card:active {
  opacity: 0.7;
}

.lesson-stripe {
  width: 4px;
  border-radius: 2px;
  flex: 0 0 4px;
  background: var(--hint);
}

.lesson-body {
  min-width: 0;
  flex: 1;
}

.lesson-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  /* В узкой колонке «17:00–18:30» не должно рваться посередине:
     пусть лучше сумма переедет на свою строку целиком. */
  white-space: nowrap;
}

.lesson-card .row-between {
  flex-wrap: wrap;
  row-gap: 0;
}

.lesson-card .row-between > .small {
  white-space: nowrap;
}

.lesson-name {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-meta {
  font-size: 13px;
  color: var(--hint);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

/* Отменённые и перенесённые — перечёркнуты и приглушены. */
.lesson-card.is-void .lesson-time,
.lesson-card.is-void .lesson-name {
  text-decoration: line-through;
}

.lesson-card.is-void {
  opacity: 0.5;
}

.lesson-card.is-stale {
  outline: 1px solid var(--warn);
}

/* Состояние передаётся цветом самого слова. Пилюли с заливкой рябили
   в списке: в одной строке их бывает две-три. */
/* Пилюля читается быстрее цветного слова: в списке взгляд цепляется
   за форму раньше, чем разбирает надпись. Заливки мягкие, чтобы
   две-три пилюли в строке не рябили. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--hint);
  white-space: nowrap;
}

.badge.paid,
.badge.done {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.void {
  background: var(--error-soft);
  color: var(--error);
}

/* ------------------------------------------------------------------- месяц */

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month-weekday {
  text-align: center;
  font-size: 12px;
  color: var(--hint);
  padding-bottom: 4px;
  text-transform: capitalize;
}

.month-cell {
  aspect-ratio: 1;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--section);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 15px;
}

.month-cell.other-month {
  opacity: 0.35;
}

.month-cell.is-today {
  outline: 1px solid var(--button);
}

.month-cell:active {
  background: var(--secondary);
}

.dots {
  display: flex;
  gap: 2px;
  height: 6px;
  align-items: center;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--link);
}

/* ------------------------------------------------------- карточка занятия */

.lesson-hero {
  background: var(--section);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: var(--gap);
  border-left: 3px solid var(--link);
  box-shadow: var(--shadow);
}

.lesson-hero h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 2px;
}

.lesson-hero .when {
  font-size: 16px;
  color: var(--hint);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 15px;
  margin: 14px 0 0;
}

.facts dt {
  color: var(--hint);
}

.facts dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.facts a {
  color: var(--link);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Обычная кнопка — контур, а не серый прямоугольник. Заливка остаётся
   только у главной: тогда сразу видно, какое действие основное. */
.action {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  transition: background 0.12s ease, opacity 0.12s ease;
}

.action:active {
  opacity: 0.7;
}

/* Ссылка в роли кнопки не должна выглядеть подчёркнутым текстом. */
a.action {
  text-decoration: none;
  color: var(--text);
}

a.action.primary {
  color: var(--button-text);
}

.action.primary {
  background: var(--button);
  border-color: var(--button);
  color: var(--button-text);
  box-shadow: var(--shadow);
}

.action.success {
  background: var(--ok-soft);
  color: var(--ok);
}

.action.danger {
  color: var(--error);
}

.field-label {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 6px;
  display: block;
}

/* --------------------------------------------------------------- шторки */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

.sheet {
  background: var(--bg);
  width: 100%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: slide-up 0.2s ease;
}

@media (min-width: 760px) {
  .sheet-backdrop {
    align-items: center;
  }

  .sheet {
    border-radius: 18px;
    max-height: 80vh;
  }
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--separator);
  margin: -6px auto 12px;
}

.sheet h2 {
  font-size: 19px;
  margin: 0 0 4px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.sheet-actions .action {
  width: 100%;
}

@keyframes slide-up {
  from {
    transform: translateY(18px);
    opacity: 0.4;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* -------------------------------------------------- уведомления и загрузка */

#toast-root {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-height) + 16px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--section);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  max-width: 480px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  animation: slide-up 0.2s ease;
}

.toast.error {
  background: var(--error);
  color: #fff;
}

.toast.success {
  background: var(--ok);
  color: #fff;
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: var(--button);
  transform-origin: left;
  animation: progress 1.2s ease-in-out infinite;
}

#loader[hidden] {
  display: none;
}

@keyframes progress {
  0% {
    transform: scaleX(0);
  }
  50% {
    transform: scaleX(0.7);
  }
  100% {
    transform: scaleX(1);
    opacity: 0.2;
  }
}

.empty {
  text-align: center;
  color: var(--hint);
  padding: 40px 20px;
  font-size: 15px;
}

/* -------------------------------------------------------------- настройки */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
}

.setting-label {
  flex: 1 1 auto;
  min-width: 0;
}

.setting-divider {
  height: 1px;
  background: var(--separator);
  margin: 2px 0;
}

/* Поля справа от подписи не должны растягиваться на всю ширину:
   «08:00» в поле шириной с экран выглядит как ошибка вёрстки. */
input.compact,
select.compact {
  width: auto;
  min-width: 112px;
  /* Названия поясов длинные, но подпись слева важнее: пусть поле
     ужимается, а не выдавливает её в четыре строки. */
  max-width: 58%;
  flex: 0 1 auto;
  text-align: center;
}

/* Переключатель. Обычная галочка на телефоне мелкая и непонятная —
   ей не видно, включено сейчас или выключено. */
input[type="checkbox"].switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 30px;
  min-height: 30px;
  flex: none;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--separator);
  transition: background 0.15s ease, border-color 0.15s ease;
}

input[type="checkbox"].switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
  transition: transform 0.15s ease;
}

input[type="checkbox"].switch:checked {
  background: var(--button);
  border-color: var(--button);
}

input[type="checkbox"].switch:checked::after {
  transform: translateX(18px);
}

/* ------------------------------------------- фильтр календаря по ученику */

/* Полоса заметная намеренно: пока она видна, календарь показывает
   не всё расписание, и об этом нельзя забыть. */
.filter-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.filter-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-clear {
  min-height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--section);
  color: var(--link);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

/* ------------------------------------------------------------- контакты */

/* Подпись «мама, Ирина» над строкой её контактов в карточке занятия. */
.contact-person {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--hint);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 420px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action.contact {
  justify-content: flex-start;
  padding: 8px 14px;
  min-height: 52px;
}

.contact-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.contact-title {
  font-size: 13px;
  color: var(--hint);
  font-weight: 400;
}

.contact-value {
  font-size: 16px;
  font-weight: 500;
  /* Номер не должен переноситься посередине. */
  white-space: nowrap;
}

/* ---------------------------------------------------------- подготовка */

/* Полоса освоенного. Тонкая: это подпись к сетке, а не главный герой
   экрана — сама сетка рассказывает больше. */
.progress-line {
  height: 6px;
  border-radius: 999px;
  background: var(--secondary);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-line i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.2s ease;
}

/* Плитки выкладываются сами: 20 заданий у профильного ЕГЭ и 27 у КЕГЭ,
   а ширина экрана у телефона и планшета разная. */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
}

.task-tile {
  min-height: 46px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  color: var(--hint);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.task-tile[data-status="in_progress"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.task-tile[data-status="mastered"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.task-tile:active {
  opacity: 0.7;
}

/* Строка выбора экзамена: название слева, число заданий справа.
   Названия длинные («ЕГЭ математика (профильный уровень)»), поэтому
   строка тянется в высоту, а не обрезает текст. */
.action.pick {
  justify-content: space-between;
  text-align: left;
  gap: 12px;
  padding: 10px 14px;
  height: auto;
  line-height: 1.3;
}

/* ДЗ с прошлого занятия в карточке занятия. Переносы строк сохраняем:
   задания часто пишут списком — «№1–5, №12, повторить формулы». */
.homework-text {
  margin: 6px 0 0;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
