:root {
  --ink: #273044;
  --ink-soft: #5e6678;
  --blue-900: #243f7d;
  --blue-800: #2f4f93;
  --blue-700: #4769aa;
  --blue-500: #7ea8dc;
  --blue-300: #b7cfee;
  --blue-200: #dbe8f7;
  --blue-100: #eef4fb;
  --cream: #f7f4ec;
  --cream-deep: #ece7dc;
  --white: #fffdf8;
  --success: #4f8a72;
  --warning: #bd8652;
  --danger: #b66067;
  --school: #7f73b8;
  --shadow: 0 18px 55px rgba(36, 63, 125, 0.11);
  --shadow-soft: 0 10px 30px rgba(36, 63, 125, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --sidebar-width: 272px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 4%, rgba(183, 207, 238, 0.34), transparent 24rem),
    linear-gradient(135deg, #f9f7f1 0%, var(--cream) 55%, #f1f4f8 100%);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(126, 168, 220, 0.35);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

small {
  color: var(--ink-soft);
}

.is-hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #f8fbff;
  background:
    linear-gradient(175deg, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(160deg, var(--blue-900), #2e579e 72%, #3f70b6);
  overflow: hidden;
  z-index: 20;
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  pointer-events: none;
}

.sidebar::before {
  width: 240px;
  height: 240px;
  left: -138px;
  bottom: 70px;
}

.sidebar::after {
  width: 170px;
  height: 170px;
  right: -100px;
  top: 80px;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 8px 42px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  color: #dcecff;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.brand-title-accent {
  margin-top: 3px;
  color: #cfe2fb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
}

.main-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--blue-900);
  background: #f8f5ee;
  box-shadow: 0 10px 25px rgba(8, 24, 61, 0.14);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.sidebar-note-label {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: #eaf3ff;
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-note p {
  margin: 9px 0 0;
  font-size: 0.82rem;
}

.sidebar-action {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 13px;
  color: #eaf3ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.18s ease;
}

.sidebar-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

.main-content {
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 56px) 56px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.today-chip {
  padding: 10px 15px;
  border: 1px solid rgba(36, 63, 125, 0.1);
  border-radius: 999px;
  color: var(--blue-900);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow-soft);
  font-size: 0.87rem;
  font-weight: 650;
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--blue-900);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--blue-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #cfe2fb;
}

.page {
  display: none;
  animation: page-in 0.22s ease;
}

.page.is-active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  position: relative;
  min-height: 264px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
  padding: clamp(28px, 5vw, 50px);
  border-radius: var(--radius-xl);
  color: #f8fbff;
  background:
    radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.12), transparent 18rem),
    linear-gradient(125deg, #294989 0%, #3f68aa 58%, #6c94cc 100%);
  box-shadow: 0 20px 50px rgba(36, 63, 125, 0.18);
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 160px;
  right: -100px;
  bottom: -120px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-copy h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
}

.hero-copy p {
  max-width: 580px;
  margin-bottom: 23px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-illustration {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  place-items: center;
}

.hero-illustration svg {
  width: min(100%, 420px);
  max-height: 230px;
}

.button,
.icon-button,
.text-button,
.segment,
.quick-action,
.lesson-card,
.student-card,
.material-card,
.group-card {
  -webkit-user-select: none;
  user-select: none;
}

.button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  background: var(--blue-800);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--blue-900);
  box-shadow: 0 8px 18px rgba(36, 63, 125, 0.18);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-light {
  color: var(--blue-900);
  background: #f8f5ee;
}

.button-light:hover {
  background: #fff;
}

.button-ghost-light {
  border-color: rgba(255, 255, 255, 0.25);
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.05);
}

.button-ghost-light:hover {
  background: rgba(255, 255, 255, 0.11);
}

.button-secondary {
  border-color: rgba(36, 63, 125, 0.12);
  color: var(--blue-900);
  background: var(--white);
}

.button-secondary:hover {
  color: #fff;
  background: var(--blue-800);
}

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

.button-danger:hover {
  background: #9f4f57;
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.84rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(36, 63, 125, 0.1);
  border-radius: 13px;
  color: var(--blue-900);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  font-size: 1.45rem;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: var(--blue-100);
}

.icon-button.small {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  box-shadow: none;
}

.text-button {
  padding: 5px;
  border: 0;
  color: var(--blue-700);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--blue-900);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stat-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.83);
  box-shadow: var(--shadow-soft);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  right: -20px;
  bottom: -25px;
  border-radius: 50%;
  background: var(--blue-200);
  opacity: 0.5;
}

.stat-card strong {
  display: block;
  margin-top: 11px;
  color: var(--blue-900);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.content-grid {
  display: grid;
  gap: 18px;
}

.home-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
}

.panel {
  padding: 24px;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
}

.panel-soft {
  background:
    linear-gradient(140deg, rgba(238, 244, 251, 0.95), rgba(255, 253, 248, 0.92));
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header.compact {
  align-items: flex-start;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.lesson-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid rgba(36, 63, 125, 0.09);
  border-left: 4px solid var(--blue-700);
  border-radius: 16px;
  color: var(--ink);
  background: #fffefa;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.lesson-card:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 63, 125, 0.18);
  box-shadow: 0 10px 24px rgba(36, 63, 125, 0.08);
}

.lesson-card.school {
  border-left-color: var(--school);
}

.lesson-card.moved {
  border-left-style: dashed;
  opacity: 0.66;
}

.lesson-card.cancelled {
  border-left-color: #9aa0ad;
  opacity: 0.55;
  text-decoration: line-through;
}

.lesson-time {
  color: var(--blue-900);
  font-size: 0.98rem;
  font-weight: 800;
}

.lesson-main strong {
  display: block;
  font-size: 0.98rem;
}

.lesson-main small {
  display: block;
  margin-top: 2px;
}

.lesson-topic-line {
  line-height: 1.35;
}

.lesson-transfer-note {
  color: var(--muted);
  font-style: italic;
  white-space: normal;
}

.lesson-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 0.73rem;
  font-weight: 750;
  white-space: nowrap;
}

.badge.school {
  color: #51468c;
  background: #efedf9;
}

.badge.success {
  color: #316c55;
  background: #e8f4ee;
}

.badge.warning {
  color: #8d5e2f;
  background: #f8eddf;
}

.badge.danger {
  color: #8d4148;
  background: #f7e7e9;
}

.badge.neutral {
  color: #626978;
  background: #f0f1f3;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-action {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.85);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.quick-action:hover {
  transform: translateX(2px);
  background: #fff;
}

.quick-action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--blue-900);
  background: var(--blue-200);
  font-size: 1.25rem;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action small {
  margin-top: 2px;
  font-size: 0.78rem;
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed rgba(36, 63, 125, 0.18);
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(238, 244, 251, 0.45);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(36, 63, 125, 0.09);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
}

