:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --sidebar: #12242b;
  --ink: #122027;
  --muted: #63737a;
  --line: #e2e8ea;
  --teal: #007f79;
  --teal-soft: #def2ef;
  --coral: #e15d45;
  --yellow: #efc35a;
  --blue: #3c74d9;
  --green: #2e9366;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 14px 18px;
  background: var(--sidebar);
  color: #f7fafb;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
}

.logo span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.navigation {
  display: grid;
  gap: 4px;
  margin-top: 48px;
}

.navigation button,
.mobile-nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: rgba(245, 250, 251, .75);
  background: transparent;
  text-align: left;
}

.navigation button span {
  width: 22px;
  text-align: center;
  font-size: 21px;
}

.navigation button.selected {
  background: rgba(0, 127, 121, .28);
  color: white;
}

.sidebar-course {
  margin-top: auto;
  border: 1px solid rgba(226, 232, 234, .14);
  border-radius: 8px;
  padding: 16px;
}

.sidebar-course p {
  margin-bottom: 10px;
  color: rgba(245, 250, 251, .55);
  font-size: 12px;
}

.sidebar-course strong, .sidebar-course span { display: block; }
.sidebar-course span { margin-top: 7px; color: rgba(245, 250, 251, .6); font-size: 13px; }

.course-progress {
  height: 5px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(245, 250, 251, .15);
}

.course-progress i {
  display: block;
  width: 68%;
  height: 100%;
  background: var(--teal);
}

.workspace {
  min-width: 0;
  padding: 27px clamp(18px, 3vw, 38px) 38px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto 30px;
}

.date-label, .view-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}

.topbar h1 { font-size: 34px; letter-spacing: 0; }

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

.notice-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.notice-button span {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 11px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 8px 8px 4px 4px;
}

.notice-button span::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 2px;
  width: 4px;
  height: 2px;
  background: var(--muted);
}

.notice-button { font-size: 0; }
.notice-button::after {
  content: "3";
  position: absolute;
  top: -6px;
  right: -4px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 11px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.sync-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.profile > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 700;
}

.profile small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 1160px;
  margin: 0 auto;
}

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

.live-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 174px;
  border-radius: 8px;
  padding: 27px 32px;
  color: white;
  background: #183e45;
}

.empty-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 142px;
  border: 1px dashed #bfd4d7;
  border-radius: 8px;
  padding: 26px 30px;
  background: var(--surface);
}

.empty-lesson p {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 650;
}

.empty-lesson h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.empty-lesson span {
  color: var(--muted);
}

.live-main p {
  margin: 15px 0 8px;
  color: rgba(255, 255, 255, .72);
}

.live-main h2 { margin-bottom: 10px; font-size: 29px; }
.lesson-time { color: rgba(255,255,255,.76); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 11px;
  background: #286269;
  font-size: 13px;
  font-weight: 600;
}

.live-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e05c45;
}
.live-pill.planned {
  color: #dae7e9;
  background: #29434a;
}
.live-pill.planned::before {
  background: #afbdc2;
}
.primary-button.disabled {
  cursor: not-allowed;
  opacity: .7;
}

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

