/* Журнал колледжа — screen-specific styles (built on the tokens and components of app.css), then print. */

/* Screens: sign-in and password change */

.auth-card {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-7) var(--space-6);
  box-shadow: var(--shadow-pop);
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth-card__lead {
  margin-top: calc(-1 * var(--space-2));
  color: var(--text-muted);
}

.auth-card__foot {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 30rem) {
  .auth-card { padding: var(--space-6) var(--space-5); }
}

/* Screens: the student's home */

.profile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
}

.profile__text {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.profile__name {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.profile__role { color: var(--text-muted); }

.profile__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* On the student's phone badges keep the body size (16 px). */
.student .badge {
  min-height: 1.75rem;
  padding: 0.125rem var(--space-3);
  font-size: 1rem;
  font-weight: 600;
}

.soon-list {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 36rem) {
  .soon-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.soon {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
}

.soon__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-control);
  background: var(--muted);
  color: var(--text-muted);
}

.soon__icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.soon__body {
  display: grid;
  gap: var(--space-1);
}

.soon__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.soon__text { color: var(--text-muted); }

/* «Сегодня»: the one live section of the student's home, so it carries the accent the placeholders do not. */
.today {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border-top: 3px solid var(--primary-fill);
}

.today__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.today__icon {
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.today__title {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.today__date { color: var(--text-muted); }

.today__date::first-letter { text-transform: uppercase; }

.today__date:empty { display: none; }

.today__pairs {
  display: grid;
  gap: var(--space-2);
}

.today__pairs > li { display: grid; }

.today__none {
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-inner);
  color: var(--text-muted);
  text-align: center;
}

.today__failed {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.today__week { justify-content: center; }

/* «Предметы» on the student's home: the subjects of the group. A subject with a syllabus is a whole row to tap,
   with an arrow; one without says so and leads nowhere. */
.courses {
  display: grid;
  gap: var(--space-3);
  overflow: hidden;
  padding: var(--space-4);
}

.courses__icon {
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.courses__list { margin: 0 calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); }

.courses__list > li + li { border-top: 1px solid var(--border); }

.course {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 3.5rem;
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  text-decoration: none;
}

.course.is-link:hover { background: var(--row-hover); }

.course.is-link:focus-visible { outline-offset: -2px; }

.course__text {
  display: grid;
  flex: 1;
  gap: 0.125rem;
  min-width: 0;
}

.course__name { font-weight: 600; }

.course__teacher,
.course__none { color: var(--text-muted); }

.course__none { font-style: italic; }

.course__go {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary-ink);
}

/* The student's way back from a screen of their own: the bar has no menu. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  justify-self: start;
  min-height: 2.75rem;
  margin-left: calc(-1 * var(--space-2));
  padding: 0 var(--space-2);
  border-radius: var(--radius-control);
  color: var(--primary-ink);
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover { background: var(--secondary); }

.back-link .icon {
  width: 1.125rem;
  height: 1.125rem;
  transform: scaleX(-1);
}

/* Screens: the staff home */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-3);
}

.tile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-4);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
}

.tile:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-control);
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.tile--accent .tile__icon {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.tile__text {
  display: grid;
  flex: 1;
  gap: 0.125rem;
  min-width: 0;
}

.tile__title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.tile__hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.tile__go {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.list {
  max-width: 48rem;
  overflow: hidden;
}

.list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}

.list__row:first-child { border-top: 0; }

.list__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-inner);
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.list__icon .icon {
  width: 1rem;
  height: 1rem;
}

.subject__name {
  flex: 1 1 12rem;
  font-weight: 500;
}

.subject__count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Screens: a directory */

.table-card { overflow: hidden; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.toolbar > .search { flex: 1 1 16rem; max-width: 24rem; }

.toolbar > .field { flex: 0 1 14rem; }

.toolbar__count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 12rem;
}

.person__text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.person__name { font-weight: 500; }

.person__sub {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* The one-time password */

.slip {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--muted);
}

.slip__row {
  display: grid;
  gap: var(--space-1);
}

.slip__label { color: var(--text-muted); }

.slip__login {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.slip__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.slip__secret {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  user-select: all;
}

.slip__status {
  margin-block: calc(-1 * var(--space-2));
  color: var(--success);
  font-size: var(--hint-fs);
  font-weight: 500;
}

/* Kept in the page while empty, so the copy result is announced; it takes no room until then. */
.slip__status:empty { margin: calc(-1 * var(--space-4)) 0 0; }

/* Screens: import — five steps in one card, the number in a circle on a line */

.steps { padding: var(--space-2) 0; }

.step {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
}

/* The line that joins the step numbers. */
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 3.75rem;
  bottom: -0.25rem;
  left: 2.25rem;
  width: 1px;
  background: var(--border-strong);
}

.step__number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: var(--space-5) 0 0 1.25rem;
  border-radius: 50%;
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.step--waiting .step__number {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
}

.step__body {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5) var(--space-6) var(--space-5) 0;
}

.step__body > * { max-width: 100%; }

.step__body > .stack,
.step__body > .note,
.step__body > .tally { justify-self: stretch; }

