body.modal-open {
  overflow: hidden;
}

.class-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.class-modal--visible {
  visibility: visible;
  opacity: 1;
}

.class-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(225, 223, 247, 0.76);
  backdrop-filter: blur(4px);
  cursor: default;
}

.class-dialog {
  position: relative;
  width: min(1040px, calc(100vw - 48px));
  padding: 34px 54px 26px;
  overflow: hidden;
  border: 1px solid rgba(87, 59, 183, 0.13);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(47, 31, 115, 0.2);
  transform: translateY(14px) scale(0.985);
  transition: transform 200ms ease;
}

.class-step[hidden] {
  display: none;
}

.class-modal--visible .class-dialog {
  transform: translateY(0) scale(1);
}

.class-dialog__close {
  position: absolute;
  top: 24px;
  right: 25px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #626487;
  transition: color 160ms ease, background 160ms ease;
}

.class-dialog__close:hover {
  color: var(--ink);
  background: #f4f1ff;
}

.class-dialog__close svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.class-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 42px;
  padding: 0;
  list-style: none;
}

.class-progress__step {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #8587a7;
  background: #f0eff8;
  font-size: 12px;
  font-weight: 800;
}

.class-progress__step--active {
  color: #fff;
  background: linear-gradient(145deg, #7249ff, #4b1ee8);
  box-shadow: 0 5px 13px rgba(88, 49, 231, 0.23);
}

.class-progress__line {
  width: 38px;
  margin-inline: 6px;
  border-top: 2px dashed #e7e3f7;
}

.class-dialog__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.8fr);
  align-items: center;
  gap: 20px;
}

.class-dialog__heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.class-dialog__heading > span:first-child {
  color: var(--purple);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.class-dialog__heading > span:nth-child(2) {
  font-size: 22px;
}

.class-dialog__heading h2 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.class-dialog__content > p {
  margin-top: 17px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.class-name-field {
  display: block;
  margin-top: 20px;
}

.class-name-field input {
  width: 100%;
  height: 68px;
  padding: 0 20px;
  border: 2px solid #7653e9;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 19px;
  box-shadow: 0 0 0 0 rgba(96, 54, 247, 0);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.class-name-field input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(96, 54, 247, 0.1);
}

.class-list-status:empty {
  display: none;
}

.class-list-retry {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #dcd3fc;
  border-radius: 10px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
}

.class-mode {
  display: inline-flex;
  margin-top: 24px;
  padding: 4px;
  gap: 2px;
  border: 1px solid #e4e0f2;
  border-radius: 12px;
}

.class-mode__tab {
  padding: 8px 18px;
  border-radius: 9px;
  color: #4b4d78;
  font-size: 14px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease;
}

.class-mode__tab:hover,
.class-mode__tab[aria-selected="true"] {
  color: var(--purple);
}

.class-mode__tab[aria-selected="true"] {
  background: #f0ecff;
}

.class-existing {
  margin-top: 18px;
}

.class-search input {
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #faf9ff;
  font: inherit;
  font-size: 14px;
}

.class-search input:focus {
  border-color: var(--purple);
}

.class-list {
  display: grid;
  max-height: 232px;
  padding: 2px;
  gap: 8px;
  overflow-y: auto;
}

.class-option {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 52px;
  padding: 8px 14px;
  gap: 12px;
  border: 2px solid #ece8fa;
  border-radius: 11px;
  background: #fff;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.class-option:hover {
  border-color: #cdc2fb;
}

.class-option[aria-checked="true"] {
  border-color: #7653e9;
  background: #f7f5ff;
}

.class-option__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--purple);
  background: #f0ecff;
  font-size: 14px;
  font-weight: 800;
}

.class-option[aria-checked="true"] .class-option__avatar {
  color: #fff;
  background: linear-gradient(145deg, #7249ff, #4b1ee8);
}

.class-option__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-list__empty {
  color: var(--muted);
  font-size: 13px;
}

.class-link-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  margin-top: 22px;
  gap: 10px;
}

.class-link-preview__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--purple);
  background: #f0ecff;
}

.class-link-preview__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.class-link-preview > div {
  display: flex;
  flex-wrap: wrap;
  padding-top: 7px;
  gap: 4px 7px;
  min-width: 0;
  font-size: 13px;
}

.class-link-preview strong {
  overflow: hidden;
  color: var(--purple);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-link-preview small {
  flex-basis: 100%;
  margin-top: 6px;
  color: #898ba8;
  font-size: 11px;
}

.class-dialog__visual {
  min-width: 0;
}

.class-dialog__visual img {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(91, 54, 204, 0.11));
}