.primary-button, .secondary-button, .table-button {
  min-height: 43px;
  border: 0;
  border-radius: 8px;
  padding: 0 17px;
  font-weight: 650;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.live-actions .primary-button { background: #078c84; }
.live-actions .secondary-button { border-color: rgba(255,255,255,.27); background: transparent; color: white; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-row article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-row article {
  display: grid;
  gap: 8px;
  padding: 19px 22px;
}

.stat-row span { color: var(--muted); font-size: 14px; }
.stat-row strong { font-size: 32px; }
.stat-row small { color: var(--green); }

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.teacher-grid { grid-template-columns: 1.07fr .93fr; }

.panel { padding: 20px; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-header h2 { font-size: 20px; }
.panel-header button {
  border: 0;
  background: none;
  color: var(--teal);
  font-weight: 650;
}

.empty-state {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-top: 1px solid var(--line);
}

.lesson-row time {
  font-weight: 650;
}

.lesson-row time small,
.lesson-row div span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-badge {
  color: var(--muted);
  font-size: 12px;
}

.table-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--teal);
  background: var(--teal-soft);
}

.table-button.dark {
  color: white;
  background: var(--teal);
}

.table-button.completed {
  color: var(--green);
  background: #e7f3ec;
}

.task-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.task-status {
  width: 7px;
  height: 42px;
  border-radius: 8px;
}
.task-status.pending { background: var(--coral); }
.task-status.sent { background: var(--yellow); }
.task-status.done { background: var(--green); }

.task-copy p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}
.task-copy span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.task-label { color: var(--muted); font-size: 13px; }
.submission-form {
  display: grid;
  gap: 8px;
  grid-column: 2 / -1;
  margin-top: 10px;
}
.submission-form input,
.submission-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: white;
}
.submission-form textarea { min-height: 62px; resize: vertical; }
.submission-files {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.submission-files li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}
.download-link {
  border: 0;
  padding: 0;
  color: var(--teal);
  background: transparent;
}
.grade-chip {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: #e7f3ec;
}

.register-head,
.register-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 132px 67px;
  gap: 8px;
  align-items: center;
}

.register-head {
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.register-row {
  min-height: 54px;
  border-top: 1px solid var(--line);
}

.register-row select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 7px;
  background: white;
  color: var(--ink);
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.view-head h2 { font-size: 28px; }

.schedule-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
}

.calendar-layout {
  min-width: 0;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) 306px;
  gap: 14px;
  align-items: start;
}

.schedule-layout .schedule-board {
  grid-template-columns: repeat(5, minmax(126px, 1fr));
}

.day-column {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 12px;
  background: var(--surface);
}

.day-column.current { border-top: 3px solid var(--teal); }
.day-column h3 { margin-bottom: 18px; font-size: 16px; }
.day-column .lesson-row {
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--teal-soft);
  border-radius: 8px;
  padding: 10px;
  background: #f1faf9;
}

.calendar-event {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  padding: 12px;
  background: #e7eefb;
}
.calendar-event + .calendar-event { margin-top: 9px; }
.calendar-event.live-event {
  color: white;
  background: #24625f;
}
.calendar-event.live-event time,
.calendar-event.live-event span { color: rgba(255, 255, 255, .78); }
.calendar-event time, .calendar-event span { color: var(--muted); font-size: 13px; }
.no-lessons { color: var(--muted); font-size: 13px; }

.homework-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 350px;
  gap: 14px;
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) 390px;
  gap: 14px;
}