.step__title {
  display: flex;
  align-items: center;
  min-height: 2rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.step--waiting .step__title {
  color: var(--text-muted);
  font-weight: 500;
}

.step__hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

@media (max-width: 36rem) {
  .step { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .step__number { margin-left: var(--space-3); }
  .step:not(:last-child)::before { left: 1.75rem; }
  .step__body { padding-right: var(--space-4); }
}

/* Row 1 of the template, drawn like a spreadsheet: column letters, row number, the titles. */
.xl {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.xl__table {
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.xl__table th,
.xl__table td {
  padding: var(--space-1) var(--space-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.xl__corner,
.xl__letter,
.xl__index {
  background: var(--muted);
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.xl__cell {
  min-width: 8rem;
  font-weight: 600;
  white-space: nowrap;
}

.xl__table .xl__index--blank,
.xl__table .xl__mark {
  border-bottom: 0;
  background: transparent;
}

.xl__mark {
  color: var(--text-muted);
  white-space: nowrap;
}

.xl__mark--required {
  color: var(--primary-ink);
  font-weight: 500;
}

.col-hints {
  display: grid;
  gap: var(--space-2);
  font-size: 0.8125rem;
}

.col-hints__row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: var(--space-4);
}

.col-hints__name { font-weight: 600; }

.col-hints dd { color: var(--text-muted); }

@media (max-width: 40rem) {
  .col-hints__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

.file {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

/* The real file input stays focusable but invisible; its label is the visible button. */
.file__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}

.file__button { cursor: pointer; }

.file__input:focus-visible + .file__button {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.file__input:disabled + .file__button {
  cursor: not-allowed;
  opacity: 0.5;
}

.file__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  overflow-wrap: anywhere;
}

.file__icon { color: var(--success); }

.file__title { font-weight: 500; }

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-3);
  max-width: 36rem;
}

.tally__item {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--muted);
}

.tally__count {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: var(--tracking-title);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tally__label {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.tally__item--bad {
  border-color: var(--danger-line);
  background: var(--danger-wash);
}

.tally__item--bad .tally__count { color: var(--danger); }

.passwords {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.table td.table__id { font-family: var(--font-mono); letter-spacing: 0; }

.table td.table__secret {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Screens: semester settings — three panels, the bell times drawn as a ribbon of the day */

.settings {
  display: grid;
  align-items: start;
  gap: var(--space-5);
}

@media (min-width: 75rem) {
  .settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}

.settings__column {
  display: grid;
  align-content: start;
  gap: var(--space-5);
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) 0;
}

.panel__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-control);
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.panel__text {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.panel__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.panel__hint {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  line-height: 1.4;
}

.panel__body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.settings .field__input { font-variant-numeric: tabular-nums; }

/* Read-only (no right to save): the values stay readable, nothing looks like it can be typed into. */
.settings .field__input[readonly] {
  border-color: var(--border);
  background: transparent;
  cursor: default;
}

.settings .field__input[readonly]:focus { box-shadow: none; }

.date-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-4);
}

/* Days off: a page of a tear-off calendar each, the weekday printed in red as on a red-letter day. */

.holidays {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-2);
}

.holiday {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.holiday__leaf {
  display: grid;
  flex: none;
  width: 2.75rem;
  overflow: hidden;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
  text-align: center;
}

.holiday__weekday {
  padding: 0.0625rem 0;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.holiday__day {
  padding: 0.125rem 0 0.1875rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.holiday__text {
  display: grid;
  flex: 1;
  justify-items: start;
  min-width: 0;
  line-height: 1.3;
}

.holiday__date { font-weight: 500; }

.holiday__sub {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.holiday__text .badge { margin-top: var(--space-1); }

.holiday__text .badge[hidden] { display: none; }

.adder__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.adder__row > .field__input {
  flex: 1 1 10rem;
  max-width: 14rem;
}

/* Bell times */

.ribbon {
  padding: var(--space-3) var(--space-3) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--input-bg);
}

.ribbon:empty { display: none; }

.ribbon__track {
  position: relative;
  height: 1.75rem;
  border-radius: var(--radius-inner);
  background: var(--muted);
}

.ribbon__block {
  position: absolute;
  top: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 1.25rem;
  border-radius: 6px;
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ribbon__block.is-overlap {
  background: var(--danger-fill);
  box-shadow: 0 0 0 2px var(--danger-line);
}

.ribbon__scale {
  position: relative;
  height: 1rem;
  margin-top: var(--space-1);
}

.ribbon__tick {
  position: absolute;
  top: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1rem;
  transform: translateX(-50%);
}

.ribbon__tick:first-child { transform: none; }

.ribbon__tick:last-child { transform: translateX(-100%); }

.bell {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) minmax(8rem, 13.5rem) 4.25rem;
  align-items: center;
  gap: var(--space-3);
}

/* The list of times is wide enough for «08:02 — вне списка» and «Выберите время». */
.bell__input { font-variant-numeric: tabular-nums; }

/* Without the right to save (the vice-rector) the time reads as a value, not as a list to open. */
.bell__input:disabled {
  appearance: none;
  opacity: 1;
  cursor: default;
}

.bell__number {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--primary-line);
  border-radius: 50%;
  background: var(--primary-wash);
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bell__label { font-weight: 500; }

.bell__end {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The break between two classes, on the line that joins their numbers. */
.bell-gap {
  position: relative;
  min-height: 1.5rem;
  padding: 0.1875rem 0 0.1875rem calc(1.75rem + var(--space-3));
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.bell-gap::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(0.875rem - 1px);
  border-left: 2px dotted var(--border-strong);
}

.bell-gap.is-overlap {
  color: var(--danger);
  font-weight: 600;
}

.bell-gap.is-overlap::before { border-left: 2px solid var(--danger); }

.bells__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Save: a bar that stays at the bottom of the window while the panels scroll. */
.savebar {
  position: sticky;
  bottom: var(--space-4);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.savebar__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: auto;
  color: var(--text-muted);
}

.savebar__status.is-dirty { color: var(--warning); }

.savebar__status.is-dirty::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.settings-notes {
  display: grid;
  gap: var(--space-2);
}

/* Screens: week template — the week as a timetable board; a subject keeps one colour all week */

.template-notes {
  display: grid;
  gap: var(--space-2);
}

.week-card { overflow: hidden; }

.week-toolbar { border-bottom: 1px solid var(--border); }

.week-toolbar > .field { flex: 0 1 10rem; }

/* The colour of a subject (and of a discipline on «Предметы»): the tones of the initials avatars. The window of a
   pair carries the colour of its card. */
.legend__item[data-tone="0"], .lesson[data-tone="0"], .pair[data-tone="0"], .discipline[data-tone="0"], .pair-details__head[data-tone="0"] { --lesson: var(--tone-0); --lesson-bg: var(--tone-0-bg); }
.legend__item[data-tone="1"], .lesson[data-tone="1"], .pair[data-tone="1"], .discipline[data-tone="1"], .pair-details__head[data-tone="1"] { --lesson: var(--tone-1); --lesson-bg: var(--tone-1-bg); }
.legend__item[data-tone="2"], .lesson[data-tone="2"], .pair[data-tone="2"], .discipline[data-tone="2"], .pair-details__head[data-tone="2"] { --lesson: var(--tone-2); --lesson-bg: var(--tone-2-bg); }
.legend__item[data-tone="3"], .lesson[data-tone="3"], .pair[data-tone="3"], .discipline[data-tone="3"], .pair-details__head[data-tone="3"] { --lesson: var(--tone-3); --lesson-bg: var(--tone-3-bg); }
.legend__item[data-tone="4"], .lesson[data-tone="4"], .pair[data-tone="4"], .discipline[data-tone="4"], .pair-details__head[data-tone="4"] { --lesson: var(--tone-4); --lesson-bg: var(--tone-4-bg); }
.legend__item[data-tone="5"], .lesson[data-tone="5"], .pair[data-tone="5"], .discipline[data-tone="5"], .pair-details__head[data-tone="5"] { --lesson: var(--tone-5); --lesson-bg: var(--tone-5-bg); }

/* Each subject of the group and how many pairs it has a week; a subject not in the week yet is dashed. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 1.75rem;
  padding: 0.125rem var(--space-3) 0.125rem var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.legend__swatch {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 3px;
  background: var(--lesson);
}

.legend__count {
  color: var(--text-muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.legend__item.is-unused {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.legend__item.is-unused .legend__swatch {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--lesson);
}

/* The grid scrolls inside its frame on a narrow window; the column of pairs stays in place. */
.week {
  width: 100%;
  min-width: 52rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.875rem;
}

.week th,
.week td {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.week th:first-child,
.week td:first-child,
.week th:nth-child(2),
.week td:nth-child(2) { border-left: 0; }

.week tbody tr:last-child > * { border-bottom: 0; }

.week thead th {
  height: 2.5rem;
  padding: 0 var(--space-3);
  background: var(--muted);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.week .week__corner {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 8rem;
}

/* The line on the right of the pinned column stays when the days scroll under it. */
.week .week__corner,
.week .week__slot { box-shadow: inset -1px 0 0 var(--border); }

.week__dayname { display: inline-block; }

.week__dayname::first-letter { text-transform: uppercase; }

.week .week__slot {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: var(--space-3);
  background: var(--surface);
  font-weight: 400;
}

.week__slot-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.week__number {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--primary-line);
  border-radius: 50%;
  background: var(--primary-wash);
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.week__time {
  display: grid;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.week__from { font-weight: 600; }

.week__to,
.week__time--none {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.week__time--none { padding-top: 0.25rem; }

.week__cell {
  height: 6rem;
  padding: var(--space-1);
}

/* The day opened from the schedule: its column is washed in the accent, its name underlined by an accent bar. */
.week thead th.is-target {
  background: var(--primary-wash);
  color: var(--primary-ink);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.week td.is-target {
  background: var(--primary-wash);
  box-shadow: inset 1px 0 0 var(--primary-line), inset -1px 0 0 var(--primary-line);
}

/* A pair of the template: the subject in its colour, the teacher, the room at the bottom. */
.lesson {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  width: 100%;
  height: 100%;
  min-height: 5.5rem;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-left: 3px solid var(--lesson);
  border-radius: var(--radius-inner);
  background: var(--lesson-bg);
  color: var(--text);
  text-align: left;
}

button.lesson:hover { box-shadow: inset 0 0 0 1px var(--lesson); }

.lesson:focus-visible,
.slot-add:focus-visible { outline-offset: -2px; }

.lesson__subject {
  color: var(--lesson);
  font-weight: 600;
  line-height: 1.3;
}

.lesson__teacher {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  line-height: 1.3;
}

.lesson__room {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lesson__room .icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-muted);
}

/* An empty place: a quiet plus that wakes up under the pointer. */
.slot-add {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 5.5rem;
  border: 1px dashed transparent;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-muted);
  opacity: 0.5;
}

.slot-add:hover,
.slot-add:focus-visible {
  border-color: var(--primary-line);
  background: var(--primary-wash);
  color: var(--primary-ink);
  opacity: 1;
}

.button--quiet-danger { color: var(--danger); }

.button--quiet-danger:hover { background: var(--danger-wash); }

/* A button that stands apart from the others, on the left of the dialog's buttons. */
.dialog__aside { margin-right: auto; }

/* The semester schedule */

.semester__range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.semester__range .icon { color: var(--primary-ink); }

.dialog--preview { width: min(calc(100% - 2rem), 36rem); }

/* What changes on the first line, what stays on the second. */
.dialog--preview .tally {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: none;
}

.dialog--preview .tally__item { grid-column: span 2; }

.dialog--preview .tally__item:nth-child(n + 4) { grid-column: span 3; }

@media (max-width: 30rem) {
  .dialog--preview .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .dialog--preview .tally__item,
  .dialog--preview .tally__item:nth-child(n + 4) { grid-column: auto; }
}

.dialog--preview .tally__count { font-size: 1.375rem; }

@media (prefers-reduced-motion: no-preference) {
  .lesson.is-fresh { animation: fresh-lesson 2.4s ease-out both; }
}

@keyframes fresh-lesson {
  from { box-shadow: 0 0 0 3px var(--primary-line); }
  to { box-shadow: 0 0 0 3px transparent; }
}

/* A semester of the year to switch to. The semester that is on carries a green light and «идёт сейчас», as a
   lamp over a door says the room is in session. */
.semester-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: 0 var(--space-4);
}

.semester-tab__name { font-weight: 600; }

.semester-tab__now {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.semester-tab__now::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--success-wash);
}

/* «Сейчас идёт» in the semester settings: two buttons under the dates. Read-only, the chosen one stays plain. */
.semester-now__switch { justify-self: start; }

.semester-now .segmented__button {
  min-height: 2.25rem;
  padding: 0 var(--space-4);
  font-weight: 600;
}

.semester-now .segmented__button:disabled[aria-pressed="true"] { opacity: 1; }

/* Screens: schedule — the week as day columns (a list on a narrower window), each day under its calendar page;
   a pair keeps its subject's colour on every schedule screen, and a cancelled one is struck out and hatched */

.badge--danger { border-color: var(--danger-line); background: var(--danger-wash); color: var(--danger); }

.schedule-notes {
  display: grid;
  gap: var(--space-2);
}

.schedule-card { overflow: hidden; }

.schedule-toolbar { border-bottom: 1px solid var(--border); }

.schedule-toolbar > .field { flex: 0 1 13rem; }

/* «‹ 16–22 ноября ›  Эта неделя» on the right of the toolbar. */
.week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.week-nav__label {
  min-width: 9.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.week-nav__this { margin-left: var(--space-2); }

/* The chevron points right; «back» buttons mirror it. */
.chevron-back .icon { transform: scaleX(-1); }

.schedule-day {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.schedule-day__input {
  width: auto;
  min-width: 10rem;
  font-variant-numeric: tabular-nums;
}

.schedule-day__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  font-weight: 600;
}

.schedule-day__label > span:first-child::first-letter { text-transform: uppercase; }

.schedule-empty { padding: var(--space-4); }

/* The week or the day being replaced by the next one stays, dimmed, until the answer comes. */
.schedule-body { transition: opacity 0.15s ease-out; }

.schedule-body.is-stale { opacity: 0.55; }

.schedule-week {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

/* Days: a list by default; every day is a header and its pairs side by side as far as they fit. */
.days {
  display: grid;
  gap: var(--space-3);
}

.day {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.day.is-today {
  border-color: var(--primary-line);
  background: var(--primary-wash);
}

.day.is-empty {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.day__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

/* The page of a tear-off calendar, as on the topics screen; today's page is filled with the accent. */
.day__leaf {
  display: grid;
  flex: none;
  width: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
  text-align: center;
}

.day__weekday {
  padding: 0.0625rem 0;
  background: var(--primary-wash);
  color: var(--primary-ink);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.day__number {
  padding: 0.0625rem 0 0.125rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.day.is-today .day__leaf { border-color: var(--primary-fill); }

.day.is-today .day__weekday,
.day.is-today .day__number {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.day__title {
  display: grid;
  min-width: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.3;
}

.day__name {
  font-weight: 600;
  display: inline-block;
}

.day__name::first-letter { text-transform: uppercase; }

.day__date {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

/* In the week of a group the name of a day opens that day of the group's week template: a quiet dotted line
   says it is a link, the accent comes on hover. */
.day__link {
  display: grid;
  min-width: 0;
  border-radius: var(--radius-inner);
  text-decoration: none;
}

.day__link .day__name {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--primary-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 1px;
}

.day__link:hover .day__name {
  color: var(--primary-ink);
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}

.day__head > .badge { margin-left: auto; }

.day__none {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.day.is-empty .day__none { justify-self: end; }

.day__pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-2);
}

.day__pairs > li { display: grid; }

/* Wide window: Monday to Saturday (and Sunday when it has a pair) as columns. */
@media (min-width: 75rem) {
  .schedule-week .days {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .schedule-week .days[data-count="7"] { grid-template-columns: repeat(7, minmax(0, 1fr)); }

  .schedule-week .day {
    align-content: start;
    min-height: 14rem;
    padding: var(--space-2);
  }

  .schedule-week .day.is-empty {
    grid-template-columns: none;
    align-items: start;
  }

  .schedule-week .day.is-empty .day__none {
    justify-self: center;
    padding-top: var(--space-6);
  }

  .schedule-week .day__pairs { grid-template-columns: minmax(0, 1fr); }

  .schedule-week .day__head { flex-wrap: wrap; }
}

/* One pair: time and number, the subject in its colour, who and where, the topic, the marks, the note. */
.pair {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3125rem;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--lesson);
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  line-height: 1.3;
}

button.pair:hover {
  border-color: var(--lesson);
  box-shadow: inset 0 0 0 1px var(--lesson);
}

.pair:focus-visible { outline-offset: 2px; }

.pair__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.pair__time {
  font-weight: 600;
  white-space: nowrap;
}

.pair__slot {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pair__subject {
  color: var(--lesson);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pair__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem var(--space-3);
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.pair__who {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pair__who .icon {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
}

.pair__who.is-substitute,
.schedule-table .is-substitute { color: var(--warning); }

.pair__topic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem var(--space-2);
  font-size: var(--hint-fs);
}

.pair__topic.is-none { color: var(--text-muted); }

/* The modules without hours marked on a lesson (one or two): «Модуль» and their names, on a line of their own. */
.lesson-controls {
  display: inline-flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem var(--space-2);
}

.lesson-controls__names {
  color: var(--warning);
  font-weight: 500;
}

.pair__flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.pair__moved {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem var(--space-2);
}

.pair__from {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.pair__note {
  padding-left: var(--space-2);
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  overflow-wrap: anywhere;
}

/* A cancelled pair: struck out on a hatched ground, its colour gone. */
.pair.is-cancelled {
  --lesson: var(--text-muted);
  border-left-color: var(--danger);
  background:
    repeating-linear-gradient(-45deg, transparent 0 7px, var(--border) 7px 8px),
    var(--surface);
}

.pair.is-cancelled .pair__subject {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.pair.is-cancelled .pair__time { color: var(--text-muted); }

button.pair.is-cancelled:hover { border-color: var(--danger-line); box-shadow: inset 0 0 0 1px var(--danger-line); }

@media (prefers-reduced-motion: no-preference) {
  .pair.is-fresh { animation: fresh-lesson 2.4s ease-out both; }
}

/* The week as a grid (a staff window from 1200 px): the pair numbers down the left with their time, written once,
   the days across under a head like the template board's; today's column is washed in the accent. A cell holds
   short cards; the whole pair is in its window. Keep the width in step with GRID_FROM in views/pairParts.js. */
.week-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* Narrow enough to leave the days room for «Понедельник» even with a Saturday column at 1200 px. */
.grid__slot-col { width: 6rem; }

.grid th,
.grid td {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.grid tr > :first-child { border-left: 0; }

.grid tbody tr:last-child > * { border-bottom: 0; }

.grid thead th {
  padding: var(--space-2);
  background: var(--muted);
  vertical-align: bottom;
}

.grid thead th:first-child { border-top-left-radius: calc(var(--radius-card) - 1px); }

.grid thead th:last-child { border-top-right-radius: calc(var(--radius-card) - 1px); }

.grid__corner {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.grid__dayhead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}

.grid__daytitle,
.grid__daytitle > .day__link {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.grid__day .day__name {
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid__date {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Today: the head under an accent bar, its column washed. */
.grid thead th.is-today {
  background: var(--primary-wash);
  box-shadow: inset 0 3px 0 var(--primary);
}

.grid__day.is-today .day__name { color: var(--primary-ink); }

.grid td.is-today { background: var(--primary-wash); }

.grid__slot {
  padding: var(--space-3) var(--space-2);
  background: var(--surface);
  font-weight: 400;
}

.grid__pair {
  display: block;
  font-weight: 600;
  white-space: nowrap;
}

.grid__time {
  display: block;
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.grid__cell { padding: var(--space-1); }

.grid__pairs {
  display: grid;
  gap: var(--space-1);
}

.grid__pairs > li { display: grid; }

/* The short card: the subject on up to three lines, then one line each for who and where and for the lesson, then the
   marks. Lines that do not fit end in an ellipsis; the window has them in full. The subject breaks between words; a word
   longer than the card («Предпринимательство» in a narrow column) breaks at a soft hyphen (hyphenate in pairs.js). */
.pair--brief {
  gap: 0.1875rem;
  min-width: 0;
  padding: 0.4375rem 0.375rem var(--space-2) var(--space-2);
  font-size: var(--hint-fs);
}

.pair--brief .pair__time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.pair--brief .pair__subject {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.875rem;
  line-height: 1.25;
  overflow-wrap: break-word;
  hyphens: auto;
}

.pair__line {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair__line .pair__who {
  display: inline;
  margin-right: var(--space-2);
}

.pair__line .pair__who:last-child { margin-right: 0; }

.pair__line .pair__who .icon {
  margin-right: 0.1875rem;
  vertical-align: -0.125rem;
}

.pair__line--topic { color: var(--text); }

.pair__line--topic.is-none { color: var(--text-muted); }

.pair__marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.125rem;
}

.pair__has-note {
  display: inline-grid;
  place-items: center;
  color: var(--text-muted);
}

.pair__has-note .icon {
  width: 1rem;
  height: 1rem;
}

/* The day of all groups as a table. */
.schedule-table .table { min-width: 64rem; }

.schedule-table__when {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.schedule-table__time { font-variant-numeric: tabular-nums; }

.schedule-table__topic {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem var(--space-2);
}

.schedule-table__status { max-width: 16rem; }

.schedule-table .table__actions { text-align: right; }

.schedule-table__open {
  min-height: 2rem;
  padding: 0 var(--space-3);
  white-space: nowrap;
}

.schedule-table tr.is-cancelled td { color: var(--text-muted); }

.schedule-table tr.is-cancelled .table__label { text-decoration: line-through; }

/* The dialog of a pair. */
.dialog--pair { width: min(calc(100% - 2rem), 34rem); }

.pair-now {
  display: grid;
  gap: var(--space-2);
}

.pair-now__place {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pair-now__place .icon { flex: none; color: var(--primary-ink); }

.pair-now__place > span::first-letter { text-transform: uppercase; }

.pair-now__note {
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
}

.pair-when {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-4);
  align-items: start;
}

/* The change dialog names the lesson in full under the place. */
.pair-now__topic {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.pair-now__topic > .icon {
  flex: none;
  margin-top: 0.125rem;
  color: var(--primary-ink);
}

.pair-now__topic.is-none { color: var(--text-muted); }

.pair-now__lesson {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem var(--space-2);
}

/* The window of a pair: the subject under a bar in its colour, as on its card; then the facts, a label on the left
   of each (above it on a phone). */
.pair-details__head {
  display: grid;
  gap: var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--lesson);
}

.pair-details__head .dialog__kicker { margin-bottom: 0; }

.pair-details__head .dialog__title { overflow-wrap: anywhere; }

.pair-facts { border-top: 1px solid var(--border); }

.pair-facts__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.pair-facts dt {
  padding-top: 0.0625rem;
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 500;
}

.pair-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
  overflow-wrap: anywhere;
}

.pair-facts .badge { white-space: normal; }

.pair-facts__when { font-variant-numeric: tabular-nums; }

.pair-facts__when::first-letter { text-transform: uppercase; }

.pair-facts__topic {
  flex: 1 1 100%;
  font-weight: 500;
}

.pair-facts__note { white-space: pre-line; }

@media (max-width: 30rem) {
  .pair-facts__row { grid-template-columns: minmax(0, 1fr); }
}

/* «Моё расписание»: today's day is scrolled to under the sticky bar, not behind it. */
.my-week .day { scroll-margin-top: calc(var(--topbar-h) + var(--space-3)); }

/* On the student's phone nothing is smaller than 16 px: the small print of a pair and the calendar page grow. */
.student .pair__slot,
.student .pair__from { font-size: 1rem; }

.student .day__leaf { width: 3.25rem; }

.student .day__weekday {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.student .day__number { font-size: 1.25rem; }

/* An empty today has the «Сегодня» badge in its head: «Пар нет» goes under it instead of beside. */
.student .day.is-today.is-empty { grid-template-columns: minmax(0, 1fr); }

.student .day.is-today.is-empty .day__none { justify-self: start; }

/* The week switcher on a phone: arrows at the edges, the week between them, «Эта неделя» on its own line. */
.student .week-nav {
  flex: 1 1 100%;
  margin-left: 0;
}

.student .week-nav__label {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
}

.student .week-nav__this {
  flex: 1 1 100%;
  margin-left: 0;
}

@media (min-width: 36rem) {
  .student .week-nav__this { flex: none; }
}

.subject__plan { flex: none; }

/* Screens: the syllabus of a subject — the title page as a strip of facts, the thematic plan by units with the
   dates of the group, the descriptions of the topics. A date carries the letter of its lesson type in the colour
   the pair cards use for that type (lecture blue, practice green, module amber), so the plan reads like the week. */

.syllabus {
  display: grid;
  gap: var(--space-5);
  transition: opacity 0.15s ease-out;
}

.syllabus > * { min-width: 0; }

.syllabus.is-stale { opacity: 0.55; }

/* The title on the left, the buttons of the file on the right (below it when there is no room); a message and
   «Как заполнить шаблон» take the whole width under both. */
.syllabus-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.syllabus-head__text {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.syllabus-tools { display: contents; }

.syllabus-tools__row,
.syllabus-tools__buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* The two buttons keep together: when the row is short of room, the help link goes onto a line of its own. */
.syllabus-tools__buttons { min-width: 0; }

.syllabus-tools > .note,
.syllabus-help { flex: 1 1 100%; }

/* «Как заполнить шаблон»: a quiet disclosure in front of the buttons; its chevron turns down when it is open. */
.help-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--primary-ink);
  font-size: var(--control-fs);
  font-weight: 500;
}

.help-toggle:hover { background: var(--secondary); }

.help-toggle .icon {
  width: 1rem;
  height: 1rem;
}

.help-toggle__chevron { transition: transform 0.15s ease-out; }

.help-toggle[aria-expanded="true"] .help-toggle__chevron { transform: rotate(90deg); }

.syllabus-help {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.syllabus-help[hidden] { display: none; }

.syllabus-help__list {
  display: grid;
  gap: var(--space-3) var(--space-6);
}

@media (min-width: 64rem) {
  .syllabus-help__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.syllabus-help__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  line-height: 1.5;
}

.syllabus-help__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-inner);
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.syllabus-help__icon .icon {
  width: 1rem;
  height: 1rem;
}

/* The check window of a syllabus file: whose it is and which file, then each semester on a plate with a primary
   spine (what it holds, what it changes), then remarks in amber and errors in red, each as a list that scrolls on
   its own so that the buttons stay in reach. */
.dialog--check { width: min(calc(100% - 2rem), 42rem); }

.check-head {
  display: grid;
  gap: var(--space-1);
  margin-top: calc(-1 * var(--space-2));
}

.check-head__whose { color: var(--text); }

.check-head__file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.check-head__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--success);
}

.check-head__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-semesters {
  display: grid;
  gap: var(--space-2);
}

.check-semester {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--muted);
  box-shadow: inset 3px 0 0 var(--primary);
}

.check-semester__figures {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.check-semester__change {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
}

.check-semester__change.is-first { color: var(--primary-ink); }

.check-group {
  display: grid;
  gap: var(--space-2);
}

.check-group__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.check-group__count {
  min-width: 1.5rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.375rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.check-group--warning .check-group__count { background: var(--warning-wash); color: var(--warning); }

.check-group--error .check-group__count { background: var(--danger-wash); color: var(--danger); }

.check-group__hint {
  margin-top: calc(-1 * var(--space-1));
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.check-list {
  max-height: min(18rem, 38vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}

.check-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.45;
}

.check-list__item:first-child { border-top: 0; }

.check-list__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15em;
}

.check-group--warning .check-list__icon { color: var(--warning); }

.check-group--error .check-list__icon { color: var(--danger); }

.check-list__where {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.check-list__count { color: var(--text-muted); }

.check-failed {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--danger);
  font-weight: 500;
}

.check-failed__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1em;
}

.syllabus-head__kicker {
  color: var(--primary-ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.syllabus-head__who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  color: var(--text-muted);
}

.syllabus-head__teacher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.syllabus-head__teacher .icon {
  width: 1rem;
  height: 1rem;
}

/* The group and the semester: links drawn as a segmented control; the page shown is the pressed one. */
.syllabus-switches {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3) var(--space-6);
}

.syllabus-switch {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
  max-width: 100%;
}

.syllabus-switch__links {
  flex-wrap: wrap;
  max-width: 100%;
}

.syllabus-switch__links .segmented__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.syllabus-switch__links .segmented__button[aria-current="page"] {
  background: var(--seg-active);
  box-shadow: var(--seg-shadow);
  color: var(--text);
}

.syllabus-switch__hint {
  max-width: 34rem;
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.syllabus-card__title {
  padding: var(--space-4) var(--space-5) 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* «Титул»: a strip of facts, each under a hairline; a row of the strip stretches to the edge. */
.facts {
  display: flex;
  flex-wrap: wrap;
  margin: var(--space-3) 0 0 -1px;
}

.fact {
  display: grid;
  flex: 1 1 11rem;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.fact__label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.fact__value {
  font-size: 0.9375rem;
  font-weight: 500;
}

.fact__value.is-empty { color: var(--text-muted); }

.syllabus-notes {
  display: grid;
  gap: var(--space-2);
}

/* «Тематический план» */
.syllabus-plan { overflow: hidden; }

.syllabus-plan .syllabus-card__title { padding-bottom: var(--space-3); }

.plan-table {
  min-width: 42rem;
  border-top: 1px solid var(--border);
}

.plan-table .num {
  width: 1%;
  padding-inline: var(--space-4);
  text-align: right;
}

.plan-table .plan-table__pairs { width: 25%; }

.plan-table td { vertical-align: top; }

.plan-table td.num { padding-top: calc(var(--space-3) + 0.0625rem); }

/* «Юнит 1»: a line of small capitals over its rows; the next unit also gets a stronger rule. */
.plan-unit__head th {
  height: auto;
  padding-block: var(--space-4) var(--space-2);
  color: var(--primary-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A unit with a title reads as a line of text, not as a label: «Юнит 1. Техническое и программное обеспечение». */
.plan-unit__head th.has-title {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.plan-unit + .plan-unit .plan-unit__head th { border-top: 1px solid var(--border-strong); }

.plan-row__title { line-height: 1.4; }

.plan-row__name { font-weight: 500; }

.plan-row__kind {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* The hours as a line under the topic: only where the columns are not shown. */
.plan-row__summary { display: none; }

.plan-row__planned { color: var(--text-muted); }

.plan-none { color: var(--text-muted); }

/* The module (рубежный контроль) that closes a unit: an amber band with a bar on its left. */
.syllabus-plan .plan-row.is-control td { background: var(--warning-wash); }

.syllabus-plan .plan-row.is-control td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.plan-row.is-control .plan-row__name {
  color: var(--warning);
  font-weight: 600;
}

/* The dates of the group's pairs: a tab with the letter of the lesson type, then the day. */
.dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
}

.date {
  display: inline-flex;
  align-items: stretch;
  min-height: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

.date__type {
  display: grid;
  place-items: center;
  min-width: 1.375rem;
  padding: 0 0.25rem;
  background: var(--muted);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  text-decoration: none;
  cursor: help;
}

.date[data-type="lecture"] .date__type { background: var(--primary-wash); color: var(--primary-ink); }
.date[data-type="practice"] .date__type { background: var(--success-wash); color: var(--success); }
.date[data-type="control"] .date__type { background: var(--warning-wash); color: var(--warning); }

.date__day {
  display: flex;
  align-items: center;
  padding: 0 0.4375rem;
}

.date.is-held { border-color: var(--success-line); }

.date__held {
  align-self: center;
  width: 0.875rem;
  height: 0.875rem;
  margin-right: 0.375rem;
  color: var(--success);
}

.date.is-missing {
  align-items: center;
  padding: 0 var(--space-2);
  border-style: dashed;
  border-color: var(--warning-line);
  background: transparent;
  color: var(--warning);
}

/* «Итого» */
.syllabus-plan .plan-total th,
.syllabus-plan .plan-total td {
  height: auto;
  padding-block: var(--space-3);
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  background: var(--muted);
  color: var(--text);
  font-size: inherit;
  font-weight: 700;
}

/* «Описание тем»: the topic on the left, what it is about on the right, as in a glossary. */
.about { padding: 0 var(--space-5) var(--space-2); }

.about__item {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--space-1) var(--space-6);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.about__item:first-child { border-top: 0; }

.about__topic { font-weight: 600; }

.about__text {
  max-width: 44rem;
  line-height: 1.55;
  white-space: pre-line;
}

@media (max-width: 48rem) {
  .about__item { grid-template-columns: minmax(0, 1fr); }
}

/* On the student's phone nothing is smaller than 16 px. */
.student .syllabus-head__kicker,
.student .fact__label,
.student .semester-tab__now,
.student .plan-table,
.student .plan-unit__head th,
.student .plan-row__kind,
.student .date,
.student .date__type { font-size: 1rem; }

.student .fact__value { font-size: 1rem; }

.student .semester-tab { min-height: var(--seg-h); }

.student .date { min-height: 2rem; }

.student .date__type { min-width: 1.75rem; }

/* A narrow screen: the switches take the whole width, the facts read as «label — value» lines, and the plan
   becomes a list (the same table, laid out by these rules only): the topic, its hours under it, then its dates. */
@media (max-width: 36rem) {
  .syllabus-switch,
  .syllabus-switch__links { width: 100%; }

  .syllabus-switch__links .segmented__button {
    flex: 1 1 0;
    flex-wrap: wrap;
    gap: 0 var(--space-2);
    min-width: 0;
    padding-block: var(--space-1);
  }

  .syllabus-card__title { padding-inline: var(--space-4); }

  .fact {
    flex-basis: 100%;
    gap: 0.125rem;
    padding: var(--space-2) var(--space-4) var(--space-3);
    border-left: 0;
  }

  .syllabus-plan .table-scroll { overflow: visible; }

  .plan-table,
  .plan-table tbody,
  .plan-table tfoot { display: block; }

  .plan-table { min-width: 0; }

  .plan-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .plan-table tr {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
  }

  .syllabus-plan .plan-table th,
  .syllabus-plan .plan-table td {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    white-space: normal;
  }

  .syllabus-plan .plan-table .num { display: none; }

  .plan-row__summary {
    display: block;
    margin-top: var(--space-1);
    color: var(--text-muted);
    font-size: var(--hint-fs);
  }

  .plan-row__hours { white-space: nowrap; }

  .plan-unit__head { border-bottom: 0; }

  .syllabus-plan .plan-unit__head th { padding-top: var(--space-2); }

  .plan-unit + .plan-unit .plan-unit__head { border-top: 1px solid var(--border-strong); }

  .syllabus-plan .plan-unit + .plan-unit .plan-unit__head th { border-top: 0; }

  .plan-row.is-control {
    background: var(--warning-wash);
    box-shadow: inset 3px 0 0 var(--warning);
  }

  .syllabus-plan .plan-row.is-control td,
  .syllabus-plan .plan-row.is-control td:first-child { background: none; box-shadow: none; }

  .syllabus-plan .plan-total {
    border-top: 1px solid var(--border-strong);
    border-bottom: 0;
    background: var(--muted);
  }

  .syllabus-plan .plan-total th,
  .syllabus-plan .plan-total td { border: 0; background: none; }

  .plan-total .plan-row__summary {
    color: var(--text);
    font-weight: 500;
  }

  .about { padding-inline: var(--space-4); }
}

/* The syllabus page, task 43: the bar of the version, the list of sections, every section of the syllabus.
   The bar reads like the spine of a file folder: a rail in the colour of the status on its left (approved green,
   under review blue, returned amber, a draft grey), the status in words, the switch to the other version, the
   buttons. Everything written in the syllabus is plain text in the colours of the theme. */

.version-bar {
  --tone: var(--text-muted);
  --tone-wash: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--tone-wash), transparent 18rem), var(--surface);
  box-shadow: inset 4px 0 0 var(--tone), var(--shadow-card);
}

.version-bar[data-tone="success"] { --tone: var(--success); --tone-wash: var(--success-wash); }
.version-bar[data-tone="primary"] { --tone: var(--primary); --tone-wash: var(--primary-wash); }
.version-bar[data-tone="warning"] { --tone: var(--warning); --tone-wash: var(--warning-wash); }

.version-bar__status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  margin-right: auto;
  font-weight: 600;
}

.version-bar__dot {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 4px var(--tone-wash);
}

.version-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.version-bar__error { flex: 1 1 100%; }

/* «Утверждённая / Новая версия»: the version shown is the pressed one; the new one carries its status. */
.version-switch .segmented__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.version-switch .segmented__button[aria-current="page"] {
  background: var(--seg-active);
  box-shadow: var(--seg-shadow);
  color: var(--text);
}

.version-switch__status {
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
}

.version-switch__status[data-status="review"] { background: var(--primary-wash); color: var(--primary-ink); }
.version-switch__status[data-status="returned"] { background: var(--warning-wash); color: var(--warning); }

.syllabus-remark .sform-remark__title { margin: 0; }

.syllabus-open-note { max-width: 60rem; }

/* «Разделы»: the sections shown, as quiet chips in one wrapping row. */
.syllabus-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.syllabus-toc__title {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.syllabus-toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.syllabus-toc__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--control-fs);
  font-weight: 500;
}

.syllabus-toc__link:hover { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary-ink); }

/* A section: a card under its title; the title is where the list of sections lands, clear of the top bar. */
.syllabus-sec { overflow: hidden; scroll-margin-top: calc(var(--topbar-h) + var(--space-4)); }

.syllabus-sec .syllabus-card__title:focus { outline: none; }

.syllabus-sec .syllabus-card__title:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.syllabus-sec > .facts { margin-bottom: 0; }

.syllabus-sec__body {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.fact--wide { flex-basis: 100%; }

.fact__value.is-pre { white-space: pre-line; overflow-wrap: anywhere; }

/* «Цель и результаты»: the aim as a short lead, the outcomes side by side. */
.goal {
  display: grid;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: 3px solid var(--primary);
}

.goal__title,
.outcomes__title,
.syl-points__title,
.unit-card__label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.goal__text {
  max-width: 52rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.outcomes {
  display: grid;
  gap: var(--space-3);
}

.outcomes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-3);
}

.outcomes__grid .syl-points {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
}

.syl-points {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.syl-points__list {
  display: grid;
  gap: var(--space-2);
  padding-left: 1.25rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

ul.syl-points__list { list-style: disc; }

ol.syl-points__list { padding-left: 1.5rem; list-style: decimal; }

.syl-points__list li::marker { color: var(--primary-ink); font-weight: 600; }

/* Inside a box of outcomes the name of the list is a plain heading: the eyebrow above the boxes names the group. */
.outcomes__grid .syl-points__title {
  color: var(--text);
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
}

/* «Тематический план»: the number of the journal as a small chip in the colour of the kind. */
.syllabus-plan .syllabus-notes { padding: 0 var(--space-5) var(--space-3); }

.lesson-no {
  --kind: var(--primary-ink);
  --kind-wash: var(--primary-wash);
  display: inline-block;
  min-width: 2rem;
  margin-right: var(--space-2);
  padding: 0 0.3125rem;
  border-radius: 5px;
  background: var(--kind-wash);
  color: var(--kind);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5rem;
  text-align: center;
  vertical-align: 0.0625rem;
}

.lesson-no[data-kind="practice"],
.lesson-no[data-kind="seminar"],
.lesson-no[data-kind="lab"] { --kind: var(--success); --kind-wash: var(--success-wash); }

.lesson-no[data-kind="control"] { --kind: var(--warning); --kind-wash: var(--warning-wash); }

.plan-table .plan-table__kind {
  width: 1%;
  color: var(--text-muted);
  white-space: nowrap;
}

.plan-table td.plan-table__kind { padding-top: calc(var(--space-3) + 0.0625rem); }

.plan-table .plan-row__kind {
  display: inline;
  font-size: inherit;
}

.plan-row__forms {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

/* «Описание юнитов»: a card for each unit, its number as an eyebrow, the key questions numbered. */
.unit-cards {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.unit-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
}

.unit-card__title {
  display: grid;
  gap: var(--space-1);
  font-size: 1rem;
  font-weight: 600;
}

.unit-card__no {
  color: var(--primary-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-card__lead,
.unit-card__text {
  max-width: 52rem;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.unit-card__block {
  display: grid;
  gap: var(--space-2);
}

.unit-card__questions {
  display: grid;
  gap: var(--space-2);
  padding-left: 1.5rem;
  list-style: decimal;
  line-height: 1.5;
}

.unit-card__questions li::marker { color: var(--primary-ink); font-weight: 700; }

.unit-card .about { padding: 0; }

.unit-card .about__item { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); padding: var(--space-3) 0; }

/* «СРС»: each work as a row: its name and where it belongs, then its tasks. */
.self-works {
  display: grid;
  padding: var(--space-2) var(--space-5) var(--space-4);
}

.self-work {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.self-work:first-child { border-top: 0; }

.self-work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.self-work__name {
  font-size: 0.9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.self-work__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.self-work__tasks {
  display: grid;
  gap: var(--space-1);
  padding-left: 1.25rem;
  color: var(--text-muted);
  list-style: disc;
  line-height: 1.5;
}

/* «Литература»: a book as a library card writes it. */
.books {
  display: grid;
  gap: var(--space-3);
  counter-reset: book;
}

.book {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  padding-left: 2rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  counter-increment: book;
}

.book::before {
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  content: counter(book) ".";
}

.book__authors { color: var(--text-muted); }

.book__title { font-weight: 600; }

.book__imprint { color: var(--text-muted); }

.book__have {
  display: inline-flex;
  flex-basis: 100%;
  align-items: center;
  gap: var(--space-1);
  color: var(--success);
  font-size: var(--hint-fs);
}

.book__have .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.books-block {
  display: grid;
  gap: var(--space-3);
}

/* «Программное обеспечение» */
.software {
  display: grid;
  padding: var(--space-2) var(--space-5) var(--space-4);
}

.software__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.software__item:first-child { border-top: 0; }

.software__name { font-weight: 600; overflow-wrap: anywhere; }

.software__link {
  min-width: 0;
  color: var(--primary-ink);
  overflow-wrap: anywhere;
}

.software__url.is-text { color: var(--text-muted); overflow-wrap: anywhere; }

/* «Политики»: the grading scale as a table, each grade under a hairline in its colour (as in the form). */
.grading {
  display: grid;
  gap: var(--space-3);
}

.grading .table-scroll {
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}

.grading-table { min-width: 48rem; }

.grading-table th,
.grading-table td { vertical-align: top; }

.grading-table thead .grading-table__grade { box-shadow: inset 0 3px 0 var(--grade); }

.grading-table [data-grade="fail"] { --grade: var(--danger); }
.grading-table [data-grade="fair"] { --grade: var(--warning); }
.grading-table [data-grade="good"] { --grade: var(--primary); }
.grading-table [data-grade="excellent"] { --grade: var(--success); }

.table.grading-table th.grading-table__name {
  height: auto;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: normal;
}

.grading-table__max { font-weight: 600; }

.grade-cell__name { display: none; }

.grade-cell__range {
  display: block;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.grade-cell__criteria {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  line-height: 1.45;
  white-space: pre-line;
}

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-5);
}

.rule-block {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.rule-block__sanction {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-inner);
  background: var(--danger-wash);
  color: var(--danger);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rule-block__sanction .icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
}

/* The windows of the deanery: what stops the approval, and the remark of a return. */
.dialog--approve { width: min(calc(100% - 2rem), 34rem); }

.approve-checks {
  display: grid;
  gap: var(--space-2);
}

.approve-checks__lead {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--danger);
  font-weight: 600;
}

.approve-checks__lead .icon { width: 1rem; height: 1rem; }

.approve-checks .sform-checks__list {
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}

.approve-checks__hint { color: var(--text-muted); font-size: var(--hint-fs); }

.dialog--return { width: min(calc(100% - 2rem), 36rem); }

.return-lead { color: var(--text-muted); }

.dialog--return .field__textarea { min-height: 9rem; resize: vertical; }

.return-under {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.return-under .field__error[hidden] { display: none; }

.return-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* On the student's phone nothing is smaller than 16 px and nothing to tap is lower than 44 px. */
.student .syllabus-toc__title,
.student .syllabus-toc__link,
.student .lesson-no,
.student .plan-row__forms,
.student .goal__title,
.student .outcomes__title,
.student .syl-points__title,
.student .unit-card__label,
.student .unit-card__no,
.student .book__have,
.student .grade-cell__criteria,
.student .self-work__name,
.student .version-switch__status,
.student .grade-cell__name { font-size: 1rem; }

.student .grading-table,
.student .table.grading-table th.grading-table__name { font-size: 1rem; }

.student .syllabus-toc__link { min-height: 2.75rem; padding-inline: var(--space-4); }

.student .software__link { display: inline-flex; align-items: center; min-height: 2.75rem; }

.student .syllabus-plan .plan-row__summary { font-size: 1rem; }

.student .lesson-no { line-height: 1.75rem; }

/* A narrow window: the bar stacks, the kind of a lesson goes into its line of hours, the grading scale becomes a
   card per kind of control with its four grades. */
@media (max-width: 36rem) {
  .version-bar { padding-left: var(--space-4); }

  .version-bar__status { flex: 1 1 100%; }

  .version-switch { width: 100%; }

  .version-switch .segmented__button { flex: 1 1 0; justify-content: center; }

  .version-bar__actions,
  .version-bar__actions .button { width: 100%; }

  .syllabus-plan .plan-table .plan-table__kind { display: none; }

  .syllabus-sec__body,
  .unit-cards,
  .self-works,
  .software { padding-inline: var(--space-4); }

  .syllabus-plan .syllabus-notes { padding-inline: var(--space-4); }

  .unit-card { padding: var(--space-3) var(--space-4) var(--space-4); }

  .unit-card .about__item { grid-template-columns: minmax(0, 1fr); }

  .grading .table-scroll { overflow: visible; border: 0; }

  .grading-table,
  .grading-table tbody { display: block; min-width: 0; }

  .grading-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .grading-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
  }

  .table.grading-table th,
  .table.grading-table td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }

  .table.grading-table .grading-table__grade {
    grid-column: 1 / -1;
    padding-left: var(--space-3);
    box-shadow: inset 3px 0 0 var(--grade);
  }

  .grade-cell__name {
    display: block;
    color: var(--text-muted);
    font-size: var(--hint-fs);
    font-weight: 600;
  }
}

@media (max-width: 36rem) {
  .week-nav { margin-left: 0; }

  .schedule-day__label { margin-left: 0; }
}

/* Screens: «Предметы» of the deanery — a discipline once, its teachers in the rows beside it; each group a chip that
   opens it; the syllabus of the teacher as a status. A discipline carries the colour its pairs have in the schedule. */

.subjects-table { min-width: 34rem; }

/* The discipline spans the rows of its teachers; a stronger rule starts the next discipline. */
.subjects-table .subjects-block + .subjects-block { border-top: 1px solid var(--border-strong); }

.table.subjects-table th.subjects-table__discipline {
  width: 17%;
  height: auto;
  padding: calc(var(--space-3) + 0.4rem) var(--space-2) var(--space-3) var(--space-4);
  border-bottom: 0;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: normal;
  vertical-align: top;
}

.subjects-table .subjects-table__discipline-col { width: 17%; }

/* Room for three groups side by side, and for the line under one of them. */
.subjects-table .subjects-table__groups { min-width: 8rem; }

/* The teacher's cell is the first of a row only under the first teacher: the same inset under every one. */
.table.subjects-table td.subjects-table__teacher { padding-left: var(--space-2); }

.subjects-table .person { min-width: 0; }

/* The row just added or given another teacher: the primary bar on the teacher, where the row begins. */
.table.subjects-table tr.is-fresh td.subjects-table__teacher { box-shadow: inset 3px 0 0 var(--primary); }

.discipline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.discipline__swatch {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 3px;
  background: var(--lesson, var(--primary));
  box-shadow: 0 0 0 3px var(--lesson-bg, var(--primary-wash));
}

/* The groups of a row: a chip each, then a line for each group whose schedule differs from the plan. */
.groups {
  display: grid;
  gap: var(--space-2);
}

.group-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  min-height: 1.75rem;
  padding: 0 0.625rem;
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  background: var(--primary-wash);
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

button.group-chip {
  cursor: pointer;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}

button.group-chip:hover {
  border-color: var(--primary);
  background: var(--accent);
}

.group-chip__icon {
  width: 0.8125rem;
  height: 0.8125rem;
  opacity: 0.5;
  transition: opacity 0.15s ease-out;
}

button.group-chip:hover .group-chip__icon,
button.group-chip:focus-visible .group-chip__icon { opacity: 1; }

.group-chip--small {
  min-height: 1.375rem;
  padding: 0 var(--space-2);
  font-size: 0.75rem;
}

.groups__note {
  color: var(--warning);
  font-size: 0.75rem;
  line-height: 1.35;
}

.groups__note.is-calm { color: var(--text-muted); }

.groups__note-group {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.syllabus-state {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
}

.syllabus-state__actions .button {
  padding-inline: var(--space-3);
  white-space: nowrap;
}

.syllabus-state__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.syllabus-state__open {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  border-radius: 6px;
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.syllabus-state__open:hover { text-decoration: underline; }

.syllabus-state__open .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.reload-failed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.reload-failed > .note { flex: 1 1 18rem; }

/* «Добавить предмет»: the steps of the window, the discipline, the rows «группа — преподаватель». */
.dialog--subject { width: min(calc(100% - 2rem), 38rem); }

.stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-2));
}

.stepper__step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 500;
}

/* The line that joins the two steps. */
.stepper__step + .stepper__step::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--border-strong);
}

.stepper__number {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stepper__number .icon {
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 2.25;
}

.stepper__step.is-current { color: var(--text); }

.stepper__step.is-current .stepper__number {
  border-color: var(--primary-fill);
  background: var(--primary-fill);
  color: var(--on-primary);
}

.stepper__step.is-done .stepper__number {
  border-color: var(--success-line);
  background: var(--success-wash);
  color: var(--success);
}

.pick-discipline {
  display: grid;
  gap: var(--space-2);
}

.field-link {
  justify-self: start;
  border-radius: 4px;
  color: var(--primary-ink);
  font-size: var(--hint-fs);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--primary-line);
  text-underline-offset: 0.2em;
}

.field-link:hover { text-decoration-color: currentColor; }

.pick {
  display: grid;
  gap: var(--space-2);
}

.pick__rows {
  display: grid;
  gap: var(--space-2);
}

.pick__head,
.pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) var(--control-h);
  gap: var(--space-2);
  align-items: start;
}

.pick__head {
  font-size: var(--control-fs);
  font-weight: 500;
  line-height: 1.3;
}

/* A row's cross sits in the third column; a lone row keeps the column empty. */
.pick-row__remove { grid-column: 3; }

/* «Ещё группа»: the place of the next row, drawn dashed. */
.pick-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: calc(100% - var(--control-h) - var(--space-2));
  min-height: var(--control-h);
  padding: var(--space-1) var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--control-fs);
  font-weight: 500;
}

.pick-more .icon {
  width: 1rem;
  height: 1rem;
}

.pick-more:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.pick-more:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Step 2: the discipline on top, each teacher with their groups, the state of the syllabus and its buttons. */
.added {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}

.added__head {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

.added__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.added__item + .added__item { border-top: 1px solid var(--border); }

.added__item .person { min-width: 0; }

.added__groups {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: 0.25rem;
}

.added__side {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
}

.added__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* The check window of a syllabus file: a file that adds and removes rows says what happens to a renamed topic. */
.check-renamed {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--primary-ink);
  font-size: var(--hint-fs);
  line-height: 1.4;
}

.check-renamed__icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1em;
}

/* A window beside the sidebar that is short of room (up to 1200 px): the table drops the initials, not a column. */
@media (min-width: 900px) and (max-width: 75rem) {
  .subjects-table .person .avatar { display: none; }
}

@media (max-width: 36rem) {
  .added__side { justify-items: start; }

  .added__buttons { justify-content: flex-start; }
}

/* The way into the syllabus form on the syllabus page: beside the buttons of the file; an error under both. */
.syllabus-head__form { margin-left: auto; }

.syllabus-head__note { flex: 1 1 100%; }

/* Screens: the syllabus form — a document in sections. The tabs are the numbered sections of the reference
   syllabus; the lessons of the plan carry the letter and colour of their kind, as the dates on the syllabus page
   do (lecture blue, the practical kinds green, the module amber), so a unit reads as the week it will become. */

.sform {
  display: grid;
  gap: var(--space-5);
}

.sform > * { min-width: 0; }

.sform .back-link { margin-bottom: calc(-1 * var(--space-3)); }

.sform-head {
  display: grid;
  gap: var(--space-2);
}

.sform-head__kicker {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sform-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  color: var(--text-muted);
}

.sform-head__version {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sform-head__who {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.sform-head__who .icon {
  width: 1rem;
  height: 1rem;
}

/* The remark of the deanery: a note pinned on top, on an amber ground with a bar on its left. */
.sform-remark {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-card);
  background: var(--warning-wash);
  box-shadow: inset 4px 0 0 var(--warning);
}

.sform-remark__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--warning);
  color: #1a1300;
}

.sform-remark__icon .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.sform-remark__body {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.sform-remark__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
  color: var(--warning);
  font-size: 0.9375rem;
  font-weight: 700;
}

.sform-remark__when {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 500;
}

.sform-remark__text {
  max-width: 60rem;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* The tabs: the sections as pills on one track, wrapping onto a second line on a laptop; on a narrow window
   the track scrolls sideways instead. The tab shown is raised with its number filled in the accent; a tab with
   unsaved changes carries an amber dot. */
.sform-tabs {
  overflow-x: auto;
  border-radius: var(--radius-control);
  background: var(--seg-track);
  scrollbar-width: thin;
}

.sform-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 3px;
  list-style: none;
}

.sform-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-inner);
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.sform-tab:hover { color: var(--text); }

.sform-tab[aria-current="page"] {
  background: var(--seg-active);
  box-shadow: var(--seg-shadow);
  color: var(--text);
}

.sform-tab__no {
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 6px;
  background: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sform-tab[aria-current="page"] .sform-tab__no {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.sform-tab__dot {
  display: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--warning);
}

.sform-tab.is-dirty .sform-tab__dot { display: block; }

@media (max-width: 48rem) {
  .sform-tabs__list {
    flex-wrap: nowrap;
    width: max-content;
  }
}

.sform-panel { overflow: hidden; }

.sform-panel__title {
  padding: var(--space-5) var(--space-6) 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sform-panel__body {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.sform-panel__body > .empty { margin: var(--space-4) 0; }

/* Fields of the form */

.field__textarea {
  min-height: 4.5rem;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  padding: var(--space-2) var(--space-3);
  line-height: 1.5;
  resize: vertical;
}

/* A version that is not edited: the values stay readable, nothing looks like it can be typed into. */
.sform .field__input:disabled {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
  opacity: 1;
  cursor: default;
}

.sform select.field__input:disabled { appearance: none; }

.sform-readonly { max-width: 60rem; }

/* «Титул»: what the journal knows itself, then four blocks of fields, two side by side on a wide window. */
.sform-fixed {
  display: grid;
  gap: var(--space-2);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--muted);
}

.sform-fixed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-5) 0;
}

.sform-fixed__hint {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.sform-fixed__facts { margin-top: 0; }

.sform-fixed__facts .fact { padding-top: var(--space-3); }

.sform-blocks {
  display: grid;
  gap: var(--space-6) var(--space-7);
}

@media (min-width: 64rem) {
  .sform-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sform-block {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  min-width: 0;
}

.sform-block__title {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  color: var(--primary-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sform-fixed .sform-block__title {
  padding: 0;
  border: 0;
}

.sform-block__fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  align-items: start;
  gap: var(--space-4);
}

.sform-block__fields > .field:not(.field--short) { grid-column: 1 / -1; }

/* A choice of a few values across the block, so its hint has room; the list itself stays short. */
.field--choice .field__input { max-width: 11rem; }

/* «Цель и результаты»: the aim across, then the five lists, two side by side on a wide window. */
.sform-goal { max-width: 60rem; }

.sform-outcomes {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 72rem) {
  .sform-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.points {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.points__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.points__title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.points__count {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.points__count.is-full { color: var(--warning); }

.points__hint,
.points__empty {
  margin-top: calc(-1 * var(--space-2));
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.points__empty { margin-top: 0; }

.points__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.point {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
}

.point__number {
  display: grid;
  place-items: center;
  height: var(--control-h);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.point__field .field__textarea { min-height: var(--control-h); }

.points__add { justify-self: start; }

/* Up, down and remove of a point or a lesson: the chevron turned to point up and down. */
.row-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.row-tools .icon-button { width: 2rem; }

.row-tools__up .icon { transform: rotate(-90deg); }

.row-tools__down .icon { transform: rotate(90deg); }

.row-tools__remove:hover {
  background: var(--danger-wash);
  color: var(--danger);
}

.row-tools .icon-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.row-tools .icon-button:disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

/* «Тематические планы» */
.units-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.units-bar__count {
  margin-right: auto;
  font-size: 1rem;
  font-weight: 600;
}

.units-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.units-bar .field__error { flex: 1 1 100%; }

.unit-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.unit-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.unit-card__name {
  flex: none;
  padding: 0.25rem var(--space-3);
  border-radius: 999px;
  background: var(--primary-wash);
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unit-card__title {
  flex: 1 1 16rem;
  max-width: 40rem;
}

.unit-card__title .field__input { font-weight: 600; }

.unit-card__tables {
  display: grid;
  gap: var(--space-4);
}

/* A table of one kind of lesson: a bar of its colour on the left. */
.ltable {
  --kind: var(--primary);
  --kind-wash: var(--primary-wash);
  --kind-ink: var(--primary-ink);
  display: grid;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: 3px solid var(--kind);
}

.ltable[data-kind="practice"],
.ltable[data-kind="seminar"],
.ltable[data-kind="lab"],
.ltable-fold[data-kind="seminar"],
.ltable-fold[data-kind="lab"] {
  --kind: var(--success);
  --kind-wash: var(--success-wash);
  --kind-ink: var(--success);
}

.ltable[data-kind="control"] {
  --kind: var(--warning);
  --kind-wash: var(--warning-wash);
  --kind-ink: var(--warning);
}

.ltable__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}

.ltable__title {
  color: var(--kind-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.ltable__sum {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
}

.ltable__hint {
  flex: 1 1 100%;
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.ltable__rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The grid of a row and of the column titles: №, topic, hours, (forms of control), tools. */
.ltable__cols,
.lrow {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 6.5rem 6.5rem;
  grid-template-areas:
    "no name hours tools"
    ". more more more"
    ". details details details";
  column-gap: var(--space-3);
}

.ltable--forms .ltable__cols,
.lrow--forms {
  grid-template-columns: 3rem minmax(0, 1fr) 6.5rem minmax(0, 13rem) 6.5rem;
  grid-template-areas:
    "no name hours forms tools"
    ". more more more more"
    ". details details details details";
}

.ltable__cols {
  grid-template-areas: none;
  padding-bottom: var(--space-1);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.lrow {
  align-items: start;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}

.lrow__no {
  grid-area: no;
  display: grid;
  place-items: center;
  height: var(--control-h);
  border-radius: var(--radius-inner);
  background: var(--kind-wash);
  color: var(--kind-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.lrow__name { grid-area: name; }

.lrow__hours { grid-area: hours; }

.lrow__forms { grid-area: forms; }

.lrow > .row-tools {
  grid-area: tools;
  height: var(--control-h);
}

/* The column titles name the fields on a wide window; their own labels are read out only. */
.lrow__name > .field__label,
.lrow__hours > .field__label,
.lrow__forms > .field__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lrow__more {
  grid-area: more;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 1.75rem;
  margin-top: var(--space-1);
  padding: 0 var(--space-2) 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-inner);
  background: none;
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 500;
}

.lrow__more:hover {
  background: var(--secondary);
  color: var(--text);
}

.lrow__summary {
  margin-left: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-muted);
}

.lrow__chevron {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.15s ease-out;
}

.lrow__more[aria-expanded="true"] .lrow__chevron { transform: rotate(90deg); }

.lrow__details {
  grid-area: details;
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-1);
}

.lrow__details[hidden] { display: none; }

.lrow__details .field__label,
.lrow__details .field__error { font-size: var(--hint-fs); }

.ltable__add { justify-self: start; }

/* An empty table of seminars or labs: only a quiet dashed button. */
.ltable-fold {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--control-fs);
  font-weight: 500;
}

.ltable-fold .icon {
  width: 1rem;
  height: 1rem;
}

.ltable-fold:hover {
  border-color: var(--kind);
  color: var(--kind-ink);
}

/* Under the cards: the hours of the plan by kind, each with its colour, and the pairs. */
.plan-sum {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-control);
  background: var(--muted);
}

.plan-sum__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.plan-sum__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-7);
}

.plan-sum__item {
  display: grid;
  gap: 0.125rem;
  padding-left: var(--space-3);
  border-left: 3px solid var(--primary);
}

.plan-sum__item[data-kind="practice"] { border-left-color: var(--success); }

.plan-sum__item[data-kind="control"] { border-left-color: var(--warning); }

.plan-sum__item--pairs { border-left-color: var(--text-muted); }

.plan-sum__item dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.plan-sum__item dd {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Save: the bar of the settings screen; the line beside the button says where the tab stands. */
.sform-unplaced {
  display: grid;
  gap: var(--space-2);
}

.savebar__status.is-saved { color: var(--success); }

.savebar__status.is-error { color: var(--danger); }

.savebar__status .icon {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 48rem) {
  .sform-panel__title { padding: var(--space-4) var(--space-4) 0; }

  .sform-panel__body { padding: var(--space-4); }

  .unit-card { padding: var(--space-3) var(--space-3) var(--space-4); }

  .ltable { padding-left: var(--space-3); }

  .ltable__cols { display: none; }

  .lrow {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    grid-template-areas:
      "no name name"
      "no hours tools"
      "no more more"
      "no details details";
    row-gap: var(--space-2);
    column-gap: var(--space-2);
  }

  .lrow--forms {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    grid-template-areas:
      "no name name"
      "no hours tools"
      "no forms forms"
      "no more more"
      "no details details";
  }

  .lrow > .row-tools { align-self: end; }

  .lrow__no { align-self: start; }

  /* No column titles here: every field shows its label. */
  .lrow__name > .field__label,
  .lrow__hours > .field__label,
  .lrow__forms > .field__label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: var(--text-muted);
    font-size: var(--hint-fs);
  }

  .lrow__hours { max-width: 9rem; }

  .lrow__more {
    flex-wrap: wrap;
    margin-top: 0;
    text-align: left;
  }

  .lrow__details { grid-template-columns: minmax(0, 1fr); }

  .sform-remark { padding: var(--space-3) var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .lrow__chevron { transition: none; }
}

/* The syllabus form, task 42: the buttons of the version in the head, what to fix before sending, the lists of
   entries (works, books, resources, the grading), the grading as a scale of four grades and «Порядок пар» — the
   lessons as the timetable will give them: the number of the pair first, in the colour of the kind. */

.sform-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-3) var(--space-6);
}

.sform-head__main {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.sform-actions {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
  max-width: 36rem;
}

.sform-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.sform-actions__hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  text-align: right;
}

.sform-actions__hint .icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
}

.sform-actions__error { justify-self: stretch; }

@media (max-width: 64rem) {
  .sform-head { grid-template-columns: minmax(0, 1fr); }

  .sform-actions { justify-items: start; max-width: none; }

  .sform-actions__buttons { justify-content: flex-start; }

  .sform-actions__hint { text-align: left; }
}

/* A tab after the check before sending: the number of its errors (red) or of what is left empty (amber). */
.sform-tab__count {
  display: grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sform-tab__count.is-error { background: var(--danger-fill); color: var(--on-primary); }

.sform-tab__count.is-warning { background: var(--warning-wash); color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning-line); }

/* What to fix before sending: a sheet pinned above the tabs with a red bar; every line is a way to its tab. */
.sform-checks {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--danger), var(--shadow-card);
}

.sform-checks__head {
  display: grid;
  gap: var(--space-1);
}

.sform-checks__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
}

.sform-checks__title:focus { outline: none; }

.sform-checks__title:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }

.sform-checks__icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--danger);
}

.sform-checks__count {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.sform-checks__lead {
  color: var(--text-muted);
  font-size: var(--hint-fs);
}

.sform-checks__sub {
  margin-top: var(--space-2);
  color: var(--warning);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sform-checks__list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.sform-check { border-bottom: 1px solid var(--border); }

.sform-check__link {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-2);
  color: var(--text);
  text-decoration: none;
}

.sform-check__link:hover { background: var(--row-hover); }

.sform-check__link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: var(--radius-inner); }

.sform-check__tab {
  justify-self: start;
  padding: 0.125rem var(--space-2);
  border-radius: 6px;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
}

.sform-check.is-warning .sform-check__tab { background: var(--warning-wash); color: var(--warning); }

.sform-check__text { font-size: var(--control-fs); }

.sform-check__go {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.sform-checks-cleared { max-width: 60rem; }

@media (max-width: 48rem) {
  .sform-checks { padding: var(--space-3) var(--space-4) var(--space-4); }

  .sform-check__link {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "tab go" "text go";
    row-gap: var(--space-1);
  }

  .sform-check__tab { grid-area: tab; }

  .sform-check__text { grid-area: text; }

  .sform-check__go { grid-area: go; }
}

/* The question before sending: what is left empty, in amber. */
.sform-submit__empty {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-inner);
  background: var(--warning-wash);
  color: var(--warning);
  font-weight: 500;
}

.sform-submit__empty .icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
}

/* The tabs of task 42: a line on what the tab is for, notes, a stack of lists. */
.sform-lead {
  max-width: 60rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.sform-lead-note { max-width: 60rem; }

.sform-panel__body > .sform-lead + .sform-lead-note { margin-top: calc(-1 * var(--space-3)); }

.sform-stack {
  display: grid;
  gap: var(--space-5);
}

/* A list of entries: numbered cards, the name and arrows on top, the fields on a grid of six columns under them. */
.entries {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.entries h4 { margin: 0; }

/* A resource: its link carries a hint, its name none — the two boxes stand on one line. */
.entries--software .entry__body { align-items: end; }

.entries__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: entry;
}

.entry {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}

.entry__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 2rem;
}

.entry__name {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry__body {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  align-items: start;
}

.entry__c1 { grid-column: span 1; }

.entry__c2 { grid-column: span 2; }

.entry__c3 { grid-column: span 3; }

.entry__c5 { grid-column: span 5; }

.entry__full { grid-column: 1 / -1; }

/* The grading: four grades side by side, each under a bar of its colour — from red to green. */
.grade-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.grade-scale__step {
  --grade: var(--danger);
  --grade-wash: var(--danger-wash);
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 3px solid var(--grade);
  border-radius: var(--radius-inner);
  background: var(--grade-wash);
}

.grade-scale__step[data-grade="fair"] { --grade: var(--warning); --grade-wash: var(--warning-wash); }

.grade-scale__step[data-grade="good"] { --grade: var(--primary); --grade-wash: var(--primary-wash); }

.grade-scale__step[data-grade="excellent"] { --grade: var(--success); --grade-wash: var(--success-wash); }

.grade-scale__name {
  color: var(--grade);
  font-size: 0.8125rem;
  font-weight: 700;
}

.grade-scale__step .field__input { background: var(--surface); }

.grade-scale__criteria .field__textarea { min-height: 5rem; }

/* The rules of behaviour and of ethics: a list of points, the sanction under it. */
.rules {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

/* «Описание юнитов»: the texts of a unit two by two, its books under them. */
.unit-card__caption {
  flex: 1 1 16rem;
  font-weight: 600;
}

.unit-about {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.unit-card--about .entries { background: var(--surface); }

/* «Порядок пар» */
.order-mode {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: 60rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--muted);
}

.order-mode__icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  color: var(--primary-ink);
}

.order-mode.is-manual .order-mode__icon { color: var(--warning); }

.order {
  display: grid;
  gap: var(--space-5);
}

.order-unit {
  display: grid;
  gap: var(--space-2);
}

.order-unit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  font-size: 1rem;
}

.order-unit__name {
  color: var(--primary-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-unit__title { font-weight: 600; }

.order-unit__list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.order-row {
  --kind: var(--primary);
  --kind-wash: var(--primary-wash);
  --kind-ink: var(--primary-ink);
  display: grid;
  grid-template-columns: 4rem 7.5rem minmax(0, 1fr) 4rem auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 3rem;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border);
}

.order-row[data-kind="practice"],
.order-row[data-kind="seminar"],
.order-row[data-kind="lab"] {
  --kind: var(--success);
  --kind-wash: var(--success-wash);
  --kind-ink: var(--success);
}

.order-row[data-kind="control"] {
  --kind: var(--warning);
  --kind-wash: var(--warning-wash);
  --kind-ink: var(--warning);
}

/* The number of the pair: a ticket of the timetable in the colour of the kind; a mark without a pair is a dot. */
.order-row__pair {
  display: grid;
  place-items: center;
  height: 2.25rem;
  border-left: 3px solid var(--kind);
  border-radius: var(--radius-inner);
  background: var(--kind-wash);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.order-row__pair.is-mark {
  border: 1px dashed var(--kind);
  background: transparent;
  color: var(--kind-ink);
  font-size: 1.5rem;
  line-height: 1;
}

.order-row__kind {
  color: var(--kind-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.order-row__text { min-width: 0; }

.order-row__label {
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.order-row__hours {
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 64rem) {
  .unit-about { grid-template-columns: minmax(0, 1fr); }

  .grade-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
  .entries { padding: var(--space-3); }

  .entry { padding: var(--space-3); }

  .entry__body { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .entry__c2,
  .entry__c3,
  .entry__c5 { grid-column: 1 / -1; }

  .entry__c1 { grid-column: span 1; }

  .grade-scale { grid-template-columns: minmax(0, 1fr); }

  .order-row {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    grid-template-areas:
      "pair text tools"
      "pair kind tools";
    row-gap: 0;
    padding: var(--space-2) 0;
  }

  .order-row__pair { grid-area: pair; height: 2.75rem; }

  .order-row__text { grid-area: text; }

  .order-row__kind { grid-area: kind; }

  .order-row__hours { display: none; }

  .order-row > .row-tools { grid-area: tools; }

  .order-row .row-tools .icon-button { width: 2.75rem; height: 2.75rem; }
}

/* Print: black on white in either theme. The passwords of an import print alone, as strips to cut apart
   along the dashed lines; any other screen prints without the sidebar and the bars. */

@media print {
  @page { margin: 12mm; }

  :root[data-theme] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --muted: #ffffff;
    --row-hover: transparent;
    --border: #999999;
    --border-strong: #666666;
    --text: #000000;
    --text-muted: #333333;
    --primary-ink: #000000;
    --shadow-card: none;
  }

  body {
    min-height: 0;
    background: #ffffff;
    color: #000000;
  }

  .sidebar,
  .topbar,
  .shell__backdrop,
  .skip-link,
  .auth__tools,
  .no-print { display: none !important; }

  .shell__body { margin: 0; }

  .content {
    display: block;
    max-width: none;
    padding: 0;
  }

  .has-printable > :not(.printable) { display: none !important; }

  .printable {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .printable .print-only {
    display: block;
    margin-bottom: var(--space-3);
  }

  .table-scroll { overflow: visible; }

  .table-scroll--framed { border: 0; }

  .badge { border-color: #000000; background: none; color: #000000; }

  .table--slips tbody td {
    padding-block: 5mm;
    border-top: 1px dashed #000000;
    border-bottom: 0;
  }

  .table--slips tbody tr:last-child td { border-bottom: 1px dashed #000000; }

  .table--slips tr { break-inside: avoid; }
}

/* Task 44: the review queue and the syllabus marks of the subject lists. A version under review is the primary blue
   everywhere (the pill of the page's version switch, the badge, the rail of a queue row); a returned one is amber. */

.badge--info { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary-ink); }

/* The number of versions under review: a solid pill at the end of the menu item and beside the tile's title. */
.nav-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nav-link__text { min-width: 0; }

.tile__title .nav-count {
  margin-left: var(--space-2);
  vertical-align: 0.125rem;
}

/* «Силлабусы на утверждении»: a rail on each row in the colour of its status, as on the version bar of the page. */
.review-table { min-width: 52rem; }

.review-row { position: relative; }

.review-table tbody .review-row td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

.review-table tbody .review-row.is-orphan td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.review-table .review-table__discipline { font-weight: 600; }

.review-table .discipline__name { overflow-wrap: anywhere; }

/* The discipline is the link; its box covers the whole row, so the row answers the pointer like a link. */
.review-table__link {
  color: var(--text);
  text-decoration: none;
}

.review-table__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.review-table__link:focus-visible { outline: none; }

.review-table__link:focus-visible::after {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-inner);
}

.review-row:hover .review-table__link .discipline__name { text-decoration: underline; }

.review-table .review-table__semester,
.review-table .review-table__version { white-space: nowrap; }

.review-table__date {
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

.review-table__by {
  display: block;
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.review-table .review-table__go,
.review-table .review-table__go-col {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.review-table__chevron {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transition: color 0.15s ease-out, transform 0.15s ease-out;
}

.review-row:hover .review-table__chevron {
  color: var(--primary-ink);
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .review-table__chevron { transition: none; }

  .review-row:hover .review-table__chevron { transform: none; }
}

/* A version without a page: the row, then a strip under it (the rail goes on) with why and what can be done. */
.review-table tbody .review-row.is-orphan td { border-bottom: 0; }

.review-table tbody .review-orphan td {
  padding-top: 0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.table.review-table tbody tr.review-orphan:hover td { background-color: transparent; }

.review-orphan__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-inner);
  background: var(--warning-wash);
}

.review-orphan__text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--warning);
  font-size: 0.8125rem;
  font-weight: 500;
}

.review-orphan__text .icon {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.review-orphan__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* «Предметы»: the mark, and beside an open version, in grey, what is approved meanwhile. */
.syllabus-mark {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.syllabus-mark__note {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.syllabus-mark__note::before {
  content: "·";
  margin-right: var(--space-2);
}

.added__side .syllabus-mark { justify-content: flex-end; }

/* A note that leads somewhere: the way is a link at its end. */
.note--with-link { flex-wrap: wrap; }

.note--with-link > span { flex: 1 1 16rem; }

.note__link {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  min-height: 1.5rem;
  margin-left: auto;
  border-radius: 6px;
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.note__link .icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* «Мои предметы»: the state of each syllabus; a returned one is what waits on the teacher. */
.subject__main {
  display: grid;
  flex: 1 1 12rem;
  gap: 0.125rem;
  min-width: 0;
}

.subject__main .subject__name { flex: none; }

.subject__alert {
  color: var(--warning);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.subject__mark { flex: none; }

.list__row.subject.is-returned {
  background: linear-gradient(90deg, var(--warning-wash), transparent 75%);
  box-shadow: inset 3px 0 0 var(--warning);
}

.list__row.subject.is-returned .list__icon {
  background: var(--warning-wash);
  color: var(--warning);
}

/* Task 17: «Журналы». A row is a subject of a group; the whole row is the link to its journal. The rail on the left
   says what waits there: red — pairs past their deadline, amber — pairs still open for marks, none — all filled in. */

.journals__toolbar { border-bottom: 1px solid var(--border); }

.journals-table { min-width: 46rem; }

.journals-table--teacher { min-width: 34rem; }

.journals-row { position: relative; }

.journals-table tbody .journals-row.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.journals-table tbody .journals-row.is-unfilled td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.journals-table .journals-table__group { width: 1%; white-space: nowrap; }

.journals-table__name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}

.journals-table__subject { font-weight: 600; }

.journals-table .discipline__name { overflow-wrap: anywhere; }

.journals-table__link {
  color: var(--text);
  text-decoration: none;
}

.journals-table__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.journals-table__link:focus-visible { outline: none; }

.journals-table__link:focus-visible::after {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-inner);
}

.journals-row:hover .journals-table__link .discipline__name { text-decoration: underline; }

.journals-table .person { min-width: 0; }

.journals-table .journals-table__held {
  width: 1%;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.journals-table__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.journals-table__badges .badge { white-space: nowrap; }

.journals-table__filled {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.journals-table__filled .icon {
  width: 0.9375rem;
  height: 0.9375rem;
  color: var(--success);
}

.journals-table .journals-table__go {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.journals-table__chevron {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transition: color 0.15s ease-out, transform 0.15s ease-out;
}

.journals-row:hover .journals-table__chevron {
  color: var(--primary-ink);
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .journals-table__chevron { transition: none; }

  .journals-row:hover .journals-table__chevron { transform: none; }
}

/* «Мои предметы»: the syllabus and the journal of a subject stay together when the row wraps. */
.subject__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Task 18: the grid of a journal (read only). Rows are students, columns are pairs; after the last pair of a unit stand
   its four columns, tinted so the eye finds where a unit ends. The first column stays while the table scrolls inside its
   block; the page itself never scrolls sideways. */

.journal { display: grid; gap: var(--space-4); min-width: 0; }

.journal__scheme { margin: 0; color: var(--text-muted); font-size: 0.875rem; }

.journal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.journal-legend__item { display: inline-flex; align-items: center; gap: var(--space-2); }

.journal-card { width: fit-content; min-width: 0; max-width: 100%; overflow: hidden; padding: 0; }

.journal-scroll { max-width: 100%; }

.journal-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.journal-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.journal-grid th,
.journal-grid td {
  padding: 0 var(--space-2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  background: var(--surface);
}

.journal-grid tbody tr:last-child th,
.journal-grid tbody tr:last-child td { border-bottom: 0; }

.journal-grid tbody tr { height: 2.5rem; }

.journal-grid tbody tr:hover td,
.journal-grid tbody tr:hover th { background-color: var(--muted); }

/* The names: stuck to the left edge. */
.journal-grid .jg-name {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 15rem;
  max-width: 19rem;
  padding: 0 var(--space-4);
  border-right: 1px solid var(--border-strong);
  text-align: left;
  font-weight: 500;
}

.journal-grid thead th {
  height: 3.5rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-raised);
}

.journal-grid thead .jg-name { position: sticky; z-index: 3; }

.jg-name__no { display: inline-block; min-width: 1.5rem; color: var(--text-muted); font-weight: 400; }

.jg-name__text { overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; display: inline-block; max-width: 13rem; }

.jg-name__left {
  margin-left: var(--space-2);
  padding: 1px var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
}

.journal-grid .is-left td,
.journal-grid .is-left th { color: var(--text-muted); }

.journal-grid .is-left .jg-name__text { text-decoration: line-through; text-decoration-color: var(--border-strong); }

/* The head of a pair: date, kind of lesson, state dot. */
.jg-pair-head { min-width: 4rem; cursor: default; }

.jg-pair-head > span:not(.jg-tip) { display: block; }

.jg-pair-head__date { color: var(--text); font-size: 0.8125rem; }

.jg-pair-head__kind { margin-top: 1px; font-size: 0.6875rem; letter-spacing: 0.02em; }

.jg-pair-head__sub { max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; color: var(--primary-ink); font-size: 0.625rem; font-weight: 500; }

.jg-kind--control { color: var(--primary-ink); }

.jg-pair-head .jg-state { position: absolute; top: 5px; right: 4px; width: 7px; height: 7px; }

.jg-state {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-muted);
  flex: none;
}

.jg-state--unfilled { background: var(--warning); }
.jg-state--overdue { background: var(--danger); }
.jg-state--missed,
.jg-state--cancelled { background: var(--border-strong); }
.jg-state--future { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-muted); }

.journal-grid thead .is-narrow,
.journal-grid .jg-cell.is-narrow { min-width: 0; width: 2rem; padding: 0; }

.journal-grid thead .is-narrow { opacity: 0.75; }

.journal-grid .jg-cell.is-narrow { background: var(--muted); }

.journal-grid .is-narrow .jg-pair-head__kind,
.journal-grid .is-narrow .jg-pair-head__sub { display: none; }

/* A cell of a mark. */
.jg-cell { min-width: 3.5rem; }

.jg-cell__in { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }

.jg-mark {
  display: inline-block;
  min-width: 1.75rem;
  padding: 1px 5px;
  border-radius: var(--radius-inner);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.jg-mark--neutral { color: var(--text-muted); font-weight: 700; }
.jg-mark--warning { background: var(--warning-wash); color: var(--warning); }
.jg-mark--danger { background: var(--danger-wash); color: var(--danger); }
.jg-mark--info { background: var(--primary-wash); color: var(--primary-ink); }
.jg-mark--success { background: var(--success-wash); color: var(--success); }

.jg-act { color: var(--text); font-size: 0.75rem; font-weight: 600; }

.journal-legend .jg-act { color: var(--text-muted); }

.jg-coat {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--warning);
  border-radius: 2px;
  transform: rotate(45deg);
  flex: none;
}

.jg-star { margin-left: 1px; color: var(--primary-ink); font-weight: 700; }

/* The columns of a unit and the summary: tinted, numbers aligned. */
.journal-grid thead .jg-unit-head { min-width: 4rem; cursor: default; background: var(--primary-wash); }

.jg-unit-head > span:not(.jg-tip) { display: block; }

.jg-unit-head__unit { color: var(--primary-ink); font-size: 0.625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

.jg-unit-head__label { color: var(--text); }

.jg-sum-head { min-width: 5rem; cursor: default; }

.jg-unit-head--total,
.jg-sum-head--absences { border-left: 1px solid var(--border-strong); }

.journal-grid .jg-pts { background: var(--primary-wash); }

.journal-grid tbody tr:hover .jg-pts { background: var(--primary-line); }

.jg-num { font-weight: 500; }

.jg-total,
.jg-sum--final { font-weight: 700; }

.journal-grid .jg-pts.is-low { color: var(--danger); font-weight: 700; }

.jg-empty { color: var(--text-muted); }

.journal-grid .jg-sum--absences { border-left: 1px solid var(--border-strong); }

/* Tooltips of the heads: on hover and on keyboard focus. */
.jg-tip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 5;
  width: max-content;
  max-width: 15rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.journal-grid th:hover > .jg-tip,
.journal-grid th:focus > .jg-tip,
.journal-grid th:focus-visible > .jg-tip,
.journal-grid th:focus-within > .jg-tip { display: block; }

.jg-sum-head .jg-tip,
.jg-unit-head--total .jg-tip { left: auto; right: 0; }

.journal-grid th:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* Task 19: the head of a pair that can be filled in, and the window «Отметки пары». */
.jg-pair-head.is-open { cursor: pointer; }

.journal-grid thead .jg-pair-head.is-open:hover { background: var(--primary-wash); }

.jg-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.jg-open:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* The head of a pair that can be marked looks like a button: a framed face behind the text, a pencil, a caption.
   The unfilled pair is the loudest (it is the main thing a teacher does); a filled one that may still be corrected is calm. */
.jg-pair-head.is-open { min-width: 4.75rem; }

.jg-pair-head.is-open > span:not(.jg-tip):not(.jg-state) { position: relative; z-index: 2; }

.jg-pair-head.is-open > span { pointer-events: none; }

.jg-pair-head.is-open .jg-state { z-index: 2; }

.jg-pair-head.is-open .jg-open {
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-inner);
  background: transparent;
  transition: background-color 0.12s, border-color 0.12s;
}

.jg-pair-head.is-open.is-planned .jg-open { border: 1.5px solid var(--primary); background: var(--primary-wash); }

.jg-pair-head.is-open:hover .jg-open,
.jg-pair-head.is-open .jg-open:focus-visible { border-color: var(--primary); background: var(--primary-line); }

.jg-pair-head.is-open .jg-open:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }

.jg-pair-head__act {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 2px;
  color: var(--primary-ink);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

.jg-pair-head__act .icon { width: 12px; height: 12px; }

.journal-grid thead .jg-pair-head.is-open:hover { background: transparent; }

.jg-open-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.25rem;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-wash);
  color: var(--primary-ink);
}

.jg-open-sample .icon { width: 12px; height: 12px; }

.dialog--marks {
  width: min(calc(100% - 1rem), 68rem);
  overflow: hidden;
}

.dialog--marks .dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: var(--space-5);
  overflow-y: auto;
}

.mk-head { display: grid; gap: var(--space-3); }

.dialog--marks .button { min-height: 44px; font-size: 1rem; }

.dialog--marks .dialog__kicker,
.dialog--marks .badge { font-size: 1rem; }

.mk-head .dialog__kicker { margin-bottom: 0; }

.mk-topic { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; color: var(--text-muted); font-size: 1rem; overflow-wrap: anywhere; }

.mk-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-inner);
  background: var(--primary-wash);
}

.mk-hint__text { margin: 0; font-size: 1rem; }

.mk-empty { margin: 0; color: var(--text-muted); font-size: 1rem; }

.mk-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  min-height: 0;
  overflow-y: auto;
}

.mk-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.mk-row:last-child { border-bottom: 0; }

.mk-row:nth-child(even) { background: var(--muted); }

.mk-row.is-invalid { box-shadow: inset 3px 0 0 var(--danger); background: var(--danger-wash); }

.mk-row__name { font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; }
.mk-row__nomark[hidden] { display: none; }
.mk-row__nomark { display: block; font-size: 1rem; font-weight: 400; color: var(--warning, var(--text-muted)); }

.mk-row__error { grid-column: 1 / -1; margin: 0; }

.mk-status { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius-control); background: var(--seg-track); }

.mk-status__btn {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
}

.mk-status__btn:hover { color: var(--text); }

.mk-status__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.mk-status__btn[aria-pressed="true"] { background: var(--seg-active); color: var(--text); font-weight: 600; box-shadow: var(--seg-shadow); }

.mk-status__btn[data-status="late"][aria-pressed="true"] { background: var(--warning-wash); color: var(--warning); }
.mk-status__btn[data-status="absent"][aria-pressed="true"] { background: var(--danger-wash); color: var(--danger); }
.mk-status__btn[data-status="excused"][aria-pressed="true"] { background: var(--primary-wash); color: var(--primary-ink); }
.mk-status__btn[data-status="madeup"][aria-pressed="true"] { background: var(--success-wash); color: var(--success); }

.mk-coat,
.mk-act { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-size: 1rem; white-space: nowrap; cursor: pointer; }

.mk-coat__box:disabled { opacity: 0.4; }

.mk-act__label { color: var(--text-muted); }

.mk-act__input { width: 5.5rem; min-height: 44px; font-size: 1rem; text-align: center; }

.mk-act__input:disabled { opacity: 0.4; }

.mk-reason .field__textarea { min-height: 5rem; resize: vertical; }

.mk-problem:empty { display: none; }

.mk-ask {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-inner);
  background: var(--warning-wash);
}

.mk-ask[hidden],
.mk-actions[hidden] { display: none; }

.mk-ask__text { margin: 0; font-size: 1rem; font-weight: 500; }

@media (max-width: 56rem) {
  .mk-row { grid-template-columns: minmax(0, 1fr) auto; }

  .mk-row__name { grid-column: 1 / -1; }

  .mk-status { grid-column: 1 / -1; flex-wrap: wrap; }

  .mk-status__btn { flex: 1 1 auto; }

  .mk-coat { justify-self: start; }

  .mk-act { justify-self: end; }
}

@media (max-width: 30rem) {
  .dialog--marks .dialog__body { padding: var(--space-4); }

  .mk-row { padding: var(--space-2) var(--space-3); gap: var(--space-1) var(--space-2); }

  .mk-status__btn { flex: 1 1 30%; min-width: 0; padding: 0 var(--space-1); line-height: 1.2; white-space: normal; }

  .mk-coat,
  .mk-act { gap: var(--space-1); white-space: nowrap; }

  .mk-act__input { width: 4.5rem; }
}

/* Task 20: a cell of the grid opens the window of the mark of one student; the window and the history of its changes. */
.jg-cell.is-open { position: relative; cursor: pointer; }

.jg-cell-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.jg-cell.is-open:hover .jg-cell-open { background: var(--primary-wash); box-shadow: inset 0 0 0 1px var(--primary-line); }

.jg-cell-open:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-wash); }

.jg-cell.is-open .jg-cell__in { pointer-events: none; position: relative; }

.dialog--cell {
  width: min(calc(100% - 1rem), 40rem);
  overflow: hidden;
}

.dialog--cell .dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: var(--space-5);
  overflow-y: auto;
}

.dialog--cell .button { min-height: 44px; font-size: 1rem; }

.dialog--cell .dialog__kicker,
.dialog--cell .badge { font-size: 1rem; }

.cl-summary {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--muted);
}

.cl-now { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; font-size: 1rem; }

.cl-now__label { color: var(--text-muted); }

.cl-now__extra { color: var(--text-muted); }

.cl-points { margin: 0; font-size: 1rem; font-variant-numeric: tabular-nums; }

.cl-form,
.cl-editor { display: grid; gap: var(--space-3); }

.cl-editor .mk-status { justify-self: start; flex-wrap: wrap; }

.cl-extras { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }

.cl-extras [hidden] { display: none; }

.cl-saved { margin: 0; color: var(--success); font-size: 1rem; font-weight: 600; }

.cl-saved:empty { display: none; }

.cl-history { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }

.cl-history[hidden] { display: none; }

.cl-history__title { margin: 0; font-size: 1rem; font-weight: 600; }

.cl-history__note { margin: 0; color: var(--text-muted); font-size: 1rem; }

.cl-log { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--primary-line); }

.cl-log__item { display: grid; gap: 2px; padding: var(--space-2) 0 var(--space-3) var(--space-4); position: relative; }

.cl-log__item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0.9rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--surface-raised);
}

.cl-log__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; font-size: 1rem; }

.cl-log__who { font-weight: 600; overflow-wrap: anywhere; }

.cl-log__time { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.cl-log__line { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }

.cl-log__reason { margin: 0; color: var(--text-muted); font-size: 1rem; font-style: italic; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 30rem) {
  .dialog--cell .dialog__body { padding: var(--space-4); }

  .cl-editor .mk-status { justify-self: stretch; }

  .cl-editor .mk-status__btn { flex: 1 1 30%; min-width: 0; padding: 0 var(--space-1); line-height: 1.2; white-space: normal; }
}

.dialog--cell .field__hint,
.dialog--cell .return-count,
.dialog--cell .field__error { font-size: 1rem; }

.cl-extras .mk-act__input { width: 6rem; }

.dialog--cell .field__label { font-size: 1rem; }

/* Task 21: the heads «РК» and «СРС» and the cell of the current control open the windows of the results of a unit. */
.jg-unit-head.is-open { position: relative; cursor: pointer; min-width: 4.5rem; }

.jg-unit-head.is-open > span:not(.jg-tip) { position: relative; z-index: 2; pointer-events: none; }

.jg-unit-head.is-open .jg-unit-open {
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-inner);
  transition: background-color 0.12s, border-color 0.12s;
}

.jg-unit-head.is-open:hover .jg-unit-open,
.jg-unit-head.is-open .jg-unit-open:focus-visible { border-color: var(--primary); background: var(--primary-line); }

.jg-unit-head.is-open .jg-unit-open:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }

.jg-unit-head__act { display: inline-flex !important; justify-content: center; margin-top: 2px; color: var(--primary-ink); }

.jg-unit-head__act .icon { width: 12px; height: 12px; }

.jg-pts.is-open { position: relative; cursor: pointer; }

.jg-pts.is-open:hover .jg-cell-open { background: var(--primary-line); box-shadow: inset 0 0 0 1px var(--primary); }

.jg-pts__in { position: relative; pointer-events: none; }

.dialog--unit { width: min(calc(100% - 1rem), 36rem); }

.ju-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

.ju-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.ju-row__who { display: flex; flex: 1 1 12rem; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); min-width: 0; }

.ju-row__name { font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; }

.ju-row__field { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }

.ju-row__of { color: var(--text-muted); font-size: 1rem; white-space: nowrap; }

.ju-input { width: 9.5rem; min-height: 44px; font-size: 1rem; text-align: center; font-variant-numeric: tabular-nums; }

.ju-input.is-low { border-color: var(--danger); color: var(--danger); font-weight: 700; }

.ju-row__error { flex: 1 0 100%; margin: 0; font-size: 1rem; }

.ju-row__error[hidden],
.ju-row [hidden] { display: none; }

.dialog--unit .ju-list { max-height: 50vh; overflow-y: auto; padding-right: var(--space-3); }

.dialog--unit .field__hint,
.dialog--unit .field__label { font-size: 1rem; }

.mk-reason[hidden] { display: none; }

@media (max-width: 600px) {
  .dialog--unit .ju-list { max-height: none; overflow: visible; padding-right: 0; }
}

/* Task 22: the menu «…» in the head of a pair and the window of a deanery action. */
.jg-pair-head.has-menu { min-width: 5.5rem; }

.jg-menu-btn {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  min-height: 1.5rem;
  height: 1.5rem;
  padding: 0 0 0.25rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.jg-menu-btn:hover,
.jg-menu-btn[aria-expanded="true"] { background: var(--primary-line); color: var(--text); }

.jg-menu-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.jg-menu {
  position: fixed;
  z-index: 60;
  min-width: 12rem;
  padding: var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-inner);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
}

.jg-menu__item {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.jg-menu__item:hover,
.jg-menu__item:focus-visible { background: var(--primary-wash); outline: none; }

.jg-menu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }

.jg-menu__item.is-danger { color: var(--danger); }

.dialog--action { width: min(calc(100% - 1rem), 34rem); }

.dialog--action .dialog__body { display: flex; flex-direction: column; gap: var(--space-4); }

/* A narrow head (missed pair) has no room at the side: the button goes under the date. */
.jg-pair-head.is-narrow .jg-menu-btn {
  top: auto;
  bottom: 0;
  left: 50%;
  height: 1.25rem;
  min-height: 1.25rem;
  transform: translateX(-50%);
}

/* Task 23: «Журнал изменений». A table of changes; a row after the deadline carries an amber rail. The table scrolls
   inside its block, the page does not. */

.jlog__toolbar { border-bottom: 1px solid var(--border); align-items: flex-end; }

.jlog__toolbar > .field { flex: 1 1 11rem; max-width: 16rem; }

.jlog__empty { padding: var(--space-4); }

.jlog__more { display: flex; justify-content: center; padding: var(--space-4); border-top: 1px solid var(--border); }

.jlog-table { min-width: 56rem; }

.jlog-table--subject { min-width: 46rem; }

.jlog-table tbody .jlog-row.is-late td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.jlog-table td { vertical-align: top; }

.jlog-table .jlog-table__when,
.jlog-table .jlog-table__pair { white-space: nowrap; font-variant-numeric: tabular-nums; }

.jlog-table__stack { display: grid; gap: var(--space-1); justify-items: start; }

.jlog-table .jlog-table__subject { min-width: 9rem; }

.jlog-table .jlog-table__change { min-width: 11rem; }

.jlog-table__name { font-weight: 600; overflow-wrap: break-word; }

.jlog-table .person__name { white-space: nowrap; }

.jlog-table .jlog-table__reason { min-width: 12rem; overflow-wrap: anywhere; color: var(--text-muted); }

.jlog-table .person { min-width: 0; }

/* Screens: scoring scheme card under the semester panels (settings) */

.settings-form {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
}

.scoring__form {
  display: grid;
  gap: var(--space-5);
}

.scoring__group {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.scoring__legend {
  padding: 0;
  margin-bottom: var(--space-3);
  color: var(--text-muted);
  font-size: var(--hint-fs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scoring__fields {
  align-items: start;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-4);
}

.scoring .field__input { font-variant-numeric: tabular-nums; }

.scoring .field__input[readonly] {
  border-color: var(--border);
  background: transparent;
  cursor: default;
}

.scoring .field__input[readonly]:focus { box-shadow: none; }

.scoring__example {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--primary-wash);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.scoring__actions {
  display: grid;
  gap: var(--space-3);
}

.scoring__actions .notes { display: grid; gap: var(--space-2); }
.scoring__actions .notes:empty { display: none; }

.scoring__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
}

.scoring__failed { display: grid; gap: var(--space-3); justify-items: start; }

/* Student home: the one tile that is already a link (the others still say «soon»). */
.soon--link {
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.soon--link:hover { border-color: var(--primary-line); }

.soon__go {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  color: var(--primary-ink);
}

/* Screens: the student's «Оценки» (#/grades, #/grades/<subjectId>) */
.gr { display: grid; gap: var(--space-4); min-width: 0; }

.gr-list { display: grid; gap: var(--space-3); }

.gr-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  color: inherit;
  text-decoration: none;
}

a.gr-card:hover { border-color: var(--primary-line); }

.gr-card--static { border-top: 3px solid var(--primary-fill); }

.gr-card__head { display: flex; align-items: center; gap: var(--space-3); }

.gr-card__titles { display: grid; gap: var(--space-1); min-width: 0; flex: 1; }

.gr-card__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gr-card__teacher { color: var(--text-muted); }

.gr-card__go { flex: none; width: 1.25rem; height: 1.25rem; color: var(--primary-ink); }

.gr-summary { display: grid; gap: var(--space-3); }

.gr-final {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.gr-units { display: grid; gap: var(--space-3); }

.gr-unit {
  display: grid;
  gap: var(--space-1);
  padding-left: var(--space-3);
  border-left: 3px solid var(--border);
}

.gr-unit__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.gr-unit__line, .gr-outside { overflow-wrap: anywhere; }

.gr-low {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--danger);
  font-weight: 600;
}

.gr-low__icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; }

.gr-attendance { color: var(--text-muted); }

.gr-none { padding: var(--space-2) 0; }

.gr-section { display: grid; gap: var(--space-3); }

.gr-section__title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; }

.gr-pairs { display: grid; gap: var(--space-2); }

.gr-pair {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.gr-pair__top, .gr-pair__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.gr-pair__bottom { justify-content: flex-end; }

.gr-pair__date { font-weight: 600; }

.gr-pair__topic { overflow-wrap: anywhere; }

.gr-pair__points { font-weight: 700; font-variant-numeric: tabular-nums; }

.gr-pair__points.is-muted { color: var(--text-muted); font-weight: 400; }

.gr-how { padding: 0; }

.gr-how__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.gr-how__summary::-webkit-details-marker { display: none; }

.gr-how__go { flex: none; width: 1.25rem; height: 1.25rem; color: var(--primary-ink); transition: transform 0.15s; }

.gr-how[open] .gr-how__go { transform: rotate(90deg); }

.gr-how__body { display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); color: var(--text-muted); }

.gr-back { justify-self: stretch; min-height: 2.75rem; }

.soon--link .soon__icon { background: var(--primary-wash); color: var(--primary-ink); }

/* The views of a journal: the switch «День · Неделя · Юнит · Весь журнал», its arrows, and the card «Сегодня». */
.jv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); min-width: 0; }

.jv-modes { flex-wrap: wrap; max-width: 100%; }

.jv-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }

.jv-nav__label { min-width: 10rem; padding: 0 var(--space-2); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.jv-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.jv-step:hover:not(:disabled) { background: var(--muted); }
.jv-step:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.jv-step:disabled { cursor: not-allowed; opacity: 0.4; }
.jv-step .icon { width: 18px; height: 18px; }
.jv-step--prev .icon { transform: scaleX(-1); }

.jv-today-btn { min-height: 2.75rem; }

.jv-unit { width: auto; min-width: 12rem; max-width: 100%; min-height: 2.75rem; }

.jv-today-card { display: grid; gap: var(--space-2); min-width: 0; }

.jv-today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--primary-line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--primary-wash);
}

.jv-today__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0; min-width: 0; }
.jv-today__title { color: var(--primary-ink); }
.jv-today__details { min-width: 0; overflow-wrap: anywhere; }
.jv-today__hint { color: var(--text-muted); }
.jv-today__act { min-height: 2.75rem; }
.jv-today__act .icon { width: 16px; height: 16px; }

/* The head of the pair of today stands out in the grid. */
.journal-grid thead .jg-pair-head.is-today { box-shadow: inset 0 -3px 0 var(--primary); }

@media (max-width: 40rem) {
  .jv-modes { width: 100%; }
  .jv-modes .segmented__button { flex: 1 1 auto; min-height: 2.75rem; }
  .jv-nav { width: 100%; }
  .jv-nav__label { flex: 1 1 auto; min-width: 0; }
  .jv-unit { width: 100%; }
  .jv-today__act { width: 100%; }
}

/* The window of marks and of a cell, compact: from a tablet's width the head is one line, the hint a slim strip, the
   rows low and the reason block short, so a laptop screen shows many students. On a phone the controls stay 44 px. */
.mk-reason__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.mk-reason__head .field__hint { flex: 1 1 14rem; margin: 0; font-size: 1rem; }
.mk-reason__head .return-count { margin-left: auto; font-size: 1rem; }

@media (min-width: 48rem) {
  .dialog--marks .dialog__body,
  .dialog--cell .dialog__body { gap: var(--space-3); padding: var(--space-4) var(--space-5); }

  .dialog--marks .mk-head,
  .dialog--cell .mk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }

  .dialog--marks .mk-head .dialog__title,
  .dialog--cell .mk-head .dialog__title { order: -1; font-size: 1rem; }

  .dialog--marks .mk-head .mk-topic,
  .dialog--cell .mk-head .mk-topic { flex: 1 1 18rem; }

  .mk-hint { gap: var(--space-2); padding: var(--space-1) var(--space-3); }
  .dialog--marks .mk-hint .button { min-height: 32px; padding-block: 0; }

  .mk-list { flex: 1 1 auto; min-height: 9rem; }
  .mk-empty { flex: none; }

  .mk-row { padding: 2px var(--space-3); gap: 0 var(--space-3); }
  .mk-status__btn { min-height: 32px; }
  .mk-coat,
  .mk-act { min-height: 32px; }
  .mk-act__input { min-height: 32px; padding-block: 0; }

  .mk-reason { gap: var(--space-1); }
  .mk-reason .field__textarea { min-height: 3.25rem; }

  .dialog--marks .dialog__actions,
  .dialog--cell .dialog__actions { margin-top: 0; }
  .dialog--marks .button,
  .dialog--cell .button { min-height: 40px; }
}

/* ---- Unit 4: the pairs of today (home), the start button (journal) and the pair screen for the projector ---- */

.jv-today__start { display: grid; gap: var(--space-1); justify-items: start; min-width: 0; }
.jv-today__start .jv-today__hint { font-size: 1rem; color: var(--danger); }
@media (max-width: 40rem) {
  .jv-today__start { width: 100%; justify-items: stretch; }
}

.lessons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  align-items: start;
  height: 100%;
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--border-strong);
}