.segment {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.segment.is-active {
  color: #fff;
  background: var(--blue-800);
}

.search-field {
  min-width: 230px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(36, 63, 125, 0.1);
  border-radius: 12px;
  background: var(--white);
}

.search-field.wide {
  min-width: 290px;
}

.search-field span {
  color: var(--blue-700);
  font-size: 1.25rem;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.select-field,
.form-control {
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(36, 63, 125, 0.14);
  border-radius: 12px;
  color: var(--ink);
  background: #fffefa;
  outline: 0;
}

.select-field {
  width: auto;
}

textarea.form-control {
  min-height: 104px;
  resize: vertical;
}

.form-control:focus,
.select-field:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(126, 168, 220, 0.16);
}

.student-list {
  display: grid;
  gap: 12px;
}

.student-card {
  overflow: hidden;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
}

.student-card-header {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.student-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--blue-900);
  background: linear-gradient(145deg, #e5effa, #bfd4ef);
  font-size: 1.1rem;
  font-weight: 800;
}

.student-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.student-title-line strong {
  font-size: 1rem;
}

.student-summary small {
  display: block;
  margin-top: 2px;
}

.student-next {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: right;
}

.student-chevron {
  color: var(--blue-700);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.student-card.is-open .student-chevron {
  transform: rotate(180deg);
}

.student-card-body {
  display: none;
  padding: 0 18px 18px 79px;
}

.student-card.is-open .student-card-body {
  display: block;
}

.student-description {
  max-width: 850px;
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.student-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-info {
  padding: 12px;
  border-radius: 14px;
  background: var(--blue-100);
}

.mini-info span,
.mini-info strong {
  display: block;
}

.mini-info span {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.student-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.group-grid,
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.group-card,
.material-card {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-soft);
}

.group-card::after,
.material-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -35px;
  bottom: -45px;
  border-radius: 50%;
  background: var(--blue-200);
  opacity: 0.55;
}

.group-card > *,
.material-card > * {
  position: relative;
  z-index: 1;
}

.group-card h3,
.material-card h3 {
  font-size: 1.08rem;
}

.group-card p,
.material-card p {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.group-members {
  margin-top: 14px;
  font-size: 0.83rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.detail-header-main {
  display: flex;
  gap: 16px;
  align-items: center;
}

.detail-avatar {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--blue-900);
  background: linear-gradient(145deg, #e9f1fb, #bed4ef);
  font-size: 1.5rem;
  font-weight: 800;
}

.detail-header h2 {
  font-size: 2rem;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.detail-tab {
  padding: 9px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.detail-tab.is-active {
  color: var(--blue-900);
  background: var(--blue-200);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
  gap: 16px;
}

.info-card {
  padding: 22px;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-soft);
}

.info-card h3 {
  margin-bottom: 12px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.contact-list {
  display: grid;
  gap: 9px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--blue-900);
  background: var(--blue-100);
  text-decoration: none;
  font-weight: 700;
}

.contact-link:hover {
  background: var(--blue-200);
}

.lesson-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
}

.lesson-table th,
.lesson-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(36, 63, 125, 0.08);
  text-align: left;
  vertical-align: top;
}

.lesson-table th {
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson-table tbody tr {
  cursor: pointer;
}

.lesson-table tbody tr:hover {
  background: var(--blue-100);
}

.schedule-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.schedule-toolbar > :last-child {
  justify-self: end;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 25px;
  border-top: 3px solid var(--blue-700);
  border-radius: 3px;
}

.legend-line.school { border-color: var(--school); }
.legend-line.moved { border-top-style: dashed; opacity: 0.7; }
.legend-line.cancelled { border-color: #9aa0ad; opacity: 0.7; }

.calendar-shell {
  overflow: auto;
  border: 1px solid rgba(36, 63, 125, 0.08);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
}

.calendar-grid {
  min-width: 980px;
  display: grid;
  grid-template-columns: 74px repeat(7, minmax(126px, 1fr));
  grid-template-rows: 62px repeat(15, 68px);
  position: relative;
}

.calendar-grid::before {
  content: "";
  position: absolute;
  left: 74px;
  right: 0;
  top: 62px;
  bottom: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 67px, rgba(36, 63, 125, 0.08) 67px, rgba(36, 63, 125, 0.08) 68px),
    repeating-linear-gradient(to right, transparent 0, transparent calc((100% / 7) - 1px), rgba(36, 63, 125, 0.07) calc((100% / 7) - 1px), rgba(36, 63, 125, 0.07) calc(100% / 7));
  pointer-events: none;
}

.calendar-corner,
.calendar-day-header,
.calendar-time {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 253, 0.88);
}

.calendar-day-header {
  flex-direction: column;
  border-left: 1px solid rgba(36, 63, 125, 0.07);
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day-header strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.calendar-day-header.today {
  color: var(--blue-700);
  background: var(--blue-100);
}

.calendar-time {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  background: rgba(248, 250, 253, 0.7);
}

.calendar-lesson {
  position: relative;
  z-index: 3;
  margin: 3px 5px;
  overflow: hidden;
  padding: 8px 9px;
  border: 1px solid rgba(36, 63, 125, 0.11);
  border-left: 4px solid var(--blue-700);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(238, 244, 251, 0.96);
  box-shadow: 0 6px 14px rgba(36, 63, 125, 0.08);
  cursor: pointer;
  text-align: left;
}

.calendar-lesson.school {
  border-left-color: var(--school);
  background: rgba(242, 239, 250, 0.96);
}

.calendar-lesson.moved {
  border-left-style: dashed;
  opacity: 0.62;
}

.calendar-lesson.cancelled {
  border-left-color: #9aa0ad;
  background: rgba(240, 241, 243, 0.94);
  opacity: 0.55;
}

.calendar-lesson strong,
.calendar-lesson small {
  display: block;
}

.calendar-lesson strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.calendar-lesson small {
  margin-top: 2px;
  font-size: 0.68rem;
}

.material-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 15px;
  color: var(--blue-900);
  background: var(--blue-200);
  font-weight: 800;
}

.material-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 29, 53, 0.52);
  backdrop-filter: blur(7px);
  animation: backdrop-in 0.18s ease;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-shell {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 26px;
  background: #fffdf8;
  box-shadow: 0 30px 90px rgba(10, 23, 52, 0.3);
  animation: modal-in 0.2s ease;
}

.modal-shell.wide {
  width: min(980px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 4;
  float: right;
  width: 36px;
  height: 36px;
  margin: -8px -8px 0 12px;
  border: 0;
  border-radius: 11px;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.modal-header {
  margin-bottom: 20px;
  padding-right: 42px;
}

.modal-header h2 {
  margin-bottom: 7px;
  font-size: 1.75rem;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.form-hint {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(36, 63, 125, 0.08);
}

.lesson-modal-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.lesson-modal-time {
  color: var(--blue-900);
  font-size: 1.1rem;
  font-weight: 800;
}

.lesson-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  gap: 14px;
}

.lesson-info-box {
  padding: 16px;
  border-radius: 16px;
  background: var(--blue-100);
}

.lesson-info-box + .lesson-info-box {
  margin-top: 10px;
}

.lesson-info-box span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lesson-info-box p {
  margin-bottom: 0;
}

.lesson-modal-buttons {
  display: grid;
  gap: 8px;
}

.preview-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid rgba(36, 63, 125, 0.1);
  border-radius: 16px;
  background: #f5f6f8;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 16px;
  object-fit: contain;
}

.word-preview {
  padding: 44px 24px;
  border: 1px dashed rgba(36, 63, 125, 0.18);
  border-radius: 18px;
  text-align: center;
  background: var(--blue-100);
}

.word-preview h3 {
  margin-bottom: 8px;
}

.word-preview p {
  max-width: 560px;
  margin: 0 auto 18px;
  color: var(--ink-soft);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(36, 63, 125, 0.1);
  border-radius: 13px;
  background: var(--blue-100);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 9px;
}

.toast {
  min-width: 270px;
  max-width: 380px;
  padding: 13px 15px;
  border-radius: 14px;
  color: #fff;
  background: var(--blue-900);
  box-shadow: 0 18px 45px rgba(13, 27, 57, 0.24);
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: #8e4650;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1150px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-template-columns: 1fr 0.7fr;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .section-toolbar:not(.schedule-toolbar) {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 50px rgba(15, 30, 63, 0.22);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
  }

  .main-content {
    padding: 18px 16px 42px;
  }

  .topbar {
    align-items: center;
    margin-bottom: 18px;
  }

  .today-chip {
    display: none;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .hero-illustration {
    display: none;
  }

  .schedule-toolbar {
    grid-template-columns: 1fr auto;
  }

  .schedule-toolbar > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .schedule-toolbar .week-nav {
    grid-column: 1;
    grid-row: 2;
  }

  .schedule-toolbar > :last-child {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 680px) {
  .stats-grid,
  .student-mini-grid,
  .modal-grid,
  .lesson-modal-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .icon-button {
    display: none;
  }

  .hero-copy h2 {
    font-size: 2.2rem;
  }

  .lesson-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .lesson-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 78px;
  }

  .student-card-header {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .student-next {
    display: none;
  }

  .student-card-body {
    padding-left: 18px;
  }

  .toolbar-right,
  .search-field,
  .search-field.wide,
  .select-field,
  .toolbar-right .button {
    width: 100%;
  }

  .detail-header,
  .detail-header-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .button {
    flex: 1;
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal-shell,
  .modal-shell.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 22px 18px;
  }

  .lesson-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .toast-region {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

.calendar-slot {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: crosshair;
}

.calendar-slot:hover {
  background: rgba(183, 207, 238, 0.18);
}

/* ========================================================================== 
   V1.1 — более живой редакционный стиль
   ========================================================================== */
:root {
  --ink: #222747;
  --ink-soft: #626987;
  --blue-900: #35388f;
  --blue-800: #4652b5;
  --blue-700: #3766d6;
  --blue-500: #7597e6;
  --blue-300: #9fb9ec;
  --blue-200: #cbdaf5;
  --blue-100: #eaf0fc;
  --cream: #fbf7ec;
  --cream-deep: #eee6d2;
  --white: #fffdf5;
  --school: #7d60b8;
  --lemon: #fff0a9;
  --peach: #f6c6b5;
  --line: #30356f;
  --shadow: 8px 8px 0 rgba(48, 53, 111, 0.14);
  --shadow-soft: 4px 5px 0 rgba(48, 53, 111, 0.10);
  --radius-xl: 30px;
  --radius-lg: 23px;
  --radius-md: 16px;
  --sidebar-width: 100%;
}

html {
  background: var(--cream);
}

body {
  background:
    radial-gradient(circle at 12px 12px, rgba(48, 53, 111, .035) 1.1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(180deg, #fbf8ef 0%, #f7f4ec 100%);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

h1, h2, h3 {
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 100%;
  height: auto;
  min-height: 78px;
  padding: 13px clamp(22px, 4vw, 64px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  overflow: visible;
  color: var(--ink);
  background: rgba(251, 247, 236, .94);
  border-bottom: 2px solid rgba(48, 53, 111, .16);
  backdrop-filter: blur(14px);
  z-index: 80;
}

.sidebar::before {
  width: 110px;
  height: 28px;
  left: auto;
  right: 39%;
  bottom: -14px;
  border: 0;
  border-top: 3px solid var(--blue-700);
  border-radius: 50%;
  transform: rotate(-2deg);
  opacity: .55;
}

.sidebar::after {
  width: 13px;
  height: 13px;
  right: 36%;
  top: 17px;
  border: 3px solid var(--blue-700);
  border-radius: 50%;
  opacity: .65;
}

.brand {
  flex: 0 0 auto;
  gap: 10px;
  margin: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--blue-700);
  transform: rotate(-7deg);
}

.brand-copy {
  min-width: 158px;
}

.brand-title {
  color: var(--ink);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: -.055em;
  text-transform: none;
  white-space: nowrap;
}

.brand-dot {
  color: var(--blue-700);
}

.brand-subtitle {
  max-width: 170px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: .56rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .015em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.nav-item {
  width: auto;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 12px;
  color: #555b78;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.nav-item:hover {
  color: var(--blue-900);
  background: var(--blue-100);
  transform: rotate(-1deg);
}

.nav-item.is-active {
  color: var(--cream);
  background: var(--blue-900);
  box-shadow: 3px 3px 0 var(--blue-300);
}

.nav-icon {
  width: 18px;
  height: 18px;
  font-size: 1rem;
}

.sidebar-note {
  display: none;
}

.sidebar-action {
  margin: 0 0 0 auto;
  padding: 9px 13px;
  border: 2px solid rgba(48, 53, 111, .22);
  border-radius: 13px;
  color: var(--blue-900);
  background: transparent;
  font-weight: 700;
}

.sidebar-action:hover {
  background: var(--lemon);
}

.main-content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px clamp(22px, 4vw, 64px) 70px;
}

.topbar {
  min-height: 86px;
  align-items: flex-end;
  margin-bottom: 30px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(48, 53, 111, .14);
}

.topbar h1 {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: .9;
  text-transform: uppercase;
}

.topbar .eyebrow {
  font-family: Georgia, serif;
  font-size: .9rem;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

body[data-page="home"] .topbar {
  display: none;
}

.today-chip {
  border: 2px solid rgba(48, 53, 111, .16);
  background: var(--lemon);
  box-shadow: 3px 3px 0 rgba(48, 53, 111, .12);
}

.icon-button {
  border: 2px solid rgba(48, 53, 111, .18);
  border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(48, 53, 111, .12);
}

.home-masthead {
  position: relative;
  min-height: 355px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(440px, 1.12fr);
  align-items: stretch;
  margin: 12px 0 28px;
  border: 2px solid var(--line);
  border-radius: 42px 42px 42px 12px;
  color: var(--cream);
  background: #95b2ea;
  box-shadow: 10px 11px 0 #d7def2;
}

.home-masthead::before {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  left: -155px;
  bottom: -250px;
  border-radius: 45% 55% 48% 52%;
  background: var(--blue-900);
  transform: rotate(14deg);
}

.home-masthead::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 85px;
  right: 34%;
  top: -52px;
  border: 3px solid rgba(255,255,255,.52);
  border-radius: 50%;
  transform: rotate(8deg);
}

.home-masthead-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 46px 24px 46px clamp(34px, 5vw, 68px);
}

.home-date-line {
  display: inline-flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.home-date {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: .02em;
}

.home-date-stroke {
  width: 92%;
  height: 9px;
  margin-top: -1px;
  border-top: 3px solid var(--lemon);
  border-radius: 50%;
  transform: rotate(-2deg);
}

.home-masthead h2 {
  margin: 0 0 18px;
  color: var(--cream);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(3.2rem, 6.8vw, 6.6rem);
  line-height: .82;
  letter-spacing: -.075em;
  text-transform: uppercase;
}

.home-masthead h2 em {
  color: var(--lemon);
  font-family: Georgia, serif;
  font-size: .68em;
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: -.035em;
}

.home-masthead p {
  margin-bottom: 22px;
  color: #fff9e8;
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(48, 53, 111, .22);
}

.home-doodle {
  position: relative;
  z-index: 1;
  min-height: 355px;
}

.home-doodle svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.doodle-blob { fill: #3e429a; }
.doodle-line { fill: none; stroke: #fff9e8; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.doodle-line.thin { stroke-width: 3; opacity: .72; }
.doodle-line.ink { stroke: #35388f; stroke-width: 4; }
.doodle-line.accent { stroke: var(--lemon); stroke-width: 5; }
.doodle-notebook path:nth-child(1),
.doodle-notebook path:nth-child(2) { fill: #fbf7ec; stroke: #30356f; stroke-width: 3; }
.doodle-formula { fill: #fff9e8; font: italic 24px Georgia, serif; }
.doodle-formula.small { font-size: 27px; }
.doodle-dot { fill: var(--peach); stroke: #30356f; stroke-width: 3; }
.doodle-star { fill: var(--lemon); stroke: #30356f; stroke-width: 3; stroke-linejoin: round; }

.hero-actions {
  gap: 12px;
}

.button {
  min-height: 43px;
  border: 2px solid var(--blue-900);
  border-radius: 14px;
  color: #fff;
  background: var(--blue-900);
  box-shadow: 3px 4px 0 rgba(48, 53, 111, .18);
}

.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 6px 0 rgba(48, 53, 111, .16);
}

.button-light {
  color: var(--blue-900);
  background: var(--lemon);
}

.button-light:hover {
  color: var(--blue-900);
  background: #fff5c9;
}

.button-ghost-light {
  border-color: rgba(255,255,255,.8);
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.button-secondary {
  border-color: rgba(48, 53, 111, .28);
  color: var(--blue-900);
  background: var(--white);
}

.home-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .55fr);
  gap: 26px;
}

.panel {
  position: relative;
  padding: 28px;
  border: 2px solid rgba(48, 53, 111, .48);
  border-radius: 28px 28px 12px 28px;
  background: var(--white);
  box-shadow: 7px 8px 0 rgba(48, 53, 111, .10);
}

.today-panel {
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(255,255,255,.65), transparent 42%),
    #f8f5ea;
}

.today-panel::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -94px;
  bottom: -116px;
  border: 3px solid var(--blue-300);
  border-radius: 44% 56% 66% 34%;
  transform: rotate(23deg);
  pointer-events: none;
}

.panel-header h2 {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.45rem);
  line-height: .95;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--blue-700);
  font-family: Georgia, serif;
  font-size: .82rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.text-button {
  color: var(--blue-900);
  border-bottom: 2px solid var(--blue-300);
  font-family: Georgia, serif;
  font-style: italic;
}

.action-board {
  overflow: hidden;
  color: var(--cream);
  background: var(--blue-900);
  border-color: var(--line);
  border-radius: 12px 30px 30px 30px;
  box-shadow: 8px 9px 0 var(--blue-300);
}

.action-board-title {
  position: relative;
  z-index: 2;
  margin-bottom: 22px;
  color: var(--lemon);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  text-transform: uppercase;
}

.action-board-title svg {
  display: block;
  width: 118px;
  height: 25px;
  margin-top: 4px;
}

.action-board-title path,
.action-board-sketch path,
.action-board-sketch circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-board-title svg { color: var(--peach); }

.quick-actions {
  position: relative;
  z-index: 2;
  gap: 13px;
}

.quick-action {
  min-height: 84px;
  padding: 14px 15px;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 17px 17px 17px 5px;
  color: var(--ink);
  background: #b5c9ef;
  box-shadow: 4px 4px 0 rgba(20,23,75,.35);
}

.quick-action:nth-child(2) {
  background: var(--lemon);
  transform: rotate(.6deg);
}

.quick-action:nth-child(3) {
  background: #f4d3c6;
  transform: rotate(-.5deg);
}

.quick-action:hover {
  transform: translate(-2px, -2px) rotate(0);
  background: #fff;
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--blue-900);
  background: transparent;
}

.action-board-sketch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  color: rgba(255,255,255,.18);
  pointer-events: none;
}

.action-board-sketch svg {
  width: 100%;
  height: 115px;
}

.lesson-list {
  gap: 13px;
}

.lesson-card {
  grid-template-columns: 82px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 14px 17px;
  border: 2px solid rgba(48, 53, 111, .34);
  border-left: 2px solid rgba(48, 53, 111, .34);
  border-radius: 16px 16px 16px 5px;
  background: #dbe5f8;
  box-shadow: 4px 4px 0 rgba(48, 53, 111, .09);
}

.lesson-card:nth-child(even) {
  background: #fffdf5;
}

.lesson-card:hover {
  transform: translate(-2px, -2px);
  border-color: var(--blue-900);
  box-shadow: 6px 6px 0 rgba(48, 53, 111, .12);
}

.lesson-card.school {
  border-left-color: rgba(48, 53, 111, .34);
}

.lesson-time {
  color: var(--blue-900);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 1.05rem;
}

.lesson-main strong {
  font-size: 1.02rem;
}

.source-mark {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  display: inline-block;
  border: 2px solid var(--blue-900);
  border-radius: 50%;
  background: var(--blue-500);
  vertical-align: middle;
}

.source-mark.school {
  border-color: #5f438c;
  background: #a98bd1;
}

.homework-badge {
  min-width: 31px;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid rgba(48, 53, 111, .24);
  color: var(--blue-900);
  background: var(--lemon);
}

.badge {
  border: 1px solid rgba(48, 53, 111, .14);
}

.empty-state {
  border: 2px dashed rgba(48, 53, 111, .34);
  background: #eef2fa;
}

.section-toolbar {
  margin-bottom: 26px;
  padding: 18px 20px;
  border: 2px solid rgba(48, 53, 111, .22);
  border-radius: 22px 22px 8px 22px;
  background: #dbe5f8;
  box-shadow: 5px 6px 0 rgba(48, 53, 111, .08);
}

.segmented-control {
  border: 2px solid rgba(48, 53, 111, .24);
  background: var(--cream);
  box-shadow: none;
}

.segment.is-active {
  background: var(--blue-900);
}

.search-field,
.select-field,
.form-control {
  border: 2px solid rgba(48, 53, 111, .20);
  border-radius: 13px;
  background: var(--white);
}

.student-list {
  gap: 17px;
}

.student-card {
  border: 2px solid rgba(48, 53, 111, .34);
  border-radius: 24px 24px 8px 24px;
  background: var(--white);
  box-shadow: 6px 7px 0 rgba(48, 53, 111, .09);
}

.student-card:nth-child(n) { background: var(--white); }

.student-avatar,
.detail-avatar {
  border: 2px solid var(--line);
  border-radius: 50% 50% 44% 56%;
  background: var(--blue-300);
  box-shadow: 3px 3px 0 rgba(48,53,111,.15);
}

.student-title-line strong {
  font-size: 1.08rem;
}

.mini-info {
  border: 1px solid rgba(48, 53, 111, .16);
  border-radius: 14px 14px 5px 14px;
  background: #dfe9fa;
}

.group-grid,
.materials-grid {
  gap: 20px;
}

.group-card,
.material-card {
  min-height: 225px;
  border: 2px solid rgba(48, 53, 111, .36);
  border-radius: 25px 25px 8px 25px;
  background: var(--white);
  box-shadow: 6px 7px 0 rgba(48, 53, 111, .10);
}

.group-card:nth-child(n),
.material-card:nth-child(n) { background: var(--white); }

.group-card::after,
.material-card::after {
  width: 112px;
  height: 70px;
  right: -28px;
  bottom: -22px;
  border: 3px solid var(--blue-700);
  border-radius: 50%;
  background: transparent;
  opacity: .25;
  transform: rotate(-13deg);
}

.material-icon {
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  border-radius: 50% 50% 42% 58%;
  background: var(--white);
}

.detail-header {
  padding: 22px;
  border: 2px solid rgba(48, 53, 111, .28);
  border-radius: 25px 25px 8px 25px;
  background: #dbe5f8;
  box-shadow: 6px 7px 0 rgba(48, 53, 111, .08);
}

.detail-tabs {
  padding: 7px;
  border: 2px solid rgba(48, 53, 111, .20);
  border-radius: 16px;
  background: var(--cream);
}

.detail-tab.is-active {
  color: var(--cream);
  background: var(--blue-900);
}

.info-card {
  border: 2px solid rgba(48, 53, 111, .25);
  border-radius: 22px 22px 7px 22px;
  box-shadow: 5px 6px 0 rgba(48,53,111,.08);
}

.schedule-legend {
  gap: 13px;
  margin: -8px 0 14px;
  padding-left: 7px;
  font-size: .72rem;
  opacity: .74;
}

.legend-line {
  width: 9px;
  height: 9px;
  border: 2px solid var(--blue-900);
  border-radius: 50%;
  background: var(--blue-500);
}

.legend-line.school {
  border-color: #5f438c;
  background: #a98bd1;
}

.legend-line.moved {
  width: 17px;
  height: 0;
  border: 0;
  border-top: 2px dashed var(--blue-900);
  border-radius: 0;
  background: transparent;
}

.legend-line.cancelled {
  width: 17px;
  height: 0;
  border: 0;
  border-top: 2px solid #999;
  border-radius: 0;
  background: transparent;
}

.calendar-shell {
  border: 2px solid rgba(48, 53, 111, .34);
  border-radius: 26px 26px 8px 26px;
  background: var(--white);
  box-shadow: 7px 8px 0 rgba(48, 53, 111, .09);
}

.calendar-day-header.today {
  color: var(--blue-900);
  background: var(--lemon);
}

.calendar-lesson {
  --lesson-bg: #dce7fa;
  border: 2px solid rgba(48, 53, 111, .34);
  border-left: 5px solid var(--blue-700);
  border-radius: 11px 11px 4px 11px;
  background: var(--lesson-bg);
  box-shadow: 2px 3px 0 rgba(48,53,111,.08);
}

.calendar-lesson.school {
  --lesson-bg: #ece3f6;
  border-left-color: var(--school);
  background: var(--lesson-bg);
}

.calendar-lesson.cancelled {
  --lesson-bg: #f0f1f3;
  background: var(--lesson-bg);
}

.calendar-lesson-content {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  padding-bottom: 10px;
}

.calendar-lesson::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 5px;
  right: 0;
  bottom: 0;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--lesson-bg) 72%);
}

.modal-backdrop {
  background: rgba(29, 32, 74, .64);
  backdrop-filter: blur(3px);
}

.modal-shell {
  border: 2px solid var(--line);
  border-radius: 28px 28px 9px 28px;
  background: var(--cream);
  box-shadow: 12px 13px 0 rgba(22,24,65,.35);
}

.modal-close {
  border: 2px solid var(--line);
  background: var(--lemon);
}

@media (max-width: 1050px) {
  .sidebar {
    gap: 14px;
    padding-inline: 20px;
  }
  .nav-item span:last-child {
    display: none;
  }
  .home-masthead {
    grid-template-columns: 1fr 1fr;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    width: 100%;
    min-height: 68px;
    transform: none;
    box-shadow: none;
  }
  .sidebar.is-open { transform: none; }
  .brand-copy { display: none; }
  .main-nav { flex: 1; justify-content: center; }
  .nav-item { padding: 9px 11px; }
  .sidebar-action { display: none; }
  .mobile-menu-button { display: none; }
  .main-content { padding: 24px 15px 48px; }
  .home-masthead {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 30px 30px 30px 8px;
  }
  .home-masthead-copy { padding: 34px 25px; }
  .home-masthead h2 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .home-doodle { min-height: 230px; margin-top: -25px; }
  .lesson-card { grid-template-columns: 68px minmax(0,1fr); }
  .lesson-meta { grid-column: 2; padding-left: 0; justify-content: flex-start; }
  .topbar h1 { font-size: 2.7rem; }
  .section-toolbar { padding: 15px; }
}

/* Version 1.3 refinements */
.group-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.group-summary span {
  padding: 4px 9px;
  border: 1px solid rgba(48, 53, 111, .18);
  border-radius: 999px;
  color: var(--blue-900);
  background: #eef3fb;
  font-size: .76rem;
  font-weight: 700;
}

.payment-entry {
  position: relative;
}

.payment-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.payment-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
}

.text-button.compact {
  padding: 2px 4px;
  font-size: .75rem;
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  color: #8f3f48;
}

.form-hint {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: .76rem;
}

.material-picker {
  position: relative;
}

.material-picker-input {
  padding-right: 46px;
}

.material-picker-clear {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 10px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.material-suggestions {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 7px;
  border: 2px solid rgba(48, 53, 111, .22);
  border-radius: 16px 16px 6px 16px;
  background: var(--white);
  box-shadow: 7px 9px 24px rgba(28, 35, 78, .16);
}

.material-suggestion {
  width: 100%;
  display: block;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.material-suggestion:hover,
.material-suggestion:focus-visible {
  background: var(--blue-100);
}

.material-suggestion strong,
.material-suggestion small {
  display: block;
}

.material-suggestion small {
  margin-top: 2px;
  color: var(--ink-soft);
}

.material-suggestion-empty {
  padding: 11px;
  color: var(--ink-soft);
  font-size: .84rem;
}

.modal-shell {
  max-height: calc(100vh - 48px);
  overflow: hidden;
  padding: 0;
}

.modal-scroll {
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  border-radius: 26px 26px 7px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(48, 53, 111, .54) transparent;
  scrollbar-gutter: stable;
}

.modal-scroll::-webkit-scrollbar,
.material-suggestions::-webkit-scrollbar {
  width: 10px;
}

.modal-scroll::-webkit-scrollbar-track,
.material-suggestions::-webkit-scrollbar-track {
  margin-block: 14px;
  background: transparent;
}

.modal-scroll::-webkit-scrollbar-thumb,
.material-suggestions::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(48, 53, 111, .58);
  background-clip: padding-box;
}

.modal-scroll::-webkit-scrollbar-thumb:hover,
.material-suggestions::-webkit-scrollbar-thumb:hover {
  background: rgba(48, 53, 111, .76);
  background-clip: padding-box;
}

@keyframes modal-attention {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  65% { transform: translateX(3px); }
}

.modal-shell.modal-attention {
  animation: modal-attention .18s ease;
}

@media (max-width: 760px) {
  .modal-scroll {
    padding: 20px;
    max-height: calc(100vh - 20px);
  }
}


/* Lesson status hierarchy — v1.3.4 */
.lesson-card.completed {
  color: #606378;
  background: #f2f4f1;
  border-color: rgba(48, 53, 111, .22);
  box-shadow: 2px 3px 0 rgba(48, 53, 111, .05);
  opacity: .76;
  filter: saturate(.58);
}

.lesson-card.completed:hover {
  opacity: .92;
  filter: saturate(.78);
  box-shadow: 4px 4px 0 rgba(48, 53, 111, .08);
}

.lesson-card.completed .lesson-time,
.lesson-card.completed .lesson-main strong {
  color: #555a73;
}

.lesson-card.moved {
  color: #67636b;
  background: #fff7d6;
  border: 2px dashed rgba(94, 88, 112, .48);
  box-shadow: none;
  opacity: .66;
}

.lesson-card.moved:hover {
  opacity: .82;
  box-shadow: none;
}

.lesson-card.cancelled {
  color: #777985;
  background: #f0f0f2;
  border-color: rgba(118, 120, 132, .35);
  border-left-color: #9496a0;
  box-shadow: none;
  opacity: .54;
  text-decoration: none;
  filter: grayscale(.45);
}

.lesson-card.cancelled .lesson-main strong {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.lesson-card.cancelled:hover {
  opacity: .68;
  box-shadow: none;
}

.lesson-card.rescheduled:not(.moved):not(.cancelled) {
  border-bottom-style: dashed;
}

.lesson-card.rescheduled:not(.moved):not(.cancelled) .lesson-transfer-note::before {
  content: "↪ ";
  color: var(--blue-700);
  font-style: normal;
  font-weight: 800;
}

.calendar-lesson.completed {
  --lesson-bg: #f0f2ef;
  color: #626579;
  border-color: rgba(48, 53, 111, .20);
  border-left-color: #7f89a9;
  background: var(--lesson-bg);
  box-shadow: none;
  opacity: .72;
  filter: saturate(.55);
}

.calendar-lesson.completed:hover {
  opacity: .88;
  filter: saturate(.75);
}

.calendar-lesson.moved {
  --lesson-bg: #fff5c9;
  color: #69636c;
  border: 2px dashed rgba(94, 88, 112, .48);
  border-left-width: 5px;
  background: var(--lesson-bg);
  box-shadow: none;
  opacity: .62;
}

.calendar-lesson.cancelled {
  --lesson-bg: #ececef;
  color: #797b84;
  border-color: rgba(118, 120, 132, .35);
  border-left-color: #9496a0;
  background: var(--lesson-bg);
  box-shadow: none;
  opacity: .48;
  filter: grayscale(.45);
}

.calendar-lesson.cancelled strong {
  text-decoration: line-through;
  text-decoration-thickness: 1.25px;
}

.calendar-lesson.rescheduled:not(.moved):not(.cancelled) {
  border-bottom-style: dashed;
}

.legend-line.completed {
  border-color: #7f89a9;
  background: #eef1ee;
  opacity: .75;
}

.legend-line.moved {
  width: 18px;
  height: 9px;
  border: 2px dashed rgba(94, 88, 112, .58);
  border-radius: 4px;
  background: #fff5c9;
}

.legend-line.cancelled {
  position: relative;
  width: 18px;
  height: 9px;
  border: 1px solid #9b9ca5;
  border-radius: 4px;
  background: #ececef;
  opacity: .72;
}

.legend-line.cancelled::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3px;
  border-top: 1.5px solid #888a94;
  transform: rotate(-18deg);
}


/* Lesson status refinements — v1.3.7 */
/* A completed lesson stays quieter than a planned one, while retaining its source hue. */
.lesson-card.completed {
  color: #5f6678;
  background: #e9f0f8;
  border-color: rgba(62, 95, 151, .28);
  border-left-color: var(--blue-700);
  opacity: .78;
  filter: saturate(.72);
}

.lesson-card.completed.school {
  color: #645f74;
  background: #eeeaf6;
  border-color: rgba(104, 86, 151, .27);
  border-left-color: var(--school);
}

.lesson-card.completed:hover {
  opacity: .94;
  filter: saturate(.88);
}

.calendar-lesson.completed {
  --lesson-bg: #e8eff7;
  color: #5f6678;
  border-color: rgba(62, 95, 151, .26);
  border-left-color: var(--blue-700);
  background: var(--lesson-bg);
  opacity: .76;
  filter: saturate(.72);
}

.calendar-lesson.completed.school {
  --lesson-bg: #eee9f6;
  color: #645f74;
  border-color: rgba(104, 86, 151, .27);
  border-left-color: var(--school);
  background: var(--lesson-bg);
}

.calendar-lesson.completed:hover {
  opacity: .92;
  filter: saturate(.88);
}

.lesson-modal-danger-zone {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(48, 53, 111, .11);
}

.button-danger-soft,
.button-danger-ghost {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(182, 96, 103, .20);
  border-radius: 13px;
  color: #93515a;
  background: rgba(182, 96, 103, .07);
  box-shadow: none;
}

.button-danger-soft:hover,
.button-danger-ghost:hover {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
  box-shadow: 0 7px 16px rgba(182, 96, 103, .20);
}

@media (max-width: 760px) {
  .lesson-modal-danger-zone {
    align-items: stretch;
  }

  .lesson-modal-danger-zone .button {
    flex: 1 1 180px;
  }
}

/* Teach.Shelf 1.4 — группы, архив, регулярное расписание и задания */
.student-card.is-archived,
.group-card.is-archived,
.assignment-card.is-closed {
  opacity: .78;
  filter: saturate(.72);
}

.button.is-active {
  background: var(--ink, #183a56);
  color: #fff;
  border-color: transparent;
}

.group-avatar {
  background: linear-gradient(145deg, #dfeaff, #fff0d5);
}

.compact-list {
  gap: 8px;
}

.full-button {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
}

.participant-tracking-box {
  margin-top: 12px;
}

.participant-tracking-head {
  margin: 5px 0 12px;
  color: var(--ink-soft);
}

.participant-tracking-list {
  display: grid;
  gap: 8px;
}

.participant-tracking-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.68);
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .86rem;
  cursor: pointer;
}

.compact-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue, #5488c7);
}

.compact-check.is-muted {
  opacity: .48;
  cursor: default;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  background: #cfd8df;
  transition: .18s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(30,50,70,.2);
  transition: .18s ease;
}

.switch-control input:checked + .switch-slider {
  background: var(--blue, #5488c7);
}

.switch-control input:checked + .switch-slider::after {
  transform: translateX(19px);
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-label-row > label {
  margin-bottom: 0;
}

.recurring-slots {
  display: grid;
  gap: 9px;
}

.recurring-slot-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, .55fr) 40px;
  gap: 9px;
  align-items: center;
}

.recurring-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding: 4px 5px 4px 0;
}

.date-exclusion-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  cursor: pointer;
  transition: .16s ease;
}

.date-exclusion-chip input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue, #5488c7);
}

.date-exclusion-chip span {
  display: grid;
  gap: 2px;
  font-size: .88rem;
}

.date-exclusion-chip small {
  color: var(--ink-soft);
}

.date-exclusion-chip.is-excluded {
  background: rgba(225,225,225,.42);
  color: var(--ink-soft);
  text-decoration: line-through;
}

.local-link-notice {
  margin-bottom: 18px;
  padding: 14px 17px;
  border: 1px solid rgba(93,133,180,.22);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(222,235,255,.7), rgba(255,245,222,.72));
  color: var(--ink-soft);
  line-height: 1.55;
}

.local-link-notice strong {
  color: var(--ink);
}

.assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
}