.material-library { min-height: 340px; }
.material-grid {
  display: grid;
  gap: 11px;
}
.material-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fbfdfd;
}
.material-card header,
.material-card footer {
  display: flex;
  align-items: center;
  gap: 9px;
}
.material-card header { justify-content: space-between; }
.material-kind {
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 700;
}
.material-kind.video { color: #2c54aa; background: #e7eefb; }
.material-kind.audio { color: #805f22; background: #fff3d9; }
.material-card h3 { margin: 12px 0 7px; font-size: 18px; }
.material-card p { margin-bottom: 14px; color: var(--muted); line-height: 1.45; }
.material-card small, .material-author { color: var(--muted); font-size: 12px; }
.material-card footer { flex-wrap: wrap; }
.material-open { display: inline-flex; align-items: center; text-decoration: none; }
.material-composer form { grid-template-columns: 1fr; }

.composer form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.composer label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.composer .full { grid-column: 1 / -1; }

.composer input,
.composer textarea,
.composer select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: white;
}

.composer textarea { min-height: 110px; resize: vertical; }

.lesson-composer form {
  grid-template-columns: 1fr;
}

.lesson-composer .primary-button {
  margin-top: 5px;
}

.group-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.group-card {
  min-height: 115px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.group-card.active {
  border-color: #b6dfdc;
  background: #f1faf9;
}

.group-card p {
  color: var(--muted);
  font-size: 13px;
}

.group-card h3 {
  margin: 9px 0 11px;
  font-size: 23px;
}

.group-card span {
  color: var(--muted);
  font-size: 13px;
}

.groups-layout {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 390px;
  gap: 14px;
}

.roster-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.roster-row span {
  color: var(--green);
  font-size: 13px;
}
.roster-row small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.inline-form {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.invite-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.invite-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.invite-form input,
.invite-form select,
.invite-link input {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.invite-link {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  border-radius: 8px;
  padding: 13px;
  background: #f1faf9;
}

.invite-link span {
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
}

.summary-panel strong {
  display: block;
  margin: 20px 0 6px;
  font-size: 42px;
}
.summary-panel p { color: var(--muted); }
.progress-track {
  height: 7px;
  margin-top: 27px;
  border-radius: 8px;
  background: #edf1f2;
}
.progress-track span {
  display: block;
  width: 87.5%;
  height: 100%;
  border-radius: 8px;
  background: var(--teal);
}

.progress-head, .progress-table > div:not(.progress-head) {
  display: grid;
  grid-template-columns: 1fr 180px 150px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}
.progress-head {
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}
.progress-table > div:not(.progress-head) { border-top: 1px solid var(--line); }
.progress-table b { color: var(--green); }

.grade-history > div:not(.panel-header) {
  display: grid;
  grid-template-columns: 1fr 120px 42px;
  align-items: center;
  min-height: 56px;
  border-top: 1px solid var(--line);
}
.grade-history span { color: var(--muted); }
.grade-history b { color: var(--green); font-size: 20px; }

.message-list article {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 75px;
  border-bottom: 1px solid var(--line);
}
.message-list article:last-child { border-bottom: 0; }
.message-list article.unread strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--teal);
}
.message-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
  font-weight: 700;
}
.message-list p { margin-top: 6px; color: var(--muted); }
.message-list time { color: var(--muted); font-size: 13px; }
.question-compose { margin-bottom: 14px; }

.assessment-layout {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) 440px;
  gap: 14px;
}
.assessment-list {
  display: grid;
  align-content: start;
  gap: 12px;
}
.assessment-summary, .assessment-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}
.assessment-submissions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.assessment-submissions div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.assessment-submissions div > strong { font-size: 13px; }
.submission-review {
  display: grid !important;
  gap: 9px !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfdfd;
}
.submission-review header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.submission-review header small { color: var(--muted); }
.submission-review p {
  color: var(--muted);
  font-size: 13px;
}
.review-form {
  display: grid;
  grid-template-columns: 108px minmax(160px, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.review-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.review-form input {
  min-height: 39px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
}
.review-comment {
  border: 1px solid #d8ece6;
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #f1faf7;
  font-size: 13px;
}
.correct-answers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.correct-answers > span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}
.correct-answers label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.correct-answers input { width: auto; min-height: 0; }
.assessment-summary span,
.assessment-card header span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.assessment-summary small,
.assessment-card header small { color: var(--muted); }
.question-list {
  display: grid;
  gap: 12px;
}
.question-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.question-builder legend { padding: 0 6px; font-weight: 650; }
.assessment-run { display: grid; gap: 12px; }
.assessment-run fieldset {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}
.assessment-run legend { padding: 0 5px; font-weight: 650; }
.assessment-run legend small { color: var(--muted); }
.assessment-run label {
  border-radius: 7px;
  padding: 9px;
  background: #f5f7f8;
}
.assessment-run input { margin-right: 8px; }
.assessment-run .answer-correct { color: #196548; background: #e4f5ea; }
.assessment-run .answer-wrong { color: #a63e32; background: #fbe9e5; }
.test-result { color: var(--green); }

.management-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.management-stats article {
  display: grid;
  gap: 7px;
}
.management-stats span { color: var(--muted); font-size: 13px; }
.management-stats strong { font-size: 32px; }
.management-layout {
  display: grid;
  grid-template-columns: minmax(450px, 1fr) 330px;
  gap: 14px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.account-row div {
  display: grid;
  gap: 5px;
}
.account-row small, .account-row span {
  color: var(--muted);
  font-size: 13px;
}
.account-row span {
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--teal);
  background: var(--teal-soft);
}
.management-groups {
  display: grid;
  align-content: start;
  gap: 11px;
}
.management-groups article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.management-groups small { color: var(--muted); }

.meeting {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
  padding: 20px clamp(16px, 3vw, 30px);
  color: white;
  background: #10191d;
  height: 100dvh;
  overflow: hidden;
}
.meeting[hidden] { display: none; }
.meeting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meeting-header p {
  display: inline-block;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 5px 12px;
  color: #75ded5;
  background: #173e40;
}
.meeting-header h2 { font-size: 25px; }
.meeting-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.recording {
  border-radius: 5px;
  padding: 5px 8px;
  background: var(--coral);
  font-weight: 700;
  font-size: 12px;
}
.meeting-stage {
  display: grid;
  grid-template-columns: minmax(340px, 1.6fr) minmax(240px, .8fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}
.speaker {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
  border-radius: 8px;
  background: #203037;
}
.stream-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #172429;
}
.stream-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: #203037;
}
.stream-placeholder p {
  color: #afbdc2;
}
.stream-placeholder.hidden {
  display: none;
}
.speaker footer {
  position: absolute;
  bottom: 14px;
  left: 14px;
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(10, 15, 18, .7);
}
.speaker footer span { margin-left: 10px; color: #75ded5; }
.video-avatar {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}
.teacher-avatar { width: 136px; height: 136px; font-size: 40px; }
.call-sidebar {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: minmax(122px, .75fr) minmax(0, 1.45fr) minmax(118px, .95fr);
}
.meeting-stage.teacher-solo {
  display: block;
}
.teacher-solo .speaker {
  display: none;
}
.teacher-solo .call-sidebar {
  height: 100%;
  grid-template-columns: minmax(300px, 1.08fr) minmax(270px, .94fr) minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.self-view {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: 8px;
  background: #203037;
}
.self-view footer {
  position: absolute;
  bottom: 10px;
  left: 10px;
  border-radius: 7px;
  padding: 7px 11px;
  background: rgba(10, 15, 18, .7);
}
.self-view footer span {
  margin-left: 8px;
  color: #75ded5;
  font-size: 12px;
}
.participants-panel,
.lesson-chat {
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  padding: 12px;
  background: #203037;
}
.participants-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
}
.meeting-panel-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.meeting-panel-title span {
  border-radius: 8px;
  padding: 1px 8px;
  color: #75ded5;
  background: #173e40;
}
.participants-list {
  display: grid;
  gap: 10px;
}
.room-settings {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(117, 222, 213, .18);
  border-radius: 8px;
  padding: 9px;
}
.room-settings label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d3dddf;
  font-size: 12px;
}
.room-settings div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}
.room-settings button,
.participant-actions button {
  border: 1px solid rgba(117, 222, 213, .25);
  border-radius: 6px;
  padding: 5px 7px;
  color: #dbe9eb;
  background: #293a40;
  font-size: 11px;
}
.participant {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 9px;
  align-items: center;
}
.participant.waiting {
  border: 1px solid rgba(239, 195, 90, .3);
  border-radius: 7px;
  padding: 8px;
}
.participant span {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 700;
}
.participant small { color: #afbdc2; font-size: 12px; }
.raised-hand {
  margin-left: 5px;
  border-radius: 5px;
  padding: 2px 5px;
  color: #18262b;
  background: var(--yellow);
  font-size: 10px;
}
.participant-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 6px;
}
.participant-actions .danger {
  border-color: rgba(225, 93, 69, .45);
  color: #ffbfaf;
}
.lesson-chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lesson-chat-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}
.lesson-chat-list article {
  border-radius: 7px;
  padding: 7px 9px;
  background: #293a40;
}
.lesson-chat-list article.mine { background: #235452; }
.lesson-chat-list strong, .lesson-chat-list time { font-size: 11px; color: #afbdc2; }
.lesson-chat-list p { margin: 3px 0; font-size: 13px; }
.lesson-chat-list time { display: block; text-align: right; }
.chat-empty { color: #afbdc2; font-size: 13px; }
.lesson-chat form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.lesson-chat input {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 7px;
  padding: 9px;
}
.lesson-chat button {
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: white;
  background: var(--teal);
}
.call-info {
  display: grid;
  gap: 9px;
  border-radius: 8px;
  padding: 12px 16px;
  background: #203037;
}
.call-info p {
  color: #afbdc2;
  line-height: 1.45;
}
.video-avatar.blue { color: white; background: var(--blue); }
.video-avatar.green { color: white; background: var(--green); }
.video-avatar.amber { background: var(--yellow); }
.meeting-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-bottom: max(2px, env(safe-area-inset-bottom));
}
.control, .end-call {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: white;
  background: #293a40;
}
.control.active { background: #25625f; }
.hand-control.active { background: #805f22; }
.mic-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.mic-glyph {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 19px;
  border: 2px solid white;
  border-radius: 8px;
}
.mic-glyph::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -6px;
  left: -6px;
  height: 11px;
  border: 2px solid white;
  border-top: 0;
  border-radius: 0 0 14px 14px;
}
.mic-control.muted .mic-glyph::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 7px;
  left: -6px;
  width: 23px;
  height: 2px;
  background: #ff8d7d;
  transform: rotate(45deg);
}
.end-call { min-width: 130px; background: var(--coral); font-weight: 700; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef3f4;
  overflow-y: auto;
}

.auth-gate[hidden] { display: none; }

.auth-panel {
  width: min(470px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(25px, 5vw, 36px);
  background: var(--surface);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 40px;
  font-size: 21px;
}

.auth-brand span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  font-weight: 800;
}

.auth-kicker {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-panel h2 {
  margin-bottom: 9px;
  font-size: 30px;
}

.auth-copy {
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 24px;
  border-radius: 8px;
  padding: 4px;
  background: #eef3f4;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}

.auth-tabs button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 4px rgba(16, 25, 29, .08);
}

.login-form {
  display: grid;
  gap: 12px;
  margin-bottom: 27px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.login-error {
  border-radius: 8px;
  padding: 10px 12px;
  color: #a63e32;
  background: #fbe9e5;
  font-size: 13px;
}
.demo-code {
  border-radius: 8px;
  padding: 10px 12px;
  color: #196548;
  background: #e4f5ea;
  font-weight: 650;
}

.invite-course {
  display: grid;
  gap: 5px;
  margin: 20px 0;
  border: 1px solid #b5dfdc;
  border-radius: 8px;
  padding: 14px;
  background: #f4fbfa;
}

.invite-course strong {
  font-size: 18px;
}

.invite-course span {
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--teal);
  background: transparent;
  font-weight: 650;
}

.demo-caption {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.account-cards {
  display: grid;
  gap: 10px;
}

@media (max-height: 760px) {
  .auth-gate { align-items: start; }
}

.account-cards button {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.account-cards button:hover {
  border-color: #b5dfdc;
  background: #f4fbfa;
}

.account-cards span {
  grid-row: 1 / 3;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 700;
}

.account-cards button:last-child span {
  color: white;
  background: var(--teal);
}

.account-cards small {
  color: var(--muted);
  margin-top: 4px;
}

.mobile-header, .mobile-nav { display: none; }

@media (max-width: 980px) {
  .app { display: block; }
  .sidebar { display: none; }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    color: var(--ink);
    background: var(--surface);
  }
  .workspace { padding: 18px 14px 86px; }
  .topbar { display: block; margin-bottom: 20px; }
  .topbar-actions { margin-top: 18px; justify-content: space-between; }
  .desktop-only, .profile div { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 8;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-nav button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 64px;
    padding: 6px 2px;
    color: var(--muted);
    font-size: 10px;
  }
  .mobile-nav button span { font-size: 20px; }
  .mobile-nav button.selected { color: var(--teal); }
  .mobile-nav strong { font-size: 10px; font-weight: 600; }
  .live-lesson, .empty-lesson { align-items: start; flex-direction: column; padding: 22px; }
  .stat-row, .two-column, .course-layout, .homework-layout, .schedule-layout, .groups-layout, .assessment-layout, .management-layout { grid-template-columns: 1fr; }
  .management-stats { grid-template-columns: 1fr; }
  .review-form { grid-template-columns: 1fr; }
  .group-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-stage { grid-template-columns: 1fr; overflow-y: auto; overflow-x: hidden; }
  .speaker { min-height: 34vh; }
  .call-sidebar {
    min-height: initial;
    overflow: visible;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(146px, auto) minmax(180px, auto);
  }
  .lesson-chat { grid-column: 1 / -1; min-height: 210px; }
  .meeting-stage.teacher-solo { display: block; }
  .teacher-solo .call-sidebar {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(220px, 34vh) minmax(180px, auto);
  }
  .teacher-solo .self-view { grid-column: 1 / -1; }
}

@media (min-width: 981px) and (max-height: 760px) {
  .meeting {
    gap: 10px;
    padding-block: 12px;
  }
  .meeting-header h2 { font-size: 21px; }
  .call-sidebar {
    gap: 8px;
    grid-template-rows: minmax(108px, .68fr) minmax(0, 1.45fr) minmax(96px, .82fr);
  }
  .participants-panel,
  .lesson-chat { padding: 10px; }
  .meeting-controls .control,
  .meeting-controls .end-call { min-height: 46px; }
}

@media (max-width: 540px) {
  .auth-gate {
    display: block;
    padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    background: var(--surface);
  }
  .auth-panel {
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
  .auth-brand {
    margin-bottom: 24px;
    font-size: 18px;
  }
  .auth-brand span {
    width: 34px;
    height: 34px;
  }
  .auth-kicker {
    margin-bottom: 14px;
    font-size: 12px;
  }
  .auth-tabs {
    margin-bottom: 22px;
  }
  .auth-tabs button {
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    font-size: 16px;
  }
  .auth-panel h2 {
    font-size: 34px;
    line-height: 1.05;
  }
  .auth-copy {
    margin-bottom: 24px;
    font-size: 18px;
    line-height: 1.42;
  }
  .login-form {
    gap: 14px;
    margin-bottom: 22px;
  }
  .login-form label {
    gap: 8px;
    font-size: 15px;
  }
  .login-form input {
    min-width: 0;
    min-height: 54px;
    font-size: 17px;
  }
  .primary-button {
    width: 100%;
    min-height: 56px;
    white-space: normal;
  }
  .topbar h1 { font-size: 30px; }
  .sync-state { display: none; }
  .profile > span { width: 39px; height: 39px; }
  .live-main h2 { font-size: 25px; }
  .panel { padding: 15px; }
  .register-head, .register-row { grid-template-columns: minmax(98px, 1fr) 115px 54px; }
  .register-row strong { font-size: 13px; }
  .task-row { grid-template-columns: 8px minmax(0, 1fr); }
  .task-row > :last-child { grid-column: 2; }
  .composer form { grid-template-columns: 1fr; }
  .group-cards { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .progress-head, .progress-table > div:not(.progress-head) { grid-template-columns: 1fr 90px 60px; }
  .meeting { padding: 12px; }
  .meeting-header { gap: 8px; align-items: start; }
  .meeting-header h2 { max-width: 182px; font-size: 18px; overflow-wrap: anywhere; }
  .meeting-meta { flex-shrink: 0; gap: 6px; font-size: 12px; }
  .call-sidebar { grid-template-columns: 1fr; }
  .self-view { min-height: 156px; }
  .participants-panel, .lesson-chat { grid-column: auto; }
  .question-builder { grid-template-columns: 1fr; }
  .meeting-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .control, .end-call {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 8px;
    font-size: 13px;
  }
  .end-call { grid-column: 1 / -1; }
}