.lesson-card.is-running { border-left-color: var(--success); }

.lesson-card__time {
  display: grid;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-title);
  font-variant-numeric: tabular-nums;
}

.lesson-card__end { font-size: var(--hint-fs); font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.lesson-card__main { display: grid; gap: var(--space-1); min-width: 0; }
.lesson-card__subject { margin: 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.lesson-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-muted); }
.lesson-card__topic { margin: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.lesson-card__side { grid-column: 1 / -1; display: grid; gap: var(--space-2); }
.lesson-card__act { min-height: 2.75rem; width: 100%; }
.lesson-card__hint { margin: 0; color: var(--text-muted); }
.lesson-card__hint--error { color: var(--danger); }

/* The pair screen: the whole window, always light. Sizes are for a projector, so the type is large. */

.lesson-frame { min-height: 100vh; background: var(--bg); color: var(--text); }

.content.lp {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: var(--space-6) var(--space-7);
  background: var(--bg);
  font-size: 1rem;
}

.lp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.lp-head__title { min-width: 0; flex: 1 1 18rem; }
.lp-head__name { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: var(--tracking-title); overflow-wrap: anywhere; }
.lp-head__topic { margin: var(--space-1) 0 0; font-size: 1.125rem; color: var(--text-muted); overflow-wrap: anywhere; }
.lp-head__tools { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lp-tool { min-height: 2.75rem; font-size: 1rem; }

.lp-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-control); background: var(--seg-track); }