.class-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid #eceaf5;
}

.class-dialog__cancel {
  min-height: 50px;
  padding: 0 14px;
  color: #666886;
  font-weight: 700;
}

.class-dialog__next {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 290px;
  min-height: 57px;
  padding: 0 25px;
  gap: 15px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(105deg, #5121ed, #7027ff);
  box-shadow: 0 11px 25px rgba(88, 38, 229, 0.25);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.class-dialog__next:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(88, 38, 229, 0.3);
}

.class-dialog__next span {
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.class-dialog__next:disabled {
  color: #9a96aa;
  background: #e9e7ee;
  box-shadow: none;
  cursor: not-allowed;
}

.class-dialog__next:disabled:hover {
  transform: none;
  box-shadow: none;
}

.lesson-picker__heading > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lesson-picker__heading > div > span:first-child {
  color: var(--purple);
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.lesson-picker__heading > div > span:nth-child(2) {
  font-size: 22px;
}

.lesson-picker__heading h2 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.lesson-picker__heading p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.recommendation-status {
  display: grid;
  place-items: center;
  min-height: 290px;
  color: var(--muted);
  font-size: 14px;
}

.recommendation-status:empty {
  display: none;
}

.recommendation-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.recommendation-card {
  position: relative;
  display: grid;
  grid-template-rows: 132px 1fr;
  min-width: 0;
  min-height: 282px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(44, 34, 93, 0.1);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.recommendation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(51, 35, 117, 0.15);
}

.recommendation-card[aria-checked="true"] {
  border-color: #dce900;
  box-shadow: 0 0 0 2px #f4ff56, 0 12px 25px rgba(154, 164, 0, 0.16);
}

.recommendation-card__cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: #ebe8fa;
}

.recommendation-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.recommendation-card:hover .recommendation-card__cover img {
  transform: scale(1.035);
}

.recommendation-card__level,
.recommendation-card__check {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  font-weight: 850;
}

.recommendation-card__level {
  top: 10px;
  left: 10px;
  min-width: 42px;
  height: 31px;
  padding: 0 8px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(145deg, #714cff, #4b20e8);
  font-size: 11px;
}

.recommendation-card__check {
  top: 9px;
  right: 9px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #4720df;
  background: #efff37;
  box-shadow: 0 4px 12px rgba(79, 82, 0, 0.18);
  font-size: 20px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 150ms ease, transform 150ms ease;
}

.recommendation-card[aria-checked="true"] .recommendation-card__check {
  opacity: 1;
  transform: scale(1);
}

.recommendation-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 13px 13px 14px;
}

.recommendation-card__body h3 {
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.recommendation-card__subtitle,
.recommendation-card__description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recommendation-card__description {
  margin-top: 10px;
}

.recommendation-card__popular {
  align-self: flex-start;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  color: #3d3a10;
  background: #f4ff47;
  font-size: 10px;
  font-weight: 800;
}

.lesson-picker__library {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  gap: 9px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
}

.lesson-picker__library span {
  font-size: 20px;
}

.class-dialog__footer--picker {
  margin-top: 15px;
}

.class-step--completion {
  position: relative;
  margin: -18px -20px -2px;
  isolation: isolate;
}

.class-completion__decor {
  position: absolute;
  z-index: -1;
  inset: -88px -12px 54px;
  width: calc(100% + 24px);
  height: calc(100% + 34px);
  object-fit: fill;
  pointer-events: none;
}

.class-completion__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.class-completion__content h2 {
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.class-completion__content h2 span {
  margin-right: 8px;
  font-size: 29px;
}

.class-completion__invite {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(720px, calc(100% - 100px));
  min-height: 150px;
  margin-top: 30px;
  padding: 29px 80px 22px;
  border: 1px solid rgba(99, 66, 205, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 15px 35px rgba(75, 46, 173, 0.13);
}

.class-completion__invite strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--purple);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-completion__copy {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 318px;
  min-height: 55px;
  margin-top: 16px;
  padding: 0 25px;
  gap: 12px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(105deg, #5121ed, #7027ff);
  box-shadow: 0 10px 23px rgba(88, 38, 229, 0.22);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.class-completion__copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 27px rgba(88, 38, 229, 0.28);
}

.class-completion__copy svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.class-completion__hint {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.class-completion__lesson {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  width: min(520px, calc(100% - 120px));
  min-height: 80px;
  margin-top: 18px;
  padding: 13px 20px;
  gap: 16px;
  border-radius: 12px;
  background: linear-gradient(105deg, #f1edff, #f7f5ff);
  text-align: left;
}

.class-completion__lesson-icon {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  border-radius: 12px;
  color: var(--purple);
  background: #e8e0ff;
}

.class-completion__lesson-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.class-completion__lesson small,
.class-completion__lesson strong {
  display: block;
}

.class-completion__lesson small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.class-completion__lesson strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-completion__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 22px;
  padding: 22px 32px 0;
  gap: 28px;
  border-top: 1px solid #eceaf5;
}

.class-completion__launch,
.class-completion__done {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 800;
}

.class-completion__launch {
  gap: 13px;
  color: #1b2100;
  background: linear-gradient(105deg, #eaff00, #d1f500);
  cursor: not-allowed;
  opacity: 0.72;
}

.class-completion__launch svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
}

.class-completion__done {
  color: var(--purple);
  border: 2px solid #7653e9;
  background: #fff;
  transition: transform 160ms ease, background 160ms ease;
}

.class-completion__done:hover {
  transform: translateY(-2px);
  background: #faf8ff;
}

@media (max-width: 900px) {
  .recommendation-track {
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 56%);
    grid-template-columns: none;
    overflow-x: auto;
    padding: 3px 3px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .recommendation-card {
    scroll-snap-align: start;
  }
}

@media (max-width: 720px) {
  .class-modal {
    align-items: end;
    padding: 0;
  }

  .class-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 25px 22px 20px;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
  }

  .class-dialog__close {
    top: 17px;
    right: 16px;
  }

  .class-progress {
    margin-bottom: 28px;
  }

  .lesson-picker__heading > div {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-right: 25px;
    gap: 7px;
  }

  .lesson-picker__heading h2 {
    flex-basis: 100%;
    font-size: 24px;
  }

  .lesson-picker__heading p {
    text-align: left;
    line-height: 1.55;
  }

  .recommendation-track {
    grid-auto-columns: minmax(205px, 78%);
    margin-top: 22px;
  }

  .recommendation-card {
    grid-template-rows: 120px 1fr;
    min-height: 265px;
  }

  .class-dialog__grid {
    grid-template-columns: 1fr;
  }

  .class-dialog__heading {
    flex-wrap: wrap;
    gap: 7px;
  }

  .class-dialog__heading h2 {
    flex-basis: 100%;
    font-size: 24px;
  }

  .class-dialog__visual {
    display: none;
  }

  .class-name-field input {
    height: 60px;
  }

  .class-dialog__footer {
    align-items: stretch;
    margin-top: 22px;
  }

  .class-dialog__cancel {
    min-width: 78px;
  }

  .class-dialog__next {
    min-width: 0;
    flex: 1;
    padding-inline: 15px;
    font-size: 14px;
  }

  .class-step--completion {
    margin: 0;
  }

  .class-completion__decor {
    inset: -70px -20px 88px;
    width: calc(100% + 40px);
    height: calc(100% - 18px);
    object-fit: cover;
  }

  .class-completion__content h2 {
    max-width: 320px;
    font-size: 26px;
  }

  .class-completion__invite {
    width: 100%;
    min-height: 0;
    margin-top: 24px;
    padding: 24px 18px 18px;
  }

  .class-completion__invite strong {
    font-size: clamp(18px, 5.5vw, 24px);
  }

  .class-completion__copy {
    width: 100%;
    min-width: 0;
  }

  .class-completion__hint br {
    display: none;
  }

  .class-completion__lesson {
    width: 100%;
  }

  .class-completion__footer {
    grid-template-columns: 1fr;
    padding-inline: 0;
    gap: 12px;
  }

  .class-completion__launch {
    order: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .class-modal,
  .class-dialog {
    transition: none;
  }
}

.class-picker-fields { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:18px 0; }
.class-picker-fields label { display:grid; align-content:start; gap:8px; color:var(--ink); font-size:13px; font-weight:600; }
.class-picker-fields input { width:100%; min-width:0; border:1px solid var(--line); border-radius:12px; padding:12px; background:#faf9ff; color:var(--ink); font:inherit; }
.class-picker-fields small { font-size:11px; color:var(--muted); font-weight:400; }
.class-error { color:#b32949; font-size:13px; margin:0 0 12px; }
.class-error:empty { display:none; }
.class-dialog[aria-busy="true"] { cursor:progress; }
.class-completion__launch { cursor:pointer; }
#class-completion-time { color:var(--muted); margin-top:12px; font-size:13px; }
@media (max-width:600px) { .class-picker-fields { grid-template-columns:1fr; } }
.class-dialog [hidden] { display:none !important; }
.class-completion__launch { opacity:1; }
@media(min-width:721px) { .class-dialog { max-height:calc(100dvh - 48px); overflow-y:auto; } }