.assignment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-soft);
}

.assignment-card::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 54px;
  height: 24px;
  border-bottom: 2px solid rgba(81,128,181,.22);
  border-radius: 50%;
  transform: rotate(-7deg);
  pointer-events: none;
}

.assignment-card-head,
.submission-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.assignment-card h3 {
  margin: 16px 0 8px;
  font-size: 1.2rem;
}

.assignment-card > p {
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}

.assignment-meta {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  font-size: .86rem;
  color: var(--ink-soft);
}

.assignment-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 17px;
  background: rgba(221,235,255,.68);
  border: 1px solid rgba(90,130,180,.18);
}

.assignment-link-box code {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.assignment-detail-layout {
  align-items: start;
}

.preline-copy {
  white-space: pre-line;
}

.assignment-material-list,
.submission-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.material-link-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas: "icon title" "icon file";
  gap: 2px 9px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.64);
  cursor: pointer;
}

.material-link-row > span { grid-area: icon; }
.material-link-row > strong { grid-area: title; }
.material-link-row > small { grid-area: file; color: var(--ink-soft); }

.material-checkbox-grid .checkbox-item span {
  display: grid;
}

.material-checkbox-grid .checkbox-item small {
  color: var(--ink-soft);
  font-weight: 400;
}

.submission-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.68);
}

.submission-head > div {
  display: grid;
  gap: 3px;
}

.submission-head small {
  color: var(--ink-soft);
}