.lp-tab {
  min-height: 2.75rem;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.lp-tab[aria-selected="true"] { background: var(--seg-active); box-shadow: var(--seg-shadow); color: var(--text); font-weight: 600; }
.lp-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.lp-body { flex: 1 1 auto; display: grid; align-content: start; }
.lp-loading, .lp-error { font-size: 1.125rem; }
.lp-error { display: grid; gap: var(--space-3); justify-items: start; }

.lp-none { display: grid; gap: var(--space-5); justify-items: start; padding: var(--space-7) 0; }
.lp-none__title { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: var(--tracking-title); color: var(--text-muted); }
.lp-big { min-height: 3.5rem; padding: 0 var(--space-7); font-size: 1.125rem; }

.lp-checkin { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-8); align-items: start; }

.lp-qr { display: grid; gap: var(--space-4); justify-items: center; }

.lp-qr__canvas {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  image-rendering: pixelated;
}

.lp-code { display: grid; gap: var(--space-2); justify-items: start; }
.lp-code__label { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.lp-code__digits { display: flex; gap: var(--space-3); }

.lp-code__digit {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 5.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-family: var(--font-mono);
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-ink);
}

.lp-code__hint { margin: 0; font-size: 1rem; color: var(--text-muted); }

.lp-side { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.lp-side__stage { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.lp-side__count { margin: 0; font-size: 3.25rem; font-weight: 700; line-height: 1.05; letter-spacing: var(--tracking-title); }
.lp-side__none { margin: 0; font-size: 1.25rem; color: var(--text-muted); }

.lp-names { column-count: 2; column-gap: var(--space-6); margin: 0; padding: 0; list-style: none; font-size: 1.375rem; }
.lp-name { break-inside: avoid; padding: var(--space-1) var(--space-2); border-radius: var(--radius-inner); overflow-wrap: anywhere; }
.lp-name.is-new { background: var(--success-wash); }

@media (prefers-reduced-motion: no-preference) {
  .lp-name.is-new { animation: lp-arrive 1.6s ease-out both; }
}

@keyframes lp-arrive {
  from { background: var(--success-line); transform: translateX(-6px); }
  to { background: transparent; transform: none; }
}

.lp-side .lp-big { justify-self: start; margin-top: var(--space-3); }

.lp:fullscreen { overflow: auto; padding: var(--space-7) var(--space-8); }
.lp:fullscreen .lp-head__name { font-size: 2.25rem; }
.lp:fullscreen .lp-code__digit { width: 5.5rem; height: 7rem; font-size: 4.75rem; }
.lp:fullscreen .lp-side__count { font-size: 4.5rem; }
.lp:fullscreen .lp-names { font-size: 1.75rem; }

@media (max-width: 62rem) {
  .content.lp { padding: var(--space-5) var(--space-4); }
  .lp-checkin { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .lp-code__digit { width: 3.5rem; height: 4.5rem; font-size: 3rem; }
  .lp-side__count { font-size: 2.5rem; }
  .lp-names { column-count: 1; }
  .lp-big { width: 100%; }
}

/* The pair screen, stages «Материал» and «Итог». */

.lp-material { display: grid; gap: var(--space-4); justify-items: start; padding: var(--space-6) 0; max-width: 60rem; }
.lp-material__topic { margin: 0; font-size: 3rem; font-weight: 700; line-height: 1.1; letter-spacing: var(--tracking-title); overflow-wrap: anywhere; }
.lp-material__kind { margin: 0; font-size: 1.5rem; color: var(--text-muted); text-transform: none; }
.lp-material__left { margin: var(--space-4) 0 0; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.04em; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.lp-material__count { margin: 0; font-size: 2.25rem; font-weight: 700; letter-spacing: var(--tracking-title); }
.lp-material .lp-big { margin-top: var(--space-4); }

.lp-sum { display: grid; gap: var(--space-4); min-width: 0; }
.lp-sum__warn { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 1rem; font-weight: 600; color: var(--warning); }
.lp-sum__note { margin: 0; font-size: 1.125rem; color: var(--text-muted); }
.lp-sum__scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-inner); background: var(--surface); }
.lp-sum__table { width: 100%; min-width: 52rem; border-collapse: collapse; font-size: 1rem; }
.lp-sum__caption { padding: var(--space-2) var(--space-4); text-align: left; font-weight: 600; clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; }
.lp-sum__table th,
.lp-sum__table td { padding: var(--space-2) var(--space-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.lp-sum__table thead th { font-size: 1rem; font-weight: 600; color: var(--text-muted); background: var(--muted); white-space: nowrap; }
.lp-sum__table tbody tr:last-child > * { border-bottom: 0; }
.lp-sum__table tbody tr:nth-child(even) { background: var(--muted); }
.lp-sum__row.is-invalid { box-shadow: inset 3px 0 0 var(--danger); background: var(--danger-wash); }
.lp-sum__n { width: 3rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lp-sum__name { font-weight: 500; overflow-wrap: anywhere; min-width: 11rem; }
.lp-sum__source { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-sum__source.is-auto { color: var(--warning); }
.lp-sum__error { margin: var(--space-1) 0 0; font-weight: 400; }
.lp-sum__status { white-space: nowrap; }
.lp-sum__problem:empty { display: none; }
.lp-sum__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.lp-sum__saved { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 1rem; font-weight: 600; color: var(--success); }
.lp-sum .lp-big:disabled { opacity: 0.5; cursor: default; }

.lp-done { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: 1px solid var(--success-line); border-radius: var(--radius-inner); background: var(--success-wash); }
.lp-done__title { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: var(--tracking-title); color: var(--success); }
.lp-done__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }

.jg-pair-head__live { margin-top: 2px; padding: 0 var(--space-2); border-radius: 999px; background: var(--success-wash); color: var(--success); font-size: 0.6875rem; font-weight: 600; line-height: 1.3; letter-spacing: 0.02em; }

@media (max-width: 62rem) {
  .lp-material__topic { font-size: 2.25rem; }
}

/* «Я на паре» on the student's home: shown only while a check-in of the group is open. */
.here-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-left: 4px solid var(--primary-fill);
  background: var(--primary-wash);
}

.here-card.is-marked {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-left-color: var(--success);
  background: var(--success-wash);
}

.here-card__text { display: grid; gap: var(--space-1); min-width: 0; }
.here-card__now { margin: 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.here-card__left { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: var(--tracking-title); font-variant-numeric: tabular-nums; color: var(--primary-ink); }
.here-card__done { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--success); }
.here-card__go { min-height: 3.5rem; width: 100%; font-size: 1.125rem; font-weight: 600; }
.here-card__go .icon { width: 1.5rem; height: 1.5rem; }

.here-card__tick {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--success);
  color: var(--bg);
}

.here-card__tick .icon { width: 1.5rem; height: 1.5rem; }

/* The check-in screen of a student (#/here): a phone screen, big type, big targets. */
.here {
  display: grid;
  gap: var(--space-4);
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.here__title { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: var(--tracking-title); }
.here__body { display: grid; gap: var(--space-4); }
.here__note, .here__msg { font-size: 1rem; }
.here__msg { font-weight: 600; }

.here__pair, .here__form, .here__empty, .here__done, .here__failed {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.here__place { margin: 0; font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }
.here__muted { margin: 0; color: var(--text-muted); font-size: 1rem; }
.here__big { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: var(--tracking-title); overflow-wrap: anywhere; }

.here__left {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-title);
  font-variant-numeric: tabular-nums;
  color: var(--primary-ink);
}

.here__label { font-size: 1rem; font-weight: 600; }

.here__code {
  width: 100%;
  min-height: 4.5rem;
  padding: 0 0 0 0.5em;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-card);
  background: var(--input-bg);
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.here__code:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-soft);
}

.here__go { min-height: 3.5rem; width: 100%; font-size: 1.125rem; font-weight: 600; }
.here__go[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.here__go.is-busy { opacity: 1; }

.here__done { justify-items: center; text-align: center; padding: var(--space-6) var(--space-4); }
.here__empty { text-align: left; }

.here__tick {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--success);
  color: var(--bg);
}

.here__tick .icon { width: 2.75rem; height: 2.75rem; stroke-width: 3; }

/* «Задания» of the teacher (unit 5): the subjects, the assignments of a subject, the window of an assignment */

.task-subjects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-subject {
  position: relative;
  display: grid;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-5) var(--space-5) var(--space-5) calc(var(--space-5) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}

.task-subject::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lesson, var(--primary));
}

.task-subject[data-tone="0"] { --lesson: var(--tone-0); }
.task-subject[data-tone="1"] { --lesson: var(--tone-1); }
.task-subject[data-tone="2"] { --lesson: var(--tone-2); }
.task-subject[data-tone="3"] { --lesson: var(--tone-3); }
.task-subject[data-tone="4"] { --lesson: var(--tone-4); }
.task-subject[data-tone="5"] { --lesson: var(--tone-5); }

.task-subject:hover { border-color: var(--primary-line); background: var(--surface-raised); }

.task-subject:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.task-subject__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.task-subject__name { padding-right: 1.5rem; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: anywhere; }

.task-subject__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); color: var(--text-muted); font-size: var(--control-fs); }

.task-subject__chevron { position: absolute; right: var(--space-4); bottom: var(--space-5); width: 1.25rem; height: 1.25rem; color: var(--text-muted); }

.tasks-body { display: grid; gap: var(--space-4); }

.task-past-toggle { justify-self: start; }

.tasks-table td { vertical-align: top; }

.tasks-table__title { position: relative; min-width: 12rem; max-width: 26rem; font-weight: 600; }

.tasks-table__link { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }

.tasks-table__link::after { content: ""; position: absolute; inset: 0; }

.tasks-table__link:focus-visible { outline: none; }