.review-fields {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.review-fields label,
.public-form-field {
  display: grid;
  gap: 6px;
}

.review-fields label > span,
.public-form-field > span {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* Public task page */
.public-task-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(195,218,255,.62), transparent 32%),
    radial-gradient(circle at 90% 18%, rgba(255,225,174,.58), transparent 30%),
    var(--cream, #f7f2e8);
}

.public-task-shell {
  width: min(880px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.public-task-brand {
  margin-bottom: 20px;
}

.public-task-card {
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(70,103,135,.15);
  border-radius: 30px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 24px 70px rgba(46,67,87,.12);
  backdrop-filter: blur(8px);
}

.public-task-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.public-task-header h1 {
  margin: 5px 0 6px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.08;
}

.public-task-target {
  margin: 0;
  color: var(--ink-soft);
}

.public-task-deadline {
  display: grid;
  min-width: 190px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,239,204,.72);
}

.public-task-deadline span {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.public-task-description {
  padding: 24px 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.public-task-materials,
.public-upload-section,
.public-submission-status {
  margin-top: 18px;
  padding: 20px;
  border-radius: 21px;
  background: rgba(238,244,251,.68);
}

.public-task-materials h2,
.public-upload-section h2,
.public-submission-status h2 {
  margin: 0 0 14px;
}

.public-material-link {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.public-material-link:hover { background: #fff; }

.public-material-link > span:last-child {
  display: grid;
  gap: 2px;
}

.public-material-link small {
  color: var(--ink-soft);
}

.public-submission-status.checked {
  background: rgba(222,242,227,.7);
}

.public-submission-status.revision_requested {
  background: rgba(255,236,198,.72);
}

.teacher-feedback {
  margin: 14px 0;
  padding: 14px;
  border-radius: 15px;
  background: rgba(255,255,255,.76);
}

.teacher-feedback > span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.teacher-feedback p {
  margin-bottom: 0;
}

.public-upload-section form {
  display: grid;
  gap: 14px;
}

.public-submit-button {
  justify-self: start;
}

.public-closed-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(230,230,230,.58);
  color: var(--ink-soft);
}

.public-task-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--ink-soft);
}

.muted-copy {
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .participant-tracking-row {
    grid-template-columns: 1fr;
  }
  .recurring-slot-row {
    grid-template-columns: 1fr 1fr 40px;
  }
  .assignment-link-box,
  .public-task-header {
    grid-template-columns: 1fr;
    display: grid;
  }
  .public-task-deadline {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .recurring-slot-row {
    grid-template-columns: 1fr 40px;
  }
  .recurring-slot-row [data-slot-time] {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .public-task-shell {
    width: min(100% - 18px, 880px);
    padding-top: 18px;
  }
  .public-task-card {
    border-radius: 22px;
  }
}

/* Teach.Shelf 1.5: серии и связанные домашние задания */
.homework-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  border: 1px solid transparent;
}

.homework-status.compact {
  min-height: 20px;
  padding: 2px 7px;
  font-size: .68rem;
}

.homework-status.not-submitted {
  color: #7f6744;
  background: rgba(242, 224, 185, .62);
  border-color: rgba(177, 139, 74, .16);
}

.homework-status.submitted {
  color: #805b1d;
  background: rgba(255, 211, 118, .62);
  border-color: rgba(196, 139, 38, .22);
}

.homework-status.revision {
  color: #8b4b3f;
  background: rgba(245, 191, 174, .58);
  border-color: rgba(185, 92, 72, .2);
}

.homework-status.checked {
  color: #376d58;
  background: rgba(184, 226, 207, .62);
  border-color: rgba(69, 137, 108, .19);
}

.calendar-lesson .homework-status {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-homework-box {
  display: grid;
  gap: 11px;
}

.lesson-assignment-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.lesson-assignment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.66);
}

.lesson-assignment-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lesson-assignment-item small {
  color: var(--ink-soft);
}

.lesson-assignment-item.submitted { border-left: 4px solid #d5a43f; }
.lesson-assignment-item.revision { border-left: 4px solid #c27663; }
.lesson-assignment-item.checked { border-left: 4px solid #69a58b; }
.lesson-assignment-item.not-submitted { border-left: 4px solid #c8b58d; }

.group-homework-list {
  display: grid;
  gap: 10px;
}

.group-homework-row {
  display: grid;
  grid-template-columns: minmax(130px, .55fr) minmax(220px, 1.45fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.group-homework-student {
  display: grid;
  gap: 3px;
}

.group-homework-student small {
  color: var(--ink-soft);
}

.participant-tracking-row.attendance-only {
  grid-template-columns: minmax(150px, 1fr) auto;
}

.assignment-grade-control {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 15px;
  background: rgba(242, 246, 251, .75);
}

.assignment-grade-control label {
  display: grid;
  gap: 6px;
  flex: 1;
}

.public-grade-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 4px 0 18px;
  padding: 14px 16px;
  border-radius: 17px;
  background: rgba(225, 239, 232, .78);
  border: 1px solid rgba(78, 137, 111, .18);
}

.public-grade-result span {
  color: var(--ink-soft);
  font-size: .82rem;
}

.recurring-slot-row {
  grid-template-columns: minmax(180px, 1fr) minmax(112px, .5fr) minmax(105px, .45fr) 40px;
}

.recurring-duration {
  min-width: 0;
}

@media (max-width: 900px) {
  .group-homework-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .recurring-slot-row {
    grid-template-columns: 1fr 1fr;
  }
  .recurring-slot-row .icon-button {
    justify-self: end;
  }
  .lesson-assignment-item {
    grid-template-columns: 1fr;
  }
  .assignment-grade-control {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .recurring-slot-row {
    grid-template-columns: 1fr;
  }
  .recurring-slot-row [data-slot-time] {
    grid-column: auto;
    grid-row: auto;
  }
}
.homework-status.partial {
  color: #5f628b;
  background: rgba(205, 209, 241, .62);
  border-color: rgba(89, 96, 157, .18);
}

.date-exclusion-chip.is-protected {
  border-style: dashed;
  text-decoration: none;
  cursor: not-allowed;
  opacity: .82;
}

.date-exclusion-chip.is-protected small {
  font-style: italic;
}

/* ---------- Авторизация и профиль преподавателя ---------- */
.auth-gate {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 228, 177, 0.48), transparent 23rem),
    radial-gradient(circle at 87% 12%, rgba(183, 207, 238, 0.62), transparent 28rem),
    linear-gradient(135deg, #f9f6ed 0%, #f4f1e8 48%, #edf3fa 100%);
}

.auth-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(47, 79, 147, 0.18);
}

.auth-formula {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  letter-spacing: 0.02em;
  transform: rotate(-4deg);
}

.auth-formula.formula-one { left: 4%; top: 13%; font-size: clamp(1.2rem, 2.5vw, 2.1rem); }
.auth-formula.formula-two { right: 5%; bottom: 12%; font-size: clamp(1.45rem, 3vw, 2.5rem); transform: rotate(5deg); }
.auth-formula.formula-three { left: 37%; bottom: 5%; font-size: clamp(1rem, 2vw, 1.65rem); transform: rotate(2deg); }

.auth-scribble {
  position: absolute;
  width: min(72rem, 94vw);
  right: -8rem;
  bottom: -7rem;
  fill: none;
  stroke: rgba(71, 105, 170, 0.13);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.auth-layout {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 470px);
  align-items: center;
  gap: clamp(42px, 7vw, 96px);
  padding: 54px 0;
}

.auth-intro {
  max-width: 660px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(42px, 7vh, 72px);
}

.auth-brand-mark {
  width: 54px;
  height: 54px;
  color: var(--blue-800);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 32px rgba(47, 79, 147, 0.12);
}

.auth-brand-title {
  color: var(--blue-900);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.auth-brand-title span {
  color: #e6a85d;
}

.auth-brand-subtitle {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.auth-intro h1 {
  max-width: 650px;
  margin-bottom: 25px;
  color: var(--blue-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 5.8vw, 5.15rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-intro h1 em {
  color: var(--blue-700);
  font-weight: 500;
}

.auth-intro > p {
  max-width: 590px;
  color: #596379;
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.72;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 30px;
  color: var(--blue-800);
  font-size: 0.92rem;
  font-weight: 650;
}

.auth-card {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 34px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 28px 80px rgba(36, 63, 125, 0.16);
  backdrop-filter: blur(18px);
}

.auth-card-head h2 {
  margin-top: 5px;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  color: var(--blue-900);
}

.auth-card-head p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 28px 0 24px;
  padding: 5px;
  border-radius: 16px;
  background: var(--blue-100);
}

.auth-tab {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: 0.18s ease;
}

.auth-tab.is-active {
  color: var(--blue-900);
  background: var(--white);
  box-shadow: 0 5px 16px rgba(36, 63, 125, 0.1);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-form .form-control {
  min-height: 49px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 5px;
  border-radius: 15px;
}

.auth-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #7b343b;
  background: #f9e4e6;
  font-size: 0.9rem;
}

.auth-message.success {
  color: #356b58;
  background: #e6f3ec;
}

.auth-footnote {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(39, 48, 68, 0.09);
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.teacher-profile {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.teacher-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: var(--blue-900);
  background: #fff4d9;
  font-size: 0.82rem;
  font-weight: 850;
}

.teacher-profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.teacher-profile-copy strong,
.teacher-profile-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-profile-copy strong {
  color: #fff;
  font-size: 0.88rem;
}

.teacher-profile-copy span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
}

.teacher-logout {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
  transition: 0.18s ease;
}

.teacher-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 30px));
    gap: 34px;
    padding: 34px 0;
  }

  .auth-intro {
    text-align: center;
    margin: 0 auto;
  }

  .auth-brand {
    justify-content: center;
    margin-bottom: 30px;
  }

  .auth-intro > p {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-feature-row {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .auth-layout {
    width: min(100% - 20px, 680px);
    padding: 22px 0;
  }

  .auth-intro h1 {
    font-size: 2.45rem;
  }

  .auth-intro > p,
  .auth-feature-row {
    display: none;
  }

  .auth-brand {
    margin-bottom: 18px;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: 25px;
  }
}

/* ---------- Web beta: boot state and explicit account controls ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--ink-soft);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 228, 177, .52), transparent 26rem),
    radial-gradient(circle at 84% 16%, rgba(183, 207, 238, .60), transparent 28rem),
    var(--cream);
  font-weight: 700;
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 2px solid rgba(48, 53, 111, .18);
  border-radius: 24px;
  color: var(--blue-900);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 800;
  animation: bootPulse 1.2s ease-in-out infinite alternate;
}

.boot-mark span { color: var(--blue-700); }

@keyframes bootPulse {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-5px) rotate(1deg); }
}

.teacher-profile {
  grid-template-columns: 36px minmax(92px, 160px) auto;
  gap: 8px;
  margin: 0 0 0 auto;
  padding: 6px 7px;
  border: 2px solid rgba(48, 53, 111, .13);
  border-radius: 15px;
  background: rgba(255, 253, 245, .78);
}

.teacher-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--lemon);
}

.teacher-profile-copy strong { color: var(--ink); }
.teacher-profile-copy span { color: var(--ink-soft); }

.teacher-logout {
  width: auto;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(48, 53, 111, .16);
  border-radius: 11px;
  color: var(--blue-900);
  background: var(--blue-100);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
}

.teacher-logout:hover {
  color: var(--blue-900);
  background: var(--lemon);
  transform: translateY(-1px);
}

.teacher-logout-icon { font-size: 1rem; }
.sidebar-action { margin-left: 0; }

.inline-loading,
.detail-loading {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--ink-soft);
  text-align: center;
}

.loading-dot {
  width: 34px;
  height: 34px;
  border: 3px solid var(--blue-200);
  border-top-color: var(--blue-800);
  border-radius: 50%;
  animation: loadingSpin .75s linear infinite;
}

@keyframes loadingSpin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .teacher-profile-copy { display: none; }
  .teacher-profile { grid-template-columns: 36px auto; }
  .teacher-logout span:last-child { display: none; }
  .teacher-logout { width: 34px; padding: 0; justify-content: center; }
}

@media (max-width: 900px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 24px 18px;
  }
  .main-nav { display: grid; gap: 6px; }
  .nav-item { width: 100%; justify-content: flex-start; }
  .teacher-profile {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    margin: auto 0 0;
    padding: 10px;
  }
  .teacher-profile-copy { display: grid; }
  .teacher-logout { width: auto; padding: 0 10px; }
  .teacher-logout span:last-child { display: inline; }
  .sidebar-action { width: 100%; margin: 0; }
}

/* ---------- Teach.Shelf 1.6.4: личный кабинет и мобильная версия ---------- */
.auth-recovery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: .82rem;
}

.auth-recovery a {
  color: var(--blue-800);
  font-weight: 800;
  text-decoration: none;
}

.auth-recovery a:hover { text-decoration: underline; }

.teacher-profile {
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.teacher-profile:hover,
.teacher-profile:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(48, 53, 111, .3);
  background: rgba(255, 253, 245, .96);
}

.account-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-identity-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 2px solid rgba(48, 53, 111, .14);
  border-radius: 20px 20px 7px 20px;
  background: rgba(238, 244, 251, .8);
}

.account-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.account-identity-card > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-identity-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.04rem;
}

.account-identity-card span { color: var(--ink-soft); }

.account-timezone-chip {
  padding: 6px 10px;
  border: 1px solid rgba(48, 53, 111, .14);
  border-radius: 999px;
  color: var(--blue-900) !important;
  background: var(--white);
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-section {
  padding: 20px;
  overflow: visible;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.account-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.account-form label > span {
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 800;
}

.account-form .full { grid-column: 1 / -1; }
.account-form-actions { display: flex; justify-content: flex-end; }

.timezone-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.account-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.account-action-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(48, 53, 111, .14);
  border-radius: 17px;
  background: rgba(255, 253, 248, .78);
}

.account-action-card div { min-width: 0; }
.account-action-card strong { display: block; margin-bottom: 4px; }
.account-action-card p { margin: 0; color: var(--ink-soft); font-size: .8rem; }
.account-action-card .button { flex: 0 0 auto; }

.danger-zone-card {
  border-color: rgba(182, 96, 103, .3);
  background: rgba(255, 240, 238, .72);
}

.danger-confirmation-note {
  display: grid;
  gap: 5px;
  margin: 16px 0 20px;
  padding: 15px;
  border: 1px solid rgba(182, 96, 103, .28);
  border-radius: 16px;
  color: #7f3f47;
  background: rgba(255, 238, 236, .82);
}

.danger-confirmation-note span { font-size: .82rem; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 19;
  border: 0;
  background: rgba(18, 28, 56, .42);
  backdrop-filter: blur(2px);
}

.mobile-calendar {
  min-width: 0 !important;
  display: block !important;
  padding: 0 !important;
  background: transparent !important;
}

.mobile-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.mobile-day-button {
  min-width: 0;
  border: 1px solid rgba(48, 53, 111, .13);
  border-radius: 14px;
  padding: 8px 3px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, .82);
  cursor: pointer;
}

.mobile-day-button span {
  font-size: .68rem;
  text-transform: capitalize;
}

.mobile-day-button strong { font-size: .95rem; }

.mobile-day-button.today { border-color: rgba(71, 105, 170, .48); }
.mobile-day-button.is-selected {
  color: #fff;
  border-color: var(--blue-800);
  background: var(--blue-800);
  box-shadow: 0 7px 18px rgba(36, 63, 125, .18);
}

.mobile-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
}

.mobile-day-heading > div { min-width: 0; display: grid; }
.mobile-day-heading span { color: var(--ink-soft); font-size: .72rem; }
.mobile-day-heading strong { text-transform: capitalize; }

.mobile-calendar-list { display: grid; gap: 9px; }

.mobile-calendar-lesson {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(48, 53, 111, .15);
  border-left: 5px solid var(--blue-700);
  border-radius: 17px 17px 7px 17px;
  padding: 12px;
  color: var(--ink);
  background: rgba(238, 244, 251, .92);
  text-align: left;
  cursor: pointer;
}

.mobile-calendar-lesson.school {
  border-left-color: var(--school);
  background: rgba(239, 232, 248, .9);
}

.mobile-calendar-lesson.completed { opacity: .7; filter: saturate(.7); }
.mobile-calendar-time { display: grid; gap: 1px; font-weight: 850; color: var(--blue-900); }
.mobile-calendar-time small { color: var(--ink-soft); font-size: .7rem; font-weight: 600; }
.mobile-calendar-copy { min-width: 0; display: grid; gap: 4px; }
.mobile-calendar-copy strong,
.mobile-calendar-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-calendar-copy small { color: var(--ink-soft); }
.mobile-calendar-copy .homework-status { justify-self: start; }
.mobile-calendar-arrow { color: var(--blue-700); font-size: 1.5rem; }

.mobile-calendar-empty {
  min-height: 150px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed rgba(48, 53, 111, .2);
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, .55);
}

@media (max-width: 900px) {
  .app-shell { display: block; }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(330px, 88vw) !important;
    height: 100dvh;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 24px 18px !important;
    transform: translateX(-105%) !important;
    transition: transform .22s ease;
    overflow-y: auto;
    box-shadow: 22px 0 48px rgba(15, 30, 63, .28);
  }

  .sidebar.is-open { transform: translateX(0) !important; }
  .brand-copy { display: block !important; }
  .main-nav { display: grid !important; flex: 0 0 auto !important; justify-content: stretch !important; }
  .nav-item { width: 100% !important; justify-content: flex-start !important; }
  .nav-item span:last-child { display: inline !important; }
  .sidebar-note { margin-top: auto; }
  .sidebar-action { display: flex !important; }
  .mobile-menu-button { display: inline-grid !important; }

  .main-content {
    width: 100%;
    min-width: 0;
    padding: 14px 14px 34px !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: -14px -14px 15px;
    padding: 12px 14px;
    background: rgba(247, 244, 236, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(48, 53, 111, .08);
  }

  body.mobile-menu-open { overflow: hidden; }
  .account-settings-grid,
  .account-actions-grid { grid-template-columns: 1fr; }
  .account-action-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  input, textarea, select { font-size: 16px !important; }
  .main-content { padding: 10px 10px 28px !important; }
  .topbar { margin: -10px -10px 12px; padding: 10px; }
  .topbar h1 { font-size: 1.9rem !important; }
  .topbar .eyebrow { font-size: .67rem; }

  .home-masthead {
    grid-template-columns: 1fr !important;
    border-radius: 24px 24px 24px 8px !important;
  }
  .home-masthead-copy { padding: 26px 20px !important; }
  .home-masthead h2 { font-size: clamp(2.75rem, 15vw, 4rem) !important; }
  .home-doodle { display: none !important; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; justify-content: center; }

  .panel,
  .info-card,
  .stat-card,
  .student-card,
  .group-card,
  .material-card,
  .assignment-card { border-radius: 18px 18px 7px 18px; }

  .section-toolbar,
  .schedule-toolbar {
    display: flex !important;
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 10px;
    padding: 13px !important;
  }

  .toolbar-right,
  .schedule-toolbar .week-nav,
  .schedule-toolbar > :last-child { width: 100%; grid-column: auto !important; grid-row: auto !important; }
  .toolbar-right { display: grid; grid-template-columns: 1fr; }
  .week-nav { justify-content: space-between; }
  .week-nav .button { flex: 1; }

  .content-grid,
  .home-grid,
  .detail-layout,
  .stats-grid,
  .student-mini-grid,
  .modal-grid,
  .lesson-modal-grid,
  .checkbox-grid { grid-template-columns: 1fr !important; }

  .lesson-card {
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 10px;
    padding: 13px !important;
  }
  .lesson-meta { grid-column: 1 / -1 !important; padding-left: 68px !important; }

  .detail-header,
  .detail-header-main,
  .panel-header,
  .payment-entry-head { align-items: flex-start; flex-direction: column; }
  .detail-actions,
  .modal-actions,
  .card-actions { width: 100%; }
  .detail-actions .button,
  .modal-actions .button { flex: 1; justify-content: center; }

  .info-card { overflow-x: auto; }
  .lesson-table { min-width: 680px; }

  .modal-backdrop { padding: 0 !important; align-items: flex-end !important; }
  .modal-shell,
  .modal-shell.wide {
    width: 100% !important;
    max-width: none !important;
    max-height: 96dvh !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -12px 38px rgba(22, 24, 65, .24) !important;
  }
  .modal-scroll { max-height: 96dvh !important; padding: 20px 15px 24px !important; }
  .modal-close { top: 12px; right: 12px; }

  .account-modal-header { padding-right: 42px; flex-direction: column; }
  .account-identity-card { grid-template-columns: 48px minmax(0, 1fr); }
  .account-avatar { width: 48px; height: 48px; }
  .account-timezone-chip { grid-column: 1 / -1; justify-self: start; }
  .account-form { grid-template-columns: 1fr; }
  .account-form .full { grid-column: auto; }
  .timezone-control { grid-template-columns: 1fr; }
  .account-form-actions .button { width: 100%; justify-content: center; }

  .calendar-shell { overflow: visible !important; padding: 0 !important; background: transparent !important; }
  .calendar-grid.mobile-calendar { min-height: 0 !important; }
  .mobile-week-strip { gap: 3px; }
  .mobile-day-button { border-radius: 11px; padding: 7px 2px; }
  .mobile-day-heading { align-items: flex-start; }
  .mobile-day-heading .button { white-space: nowrap; }

  .toast-region { left: 10px; right: 10px; bottom: 10px; }
  .toast { min-width: 0; width: 100%; max-width: none; }
}

@media (max-width: 430px) {
  .mobile-calendar-lesson { grid-template-columns: 48px minmax(0, 1fr) 12px; padding: 10px; }
  .mobile-day-heading { flex-direction: column; }
  .mobile-day-heading .button { width: 100%; justify-content: center; }
  .auth-intro h1 { font-size: 2.15rem !important; }
  .auth-card { padding: 21px 15px !important; }
}

/* ---------- Teach.Shelf 1.6.5: ширина, задания и журнал работ ---------- */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.sidebar,
.main-content,
.page,
.section-toolbar,
.toolbar-right,
.main-nav,
.teacher-profile,
.search-field {
  min-width: 0;
}

/* Верхняя панель должна помещаться в окно: резервная копия остаётся
   доступной, но на десктопе занимает место одной иконки. */
@media (min-width: 901px) {
  .sidebar {
    max-width: 100vw;
    gap: clamp(8px, 1.4vw, 24px);
    padding-inline: clamp(12px, 3vw, 48px);
    flex-wrap: nowrap;
  }

  .brand { min-width: 0; }
  .main-nav {
    flex: 1 1 auto;
    justify-content: center;
  }
  .nav-item {
    flex: 0 1 auto;
    min-width: 0;
    padding-inline: clamp(8px, 1vw, 13px);
  }
  .nav-item span:last-child { white-space: nowrap; }
  .teacher-profile { flex: 0 1 auto; }

  .sidebar-action {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-left: 0;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
  }
  .sidebar-action-icon { font-size: 1.15rem; }
  .sidebar-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .brand-copy { min-width: 132px; }
  .brand-subtitle { display: none; }
  .nav-item { gap: 6px; padding-inline: 8px; }
  .nav-icon { display: none; }
}

@media (max-width: 900px) {
  .sidebar-action {
    width: 100% !important;
    height: auto;
    display: flex !important;
    justify-content: center;
    gap: 8px;
    padding: 10px 13px;
  }
  .sidebar-action-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}

/* Авторизация умещается по высоте обычного ноутбука без лишней прокрутки. */
.auth-gate {
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.auth-layout {
  min-height: 100%;
  padding-block: clamp(18px, 5vh, 48px);
}
.auth-brand { margin-bottom: clamp(20px, 5vh, 52px); }
.auth-intro h1 { font-size: clamp(2.45rem, 5.2vw, 4.65rem); }
.auth-card { padding: clamp(24px, 3.2vw, 38px); }
.auth-tabs { margin-block: 20px 18px; }
.auth-form { gap: 13px; }
.auth-form .form-control { min-height: 45px; }
.auth-submit { min-height: 46px; }
.auth-footnote { margin-top: 16px; padding-top: 14px; }

@media (min-width: 901px) and (max-height: 760px) {
  .auth-layout { padding-block: 14px; gap: clamp(28px, 5vw, 64px); }
  .auth-brand { margin-bottom: 18px; }
  .auth-intro h1 { margin-bottom: 14px; font-size: clamp(2.25rem, 4.8vw, 3.75rem); }
  .auth-intro > p { font-size: .96rem; line-height: 1.5; }
  .auth-feature-row { margin-top: 16px; }
  .auth-card { padding: 22px 28px; }
  .auth-card-head p { margin-top: 6px; }
  .auth-tabs { margin-block: 14px 13px; }
  .auth-form { gap: 10px; }
  .auth-recovery { margin-top: 9px; }
  .auth-footnote { display: none; }
}

.assignment-card-head {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.assignment-card.is-archived,
.lesson-assignment-item.is-archived,
.student-assignment-row.is-archived {
  opacity: .72;
  filter: saturate(.72);
}
.assignment-card-actions { margin-top: auto; }
.assignment-link-warning {
  color: #9b5349;
  font-weight: 800;
}
.assignment-link-warning-box {
  margin: 13px 0;
  padding: 11px 13px;
  border: 1px solid rgba(182, 96, 103, .28);
  border-radius: 13px;
  color: #7f3f47;
  background: rgba(255, 238, 236, .78);
  font-size: .82rem;
}

.submission-timing {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.submission-timing.compact { min-height: 20px; padding: 2px 7px; font-size: .68rem; }
.submission-timing.on-time {
  color: #2f6856;
  border-color: rgba(64, 132, 105, .2);
  background: rgba(184, 226, 207, .58);
}
.submission-timing.late {
  color: #8a4a32;
  border-color: rgba(185, 92, 72, .2);
  background: rgba(248, 199, 164, .62);
}
.submission-timing.not-submitted {
  color: #696b78;
  border-color: rgba(83, 87, 112, .14);
  background: rgba(225, 225, 229, .64);
}

.lesson-card.needs-review,
.mobile-calendar-lesson.needs-review {
  box-shadow: 0 0 0 3px rgba(213, 164, 63, .26), var(--shadow-soft);
}
.calendar-lesson.needs-review {
  outline: 3px solid rgba(213, 164, 63, .62);
  outline-offset: -2px;
  z-index: 7;
}
.calendar-lesson.needs-review::before,
.mobile-calendar-lesson.needs-review::before {
  content: "!";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #c88b28;
  font-size: .7rem;
  font-weight: 900;
}
.mobile-calendar-lesson { position: relative; }

.student-assignment-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-card.attention {
  border-color: rgba(196, 139, 38, .36);
  background: rgba(255, 239, 198, .72);
}
.student-assignment-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.student-assignment-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(48, 53, 111, .14);
  border-radius: 16px;
  background: rgba(255, 253, 248, .72);
}
.student-assignment-date,
.student-assignment-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.student-assignment-date strong { color: var(--blue-900); }
.student-assignment-date small,
.student-assignment-main > small { color: var(--ink-soft); }
.student-assignment-main > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-assignment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

@media (max-width: 720px) {
  .student-assignment-stats { grid-template-columns: 1fr !important; }
  .student-assignment-row {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
  }
  .student-assignment-row > .button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .assignment-card-actions .button { flex: 1 1 auto; }
}

/* Дополнительное сжатие десктопной навигации на обычных ноутбуках. */
@media (min-width: 901px) and (max-width: 1360px) {
  .teacher-profile-copy { display: none; }
  .teacher-profile { grid-template-columns: 36px auto; }
  .teacher-logout {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .teacher-logout > span:last-child { display: none; }
}

@media (min-width: 901px) and (max-width: 1280px) {
  .brand-subtitle { display: none; }
  .brand-copy { min-width: 112px; }
}

/* На типичной высоте ноутбука приветственный экран не создаёт прокрутку страницы. */
@media (min-width: 901px) and (min-height: 640px) {
  .auth-gate { overflow-y: hidden; }
  .auth-layout { height: 100%; min-height: 0; }
}

/* Дополнительное сжатие десктопной навигации на обычных ноутбуках. */
@media (min-width: 901px) and (max-width: 1360px) {
  .teacher-profile-copy { display: none; }
  .teacher-profile { grid-template-columns: 36px auto; }
  .teacher-logout {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .teacher-logout > span:last-child { display: none; }
}

@media (min-width: 901px) and (max-width: 1280px) {
  .brand-subtitle { display: none; }
  .brand-copy { min-width: 112px; }
}

/* На типичной высоте ноутбука приветственный экран не создаёт прокрутку страницы. */
@media (min-width: 901px) and (min-height: 640px) {
  .auth-gate { overflow-y: hidden; }
  .auth-layout { height: 100%; min-height: 0; }
}


/* ---------- Teach.Shelf 1.6.7: аккуратные состояния, меню и безопасный предпросмотр ---------- */
.boot-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: none;
  animation: bootPulse 1.2s ease-in-out infinite alternate;
}

.boot-mark-text {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.boot-mark .boot-dot {
  margin-inline: .02em;
  color: var(--blue-700);
}

@keyframes bootPulse {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.025); }
}

/* В карточке ДЗ все служебные плашки имеют один размер и одну базовую геометрию. */
.lesson-assignment-item .student-assignment-badges {
  align-items: center;
  gap: 6px;
}

.lesson-assignment-item .student-assignment-badges > .homework-status,
.lesson-assignment-item .student-assignment-badges > .submission-timing,
.lesson-assignment-item .student-assignment-badges > .badge {
  box-sizing: border-box;
  min-height: 28px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

/* Загрузка расписания занимает всю область календаря, а не первую ячейку сетки. */
.calendar-grid.is-loading {
  min-width: 100%;
  min-height: 520px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
}

.calendar-grid.is-loading::before { display: none; }
.calendar-grid.is-loading > .inline-loading {
  min-height: 0;
  width: 100%;
  height: 100%;
  place-content: center;
}

/* Вместо отдельной стрелки выхода — круглый вход в меню аккаунта. */
.account-menu {
  position: relative;
  z-index: 90;
  flex: 0 0 auto;
  margin-left: 0;
}

.teacher-account-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(48, 53, 111, .14);
  border-radius: 50%;
  color: var(--blue-900);
  background: rgba(255, 253, 245, .9);
  box-shadow: 0 7px 18px rgba(48, 53, 111, .09);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.teacher-account-button:hover,
.teacher-account-button[aria-expanded="true"] {
  border-color: rgba(48, 53, 111, .34);
  background: var(--white);
  transform: translateY(-1px);
}

.teacher-account-button .teacher-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .78rem;
}

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(48, 53, 111, .16);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 18px 45px rgba(31, 38, 84, .18);
  backdrop-filter: blur(16px);
}

.account-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 17px;
  width: 11px;
  height: 11px;
  border-left: 1px solid rgba(48, 53, 111, .16);
  border-top: 1px solid rgba(48, 53, 111, .16);
  background: rgba(255, 253, 248, .98);
  transform: rotate(45deg);
}

.account-popover-identity {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  padding: 10px 11px 11px;
  border-bottom: 1px solid rgba(48, 53, 111, .1);
}

.account-popover-identity strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-identity span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-item {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 4px;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.account-popover-item:hover { background: var(--blue-100); }
.account-popover-item.danger { color: #9b4852; }
.account-popover-item.danger:hover { background: rgba(247, 222, 224, .72); }

.review-status-hint {
  display: block;
  margin-top: 5px;
  color: #8a5a2f;
  font-size: .74rem;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .account-menu {
    margin: auto 0 0;
    align-self: flex-start;
  }

  .account-popover {
    top: auto;
    right: auto;
    bottom: calc(100% + 10px);
    left: 0;
  }

  .account-popover::before {
    top: auto;
    right: auto;
    bottom: -6px;
    left: 17px;
    border: 0;
    border-right: 1px solid rgba(48, 53, 111, .16);
    border-bottom: 1px solid rgba(48, 53, 111, .16);
  }
}

@media (max-width: 720px) {
  .lesson-assignment-item .student-assignment-badges > .homework-status,
  .lesson-assignment-item .student-assignment-badges > .submission-timing,
  .lesson-assignment-item .student-assignment-badges > .badge {
    min-height: 26px;
    padding-inline: 9px;
    font-size: .72rem;
  }

  .calendar-grid.is-loading { min-height: 360px; }
}


/* ---------- Teach.Shelf 1.6.8: progressive loading and viewport mobile menu ---------- */
.dashboard-skeleton {
  display: grid;
  gap: 10px;
  min-height: 150px;
  align-content: start;
}

.dashboard-skeleton-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(48, 53, 111, .10);
  border-radius: 17px;
  background: rgba(255, 253, 248, .64);
  overflow: hidden;
}

.dashboard-skeleton-row > * {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(48, 53, 111, .08), rgba(48, 53, 111, .16), rgba(48, 53, 111, .08));
  background-size: 220% 100%;
  animation: dashboardSkeleton 1.15s ease-in-out infinite;
}

.dashboard-skeleton-row i { width: 44px; height: 18px; }
.dashboard-skeleton-row b { width: min(100%, 280px); }
.dashboard-skeleton-row em { width: 70px; justify-self: end; }
.dashboard-skeleton-row.compact { opacity: .72; }

@keyframes dashboardSkeleton {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-skeleton-row > * { animation: none; }
}

@media (max-width: 900px) {
  .mobile-menu-button {
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    left: calc(12px + env(safe-area-inset-left, 0px)) !important;
    z-index: 25 !important;
    display: inline-grid !important;
    place-items: center;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px;
    border: 2px solid rgba(48, 53, 111, .28) !important;
    border-radius: 14px !important;
    color: var(--blue-900) !important;
    background: rgba(255, 253, 248, .94) !important;
    box-shadow: 4px 4px 0 rgba(48, 53, 111, .15) !important;
    backdrop-filter: blur(10px);
    font-size: 1.35rem;
    line-height: 1;
  }

  .topbar {
    padding-left: calc(70px + env(safe-area-inset-left, 0px)) !important;
  }

  body[data-page="home"] .topbar {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .dashboard-skeleton-row {
    grid-template-columns: 48px minmax(0, 1fr) 58px;
    gap: 10px;
    padding-inline: 11px;
  }
}


/* ---------- Teach.Shelf 1.6.9: lesson formats and brand favicon ---------- */
.lesson-format-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(48, 53, 111, .16);
  border-radius: 9px;
  color: #285fae;
  background: rgba(221, 235, 252, .88);
  line-height: 1;
  vertical-align: middle;
}

.lesson-format-mark.in_person {
  color: #8a5a32;
  border-color: rgba(154, 103, 58, .20);
  background: rgba(248, 230, 207, .90);
}

.lesson-format-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lesson-format-mark.with-label,
.lesson-format-mark span {
  white-space: nowrap;
}

.lesson-format-mark.with-label {
  width: auto;
  min-width: 25px;
  gap: 5px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
}

.format-value {
  display: flex !important;
  align-items: center;
  min-height: 26px;
}

.group-summary > .lesson-format-mark {
  width: auto;
  min-width: 25px;
  gap: 5px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
}

.lesson-card.format-in-person,
.mobile-calendar-lesson.format-in-person,
.calendar-lesson.format-in-person {
  background-image: linear-gradient(135deg, rgba(217, 154, 87, .075) 0 12px, transparent 12px 24px);
  background-size: 24px 24px;
}

.lesson-card.format-in-person {
  border-right-color: rgba(154, 103, 58, .24);
}

.mobile-calendar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mobile-calendar-title strong {
  min-width: 0;
  flex: 1 1 auto;
}

.calendar-format-mark {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 21px;
  height: 21px;
  border-radius: 7px;
}

.calendar-format-mark svg {
  width: 13px;
  height: 13px;
}

.calendar-lesson-content > strong {
  padding-right: 25px;
}

.form-hint.full {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .student-mini-grid {
    grid-template-columns: 1fr;
  }
}

.mini-info .lesson-format-mark,
.group-summary > .lesson-format-mark {
  display: inline-flex;
  margin: 0;
  color: #285fae;
  font-size: .74rem;
  letter-spacing: 0;
  text-transform: none;
}

.mini-info .lesson-format-mark.in_person,
.group-summary > .lesson-format-mark.in_person {
  color: #8a5a32;
}

.mini-info .lesson-format-mark span,
.group-summary .lesson-format-mark span {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Teach.Shelf 1.6.10: teacher activity categories ---------- */
:root {
  --source-personal: #4c74bd;
  --source-online-school: #8467b4;
  --source-school: #4f8968;
  --source-club: #c17a38;
  --source-other: #4e858f;
}

.source-mark.source-personal,
.legend-line.source-personal {
  border-color: #315b9f;
  background: #77a0dd;
}

.source-mark.source-online-school,
.legend-line.source-online-school {
  border-color: #62488f;
  background: #aa8bd1;
}

.source-mark.source-school,
.legend-line.source-school {
  border-color: #376b4e;
  background: #76ae8b;
}

.source-mark.source-club,
.legend-line.source-club {
  border-color: #955a25;
  background: #e2a463;
}

.source-mark.source-other,
.legend-line.source-other {
  border-color: #356771;
  background: #79adb5;
}

.lesson-card.source-personal:not(.cancelled):not(.moved) { border-left-color: var(--source-personal); }
.lesson-card.source-online-school:not(.cancelled):not(.moved) { border-left-color: var(--source-online-school); }
.lesson-card.source-school:not(.cancelled):not(.moved) { border-left-color: var(--source-school); }
.lesson-card.source-club:not(.cancelled):not(.moved) { border-left-color: var(--source-club); }
.lesson-card.source-other:not(.cancelled):not(.moved) { border-left-color: var(--source-other); }

.calendar-lesson.source-personal:not(.completed):not(.cancelled):not(.moved) {
  --lesson-bg: #dce7fa;
  border-left-color: var(--source-personal);
  background-color: var(--lesson-bg);
}

.calendar-lesson.source-online-school:not(.completed):not(.cancelled):not(.moved) {
  --lesson-bg: #ece3f6;
  border-left-color: var(--source-online-school);
  background-color: var(--lesson-bg);
}

.calendar-lesson.source-school:not(.completed):not(.cancelled):not(.moved) {
  --lesson-bg: #e0efe5;
  border-left-color: var(--source-school);
  background-color: var(--lesson-bg);
}

.calendar-lesson.source-club:not(.completed):not(.cancelled):not(.moved) {
  --lesson-bg: #f7e8d6;
  border-left-color: var(--source-club);
  background-color: var(--lesson-bg);
}

.calendar-lesson.source-other:not(.completed):not(.cancelled):not(.moved) {
  --lesson-bg: #deedef;
  border-left-color: var(--source-other);
  background-color: var(--lesson-bg);
}

.calendar-lesson.completed.source-personal { --lesson-bg: #e8eff7; border-left-color: var(--source-personal); background-color: var(--lesson-bg); }
.calendar-lesson.completed.source-online-school { --lesson-bg: #eee9f6; border-left-color: var(--source-online-school); background-color: var(--lesson-bg); }
.calendar-lesson.completed.source-school { --lesson-bg: #e8f0ea; border-left-color: var(--source-school); background-color: var(--lesson-bg); }
.calendar-lesson.completed.source-club { --lesson-bg: #f3ece3; border-left-color: var(--source-club); background-color: var(--lesson-bg); }
.calendar-lesson.completed.source-other { --lesson-bg: #e6eff0; border-left-color: var(--source-other); background-color: var(--lesson-bg); }

.mobile-calendar-lesson.source-personal:not(.completed) {
  border-left-color: var(--source-personal);
  background-color: rgba(232, 240, 251, .94);
}

.mobile-calendar-lesson.source-online-school:not(.completed) {
  border-left-color: var(--source-online-school);
  background-color: rgba(239, 232, 248, .92);
}

.mobile-calendar-lesson.source-school:not(.completed) {
  border-left-color: var(--source-school);
  background-color: rgba(229, 242, 233, .94);
}

.mobile-calendar-lesson.source-club:not(.completed) {
  border-left-color: var(--source-club);
  background-color: rgba(249, 236, 220, .94);
}

.mobile-calendar-lesson.source-other:not(.completed) {
  border-left-color: var(--source-other);
  background-color: rgba(227, 240, 242, .94);
}

.mobile-calendar-lesson.completed.source-personal { border-left-color: var(--source-personal); background-color: #edf2f8; }
.mobile-calendar-lesson.completed.source-online-school { border-left-color: var(--source-online-school); background-color: #f0ecf6; }
.mobile-calendar-lesson.completed.source-school { border-left-color: var(--source-school); background-color: #ebf2ed; }
.mobile-calendar-lesson.completed.source-club { border-left-color: var(--source-club); background-color: #f4eee7; }
.mobile-calendar-lesson.completed.source-other { border-left-color: var(--source-other); background-color: #eaf1f2; }

@media (max-width: 760px) {
  .schedule-legend {
    row-gap: 8px;
  }
}

/* Teach.Shelf 1.8.1 — lesson-create flow */
.auth-inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: -2px;
}

.auth-text-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary, #35388f);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(53, 56, 143, .28);
  text-underline-offset: 3px;
}

.auth-text-button:hover {
  text-decoration-color: currentColor;
}

.auth-back-button {
  justify-self: start;
  margin-top: 2px;
}

.auth-form-note {
  color: var(--muted, #72758a);
  line-height: 1.45;
}

.account-email-section {
  grid-column: 1 / -1;
}

.account-section-copy,
.linked-email-row p {
  margin: 0 0 16px;
  color: var(--muted, #72758a);
  line-height: 1.55;
}

.linked-email-row {
  display: grid;
  gap: 6px;
}

.linked-email-row strong {
  overflow-wrap: anywhere;
}

.account-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status-chip.is-verified {
  color: #296642;
  background: rgba(69, 163, 105, .13);
}

.account-status-chip.is-pending {
  color: #8a6117;
  background: rgba(220, 164, 58, .16);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

@media (max-width: 720px) {
  .auth-inline-actions {
    display: grid;
    justify-content: stretch;
  }

  .account-status-chip {
    justify-self: start;
  }
}

/* Version 1.9: direct uploads and photo-to-PDF submissions */
.public-upload-choice {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(48, 53, 111, .16);
  border-radius: 17px;
  background: rgba(255, 255, 255, .54);
}

.public-upload-divider {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 22px;
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.public-upload-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.public-upload-divider span {
  position: relative;
  padding: 0 10px;
  background: #f8fbff;
}

.photo-selection-summary {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(225, 237, 252, .82);
  color: var(--ink);
}

.photo-selection-summary small {
  color: var(--ink-soft);
}

.photo-selection-summary ol {
  display: grid;
  gap: 3px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
  font-size: .78rem;
  color: var(--ink-soft);
}

.photo-selection-summary li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px;
  overflow-wrap: anywhere;
}


/* v1.9.2: единый календарь и удобный ввод времени для форм расписания */
.date-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  text-align: left;
  cursor: pointer;
}

.date-picker-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.date-picker-trigger-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: .94rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-trigger-copy small {
  color: var(--ink-soft);
  font-size: .76rem;
  text-transform: capitalize;
}

.date-picker-icon {
  flex: 0 0 auto;
  color: var(--blue-700);
  font-size: 1.25rem;
  line-height: 1;
}

.date-picker-panel,
.time-picker-panel {
  position: relative;
  z-index: 8;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(36, 63, 125, .14);
  border-radius: 16px;
  background: #fffefa;
  box-shadow: 0 14px 34px rgba(31, 42, 88, .14);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  text-align: center;
}

.date-picker-header strong {
  color: var(--blue-900);
  text-transform: capitalize;
}

.date-picker-nav {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(36, 63, 125, .12);
  border-radius: 11px;
  color: var(--blue-800);
  background: rgba(238, 244, 252, .76);
  font-size: 1.45rem;
  cursor: pointer;
}

.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.date-picker-weekdays {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 760;
  text-align: center;
}

.date-picker-weekdays span {
  padding: 4px 0;
}

.date-picker-day {
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.date-picker-day:hover,
.date-picker-day:focus-visible {
  background: rgba(126, 168, 220, .18);
  outline: none;
}

.date-picker-day.is-outside {
  color: rgba(76, 82, 117, .42);
}

.date-picker-day.is-today {
  box-shadow: inset 0 0 0 1px var(--blue-500);
}

.date-picker-day.is-selected {
  color: #fff;
  background: var(--blue-800);
  box-shadow: none;
  font-weight: 760;
}

.date-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(36, 63, 125, .08);
}

.time-picker-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
}

.time-picker-input-row .form-control {
  font-variant-numeric: tabular-nums;
}

.time-picker-toggle {
  border: 1px solid rgba(36, 63, 125, .14);
  border-radius: 12px;
  color: var(--blue-800);
  background: #fffefa;
  font-size: 1.25rem;
  cursor: pointer;
}

.time-picker-toggle:focus-visible,
.date-picker-trigger:focus-visible,
.date-picker-nav:focus-visible {
  border-color: var(--blue-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(126, 168, 220, .16);
}

.time-picker-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 3px;
}

.time-picker-options button {
  min-height: 36px;
  border: 1px solid rgba(36, 63, 125, .1);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(242, 246, 251, .72);
  font: inherit;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.time-picker-options button:hover,
.time-picker-options button:focus-visible {
  border-color: var(--blue-500);
  background: rgba(126, 168, 220, .17);
  outline: none;
}

@media (max-width: 520px) {
  .date-picker-panel,
  .time-picker-panel {
    padding: 10px;
    border-radius: 14px;
    box-shadow: none;
  }

  .date-picker-day {
    min-height: 38px;
  }

  .time-picker-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 250px;
  }
}


/* ---------- Teach.Shelf 1.9.2: единая карточка задания ---------- */
.assignment-detail-layout {
  grid-template-columns: minmax(0, 1fr);
}

.assignment-condition-card,
.assignment-submissions-card {
  min-width: 0;
}

.assignment-section-title {
  margin-bottom: 14px;
}

.assignment-condition-card > .preline-copy {
  margin-top: 0;
  line-height: 1.65;
}

.assignment-submissions-card .submission-list {
  margin-top: 16px;
}

@media (min-width: 901px) {
  .assignment-submissions-card .review-fields {
    grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
    align-items: start;
  }

  .assignment-submissions-card .review-fields label:nth-child(2),
  .assignment-submissions-card .review-fields label:nth-child(4) {
    grid-column: 2;
  }
}


/* ---------- Teach.Shelf 1.9.2: review history and polished desktop layout ---------- */
.modal-grid > .date-picker-root,
.modal-grid > .time-picker-root {
  align-self: start;
  align-content: start;
  grid-template-rows: auto 58px auto;
}

.date-picker-root > label,
.time-picker-root > label {
  align-self: end;
  min-height: 18px;
  margin: 0;
}

.date-picker-root .date-picker-trigger,
.time-picker-root .time-picker-input-row {
  align-self: stretch;
  margin: 0;
}

.time-picker-input-row,
.time-picker-input-row .form-control,
.time-picker-toggle {
  min-height: 58px;
}

.preview-navigation {
  display: flex;
  justify-content: flex-start;
  margin: -2px 0 14px;
}

.submission-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.submission-card.is-reviewed {
  border-color: rgba(74, 132, 103, .24);
  background: linear-gradient(145deg, rgba(242, 250, 245, .92), rgba(255,255,255,.82));
}

.submission-card.is-return-target {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(126, 168, 220, .18), var(--shadow-soft);
}

.saved-review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(224, 241, 231, .78);
  color: var(--ink);
}

.saved-review-summary span {
  color: var(--ink-soft);
  font-size: .78rem;
}

.public-submissions-history {
  width: min(700px, 100%);
  margin: 24px auto 0;
}

.public-history-heading {
  margin-bottom: 14px;
}

.public-history-heading h2 {
  margin: 4px 0 5px;
}

.public-history-heading p {
  margin: 0;
  color: var(--ink-soft);
}

.public-attempt-list {
  display: grid;
  gap: 14px;
}

.public-submission-attempt {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(48, 53, 111, .14);
  border-radius: 20px;
  background: rgba(239, 245, 253, .82);
  box-shadow: 0 8px 24px rgba(46, 67, 87, .07);
}

.public-submission-attempt.checked {
  border-color: rgba(73, 143, 105, .22);
  background: rgba(226, 243, 232, .82);
}

.public-submission-attempt.revision_requested {
  border-color: rgba(193, 139, 48, .24);
  background: rgba(255, 239, 207, .86);
}

.public-submission-attempt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.public-submission-attempt-head > div {
  display: grid;
  gap: 3px;
}

.public-submission-attempt-head span:first-child {
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.public-submission-attempt-head strong {
  font-size: 1.13rem;
}

.public-attempt-grade {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 8px 11px;
  border: 1px solid rgba(48, 53, 111, .13);
  border-radius: 999px;
  color: var(--blue-900) !important;
  background: rgba(255,255,255,.78);
  font-size: .84rem !important;
  font-weight: 800 !important;
  text-align: center;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.public-submission-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}

.public-submission-file-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.public-submission-file-row strong {
  overflow-wrap: anywhere;
}

.public-submission-file-row small {
  color: var(--ink-soft);
}

.student-submission-comment,
.public-submission-attempt .teacher-feedback {
  margin: 0;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}

.student-submission-comment span {
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 700;
}

.student-submission-comment p,
.public-submission-attempt .teacher-feedback p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.public-submission-attempt > .button {
  justify-self: start;
}

@media (max-width: 680px) {
  .modal-grid > .date-picker-root,
  .modal-grid > .time-picker-root {
    grid-template-rows: auto auto auto;
  }

  .public-submissions-history {
    width: 100%;
  }

  .public-submission-attempt {
    padding: 15px;
    border-radius: 17px;
  }

  .public-submission-attempt-head {
    align-items: center;
  }
}

/* Teach.Shelf 1.10.0 — PWA and notification controls */
.notification-settings-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, .48fr);
  gap: 18px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid rgba(52, 58, 139, .15);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239, 244, 253, .88), rgba(255, 255, 255, .84));
}

.notification-settings-box-simple {
  grid-template-columns: 1fr;
}

.notification-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.notification-toggle-row input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--blue-700);
  flex: 0 0 auto;
}

.notification-toggle-row > span,
.notification-lead-field {
  display: grid;
  gap: 5px;
}

.notification-toggle-row strong {
  color: var(--ink);
  font-size: .98rem;
}

.notification-toggle-row small,
.notification-lead-field small {
  color: var(--ink-soft);
  line-height: 1.42;
}

.notification-lead-field {
  transition: opacity .18s ease;
}

.notification-lead-field > span {
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
}

.notification-lead-field.is-disabled {
  opacity: .42;
  pointer-events: none;
}

.account-notification-section {
  margin-top: 18px;
}

.account-notification-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.account-notification-status {
  display: grid;
  gap: 6px;
  max-width: 610px;
}

.account-notification-status strong {
  font-size: 1.03rem;
}

.account-notification-status span,
.account-notification-note {
  color: var(--ink-soft);
  line-height: 1.5;
}

.account-notification-actions,
.public-review-push-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.account-notification-note {
  margin: 16px 0 0;
  font-size: .84rem;
}

.public-review-push-card {
  width: min(700px, 100%);
  margin: 24px auto 0;
  padding: 19px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(52, 58, 139, .17);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(237, 242, 255, .96), rgba(255, 255, 255, .92));
  box-shadow: 0 9px 28px rgba(45, 60, 104, .075);
}

.public-review-push-card > div:first-child {
  min-width: 0;
}

.public-review-push-card h2 {
  margin: 4px 0 6px;
  font-size: 1.18rem;
}

.public-review-push-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.48;
}

@media (max-width: 760px) {
  .notification-settings-box {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .account-notification-layout,
  .public-review-push-card {
    align-items: stretch;
    flex-direction: column;
  }

  .account-notification-actions,
  .public-review-push-actions {
    justify-content: flex-start;
  }

  .account-notification-actions .button,
  .public-review-push-actions .button {
    flex: 1 1 180px;
  }
}

.notification-summary-box p {
  margin: 6px 0 0;
}

/* Teach.Shelf 1.11.0 — встроенная проверка PDF */
.pdf-review-loading { padding: 32px 12px 40px; }
.pdf-review-shell { display: grid; gap: 16px; min-height: min(82vh, 920px); }
.pdf-review-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; padding-right: 54px; }
.pdf-review-header h2 { margin: 3px 0 2px; }
.pdf-review-header p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.pdf-review-draft-state { align-self: center; padding: 8px 12px; border-radius: 999px; background: var(--soft-blue); color: var(--navy); font-size: .84rem; font-weight: 700; text-align: center; }
.pdf-review-toolbar { position: sticky; top: -1px; z-index: 8; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid rgba(53,56,143,.18); border-radius: 18px; background: rgba(255,252,243,.96); box-shadow: 0 8px 24px rgba(32,35,92,.08); backdrop-filter: blur(10px); }
.pdf-review-toolbar-group { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 3px 5px; border-radius: 13px; background: rgba(239,244,255,.82); }
.pdf-review-tools-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.pdf-tool { min-width: 38px; min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pdf-tool:hover { background: #fff; border-color: rgba(53,56,143,.18); }
.pdf-tool.is-active { color: #fff; background: var(--indigo); box-shadow: 0 4px 10px rgba(53,56,143,.2); }
.pdf-tool:disabled { opacity: .38; cursor: default; }
.pdf-tool.symbol { font-size: 1.2rem; }
.pdf-color-chip { width: 38px; height: 36px; overflow: hidden; border-radius: 10px; border: 1px solid rgba(53,56,143,.18); background: #fff; }
.pdf-color-chip input { width: 52px; height: 48px; margin: -6px; border: 0; background: transparent; cursor: pointer; }
.pdf-width-control { display: inline-flex; gap: 7px; align-items: center; padding: 0 5px; color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.pdf-width-control input { width: 88px; }
.pdf-review-tool-hint { color: var(--muted); font-size: .84rem; font-weight: 650; padding: 0 6px; }
.pdf-review-viewport { position: relative; min-height: 460px; max-height: 68vh; overflow: auto; padding: 18px; border-radius: 22px; background: #dfe3ec; box-shadow: inset 0 0 0 1px rgba(53,56,143,.1); overscroll-behavior: contain; }
.pdf-review-page-stage { position: relative; width: 100%; min-width: 280px; margin: 0 auto; background: #fff; box-shadow: 0 10px 32px rgba(20,23,65,.18); transform-origin: top left; }
.pdf-review-page-stage img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pdf-review-page-stage img.is-loading { opacity: 0; }
.pdf-review-page-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.pdf-review-page-stage canvas[data-tool="eraser"] { cursor: cell; }
.pdf-review-page-stage canvas[data-tool="text"] { cursor: text; }
.pdf-review-page-loading, .pdf-review-page-error { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); background: #f5f5f7; }
.pdf-review-page-loading::before { content: ""; width: 32px; height: 32px; margin: 0 auto 6px; border: 4px solid rgba(53,56,143,.16); border-top-color: var(--indigo); border-radius: 50%; animation: spin 1s linear infinite; }
.pdf-review-page-error strong { color: var(--navy); font-size: 1.05rem; }
.pdf-review-result-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid rgba(53,56,143,.14); border-radius: 20px; background: linear-gradient(135deg, rgba(238,245,255,.92), rgba(255,249,232,.88)); }
.pdf-review-result-panel h3 { margin: 3px 0 0; }
.pdf-review-result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr); gap: 12px; }
.pdf-review-result-grid label { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.pdf-review-comment { grid-column: 1 / -1; }
.pdf-review-comment textarea { min-height: 96px; resize: vertical; }
.pdf-review-actions { position: sticky; bottom: -1px; z-index: 7; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border-top: 1px solid rgba(53,56,143,.1); background: rgba(255,252,243,.97); backdrop-filter: blur(10px); }
.pdf-review-busy { margin-right: auto; color: var(--muted); font-size: .86rem; font-weight: 700; }
.submission-review-file-state { margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: rgba(70,151,111,.11); color: #276246; font-size: .82rem; font-weight: 700; }

@media (max-width: 760px) {
  .pdf-review-shell { gap: 11px; min-height: 86vh; }
  .pdf-review-header { grid-template-columns: 1fr; gap: 9px; padding-right: 45px; }
  .pdf-review-header > .button { justify-self: start; }
  .pdf-review-draft-state { justify-self: start; text-align: left; }
  .pdf-review-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 7px; border-radius: 14px; }
  .pdf-review-toolbar-group { flex: 0 0 auto; }
  .pdf-review-viewport { min-height: 55vh; max-height: 61vh; padding: 8px; border-radius: 16px; }
  .pdf-review-result-grid { grid-template-columns: 1fr; }
  .pdf-review-comment { grid-column: auto; }
  .pdf-review-actions { display: grid; grid-template-columns: 1fr; padding: 10px 0 0; }
  .pdf-review-actions .button { width: 100%; }
  .pdf-review-busy { margin: 0; }
}

.submission-review-file-state.is-staged {
  border: 1px solid rgba(65, 91, 164, 0.28);
  border-color: rgba(65, 91, 164, 0.28);
  background: rgba(224, 235, 255, 0.72);
  color: var(--ink);
}

/* Teach.Shelf 1.11.1 — полноэкранная проверка PDF и быстрые карточки заданий */
.modal-backdrop.fullscreen {
  padding: 0 !important;
  place-items: stretch !important;
  background: #dfe3ec;
  backdrop-filter: none;
}
.modal-shell.fullscreen,
.modal-shell.fullscreen.wide {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #eef1f7;
}
.modal-shell.fullscreen .modal-scroll {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh !important;
  overflow: hidden;
  padding: 0 !important;
  border-radius: 0 !important;
}
.modal-shell.fullscreen > .modal-scroll > .modal-close { display: none; }
.modal-shell.fullscreen #modalContent { width: 100%; height: 100%; }

.assignment-detail-loading {
  min-height: 330px;
  display: grid;
  place-content: center;
  grid-template-columns: auto minmax(0, 360px);
  gap: 18px;
  align-items: center;
  padding: 48px 20px;
  text-align: left;
}
.assignment-detail-loading strong,
.assignment-detail-loading span { display: block; }
.assignment-detail-loading strong { color: var(--navy); font-size: 1.2rem; }
.assignment-detail-loading span { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.assignment-detail-loading-spinner,
.pdf-review-opening-spinner {
  width: 42px;
  height: 42px;
  border: 5px solid rgba(53,56,143,.16);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
.button.is-loading { cursor: wait; }

.pdf-review-opening,
.pdf-review-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 30px;
  color: var(--navy);
  text-align: center;
  background: #eef1f7;
}
.pdf-review-opening strong { font-size: 1.25rem; }
.pdf-review-opening span { max-width: 520px; color: var(--muted); line-height: 1.5; }
.pdf-review-fallback > div:first-child { max-width: 620px; }
.pdf-review-fallback h2 { margin: 5px 0 8px; }
.pdf-review-fallback p { color: var(--muted); }

.pdf-review-app {
  --review-topbar-height: 64px;
  --review-mobile-tools-height: 0px;
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--review-topbar-height) minmax(0, 1fr);
  overflow: hidden;
  color: var(--ink);
  background: #dfe3ec;
}
.pdf-review-topbar {
  position: relative;
  z-index: 30;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(53,56,143,.16);
  background: rgba(255,252,243,.98);
  box-shadow: 0 5px 20px rgba(20,23,65,.08);
}
.pdf-review-top-button,
.pdf-review-icon-button,
.pdf-review-page-label,
.pdf-review-zoom-label {
  min-height: 42px;
  border: 1px solid rgba(53,56,143,.18);
  border-radius: 12px;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.pdf-review-top-button { padding: 8px 13px; }
.pdf-review-icon-button { width: 42px; padding: 0; font-size: 1.4rem; line-height: 1; }
.pdf-review-page-label { min-width: 70px; padding: 0 10px; }
.pdf-review-zoom-label { min-width: 102px; padding: 0 12px; }
.pdf-review-title { min-width: 0; display: grid; gap: 2px; }
.pdf-review-title strong,
.pdf-review-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-review-title strong { color: var(--navy); font-size: 1rem; }
.pdf-review-title span { color: var(--muted); font-size: .82rem; }
.pdf-review-top-controls { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.pdf-review-done { min-height: 42px; padding-inline: 18px; }

.pdf-review-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  overflow: hidden;
}
.pdf-review-app.is-readonly .pdf-review-workspace { grid-template-columns: minmax(0, 1fr); }
.pdf-review-desktop-tools {
  z-index: 20;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  border-right: 1px solid rgba(53,56,143,.15);
  background: rgba(255,252,243,.97);
}
.pdf-review-tool {
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 5px 3px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--navy);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.pdf-review-tool > span:first-child { font-size: 1.35rem; line-height: 1; }
.pdf-review-tool small { color: inherit; font-size: .64rem; font-weight: 700; }
.pdf-review-tool:hover { border-color: rgba(53,56,143,.15); background: #fff; }
.pdf-review-tool.is-active { color: #fff; background: var(--indigo); box-shadow: 0 5px 12px rgba(53,56,143,.22); }
.pdf-review-tool:disabled { opacity: .35; cursor: default; }
.pdf-review-tools-divider { height: 1px; margin: 3px 5px; background: rgba(53,56,143,.15); }
.pdf-review-current-color { width: 23px; height: 23px; border: 2px solid #fff; border-radius: 7px; box-shadow: 0 0 0 1px rgba(53,56,143,.22); }

.pdf-review-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  max-height: none;
  padding: 22px;
  border-radius: 0;
  background: #cfd5df;
  box-shadow: none;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: rgba(53,56,143,.5) transparent;
}
.pdf-review-pages { min-width: 0; display: grid; justify-items: center; gap: 22px; padding-bottom: 50px; }
.pdf-review-page {
  position: relative;
  width: min(1120px, calc(100% - 20px));
  flex: none;
  aspect-ratio: var(--page-ratio);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20,23,65,.2);
  transform-origin: top center;
}
.pdf-review-page > img,
.pdf-review-page > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pdf-review-page > img { display: block; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.pdf-review-page > img.is-loading { opacity: 0; }
.pdf-review-page > canvas { z-index: 3; cursor: crosshair; }
.pdf-review-page > canvas[data-tool="eraser"] { cursor: cell; }
.pdf-review-page > canvas[data-tool="text"] { cursor: text; }
.pdf-review-page-number {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 8px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(25,29,72,.76);
  font-size: .75rem;
  font-weight: 800;
  pointer-events: none;
}
.pdf-review-page-loading,
.pdf-review-page-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  background: #f4f5f7;
  text-align: center;
}
.pdf-review-page-loading::before {
  content: "";
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 4px solid rgba(53,56,143,.16);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.pdf-review-page-error strong { color: var(--navy); }

.pdf-review-tool-options {
  position: fixed;
  z-index: 60;
  left: 88px;
  top: 78px;
  width: min(440px, calc(100vw - 110px));
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(53,56,143,.18);
  border-radius: 18px;
  background: rgba(255,252,243,.99);
  box-shadow: 0 18px 46px rgba(20,23,65,.2);
}
.pdf-review-option-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: center; }
.pdf-review-option-row > strong { color: var(--navy); font-size: .82rem; }
.pdf-review-color-presets,
.pdf-review-width-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.pdf-review-color-presets > button {
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  border-radius: 10px;
  background: var(--chip);
  box-shadow: 0 0 0 1px rgba(53,56,143,.2);
  cursor: pointer;
}
.pdf-review-custom-color { position: relative; min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid rgba(53,56,143,.18); border-radius: 10px; background: #fff; cursor: pointer; }
.pdf-review-custom-color input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pdf-review-custom-color span { color: var(--navy); font-size: .78rem; font-weight: 750; }
.pdf-review-width-presets > button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid rgba(53,56,143,.18);
  border-radius: 10px;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.pdf-review-width-presets > button span { width: 22px; height: var(--width); border-radius: 999px; background: currentColor; }
.pdf-review-width-presets > button.is-active { color: #fff; background: var(--indigo); }

.pdf-review-mobile-tools { display: none; }
.pdf-review-action-sheet { position: fixed; inset: 0; z-index: 1000; display: grid; align-items: end; }
.pdf-review-sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(18,21,56,.52); backdrop-filter: blur(3px); }
.pdf-review-sheet-panel {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 28px));
  max-height: min(86dvh, 780px);
  margin: 0 auto 14px;
  overflow-y: auto;
  display: grid;
  gap: 15px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 24px 24px 8px 24px;
  background: var(--cream);
  box-shadow: 10px 12px 0 rgba(22,24,65,.32);
}
.pdf-review-sheet-handle { display: none; }
.pdf-review-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.pdf-review-sheet-head h2 { margin: 3px 0 0; font-size: 1.45rem; }
.pdf-review-result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .42fr); gap: 12px; }
.pdf-review-result-grid label { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 750; }
.pdf-review-comment { grid-column: 1 / -1; }
.pdf-review-comment textarea { min-height: 92px; resize: vertical; }
.pdf-review-sheet-status { min-height: 25px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; font-weight: 700; }
#pdfReviewDraftStatus[data-tone="saving"] { color: #5a61a7; }
#pdfReviewDraftStatus[data-tone="saved"] { color: #28704f; }
#pdfReviewDraftStatus[data-tone="error"] { color: var(--danger); }
.pdf-review-sheet-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.pdf-review-sheet-actions .button { flex: 1 1 220px; justify-content: center; }
.pdf-review-busy { color: var(--indigo); }

@media (max-width: 900px) {
  .pdf-review-title { display: none; }
  .pdf-review-topbar { grid-template-columns: auto minmax(0, 1fr); }
  .pdf-review-top-controls { justify-content: flex-end; }
  .pdf-review-zoom-label { display: none; }
}

@media (max-width: 760px) {
  .modal-backdrop.fullscreen { align-items: stretch !important; }
  .modal-shell.fullscreen,
  .modal-shell.fullscreen.wide { max-height: 100dvh !important; border-radius: 0 !important; }
  .modal-shell.fullscreen .modal-scroll { max-height: 100dvh !important; }
  .pdf-review-app {
    --review-topbar-height: 54px;
    --review-mobile-tools-height: 62px;
    grid-template-rows: var(--review-topbar-height) minmax(0, 1fr) var(--review-mobile-tools-height);
  }
  .pdf-review-topbar { grid-row: 1; grid-template-columns: auto minmax(0, 1fr); gap: 5px; padding: 5px 7px; }
  .pdf-review-top-button { width: 42px; min-height: 42px; padding: 0; font-size: 1.2rem; }
  .pdf-review-top-button span { display: none; }
  .pdf-review-top-controls { gap: 3px; }
  .pdf-review-top-controls .pdf-review-icon-button { width: 34px; min-height: 40px; border-color: transparent; background: transparent; }
  .pdf-review-page-label { min-width: 58px; min-height: 40px; padding: 0 5px; border-color: transparent; background: transparent; font-size: .82rem; }
  .pdf-review-done { min-height: 40px; padding: 0 11px; border-radius: 10px; font-size: .84rem; }
  .pdf-review-workspace { grid-row: 2; grid-template-columns: minmax(0, 1fr); }
  .pdf-review-desktop-tools { display: none; }
  .pdf-review-viewport { padding: 6px; scroll-padding-top: 8px; }
  .pdf-review-pages { gap: 10px; padding-bottom: 24px; }
  .pdf-review-page { width: calc(100% - 4px); box-shadow: 0 3px 12px rgba(20,23,65,.18); }
  .pdf-review-page-number { top: 5px; left: 5px; min-width: 24px; height: 24px; font-size: .68rem; }
  .pdf-review-mobile-tools {
    grid-row: 3;
    z-index: 40;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: stretch;
    gap: 1px;
    padding: 4px 3px max(4px, env(safe-area-inset-bottom));
    overflow: hidden;
    border-top: 1px solid rgba(53,56,143,.16);
    background: rgba(255,252,243,.99);
    box-shadow: 0 -5px 18px rgba(20,23,65,.09);
  }
  .pdf-review-mobile-tools .pdf-review-tool { min-height: 50px; padding: 3px 1px; border-radius: 9px; }
  .pdf-review-mobile-tools .pdf-review-tool > span:first-child { font-size: 1.14rem; }
  .pdf-review-mobile-tools .pdf-review-tool small { font-size: .52rem; }
  .pdf-review-tool-options {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(var(--review-mobile-tools-height) + 8px);
    width: auto;
    max-height: 54dvh;
    overflow-y: auto;
    padding: 13px;
    border-radius: 17px;
  }
  .pdf-review-option-row { grid-template-columns: 1fr; gap: 7px; }
  .pdf-review-width-presets > button { flex: 1 1 120px; justify-content: center; }
  .pdf-review-action-sheet { align-items: end; }
  .pdf-review-sheet-panel {
    width: 100%;
    max-height: 88dvh;
    margin: 0;
    padding: 14px 13px calc(16px + env(safe-area-inset-bottom));
    border-width: 2px 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 34px rgba(20,23,65,.22);
  }
  .pdf-review-sheet-handle { width: 44px; height: 5px; display: block; justify-self: center; border-radius: 999px; background: rgba(53,56,143,.25); }
  .pdf-review-result-grid { grid-template-columns: 1fr; }
  .pdf-review-comment { grid-column: auto; }
  .pdf-review-sheet-actions { display: grid; grid-template-columns: 1fr; }
  .pdf-review-sheet-actions .button { width: 100%; }
  .assignment-detail-loading { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

@media (max-width: 420px) {
  .pdf-review-top-controls .pdf-review-icon-button:first-child,
  .pdf-review-top-controls .pdf-review-icon-button:nth-of-type(3) { display: none; }
  .pdf-review-mobile-tools .pdf-review-tool small { display: none; }
  .pdf-review-mobile-tools .pdf-review-tool { min-height: 48px; }
}

/* Teach.Shelf 1.11.2 — быстрый PDF.js-рендеринг и управление редактором */
.pdf-review-tool.is-active {
  color: var(--navy);
  border-color: rgba(53,56,143,.42);
  background: #e9efff;
  box-shadow: inset 0 0 0 2px rgba(53,56,143,.08), 0 4px 12px rgba(53,56,143,.14);
}
.pdf-review-tool.is-active > span:first-child {
  color: var(--indigo);
  opacity: 1;
  visibility: visible;
  -webkit-text-fill-color: currentColor;
}
.pdf-review-page > .pdf-review-page-source,
.pdf-review-page > .pdf-review-page-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pdf-review-page > .pdf-review-page-source {
  z-index: 1;
  display: block;
  background: #fff;
  pointer-events: none;
}
.pdf-review-mobile-history { display: none; }

@media (max-width: 760px) {
  .pdf-review-mobile-history {
    position: fixed;
    z-index: 58;
    right: 8px;
    bottom: calc(var(--review-mobile-tools-height) + 9px + env(safe-area-inset-bottom));
    display: flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(53,56,143,.18);
    border-radius: 14px;
    background: rgba(255,252,243,.96);
    box-shadow: 0 7px 18px rgba(20,23,65,.18);
    backdrop-filter: blur(8px);
  }
  .pdf-review-mobile-history-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(53,56,143,.16);
    border-radius: 10px;
    color: var(--navy);
    background: #fff;
    font: 800 1.25rem/1 system-ui, sans-serif;
  }
  .pdf-review-mobile-history-button:disabled { opacity: .32; }
  .pdf-review-page > .pdf-review-page-canvas { touch-action: none; }
}

/* Public assignment file viewer — v1.12.2 */
.public-material-link.is-opening,
[data-public-file].is-opening {
  cursor: wait;
  opacity: .72;
}

.public-file-body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: #cfd5e1;
  color: var(--navy);
}

.public-file-app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #cfd5e1;
}

.public-file-topbar {
  position: relative;
  z-index: 20;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(53,56,143,.15);
  background: rgba(255,252,243,.98);
  box-shadow: 0 3px 14px rgba(30,34,77,.12);
  backdrop-filter: blur(12px);
}

.public-file-back {
  width: 48px;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(53,56,143,.2);
  border-radius: 14px;
  background: #fffdf7;
  color: var(--navy);
  font: inherit;
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(53,56,143,.11);
}

.public-file-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.public-file-title strong,
.public-file-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-file-title strong {
  font-size: 1rem;
  font-weight: 850;
}

.public-file-title span {
  color: var(--muted);
  font-size: .82rem;
}

.public-file-download {
  min-height: 44px;
  padding-inline: 18px;
}

.public-file-stage {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

.public-file-loading,
.public-file-error,
.public-file-fallback {
  width: min(620px, calc(100% - 24px));
  min-height: 360px;
  margin: clamp(26px, 8vh, 90px) auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  border: 1px solid rgba(53,56,143,.14);
  border-radius: 26px;
  background: rgba(255,252,243,.96);
  text-align: center;
  box-shadow: 0 18px 44px rgba(24,28,72,.12);
}

.public-file-loading strong {
  font-size: 1.25rem;
}

.public-file-loading > span,
.public-file-error p,
.public-file-fallback p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.public-file-error h1,
.public-file-fallback h1 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.public-file-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(53,56,143,.16);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: public-file-spin .8s linear infinite;
}

@keyframes public-file-spin {
  to { transform: rotate(360deg); }
}

.public-file-progress {
  width: min(360px, 100%);
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(53,56,143,.14);
}

.public-file-progress > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--indigo);
  transition: width .16s ease;
}

.public-file-pages {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

.public-file-page {
  position: relative;
  width: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(20,23,65,.2);
}

.public-file-page canvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.public-file-page-number {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  min-width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(39,43,94,.88);
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(20,23,65,.2);
}

.public-file-page-placeholder {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.public-file-page-placeholder .public-file-spinner {
  width: 27px;
  height: 27px;
  border-width: 3px;
}

.public-file-image-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

.public-file-image-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(20,23,65,.2);
}

@media (max-width: 720px) {
  .public-file-topbar {
    gap: 7px;
    padding: max(7px, env(safe-area-inset-top)) 8px 7px;
  }

  .public-file-back {
    width: 43px;
    min-height: 43px;
    border-radius: 12px;
  }

  .public-file-title strong { font-size: .88rem; }
  .public-file-title span { font-size: .72rem; }

  .public-file-download {
    min-height: 42px;
    padding-inline: 11px;
    border-radius: 11px;
    font-size: .78rem;
  }

  .public-file-stage { padding: 7px; }

  .public-file-loading,
  .public-file-error,
  .public-file-fallback {
    width: calc(100% - 10px);
    min-height: 300px;
    margin: 18px auto;
    padding: 22px 16px;
    border-radius: 20px;
  }

  .public-file-pages { gap: 10px; }

  .public-file-page {
    min-height: 260px;
    border-radius: 2px;
    box-shadow: 0 3px 13px rgba(20,23,65,.18);
  }

  .public-file-page-placeholder { min-height: 260px; }

  .public-file-page-number {
    top: 6px;
    left: 6px;
    min-width: 27px;
    height: 27px;
    padding-inline: 6px;
    font-size: .62rem;
  }
}


/* Teach.Shelf 1.12.2 — PWA file viewer and mobile ergonomics */
.app-file-viewer-frame {
  display: block;
  background: #cfd5e1;
}

.public-file-body.is-embedded,
.public-file-body.is-embedded .public-file-app {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.public-file-body.is-embedded .public-file-app {
  grid-template-rows: minmax(0, 1fr);
}

.public-file-body.is-embedded .public-file-topbar {
  display: none;
}

.public-file-body.is-embedded .public-file-stage {
  padding: 8px;
}

.sidebar.is-swipe-dragging {
  transition: none !important;
  transform: translateX(var(--mobile-menu-drag-x, -105%)) !important;
}

.sidebar-scrim {
  opacity: 1;
  transition: opacity .18s ease;
}

.sidebar-scrim.is-swipe-preview {
  display: block !important;
  opacity: var(--mobile-menu-scrim-opacity, 0);
  transition: none;
  pointer-events: none;
}

@media (max-width: 900px) {
  .main-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .page.is-active {
    padding-bottom: 34px;
  }

  .modal-scroll {
    padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  }

  #modalContent::after {
    content: "";
    display: block;
    height: 22px;
    pointer-events: none;
  }
}

@media (max-width: 720px) {
  .app-file-viewer-frame {
    height: min(72dvh, 760px);
    border-radius: 14px;
  }

  .public-file-body.is-embedded .public-file-stage {
    padding: 5px;
  }
}