.tasks-table__link:focus-visible::after { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: var(--radius-inner); }

.tasks-row:hover .tasks-table__link { text-decoration: underline; }

.tasks-table__sub { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--hint-fs); font-weight: 400; }

.tasks-table__unit { white-space: nowrap; }

.tasks-table__due { white-space: nowrap; }

.tasks-table__actions { position: relative; width: 1%; text-align: right; white-space: nowrap; }

.tasks-table .row-actions { display: inline-flex; gap: var(--space-1); }

.task-due--danger { color: var(--danger); font-weight: 600; }

.task-due--warning { color: var(--warning); font-weight: 600; }

.task-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }

.task-progress__main { font-variant-numeric: tabular-nums; }

.icon-button--danger:hover { background: var(--danger-wash); color: var(--danger); }

.icon-button[aria-disabled="true"] { cursor: not-allowed; opacity: 0.4; }

.icon-button[aria-disabled="true"]:hover { background: transparent; color: var(--text-muted); }

.dialog--task { width: min(calc(100% - 1rem), 40rem); }

.task-form { display: grid; gap: var(--space-4); }

.task-form__row { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-4); }

.task-form__pair,
.task-form__fixed-place {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-inner);
  background: var(--primary-wash);
}

.task-form__pair p,
.task-form__fixed-place p { margin: 0; }

.task-form__pair-subject { font-weight: 600; }

.task-form__fixed-label { margin-right: var(--space-2); color: var(--text-muted); }

.task-form__fixed { margin: 0; font-weight: 600; }

.lp-sum__link { color: var(--primary-ink); font-weight: 600; }

@media (max-width: 599px) {
  .tasks-table__title { min-width: 10rem; }
}

/* The assignment for the staff: the students and the work of the chosen one (#/task/<id>) */

.task-screen { display: grid; gap: var(--space-4); }

.task-info { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5); }

.task-info p { margin: 0; }

.task-info__eyebrow { color: var(--primary-ink); font-size: var(--hint-fs); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }

.task-info__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); color: var(--text-muted); }

.task-info__text { max-width: 70ch; white-space: pre-wrap; overflow-wrap: anywhere; }

.check { display: grid; gap: var(--space-4); align-items: start; }

.check > * { min-width: 0; }

@media (min-width: 768px) {
  .check { grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); }
  .check__list { position: sticky; top: var(--space-4); max-height: calc(100vh - 2 * var(--space-4)); overflow-y: auto; }
}

.check__list,
.check__work { display: grid; gap: var(--space-3); padding: var(--space-4); }

.check__heading { margin: 0; font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }

.check__students { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.check__none { margin: 0; color: var(--text-muted); }

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "a n" ". s";
  align-items: center;
  gap: var(--space-1) var(--space-3);
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.check-row .avatar { grid-area: a; }

.check-row__name { grid-area: n; font-weight: 500; overflow-wrap: anywhere; }

.check-row__state { grid-area: s; display: flex; flex-wrap: wrap; gap: var(--space-1); }

.check-row:hover { background: var(--muted); }

.check-row[aria-current="true"] { border-color: var(--primary-line); background: var(--primary-wash); }

.check-work__head { display: flex; align-items: center; gap: var(--space-3); }

.check-work__who { display: grid; gap: var(--space-1); min-width: 0; }

.check-work__state { display: flex; flex-wrap: wrap; gap: var(--space-1); }

.check-work__none { margin: 0; padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-inner); color: var(--text-muted); }

.attempt { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-inner); }

.attempt--current { background: var(--muted); }

.attempt p { margin: 0; }

.attempt__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }

.attempt__time { color: var(--text-muted); }

.attempt__text { white-space: pre-wrap; overflow-wrap: anywhere; }

.attempt__text--none,
.attempt__checked { color: var(--text-muted); font-size: var(--hint-fs); }

.attempt__result { display: grid; gap: var(--space-1); }

.file-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

.file-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
}

.file-chip:hover { border-color: var(--primary); }

.file-chip__kind { min-width: 2.75rem; padding: 2px var(--space-2); border-radius: var(--radius-inner); background: var(--primary-wash); color: var(--primary-ink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }

.file-chip__name { overflow-wrap: anywhere; font-weight: 500; }

.file-chip__size { color: var(--text-muted); font-size: var(--hint-fs); white-space: nowrap; }

.grade { display: grid; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }

.grade__title { margin: 0; font-size: 1rem; font-weight: 600; }

.grade .field__hint { margin: 0; }

.grade .field__textarea { min-height: 5rem; resize: vertical; }

.grade [hidden] { display: none; }

#grade-points { max-width: 8rem; }

.grade__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.grade__next { margin-left: auto; }

.grade__next[aria-disabled="true"] { cursor: not-allowed; opacity: 0.5; }

.grade-read { display: grid; gap: var(--space-1); }

.grade-read p { margin: 0; }

.grade-read__points { font-weight: 600; }

.check__previous { display: grid; gap: var(--space-2); }

.check__previous > .button { justify-self: start; }

.check__previous-list { display: grid; gap: var(--space-2); }

.dialog--file { width: min(calc(100% - 1rem), 46rem); }

.file-view__title { overflow-wrap: anywhere; }

.file-view__shown { display: grid; gap: var(--space-3); justify-items: start; }

.file-view__image { display: block; max-width: 100%; max-height: 65vh; border: 1px solid var(--border); border-radius: var(--radius-inner); background: var(--muted); }

@media (max-width: 767px) {
  .grade__next { margin-left: 0; }
  .grade__actions .button,
  .check__previous > .button,
  .file-view__shown .button { flex: 1 1 100%; min-height: 2.75rem; }
  .task-info { padding: var(--space-3) var(--space-4); }
}

/* The student's assignments: the card on the home screen, the list by subject (#/tasks), the work and the form (#/task/<id>) */

.homework { display: grid; gap: var(--space-4); padding: var(--space-4); }

.homework__icon { background: var(--warning-wash); color: var(--warning); }

.homework__lines { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

.homework__line {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-inner);
  background: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.homework__line--warning { border-color: var(--warning-line); border-left-color: var(--warning); background: var(--warning-wash); color: var(--text); }

.homework__line--danger { border-color: var(--danger-line); border-left-color: var(--danger); background: var(--danger-wash); color: var(--text); }

.homework__line--neutral { border-left-color: var(--primary); }

.homework__none {
  margin: 0;
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-inner);
  color: var(--text-muted);
  text-align: center;
}

.homework__all { justify-content: center; min-height: 2.75rem; }

.mine-groups { display: grid; gap: var(--space-6); }

.mine-group { display: grid; gap: var(--space-3); }

.mine-group__title { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }

.mine-tasks { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

.mine-task {
  position: relative;
  display: grid;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-4) calc(var(--space-4) + 1.5rem) var(--space-4) var(--space-4);
  border-left: 4px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.mine-task:hover { background: var(--row-hover); }

.mine-task:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mine-task--returned { border-left-color: var(--warning); }

.mine-task--submitted { border-left-color: var(--primary); }

.mine-task--checked { border-left-color: var(--success); }

.mine-task__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.mine-task__title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.mine-task__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); color: var(--text-muted); }

.mine-task__points { color: var(--success); font-weight: 600; }

.mine-task__chevron { position: absolute; top: 50%; right: var(--space-4); width: 1.25rem; height: 1.25rem; margin-top: -0.625rem; color: var(--text-muted); }

.mine-screen { gap: var(--space-4); }

.mine-work { display: grid; gap: var(--space-4); padding: var(--space-4); }

.mine-work > * { min-width: 0; }

.mine-work__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }

.mine-work__state { display: flex; flex-wrap: wrap; gap: var(--space-1); }

.mine-work__hint { margin: 0; color: var(--text-muted); }

.mine-points { margin: 0; color: var(--success); font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.mine-comment { display: grid; gap: var(--space-1); padding: var(--space-4); border: 1px solid var(--warning-line); border-left: 4px solid var(--warning); border-radius: var(--radius-inner); background: var(--warning-wash); }

.mine-comment p { margin: 0; }

.mine-comment__label { color: var(--text-muted); font-weight: 600; }

.mine-comment__text { font-size: 1.125rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.mine-form { display: grid; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }

.mine-form .field__textarea { min-height: 8rem; resize: vertical; }

.mine-form__hint { margin: 0; min-height: 1.4em; }

.mine-form__submit { width: 100%; min-height: 3rem; font-size: 1.0625rem; }

.mine-files { display: grid; gap: var(--space-3); }

.mine-files__add { justify-self: start; min-height: 2.75rem; cursor: pointer; }

.mine-files__add:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

.mine-files__hint { margin: 0; }

.mine-file-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

.mine-file { display: grid; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-inner); background: var(--surface); }

.mine-file--error { border-color: var(--danger-line); }

.mine-file__main { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); }

.mine-file__name { min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 500; text-align: left; overflow-wrap: anywhere; }

.mine-file__open { min-height: 2.75rem; color: var(--primary-ink); text-decoration: underline; cursor: pointer; }

.mine-file__size { color: var(--text-muted); white-space: nowrap; }

.mine-file__status { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--text-muted); }

.mine-file__status--done { color: var(--success); font-weight: 500; }

.mine-file__status .icon { width: 1.125rem; height: 1.125rem; }

.mine-progress { flex: 1; width: 100%; height: 0.75rem; min-width: 6rem; overflow: hidden; border: 0; border-radius: 999px; background: var(--muted); accent-color: var(--primary); }

.mine-progress::-webkit-progress-bar { background: var(--muted); }

.mine-progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }

.mine-progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

.mine-file__error { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; color: var(--danger); font-weight: 500; }

.mine-file__error .icon { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.2rem; }

.mine-file__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.mine-file__button { min-height: 2.75rem; }

.student .file-chip__kind { font-size: 1rem; }

.student .file-chip { min-height: 2.75rem; }

.student .attempt__text--none,
.student .attempt__checked { font-size: 1rem; }

/* Task 12: self-work counted by assignments in the journal, the grades button, the filters of the office list */
.jg-unit-head__tag { color: var(--text-muted); font-size: 0.6875rem; font-weight: 500; }
.jg-unit-head__tasks { display: block; margin-top: 2px; color: var(--primary-ink); font-size: 0.75rem; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.jg-unit-head__tasks:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
.jg-self { line-height: 1.2; }
.jg-self__value,
.jg-self__tag { display: block; }
.jg-self__tag { color: var(--text-muted); font-size: 0.6875rem; font-weight: 500; }
.journal-grid .jg-pts.is-provisional .jg-self__value { color: var(--text-muted); font-style: italic; }
.gr-tasks { justify-self: stretch; min-height: 2.75rem; }
.tasks-filter__empty { color: var(--text-muted); }
.tasks-toolbar { align-items: flex-end; }

/* Syllabus file: the block on the title tab of the form, the button of the syllabus page */
.sform-file {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.sform-file__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }

.sform-file__title { padding: 0; border: 0; }

.sform-file__hint { margin: 0; color: var(--text-muted); font-size: var(--hint-fs); }

.sform-file__row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }

.sform-file__tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3.5rem;
  border-radius: var(--radius-inner);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sform-file__tile[data-kind="pdf"] { background: var(--danger-wash); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }

.sform-file__tile[data-kind="word"] { background: var(--primary-wash); color: var(--primary-ink); box-shadow: inset 0 0 0 1px var(--primary-line); }

.sform-file__text { display: grid; gap: 2px; min-width: 0; }

.sform-file__name {
  justify-self: start;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.sform-file__name:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

.sform-file__meta { margin: 0; color: var(--text-muted); font-size: var(--hint-fs); font-variant-numeric: tabular-nums; }

.sform-file__none { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-muted); }

.sform-file__none .icon { width: 1.125rem; height: 1.125rem; }

.sform-file__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.sform-file__actions .button { min-height: 2.75rem; }

.sform-file__progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }

.sform-file__progress .mine-progress { flex: 1 1 10rem; }

.sform-file__percent { color: var(--text-muted); font-size: var(--hint-fs); font-variant-numeric: tabular-nums; }

.sform-file__problem { display: grid; gap: var(--space-2); justify-items: start; }

.sform-file__problem .button { min-height: 2.75rem; }

.syllabus-head__file { justify-self: start; min-height: 2.75rem; }

.syllabus-head__file-size { color: var(--text-muted); font-size: var(--hint-fs); font-weight: 500; white-space: nowrap; }

.student .syllabus-head__file { font-size: 1rem; }

@media (max-width: 37.5rem) {
  .student .syllabus-head__text { flex: 1 1 100%; }

  .student .syllabus-head__file { justify-self: stretch; justify-content: center; width: 100%; }
}
