:root {
  --brand: #e21a1a;
  --brand-rgb: 226, 26, 26;
  --brand-dark: #bd1616;
  --ink: #17191c;
  --muted: #6f747c;
  --line: #e7e7e3;
  --surface: #ffffff;
  --page: #f5f5f3;
  --success: #168b55;
  --success-soft: #e9f7ef;
  --shadow: 0 20px 60px rgba(22, 24, 28, .09);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

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

/* View changes focus the heading for screen readers; it is not a control. */
.login-copy h1[tabindex="-1"]:focus,
.lobby-intro h1[tabindex="-1"]:focus,
.live-heading h1[tabindex="-1"]:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 112px;
  height: 46px;
  object-fit: contain;
  object-position: left center;
}

.brand-fallback {
  display: none;
}

html[data-brand-has-logo="false"] .brand-fallback {
  display: grid;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  place-items: center;
  color: var(--brand-contrast, #fff);
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.brand > span {
  padding-left: 14px;
  color: #777b81;
  border-left: 1px solid #d9dad7;
  font-size: 14px;
  font-weight: 700;
}

.login-copy .login-school-name {
  margin: 18px 0 8px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
}

.login-card .brand {
  max-width: 100%;
}

.login-card .brand > span:not(.brand-fallback) {
  min-width: 0;
  line-height: 1.5;
}

.login-card .brand img {
  flex-shrink: 0;
}

html[data-entry-school="liga"] .login-card .brand img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

html[data-entry-school="centr-lux"] .login-card .brand img {
  width: clamp(116px, 30vw, 160px);
  height: 60px;
}

.primary-button,
.secondary-button,
.text-button,
.refresh-button,
.leave-top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}

.primary-button {
  min-height: 52px;
  padding: 0 22px;
  color: var(--brand-contrast, #fff);
  background: var(--brand);
  box-shadow: 0 12px 28px rgba(var(--brand-rgb), .22);
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 15px 32px rgba(var(--brand-rgb), .28);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .68;
}

.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9dbe0;
}

.text-button,
.refresh-button,
.leave-top-button {
  padding: 9px 12px;
  color: #5f646c;
  background: transparent;
}

.text-button:hover,
.refresh-button:hover {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .06);
}

.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 32px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(var(--brand-rgb), .09), transparent 32%),
    radial-gradient(circle at 92% 92%, rgba(32, 34, 38, .08), transparent 30%),
    var(--page);
}

.login-view::before,
.login-view::after {
  position: absolute;
  z-index: 0;
  width: 42vw;
  height: 42vw;
  min-width: 420px;
  min-height: 420px;
  content: "";
  border: 1px solid rgba(var(--brand-rgb), .1);
  border-radius: 50%;
  pointer-events: none;
}

.login-view::before {
  top: -28vw;
  left: -20vw;
}

.login-view::after {
  right: -24vw;
  bottom: -30vw;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  padding: clamp(28px, 5vw, 48px);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.brand-login {
  margin-bottom: 42px;
}

.login-copy {
  margin-bottom: 30px;
}

.category-pill,
.eyebrow {
  display: inline-flex;
  gap: .4em;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.category-pill {
  padding: 7px 10px;
  margin-bottom: 17px;
  background: rgba(var(--brand-rgb), .08);
  border-radius: 999px;
}

.login-copy h1,
.lobby-intro h1 {
  margin: 0;
  letter-spacing: -.04em;
}

.login-copy h1 {
  font-size: clamp(31px, 6vw, 42px);
  line-height: 1.05;
}

.login-copy p,
.lobby-intro p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 19px;
}

.login-form .field[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 13px;
  font-weight: 750;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 15px;
  color: var(--ink);
  background: #fafafa;
  border: 1px solid #dfe0dd;
  border-radius: 13px;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .09);
}

.field input[aria-invalid="true"] {
  border-color: var(--brand);
}

.field-error {
  min-height: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}

.field-error:empty {
  display: none;
}

.large-button {
  width: 100%;
  min-height: 56px;
  margin-top: 5px;
  font-size: 16px;
}

.large-button span:last-child {
  margin-left: auto;
  font-size: 22px;
}

.login-help {
  margin: 24px 0 0;
  color: #868a90;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.remember-token {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.remember-token input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.remember-token small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.lobby-view {
  min-height: 100vh;
}

.teacher-preview-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 9px max(24px, calc((100vw - 1200px) / 2));
  gap: 24px;
  color: #19142b;
  background: #c9bcff;
  border-bottom: 1px solid #9f8ee8;
}
.teacher-preview-bar[hidden] { display: none; }
.teacher-preview-bar > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.teacher-preview-bar strong { font-size: 13px; white-space: nowrap; }
.teacher-preview-bar span { color: #493f69; font-size: 12px; }
.teacher-preview-bar a {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f7f4ff;
  background: #241c3f;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}
.teacher-preview-bar a:hover { background: #332653; }

.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1120px) / 2));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.account {
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: #22252a;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  min-width: 110px;
}

.account-copy strong {
  max-width: 190px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  margin-top: 2px;
  color: #868a90;
  font-size: 11px;
}

.lobby-main {
  width: min(100% - 40px, 1120px);
  padding: 66px 0 80px;
  margin: 0 auto;
}

.lobby-intro {
  max-width: 730px;
  margin-bottom: 34px;
}

.lobby-intro h1 {
  margin-top: 10px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
}

.active-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  color: var(--brand-contrast, #fff);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, .16), transparent 34%),
    linear-gradient(128deg, var(--brand-dark), var(--brand) 58%, var(--brand-dark));
  border-radius: 25px;
  box-shadow: 0 24px 55px rgba(var(--brand-rgb), .22);
}

.active-card::after {
  position: absolute;
  right: -45px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  content: "";
  border: 32px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.live-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.live-mark i {
  width: 9px;
  height: 9px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .16);
  animation: pulse 1.5s ease-in-out infinite;
}

.active-card-copy {
  position: relative;
  z-index: 1;
}

.active-card-copy > span {
  color: var(--brand-contrast, #fff);
  opacity: .72;
  font-size: 13px;
  font-weight: 700;
}

.active-card-copy h2 {
  margin: 6px 0;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -.025em;
}

.active-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.active-topic-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  color: var(--brand-contrast, #fff);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-card-copy p {
  margin: 0;
  color: var(--brand-contrast, #fff);
  opacity: .8;
  line-height: 1.5;
}

.join-button {
  position: relative;
  z-index: 1;
  min-width: 190px;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 12px 30px rgba(74, 0, 0, .2);
}

.join-button:hover:not(:disabled) {
  color: var(--brand-dark);
  background: #fff;
}

.button-live-dot {
  font-size: 10px;
}

.waiting-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(22, 24, 28, .04);
}

.waiting-icon,
.how-to-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .08);
  border-radius: 50%;
  font-size: 21px;
  font-weight: 850;
}

.waiting-card strong,
.how-to strong {
  font-size: 15px;
}

.waiting-card p,
.how-to p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.schedule-section {
  margin-top: 48px;
}

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

.section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.03em;
}

.refresh-button {
  flex: 0 0 auto;
}

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

.slot-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 20px;
  min-height: 166px;
  padding: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 34px rgba(22, 24, 28, .045);
}

.slot-card.is-live {
  border-color: rgba(var(--brand-rgb), .32);
  box-shadow: 0 12px 36px rgba(var(--brand-rgb), .09);
}

.slot-date {
  display: grid;
  align-content: center;
  min-height: 100px;
  padding: 12px 8px;
  text-align: center;
  background: #f5f5f2;
  border-radius: 14px;
}

.slot-card.is-live .slot-date {
  color: var(--brand-contrast, #fff);
  background: var(--brand);
}

.slot-date strong {
  font-size: 32px;
  line-height: 1;
}

.slot-date span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.slot-card.is-live .slot-date span {
  color: rgba(255, 255, 255, .78);
}

.slot-copy {
  align-self: center;
  min-width: 0;
}

.slot-copy > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.slot-copy h3 {
  margin: 8px 0 7px;
  overflow: hidden;
  font-size: 19px;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.slot-loading {
  display: grid;
  grid-template-columns: 72px 1fr;
}

.slot-loading span {
  height: 16px;
  background: linear-gradient(90deg, #eee 20%, #f8f8f8 50%, #eee 80%);
  background-size: 220% 100%;
  border-radius: 8px;
  animation: loading 1.3s linear infinite;
}

.slot-loading span:first-child {
  grid-row: span 3;
  height: 100%;
}

.slot-loading span:nth-child(3) {
  width: 72%;
}

.slot-card.is-empty {
  opacity: .72;
}

.slot-card.is-empty .slot-date strong {
  font-size: 21px;
}

.schedule-error {
  padding: 12px 14px;
  margin: 14px 0 0;
  color: #a61b20;
  background: #fff0f0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
}

.student-progress-section {
  min-width: 0;
  max-width: 100%;
  margin-top: 58px;
}

.student-progress-heading {
  align-items: flex-end;
}

.student-progress-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.student-progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 16px;
  transition: opacity .18s ease;
}

.student-progress-summary.is-loading {
  opacity: .58;
}

.student-progress-summary > article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 8px 26px rgba(22, 24, 28, .035);
}

.student-progress-summary > article > div {
  display: grid;
  min-width: 0;
}

.student-progress-summary strong {
  overflow: hidden;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
}

.student-progress-summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.progress-summary-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #55606d;
  background: #f0f2f4;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
}

.progress-summary-icon.attended,
.progress-summary-icon.accuracy {
  color: var(--success);
  background: var(--success-soft);
}

.progress-summary-icon.missed {
  color: #b72228;
  background: #fff0f0;
}

.progress-summary-icon.answered {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .08);
}

.student-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.student-progress-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 34px rgba(22, 24, 28, .04);
}

.student-progress-card > header {
  padding: 20px 22px 17px;
  border-bottom: 1px solid #efefec;
}

.student-progress-card > header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.student-progress-card > header > div > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .07);
  border-radius: 11px;
  font-weight: 850;
}

.student-progress-card > header > div > div {
  min-width: 0;
}

.student-progress-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.015em;
}

.student-progress-card header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.student-progress-list,
.student-topic-list,
.student-answer-list {
  display: grid;
  min-width: 0;
  max-width: 100%;
}

.student-progress-empty {
  padding: 27px 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.student-progress-empty.is-loading {
  animation: progress-breathe 1.35s ease-in-out infinite;
}

.student-progress-empty.is-error {
  color: #a61b20;
  background: #fffafa;
}

.student-lesson-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 17px 20px;
}

.student-lesson-item + .student-lesson-item,
.student-topic-item + .student-topic-item,
.student-answer-item + .student-answer-item {
  border-top: 1px solid #efefec;
}

.student-progress-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #6b727c;
  background: #f0f2f4;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.student-lesson-item.status-attended .student-progress-mark {
  color: var(--success);
  background: var(--success-soft);
}

.student-lesson-item.status-missed .student-progress-mark {
  color: #b72228;
  background: #fff0f0;
}

.student-lesson-item.status-in-progress .student-progress-mark {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .08);
  animation: pulse 1.5s ease-in-out infinite;
}

.student-progress-item-copy,
.student-answer-copy {
  min-width: 0;
}

.student-progress-item-top,
.student-topic-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.student-progress-item-top strong,
.student-topic-heading strong,
.student-answer-copy > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.student-progress-status,
.student-answer-result {
  flex: 0 0 auto;
  padding: 5px 7px;
  color: #636a74;
  background: #f1f2f3;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.status-attended .student-progress-status {
  color: var(--success);
  background: var(--success-soft);
}

.status-missed .student-progress-status {
  color: #b72228;
  background: #fff0f0;
}

.status-in-progress .student-progress-status {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .08);
}

.student-progress-meta,
.student-progress-detail,
.student-answer-topics,
.student-answer-explanation {
  overflow-wrap: anywhere;
}

.student-progress-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.student-progress-detail,
.student-answer-topics {
  display: block;
  margin-top: 6px;
  color: #59616c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.student-lesson-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.student-lesson-topic {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 7px;
  overflow-wrap: anywhere;
  color: #4e5661;
  background: #f3f4f3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.student-topic-item {
  min-width: 0;
  padding: 18px 20px;
}

.student-topic-score {
  flex: 0 0 auto;
  color: var(--success);
  font-size: 12px;
  font-weight: 850;
}

.student-topic-track {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  background: #eceeec;
  border-radius: 999px;
}

.student-topic-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--success));
  border-radius: inherit;
  transition: width .28s ease;
}

.student-topic-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.student-topic-metrics .is-missed {
  color: #b72228;
}

.student-answer-history {
  margin-top: 16px;
}

.student-answer-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 18px 22px;
}

.student-answer-result {
  align-self: start;
  min-width: 58px;
  padding-inline: 8px;
  text-align: center;
}

.student-answer-item.is-correct .student-answer-result {
  color: var(--success);
  background: var(--success-soft);
}

.student-answer-item.is-incorrect .student-answer-result {
  color: #b72228;
  background: #fff0f0;
}

.student-answer-item.is-pending .student-answer-result {
  color: #876916;
  background: #fff7d8;
}

.student-answer-explanation {
  padding: 9px 11px;
  margin: 9px 0 0;
  color: #535a64;
  background: #f7f7f5;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.how-to {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 680px;
  padding-top: 34px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.how-to-icon {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.live-view {
  min-height: 100vh;
  color: #f5f7fa;
  background: #0e1117;
}

.live-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  padding: 10px 22px;
  background: #151922;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-live {
  color: #fff;
}

.brand-live img {
  flex-shrink: 0;
  width: auto;
  max-width: 152px;
  height: 42px;
  padding: 5px 8px;
  border-radius: 8px;
  object-position: center;
  background: #fff;
}

.brand-live > span {
  color: #9ba4b3;
  border-color: rgba(255, 255, 255, .12);
}

.live-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-width: 0;
}

.live-heading .live-mark {
  padding: 7px 10px;
  color: #ff686f;
  background: rgba(226, 26, 26, .12);
  border-radius: 999px;
}

.live-heading .live-mark i {
  box-shadow: 0 0 0 4px rgba(226, 26, 26, .17);
}

.live-heading h1 {
  max-width: 460px;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-top-button {
  justify-self: end;
  color: #ff9ba0;
  background: rgba(226, 26, 26, .1);
}

.leave-top-button:hover {
  color: #fff;
  background: rgba(226, 26, 26, .22);
}

.live-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  height: calc(100vh - 70px);
  min-height: 520px;
}

.video-column {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  padding: 14px;
}

.recording-notice {
  position: absolute;
  z-index: 8;
  top: 27px;
  left: 27px;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 54px);
  min-height: 36px;
  padding: 8px 12px;
  gap: 9px;
  color: #fff;
  background: rgba(142, 12, 20, .94);
  border: 1px solid rgba(255, 137, 143, .45);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  backdrop-filter: blur(8px);
}

.recording-notice[hidden] {
  display: none;
}

.recording-notice i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: #ff4c55;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 76, 85, .18);
  animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
  50% {
    opacity: .5;
    transform: scale(.78);
  }
}

.video-shell {
  min-height: 0;
}

.video-shell.rost-live-room {
  height: 100%;
  min-height: 350px;
  border-radius: 17px;
}

.student-quality-control {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  align-items: center;
  margin: 0;
  color: #aebbd0;
  font-size: 11px;
}
.student-quality-control label { font-weight: 700; color: #e7edf7; }
.student-quality-control select { width: 112px; min-height: 44px; border: 1px solid #40516a; border-radius: 8px; padding: 5px 8px; background: #202b3d; color: #e7edf7; }
.student-quality-control select:focus-visible { outline: 2px solid #a8c9ff; outline-offset: 2px; }
.control-bar { grid-row: 3; }
.speech-status { grid-row: 2; }
.video-shell.is-audio-only .rost-live-tile__media video { visibility: hidden; }
.video-shell.is-audio-only .rost-live-tile__media::after {
  content: 'Только звук'; position: absolute; inset: 0; display: grid; place-items: center;
  color: #dce6f5; font-weight: 700; background: #202b3d;
}
@media (max-width: 560px) {
  .student-quality-control select { width: 108px; }
}

.video-shell .rost-live-room__stage {
  min-height: 0;
}

.video-shell .rost-live-room__videos {
  position: relative;
  display: block;
  min-height: 0;
}

.video-shell .rost-live-tile {
  display: none;
}

.video-shell .rost-live-tile[data-identity="teacher"] {
  display: block;
  width: 100%;
  height: 100%;
}

.video-shell .rost-live-tile.is-local {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: 12px;
  display: block;
  width: min(24%, 210px);
  height: min(28%, 135px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.video-shell .rost-live-tile[data-identity="teacher"].is-local {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
}

.video-shell .rost-live-avatar {
  display: none;
}

.video-shell .rost-live-avatar[data-identity="teacher"] {
  display: grid;
}

.video-shell .rost-live-room__overflow:empty,
.video-shell .rost-live-room__overflow:not(:has(.rost-live-avatar[data-identity="teacher"])) {
  display: none;
}

.live-error {
  position: absolute;
  z-index: 15;
  top: 50%;
  left: 50%;
  width: min(90%, 420px);
  padding: 28px;
  color: var(--ink);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .35);
  text-align: center;
  transform: translate(-50%, -50%);
}

.live-error strong {
  font-size: 19px;
}

.live-error p {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.speech-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 6px 0;
  padding: 9px 13px;
  color: #cbd1dc;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.speech-status.is-allowed {
  color: #fff3cc;
  background: rgba(255, 201, 74, .12);
  border-color: rgba(255, 201, 74, .26);
}

.speech-status.is-speaking {
  color: #d8ffe6;
  background: rgba(45, 190, 103, .13);
  border-color: rgba(77, 220, 133, .28);
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 6px 0;
}

.media-control {
  display: grid;
  min-width: 105px;
  min-height: 58px;
  padding: 7px 12px;
  place-items: center;
  color: #e9edf3;
  background: #1b202a;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 13px;
}

.media-control:hover:not(:disabled) {
  background: #252b37;
}

.media-control:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.media-control.is-off {
  color: #ff9ca1;
  background: rgba(226, 26, 26, .1);
  border-color: rgba(226, 26, 26, .18);
}

.media-control.is-locked {
  color: #aab1bd;
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .08);
}

.media-control.is-raised {
  color: #1c1f24;
  background: #ffc94a;
  border-color: #ffc94a;
}

.media-control.leave-control {
  color: #fff;
  background: #b91e26;
  border-color: #d72a32;
}

.control-icon {
  font-size: 18px;
  line-height: 1;
}

.control-label {
  font-size: 11px;
  font-weight: 750;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: #171b24;
  border-left: 1px solid rgba(255, 255, 255, .08);
}

.chat-panel > header {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.chat-panel h2 {
  margin: 0;
  font-size: 17px;
}

.chat-panel header span {
  display: block;
  margin-top: 3px;
  color: #8993a2;
  font-size: 11px;
}

.chat-messages {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  scrollbar-color: #3b4350 transparent;
}

.chat-empty {
  display: grid;
  height: 100%;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  color: #7f8999;
  text-align: center;
}

.chat-empty > span {
  margin-bottom: 10px;
  font-size: 28px;
  filter: grayscale(1);
  opacity: .65;
}

.chat-empty strong {
  color: #bbc3ce;
  font-size: 14px;
}

.chat-empty p {
  max-width: 220px;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 15px;
}

.chat-message.mine {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 34px;
}

.chat-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #333b49;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 850;
}

.chat-bubble {
  min-width: 0;
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 4px;
}

.chat-meta strong {
  max-width: 190px;
  overflow: hidden;
  color: #dce1e8;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta time {
  color: #717b8b;
  font-size: 10px;
}

.chat-text {
  display: inline-block;
  max-width: 100%;
  padding: 9px 11px;
  color: #e6e9ee;
  background: #222833;
  border-radius: 4px 12px 12px;
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.chat-message.mine .chat-bubble {
  justify-self: end;
}

.chat-message.mine .chat-meta {
  justify-content: flex-end;
}

.chat-message.mine .chat-text {
  color: #fff;
  background: #8f1f25;
  border-radius: 12px 4px 12px 12px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 13px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.chat-form textarea {
  width: 100%;
  max-height: 92px;
  padding: 11px 12px;
  resize: none;
  color: #f3f5f7;
  background: #222833;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  outline: 0;
  line-height: 1.35;
}

.chat-form textarea:focus {
  border-color: rgba(255, 255, 255, .25);
}

.chat-form textarea:disabled {
  opacity: .55;
}

.chat-form button {
  width: 42px;
  height: 42px;
  align-self: end;
  color: var(--brand-contrast, #fff);
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 750;
}

.chat-form button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.live-quiz {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  color: #1d2025;
  background:
    radial-gradient(circle at 100% 0, rgba(var(--brand-rgb), .1), transparent 38%),
    #f8f8f6;
  animation: quiz-enter .22s ease-out;
}

.quiz-header {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid #e2e3df;
  backdrop-filter: blur(12px);
}

.quiz-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.quiz-kicker i {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .1);
}

.quiz-header small {
  display: block;
  margin-top: 5px;
  color: #737981;
  font-size: 11px;
  font-weight: 650;
}

.quiz-scroll {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
}

.quiz-image-wrap {
  width: 100%;
  aspect-ratio: auto;
  margin: 0 auto 18px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.quiz-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.live-quiz h2 {
  margin: 0 0 17px;
  color: #1c1f24;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.28;
  letter-spacing: -.025em;
}

.quiz-options {
  display: grid;
  gap: 9px;
}

.quiz-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  color: #262a30;
  background: #fff;
  border: 1px solid #dedfdb;
  border-radius: 13px;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(var(--brand-rgb), .42);
}

.quiz-option.is-selected {
  background: rgba(var(--brand-rgb), .055);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .08);
}

.quiz-option.is-correct {
  background: #eaf8f0;
  border-color: #20a665;
  box-shadow: 0 0 0 3px rgba(32, 166, 101, .08);
}

.quiz-option.is-wrong {
  background: #fff0f0;
  border-color: #df4249;
  box-shadow: 0 0 0 3px rgba(223, 66, 73, .08);
}

.quiz-option:disabled {
  cursor: default;
  opacity: 1;
}

.quiz-option-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #5d626a;
  background: #f0f1ee;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 850;
}

.quiz-option.is-selected .quiz-option-letter {
  color: var(--brand-contrast, #fff);
  background: var(--brand);
}

.quiz-option.is-correct .quiz-option-letter {
  color: #fff;
  background: #168b55;
}

.quiz-option.is-wrong .quiz-option-letter {
  color: #fff;
  background: #c62d34;
}

.quiz-option-text {
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}

.quiz-option-state {
  color: transparent;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.quiz-option.is-correct .quiz-option-state {
  color: #168b55;
}

.quiz-option.is-wrong .quiz-option-state {
  color: #c62d34;
}

.quiz-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  color: var(--brand-contrast, #fff);
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), .18);
}

.quiz-submit:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: .48;
}

.quiz-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  margin-top: 14px;
  background: #eaf8f0;
  border: 1px solid #c9e9d7;
  border-radius: 13px;
}

.quiz-result.is-incorrect {
  background: #fff1f1;
  border-color: #f0c9cb;
}

.quiz-result-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: #168b55;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 900;
}

.quiz-result.is-incorrect .quiz-result-mark {
  background: #c62d34;
}

.quiz-result strong {
  display: block;
  margin-top: 1px;
  color: #1e2823;
  font-size: 13px;
}

.quiz-result p {
  margin: 4px 0 0;
  color: #5f6d65;
  font-size: 12px;
  line-height: 1.45;
}

.quiz-result.is-incorrect strong {
  color: #61282b;
}

.quiz-result.is-incorrect p {
  color: #7b5557;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(390px, calc(100vw - 36px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 14px 16px;
  color: #f4f6f9;
  background: #20242b;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
  animation: toast-in .2s ease-out;
}

.toast > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.toast.error > span {
  background: var(--brand);
}

.toast.warning > span {
  color: #231f15;
  background: #ffc94a;
}

.toast strong {
  display: block;
  margin-top: 1px;
  font-size: 13px;
}

.toast p {
  margin: 3px 0 0;
  color: #aeb6c1;
  font-size: 12px;
  line-height: 1.4;
}

@keyframes pulse {
  50% { opacity: .45; transform: scale(.8); }
}

@keyframes loading {
  to { background-position: -220% 0; }
}

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

@keyframes quiz-enter {
  from { opacity: 0; transform: translateX(14px); }
}

@keyframes progress-breathe {
  50% { opacity: .48; }
}

@media (max-width: 920px) {
  .live-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .brand-live > span:not(.brand-fallback) {
    display: none;
  }

  .live-heading {
    padding: 0 12px;
  }

  .live-heading .live-mark {
    display: none;
  }

  .live-main {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 760px) {
  body[data-view="live"] {
    height: 100dvh;
    overflow: hidden;
    background: #0e1117;
  }

  .login-view {
    padding: 18px;
  }

  .login-card {
    border-radius: 22px;
  }

  .app-header {
    min-height: 68px;
    padding: 10px 16px;
  }

  .app-header .brand img {
    width: 88px;
    height: 38px;
  }

  .app-header .brand > span:not(.brand-fallback),
  .account-copy {
    display: none;
  }

  .lobby-main {
    width: min(100% - 28px, 1120px);
    padding: 42px 0 60px;
  }

  .active-card {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .active-topic-list {
    margin-block: 8px 10px;
  }

  .join-button {
    width: 100%;
  }

  .slot-grid {
    grid-template-columns: 1fr;
  }

  .student-progress-section {
    margin-top: 46px;
  }

  .student-progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-progress-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-header {
    height: 52px;
    min-height: 52px;
    padding: 6px 10px;
  }

  .brand-live img {
    width: auto;
    max-width: 120px;
    height: 32px;
    padding: 4px 6px;
  }

  html[data-brand-has-logo="false"] .brand-live .brand-fallback {
    min-width: 38px;
    height: 30px;
    padding: 0 7px;
    border-radius: 8px;
    font-size: 12px;
  }

  .live-heading h1 {
    font-size: 12px;
  }

  .leave-top-button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .live-view {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .live-main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(250px, 52dvh) minmax(0, 1fr);
    height: calc(100dvh - 52px);
    min-height: 0;
    overflow: hidden;
  }

  .live-view.is-quiz-active .live-main {
    grid-template-rows: clamp(230px, calc(56.25vw + 55px), 360px) minmax(0, 1fr);
  }

  .video-column {
    min-height: 0;
    padding: 6px 8px 4px;
    overflow: hidden;
  }

  .video-shell.rost-live-room {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    border-radius: 12px;
  }

  .video-shell .rost-live-room__status {
    display: none;
  }

  .video-shell .rost-live-room__stage {
    height: 100%;
    padding: 4px;
    gap: 4px;
  }

  .video-shell .rost-live-room__videos {
    height: 100%;
    grid-auto-rows: minmax(0, 1fr);
  }

  .video-shell .rost-live-tile[data-identity="teacher"] {
    min-height: 0;
    border-radius: 10px;
  }

  .live-view.is-quiz-active .speech-status {
    display: none;
  }

  .chat-panel {
    min-height: 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-left: 0;
  }

  .control-bar {
    gap: 5px;
    padding: 5px 0 0;
  }

  .media-control {
    min-width: 0;
    flex: 1;
    min-height: 44px;
    padding: 4px 5px;
    border-radius: 10px;
  }

  .control-icon {
    font-size: 15px;
  }

  .control-label {
    font-size: 9px;
    line-height: 1.05;
  }

  .video-shell .rost-live-tile.is-local {
    width: 30%;
    height: 25%;
  }

  .quiz-header {
    min-height: 36px;
    padding: 5px 10px;
  }

  .quiz-header > div {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .quiz-kicker {
    gap: 6px;
    font-size: 10px;
  }

  .quiz-kicker i {
    width: 6px;
    height: 6px;
  }

  .quiz-header small {
    margin-top: 0;
    font-size: 9px;
    text-align: right;
    white-space: nowrap;
  }

  .quiz-scroll {
    padding: 6px 10px 8px;
    overscroll-behavior: contain;
  }

  .quiz-image-wrap {
    width: 100%;
    height: auto;
    margin-bottom: 4px;
    aspect-ratio: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .quiz-image-wrap img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
  }

  .live-quiz h2 {
    margin-bottom: 5px;
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1.2;
  }

  .quiz-options {
    gap: 4px;
  }

  .quiz-option {
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    min-height: 38px;
    padding: 5px 7px;
    gap: 7px;
    border-radius: 9px;
  }

  .quiz-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 14px;
  }

  .quiz-option-text {
    font-size: 18px;
    line-height: 1.4;
  }

  .quiz-submit {
    min-height: 38px;
    margin-top: 5px;
    border-radius: 9px;
    font-size: 12px;
  }

  .quiz-result {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    margin-top: 7px;
  }

  .quiz-result-mark {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .recording-notice {
    top: 12px;
    left: 14px;
    max-width: calc(100% - 28px);
    min-height: 28px;
    padding: 5px 9px;
    font-size: 9px;
  }
}

@media (max-width: 460px) {
  .brand-login {
    margin-bottom: 32px;
  }

  .brand-login img {
    width: 96px;
  }

  .brand-login > span {
    font-size: 12px;
  }

  .login-card {
    padding: 27px 22px;
  }

  .lobby-intro h1 {
    font-size: 35px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .refresh-button {
    padding-inline: 8px;
    font-size: 0;
  }

  .refresh-button span {
    font-size: 19px;
  }

  .slot-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 15px;
    min-height: 145px;
    padding: 17px;
  }

  .slot-date {
    min-height: 94px;
  }

  .slot-date strong {
    font-size: 28px;
  }

  .slot-copy h3 {
    font-size: 17px;
  }

  .student-progress-heading {
    align-items: flex-start;
  }

  .student-progress-summary {
    gap: 8px;
  }

  .student-progress-summary > article {
    gap: 9px;
    min-height: 74px;
    padding: 12px;
    border-radius: 14px;
  }

  .progress-summary-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 10px;
    font-size: 12px;
  }

  .student-progress-summary strong {
    font-size: 22px;
  }

  .student-progress-card > header,
  .student-answer-item {
    padding-inline: 16px;
  }

  .student-lesson-item,
  .student-topic-item {
    padding-inline: 15px;
  }

  .student-progress-item-top {
    display: grid;
    justify-items: start;
  }

  .student-answer-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .student-answer-result {
    width: max-content;
  }
}

.microphone-control-group { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.microphone-control-group .media-control { min-width: 0; flex: 1; }
.microphone-control-group .microphone-settings-button { flex: 0 0 44px; padding: 4px; min-width: 44px; font-size: 20px; }
.live-view.is-compact-layout .microphone-control-group { flex: 1; min-width: 0; }
.live-view.is-compact-layout .microphone-control-group .microphone-settings-button { flex: 0 0 36px; min-width: 36px; }

/* Desktop question stage: the question owns the main canvas, video stays as PiP. */
.live-error {
  z-index: 30;
}

@media (min-width: 761px) {
  .live-view.is-quiz-active .video-column {
    --student-pip-width: clamp(160px, 20%, 240px);
  }

  .live-view.is-quiz-active .live-quiz {
    inset: 14px 14px 86px calc(var(--student-pip-width) + 28px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 17px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  }

  .live-view.is-quiz-active .video-shell {
    position: absolute;
    z-index: 25;
    top: 14px;
    left: 14px;
    width: var(--student-pip-width);
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111720;
    border: 3px solid rgba(255, 255, 255, .96);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
  }

  .live-view.is-quiz-active .video-shell.rost-live-room {
    height: auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }

  .live-view.is-quiz-active .video-shell .rost-live-room__status,
  .live-view.is-quiz-active .video-shell .rost-live-tile__meta {
    display: none;
  }

  .live-view.is-quiz-active .video-shell .rost-live-room__stage,
  .live-view.is-quiz-active .video-shell .rost-live-room__videos {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
  }

  .live-view.is-quiz-active .quiz-header {
    min-height: 36px;
    padding: 4px 12px;
  }

  .live-view.is-quiz-active .quiz-scroll {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(4, max-content);
    align-content: start;
    gap: 12px;
    padding: 0 12px 14px;
  }

  .live-view.is-quiz-active .quiz-image-wrap {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    width: calc(100% + 24px);
    max-height: none;
    margin: 0 -12px;
  }

  .live-view.is-quiz-active .live-quiz h2,
  .live-view.is-quiz-active .quiz-options,
  .live-view.is-quiz-active .quiz-submit,
  .live-view.is-quiz-active .quiz-result {
    grid-column: 1;
    min-width: 0;
  }

  .live-view.is-quiz-active .live-quiz h2 {
    grid-row: 2;
    margin-bottom: 0;
  }

  .live-view.is-quiz-active .quiz-options {
    grid-row: 3;
  }

  .live-view.is-quiz-active .quiz-submit {
    grid-row: 4;
  }

  .live-view.is-quiz-active .quiz-result {
    grid-row: 4;
    align-self: start;
  }

  .live-view.is-quiz-active .live-quiz:not(.has-image) .quiz-scroll {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-view.is-quiz-active .live-quiz:not(.has-image) h2,
  .live-view.is-quiz-active .live-quiz:not(.has-image) .quiz-options,
  .live-view.is-quiz-active .live-quiz:not(.has-image) .quiz-submit,
  .live-view.is-quiz-active .live-quiz:not(.has-image) .quiz-result {
    grid-column: 1;
    grid-row: auto;
  }

  .live-view.is-quiz-active .speech-status {
    display: none;
  }
}

@media (max-width: 760px) {
  .live-view.is-quiz-active .live-quiz {
    position: fixed;
    top: calc(52px + clamp(230px, calc(56.25vw + 55px), 360px));
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
  }

  .live-view.is-quiz-active .quiz-submit {
    position: sticky;
    z-index: 2;
    bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Student cabinet, September 2026. Intentionally scoped away from the live room. */
.login-view,
.lobby-view {
  --cabinet-bg: #111726;
  --cabinet-panel: #192132;
  --cabinet-accent: #b6a5ff;
  --ink: #f6f6fa;
  --muted: #b1b9ca;
  --line: #343d52;
  --success: #8be4b3;
  --success-soft: #193f36;
  color: var(--ink);
  background: var(--cabinet-bg);
  color-scheme: dark;
}
body[data-view="login"], body[data-view="lobby"] { background: #111726; }
.lobby-view { min-height: 100dvh; }
.lobby-view :is(button, a):focus-visible,
.login-view :is(button, a, input):focus-visible {
  outline: 3px solid var(--cabinet-accent);
  outline-offset: 4px;
}
.lobby-view .app-header {
  min-height: 88px;
  gap: 24px;
  padding: max(16px, env(safe-area-inset-top)) max(24px, calc((100vw - 1200px) / 2));
  background: rgba(17, 23, 38, .97);
  border-color: var(--line);
}
.lobby-view .brand { min-width: 0; }
.lobby-view .brand img,
.login-view .brand img {
  background: #fff;
  padding: 7px 10px;
  border-radius: 10px;
  object-position: center;
}
.lobby-view .brand > span:not(.brand-fallback),
.login-view .brand > span:not(.brand-fallback) { color: var(--muted); border-color: var(--line); font-size: 12px; }
.cabinet-nav { display: flex; gap: 28px; margin-left: auto; }
.cabinet-nav a { display: inline-flex; min-height: 44px; align-items: center; color: #c3c9d8; font-size: 13px; text-decoration: none; white-space: nowrap; }
.cabinet-nav a:hover { color: var(--cabinet-accent); }
.lobby-view .account-avatar { color: #d2c7ff; background: #2b2943; border: 1px solid #514872; }
.lobby-view .account-copy strong { max-width: 165px; font-size: 12px; }
.lobby-view .account-copy small { color: var(--muted); }
.lobby-view :is(.text-button, .refresh-button) { min-height: 44px; color: #bec5d5; font-size: 12px; }
.lobby-view :is(.text-button, .refresh-button):hover { background: #252b40; color: #e4ddff; }
.lobby-view .lobby-main { width: min(100% - 48px, 1200px); padding: 54px 0 24px; }
.cabinet-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 350px); align-items: center; gap: 50px; margin-bottom: 32px; }
.lobby-view .lobby-intro { max-width: none; margin: 0; }
.lobby-view .eyebrow { color: var(--cabinet-accent); font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.school-signature { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.school-signature i { width: 6px; height: 6px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); margin-right: 5px; }
.lobby-view .lobby-intro h1 { margin: 20px 0 16px; font-size: clamp(38px, 4.4vw, 56px); font-weight: 750; letter-spacing: -.05em; line-height: 1.08; overflow-wrap: anywhere; }
.lobby-view .lobby-intro h1 span { color: #c2b4ff; }
.lobby-view .lobby-intro p { font-size: 15px; line-height: 1.65; }
.cabinet-rhythm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; color: #c2c9d7; font-size: 12px; }
.cabinet-rhythm > span { color: var(--cabinet-accent); font-size: 20px; }
.cabinet-rhythm b { padding: 7px 10px; border: 1px solid #3c365b; border-radius: 8px; color: #d5caff; font-weight: 650; }
.next-lesson-card { position: relative; overflow: hidden; padding: 26px 28px 22px; color: #17172c; background: var(--cabinet-accent); border-radius: 22px; }
.next-lesson-card::before { content: ""; position: absolute; width: 170px; height: 170px; right: -100px; top: -66px; border: 1px solid rgba(38, 25, 77, .2); border-radius: 50%; box-shadow: 0 0 0 18px rgba(38, 25, 77, .035), 0 0 0 38px rgba(38, 25, 77, .03); pointer-events: none; }
.next-lesson-kicker { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; font-weight: 700; }
.next-lesson-kicker span:last-child { font-size: 24px; line-height: .8; }
.next-lesson-card > strong { display: block; margin-top: 28px; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
.next-lesson-time { margin: 8px 0 16px; font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.04em; }
.next-lesson-card p { font-size: 12px; line-height: 1.6; color: #373149; }
.next-lesson-card a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding-top: 12px; margin-top: 20px; border-top: 1px solid rgba(31, 21, 65, .24); color: #1a1730; font-size: 12px; font-weight: 750; text-decoration: none; }
.lobby-view .next-lesson-card a:focus-visible { outline-color: #26174b; }
.lobby-view .waiting-card { padding: 19px 24px; background: #171e2e; border: 1px solid var(--line); border-radius: 16px; box-shadow: none; }
.lobby-view .waiting-icon { background: #28243e; color: #c4b6ff; }
.lobby-view .waiting-card strong { color: #f0edf8; font-size: 14px; }
.lobby-view .waiting-card p { color: var(--muted); font-size: 12px; }
.lobby-view .active-card { background: #26233e; border: 1px solid #9a86e9; color: #f6f3ff; box-shadow: none; border-radius: 20px; }
.lobby-view .active-card::after { display: none; }
.lobby-view .active-card { scroll-margin-top: calc(130px + env(safe-area-inset-top)); }
.lobby-view .active-card-copy :is(p, span) { color: #d4cbe8; opacity: 1; }
.lobby-view .active-card .live-mark { color: #b6f0cc; }
.lobby-view .active-topic-chip { color: #e6dfff; background: #393050; border-color: #615082; }
.lobby-view .join-button { color: #191628; background: #b6a5ff; box-shadow: none; }
.lobby-view .join-button:hover { background: #c9bbff; color: #191628; }
.lobby-view :is(.schedule-section, .student-progress-section) { margin-top: 48px; scroll-margin-top: 118px; }
.lobby-view .section-heading { gap: 16px; margin-bottom: 26px; }
.lobby-view #studentSchedule > .section-heading { flex-wrap: wrap; align-items: flex-start; }
.lobby-view #studentSchedule > .section-heading > div { min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.lobby-view .section-heading h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 750; letter-spacing: -.04em; }
#scheduleSummary { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 0; margin-bottom: 16px; border-block: 1px solid var(--line); }
.calendar-toolbar h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.calendar-controls { display: flex; align-items: center; gap: 8px; }
.calendar-controls button { min-width: 44px; min-height: 44px; padding: 8px 12px; color: #d4cbe9; background: #1f2638; border: 1px solid #41435d; border-radius: 10px; font-size: 17px; }
.calendar-controls button:first-child { margin-right: 8px; font-size: 12px; }
.calendar-controls button:disabled { color: #b1b5c3; opacity: .65; cursor: default; }
.calendar-controls button:hover:not(:disabled) { background: #322b4a; border-color: #ab97eb; }
.lobby-view .calendar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lobby-view .calendar-lesson { grid-template-columns: 56px minmax(0, 1fr); min-height: 138px; gap: 18px; padding: 22px 20px; color: #e9e7f2; background: var(--cabinet-panel); border-color: #3c4156; border-radius: 16px; box-shadow: none; }
.lobby-view .calendar-lesson .slot-date { padding: 0; min-height: 0; align-self: start; background: transparent; color: #eeeafa; }
.lobby-view .calendar-lesson .slot-date strong { font-size: 34px; font-weight: 650; letter-spacing: -.04em; }
.lobby-view .calendar-lesson .slot-date :is(small, span) { display: block; color: #adb5c6; font-size: 11px; margin-top: 6px; font-weight: 600; }
.lobby-view .calendar-lesson .slot-copy { align-self: start; }
.lobby-view .calendar-lesson .slot-time { color: #c3b4fa; font-size: 12px; font-weight: 650; }
.lobby-view .calendar-lesson h3 { font-size: 14px; font-weight: 600; margin: 10px 0 8px; white-space: normal; line-height: 1.35; overflow: visible; }
.lobby-view .calendar-lesson .slot-meta { color: #b7becd; font-size: 11px; }
.lobby-view .calendar-lesson.is-past { background: #2b303a; border-color: #404650; }
.lobby-view .calendar-lesson.is-past :is(.slot-date, .slot-time) { color: #c1c4cc; }
.lobby-view .calendar-lesson.is-past h3 { color: #c4c7d0; }
.lobby-view .calendar-lesson.is-next,
.lobby-view .calendar-lesson.is-today { border-color: #b6a5ff; background: #28243f; }
.lobby-view .calendar-lesson.is-next .slot-meta,
.lobby-view .calendar-lesson.is-today .slot-meta { color: #d8cbff; }
.schedule-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; color: #b2bacb; font-size: 11px; }
.schedule-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.schedule-legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend-past { background: #697180; }
.legend-next { background: #b6a5ff; }
.schedule-legend small { width: 100%; line-height: 1.6; font-size: 11px; color: #aab3c6; }
.lobby-view .student-progress-summary > article,
.lobby-view .student-progress-card { background: var(--cabinet-panel); border-color: var(--line); box-shadow: none; border-radius: 16px; }
.lobby-view .student-progress-summary > article { min-height: 108px; padding: 20px; }
.lobby-view .student-progress-summary small { font-size: 12px; font-weight: 500; }
.lobby-view .progress-summary-icon.answered { color: #cabaff; background: #332b4c; }
.lobby-view :is(.progress-summary-icon.missed, .status-missed .student-progress-mark, .status-missed .student-progress-status, .is-incorrect .student-answer-result) { color: #ffb6bd; background: #452a36; }
.lobby-view .student-progress-card > header,
.lobby-view .student-lesson-item + .student-lesson-item,
.lobby-view .student-topic-item + .student-topic-item,
.lobby-view .student-answer-item + .student-answer-item { border-color: var(--line); }
.lobby-view .student-progress-card > header > div > span { color: #c9baff; background: #312b45; }
.lobby-view :is(.student-progress-detail, .student-answer-topics) { color: #b7c0d2; }
.lobby-view .student-lesson-topic { color: #cbd1df; background: #30394b; }
.lobby-view .student-topic-track { background: #323b4c; }
.lobby-view .student-topic-track i { background: #b6a5ff; }
.lobby-view .student-topic-metrics .is-missed { color: #ffb6bd; }
.lobby-view .student-answer-explanation { color: #c6cede; background: #242d40; }
.lobby-view .student-progress-empty { padding-block: 32px; }
.lobby-view .student-progress-empty.is-error,
.lobby-view .schedule-error { background: #412735; color: #ffc2cb; }
.lobby-view .how-to { max-width: none; margin-top: 38px; padding-top: 28px; border-color: var(--line); }
.lobby-view .how-to-icon { color: #bfb0ed; background: #25233b; }
.lobby-view .how-to p { max-width: 860px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.cabinet-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; padding-top: 24px; margin-top: 30px; border-top: 1px solid var(--line); font-size: 11px; color: #aab3c6; }
.cabinet-footer > span:first-child { font-weight: 750; color: #dde0e9; }
.cabinet-footer a { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; color: #cbbbff; text-decoration: none; }
.login-view { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); background-image: radial-gradient(ellipse at 50% 0%, #252342 0%, transparent 60%); }
.login-view::before, .login-view::after { display: none; }
.login-view .login-card { color: var(--ink); background: #192132; border: 1px solid #48435f; box-shadow: none; border-radius: 24px; }
.login-view .category-pill { color: #cab9ff; background: #332a4a; }
.login-view .login-school-name { color: #d0c3ff; }
.login-view .field > span { color: #dedee9; }
.login-view .field input { color: #f6f6fa; background: #111726; border-color: #4d556c; }
.login-view .field input::placeholder { color: #9ca6ba; }
.login-view .field input:focus { border-color: #b6a5ff; box-shadow: 0 0 0 3px rgba(182, 165, 255, .14); }
.login-view .primary-button { color: #181629; background: #b6a5ff; box-shadow: none; border-radius: 14px; }
.login-view .primary-button:hover { background: #c9bbff; }
.login-view .remember-token input { accent-color: #b6a5ff; }
.login-view .login-help { color: #b1b9ca; }
.login-view .field-error { color: #ffb8c0; }
@media (max-width: 1050px) {
  .lobby-view .app-header { gap: 16px; }
  .lobby-view .app-header .brand > span:not(.brand-fallback) { display: none; }
  .cabinet-nav { gap: 20px; }
  .cabinet-hero { gap: 28px; grid-template-columns: minmax(0, 1fr) 300px; }
  .lobby-view .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lobby-view .app-header { flex-wrap: wrap; gap: 6px 12px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
  .lobby-view .app-header .brand img { width: 98px; height: 38px; padding: 5px 8px; }
  .lobby-view .account { margin-left: auto; gap: 6px; }
  .lobby-view .account-avatar { width: 32px; height: 32px; font-size: 10px; }
  .cabinet-nav { order: 3; width: 100%; justify-content: center; gap: 36px; margin: 0; border-top: 1px solid #2d3549; }
  .cabinet-nav a { font-size: 12px; }
  .lobby-view .lobby-main { width: calc(100% - 32px); padding: 30px env(safe-area-inset-right) max(20px, env(safe-area-inset-bottom)) env(safe-area-inset-left); }
  .cabinet-hero { grid-template-columns: 1fr; gap: 24px; margin-bottom: 22px; }
  .lobby-view .lobby-intro h1 { font-size: 42px; margin-top: 18px; }
  .lobby-view .lobby-intro p { font-size: 14px; }
  .cabinet-rhythm { margin-top: 18px; }
  .next-lesson-card { padding: 22px 24px 16px; }
  .next-lesson-card > strong { margin-top: 20px; font-size: 21px; }
  .next-lesson-time { font-size: 30px; }
  .next-lesson-card p br { display: none; }
  .next-lesson-card a { margin-top: 14px; }
  .lobby-view .waiting-card { padding: 16px; gap: 14px; }
  .lobby-view .section-heading { align-items: flex-start; gap: 8px; }
  .lobby-view .section-heading h2 { font-size: 25px; }
  .lobby-view :is(.schedule-section, .student-progress-section) { margin-top: 36px; scroll-margin-top: calc(125px + env(safe-area-inset-top)); }
  .lobby-view .refresh-button { padding: 8px; font-size: 11px; }
  .calendar-toolbar { gap: 12px; }
  .calendar-toolbar h3 { font-size: 17px; }
  .calendar-controls { gap: 5px; }
  .calendar-controls button:first-child { font-size: 10px; margin: 0; padding-inline: 8px; }
  .lobby-view .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lobby-view .calendar-lesson { grid-template-columns: 1fr; gap: 16px; min-height: 0; padding: 18px 16px; }
  .lobby-view .calendar-lesson .slot-date { display: flex; align-items: baseline; gap: 8px; padding: 0; }
  .lobby-view .calendar-lesson .slot-date strong { font-size: 30px; }
  .lobby-view .calendar-lesson .slot-date :is(small, span) { margin: 0; font-size: 10px; }
  .lobby-view .calendar-lesson h3 { font-size: 12px; margin-block: 8px; }
  .lobby-view .calendar-lesson .slot-meta { font-size: 10px; }
  .lobby-view .student-progress-summary > article { padding: 16px 12px; min-height: 94px; gap: 10px; }
  .lobby-view .student-progress-summary strong { font-size: 26px; }
  .lobby-view .student-progress-summary small { font-size: 11px; }
  .lobby-view .progress-summary-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .cabinet-footer { gap: 8px 16px; font-size: 10px; }
  .cabinet-footer a { margin-left: 0; }
}
@media (max-width: 360px) {
  .lobby-view .lobby-intro h1 { font-size: 36px; }
  .calendar-toolbar { flex-direction: column; align-items: stretch; }
  .calendar-controls { justify-content: space-between; }
  .calendar-controls button:first-child { margin-right: auto; }
  .lobby-view .calendar-grid { grid-template-columns: 1fr; }
  .lobby-view .calendar-lesson { grid-template-columns: 54px minmax(0, 1fr); align-items: center; }
  .lobby-view .calendar-lesson .slot-date { display: grid; align-items: center; text-align: center; gap: 5px; }
  .lobby-view .calendar-lesson h3 { font-size: 14px; }
}

/* Approved student home hub. Scoped away from the live room and exam runner. */
:root { --cabinet-nav-height: 0px; --cabinet-safe-top: env(safe-area-inset-top, 0px); --cabinet-safe-right: env(safe-area-inset-right, 0px); --cabinet-safe-bottom: env(safe-area-inset-bottom, 0px); --cabinet-safe-left: env(safe-area-inset-left, 0px); }
.lobby-view [hidden] { display: none !important; }
.lobby-view:not(.exams-focused) .lobby-main { padding-top: 36px; padding-bottom: calc(var(--cabinet-nav-height) + 32px); }
.lobby-view:not(.exams-focused) .app-header { position: relative; flex-wrap: wrap; gap: 16px; backdrop-filter: none; }
.lobby-view .cabinet-nav { gap: 6px; align-items: center; min-width: 0; }
.lobby-view .cabinet-nav :is(a, button) { display: flex; align-items: center; justify-content: center; padding: 10px 12px; min-height: 44px; min-width: 0; white-space: normal; text-align: center; line-height: 1.35; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 13px; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.lobby-view .cabinet-nav [aria-current="page"] { background: #b6a5ff19; color: #d4caff; }
.lobby-view .cabinet-mobile-profile { display: none !important; }
.lobby-view .account-avatar { width: 44px; height: 44px; min-width: 44px; flex-shrink: 0; cursor: pointer; }
.lobby-view .account-copy { display: none; }
.hub-home, .hub-progress, .hub-cards > *, .hub-card-content, .hub-card-bottom, .hub-urgent > *, .hub-panel { min-width: 0; }
.hub-home :is(h1, h2, p, a, span), .hub-progress :is(h1, h2, p), .hub-profile, .hub-tabs, .hub-button { overflow-wrap: anywhere; }
.hub-intro { margin-bottom: 28px; }
.hub-intro h1, #studentProgressTitle { margin: 0 0 10px; font-size: 40px; line-height: 1.15; letter-spacing: -.035em; font-weight: 750; }
.hub-intro .eyebrow { display: block; margin-bottom: 10px; color: var(--muted); font-weight: 500; }
.hub-intro p { margin: 0; color: var(--muted); font-size: 16px; }
.hub-cards, .hub-progress-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hub-destination { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 12px; min-height: min(330px, 46dvh); padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--cabinet-panel); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.hub-destination:hover { border-color: #8276ac; transform: translateY(-2px); }
.hub-card-index { grid-column: 1 / -1; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.hub-card-content { grid-column: 1; grid-row: 2; align-self: center; }
.hub-card-content h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.12; letter-spacing: -.025em; }
.hub-card-content p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.hub-art { grid-column: 2; grid-row: 2; width: 100%; height: 185px; min-width: 0; align-self: center; }
.hub-art svg { display: block; width: 100%; height: 100%; }
.hub-card-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #c9c0e7; font-size: 13px; }
.hub-arrow { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #b6a5ff45; border-radius: 50%; background: #b6a5ff1a; font-size: 22px; color: #d4caff; }
.hub-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; max-width: 100%; min-width: 0; padding: 11px 20px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; line-height: 1.35; text-align: center; white-space: normal; text-decoration: none; cursor: pointer; }
.hub-button.primary { color: #19132c; background: var(--cabinet-accent); border-color: var(--cabinet-accent); }
.hub-button:hover { filter: brightness(1.12); }
.hub-button:disabled { opacity: .5; cursor: default; }
.hub-urgent { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 24px; padding: 18px 22px; border: 1px solid #7e72a9; border-radius: 18px; background: #29233f; }
.hub-urgent > div:first-child { flex: 1 1 220px; }
.hub-urgent strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.hub-urgent p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hub-urgent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-progress-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.hub-progress-summary h2 { margin: 0; font-size: 18px; }
.hub-progress-summary p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.hub-help { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 12px; color: var(--muted); font-size: 13px; }
.hub-help a { display: inline-flex; align-items: center; min-height: 44px; color: #c8baff; text-decoration: none; }
.hub-breadcrumb { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; color: var(--muted); font-size: 14px; text-decoration: none; }
.hub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.hub-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14px; text-decoration: none; }
.hub-tabs [aria-current="page"] { background: #b6a5ff20; border-color: #76669d; color: #d4caff; }
.hub-panel { padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--cabinet-panel); }
.hub-panel h2 { margin: 12px 0; font-size: 25px; }
.hub-panel p { color: var(--muted); font-size: 14px; }
.hub-panel .hub-button { margin-top: 20px; }
.hub-profile { width: min(480px, calc(100% - 32px)); max-width: calc(100% - 2 * max(var(--cabinet-safe-left), var(--cabinet-safe-right)) - 32px); max-height: calc(100dvh - 2 * max(var(--cabinet-safe-top), var(--cabinet-safe-bottom)) - 32px); overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--cabinet-panel); }
.hub-profile::backdrop { background: #000a; }
.hub-profile h2 { margin-top: 0; }
.hub-profile p { color: var(--muted); line-height: 1.6; }
#cabinetProfileName { color: var(--ink); font-weight: 700; }
.hub-profile-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.lobby-view [tabindex="-1"]:focus { outline: none; }
.lobby-view[data-cabinet-page="learning-progress"] .student-progress-section { margin-top: 0; }
.student-exams.is-solving > .hub-breadcrumb { display: none; }
body[data-view="lobby"] .toast-region { bottom: calc(max(var(--cabinet-nav-height), var(--cabinet-safe-bottom)) + 16px); max-width: calc(100% - 2 * max(var(--cabinet-safe-left), var(--cabinet-safe-right)) - 32px); }
@media (min-width: 761px) and (max-width: 1050px) {
  .lobby-view .cabinet-nav :is(a, button) { padding-inline: 8px; }
  .hub-destination { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 150px auto auto; gap: 10px; padding: 22px; }
  .hub-art { grid-column: 1; grid-row: 2; height: 150px; }
  .hub-card-content { grid-row: 3; }
  .hub-card-bottom { grid-row: 4; }
  .hub-card-content h2 { font-size: 29px; }
}
@media (max-width: 760px) {
  .lobby-view:not(.exams-focused) .app-header { min-height: 66px; flex-wrap: nowrap; padding: max(8px, var(--cabinet-safe-top)) max(16px, var(--cabinet-safe-right)) 8px max(16px, var(--cabinet-safe-left)); }
  .lobby-view .account { margin-left: auto; }
  .lobby-view #logoutButton { display: none; }
  .lobby-view.is-teacher-preview #logoutButton { display: inline-flex; min-height: 36px; padding: 7px 10px; font-size: 11px; }
  .teacher-preview-bar { align-items: stretch; padding: 10px max(16px, var(--cabinet-safe-right)) 10px max(16px, var(--cabinet-safe-left)); gap: 10px; }
  .teacher-preview-bar > div { display: grid; gap: 2px; flex: 1 1 auto; }
  .teacher-preview-bar strong { white-space: normal; }
  .teacher-preview-bar span { font-size: 10px; line-height: 1.3; }
  .teacher-preview-bar a { max-width: 128px; min-height: 44px; padding: 7px 10px; text-align: center; font-size: 10px; line-height: 1.25; }
  #lobbyView .cabinet-nav { position: fixed; z-index: 35; inset: auto 0 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 4px; margin: 0; padding: 6px max(8px, var(--cabinet-safe-right)) max(6px, var(--cabinet-safe-bottom)) max(8px, var(--cabinet-safe-left)); border-top: 1px solid var(--line); background: #111726; }
  #lobbyView .cabinet-nav :is(a, button) { font-size: 12px; padding: 10px 2px; min-height: 48px; }
  .lobby-view .cabinet-mobile-profile { display: flex !important; }
  .lobby-view .cabinet-desktop-progress { display: none !important; }
  .lobby-view:not(.exams-focused) .lobby-main { width: 100%; padding: 20px max(16px, var(--cabinet-safe-right)) calc(var(--cabinet-nav-height) + 40px) max(16px, var(--cabinet-safe-left)); }
  .hub-intro { margin-bottom: 18px; }
  .hub-intro h1, #studentProgressTitle { font-size: 29px; }
  .hub-intro p { font-size: 14px; }
  .hub-intro .eyebrow { font-size: 10px; margin-bottom: 6px; }
  .hub-cards, .hub-progress-panels { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hub-destination { grid-template-columns: minmax(0, 1fr) 94px; min-height: 182px; padding: 18px; gap: 10px; border-radius: 20px; }
  .hub-card-index { font-size: 10px; }
  .hub-card-content h2 { font-size: 25px; margin-bottom: 8px; }
  .hub-card-content p { font-size: 14px; line-height: 1.4; }
  .hub-art { height: 108px; }
  .hub-card-bottom { font-size: 12px; }
  .hub-arrow { width: 30px; height: 30px; font-size: 18px; }
  .hub-progress-summary { margin-top: 18px; padding-top: 16px; gap: 12px; }
  .hub-progress-summary p { font-size: 13px; }
  .hub-progress-summary .hub-button { padding: 10px 14px; }
  .hub-urgent { padding: 14px; margin-bottom: 16px; gap: 10px; }
  .hub-urgent strong { font-size: 15px; }
  .hub-urgent-actions { width: 100%; }
  .hub-urgent-actions .hub-button { flex: 1; font-size: 13px; padding: 9px 12px; }
  .hub-help { flex-direction: column; align-items: start; gap: 10px; }
  .hub-home.has-urgent .hub-intro { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hub-home.has-urgent .hub-destination { min-height: 116px; grid-template-columns: minmax(0, 1fr) 70px; grid-template-rows: 1fr; padding: 14px; gap: 6px; }
  .hub-home.has-urgent :is(.hub-card-index, .hub-card-bottom) { display: none; }
  .hub-home.has-urgent :is(.hub-card-content, .hub-art) { grid-row: 1; }
  .hub-home.has-urgent .hub-art { height: 78px; }
  .hub-home.has-urgent h2 { font-size: 23px; }
}
@media (max-width: 480px) {
  .hub-progress-summary { grid-template-columns: minmax(0, 1fr); }
  .hub-progress-summary .hub-button { justify-self: start; }
}
@media (max-width: 360px), (max-width: 760px) and (max-height: 740px) {
  .lobby-view:not(.exams-focused) .lobby-main { padding-top: 12px; }
  .hub-intro { margin-bottom: 12px; }
  .hub-intro .eyebrow { display: none; }
  .hub-intro h1 { font-size: 24px; margin-bottom: 4px; }
  .hub-intro p { font-size: 13px; }
  .hub-destination { min-height: 116px; grid-template-columns: minmax(0, 1fr) 64px; grid-template-rows: 1fr auto; padding: 14px; gap: 6px; border-radius: 16px; }
  .hub-card-index { display: none; }
  .hub-card-content, .hub-art { grid-row: 1; }
  .hub-card-content h2 { font-size: 23px; margin-bottom: 6px; }
  .hub-art { height: 74px; }
  .hub-card-bottom { grid-row: 2; }
  .hub-arrow { display: none; }
}
@media (min-width: 761px) and (max-height: 820px) {
  .lobby-view:not(.exams-focused) .lobby-main { padding-top: 20px; }
  .hub-intro { margin-bottom: 18px; }
  .hub-art { height: 130px; }
  .hub-destination { min-height: 260px; }
}
@media (orientation: landscape) and (max-height: 700px) {
  .hub-intro .eyebrow, .hub-intro p { display: none; }
  .hub-intro h1 { font-size: 24px; }
  .hub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-destination, .hub-home.has-urgent .hub-destination { min-height: 112px; grid-template-columns: minmax(0, 1fr) 64px; grid-template-rows: 1fr; padding: 12px; gap: 8px; }
  .hub-card-index, .hub-card-bottom { display: none; }
  .hub-card-content, .hub-art, .hub-home.has-urgent .hub-art { grid-row: 1; }
  .hub-art, .hub-home.has-urgent .hub-art { height: 76px; }
  .hub-card-content h2, .hub-home.has-urgent h2 { font-size: 22px; margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .hub-destination { transition: none; } }

/* Illustrated cabinet sections. Decorative art never carries student statistics. */
.lobby-view .hub-art img,
.lobby-view .hub-section-art { display: block; width: 100%; height: 100%; min-width: 0; object-fit: contain; pointer-events: none; }
.lobby-view .hub-art img { border-radius: 14px; }
.lobby-view .hub-section-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0 34px; }
.lobby-view .hub-section-card { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 22px; min-width: 0; min-height: 248px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--cabinet-panel); color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.lobby-view .hub-section-card:hover { border-color: #8276ac; transform: translateY(-2px); }
.lobby-view .hub-section-card-copy { min-width: 0; }
.lobby-view :is(.hub-section-card, .hub-illustrated-panel, .hub-attendance-heading, .hub-detail-card > header) :is(h2, h3, p, span) { overflow-wrap: anywhere; }
.lobby-view .hub-section-card h2 { margin: 12px 0; font-size: 29px; line-height: 1.12; letter-spacing: -.025em; }
.lobby-view .hub-section-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.lobby-view .hub-section-card > .hub-section-art { height: 170px; border-radius: 16px; }
.lobby-view .hub-section-link { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 16px; font-size: 13px; font-weight: 650; color: #d4caff; }
.lobby-view .hub-section-link > span { font-size: 20px; }
.lobby-view .hub-illustrated-panel { display: grid; grid-template-columns: minmax(0, 1fr) 160px; grid-template-rows: auto 1fr auto; align-items: center; gap: 18px 20px; min-height: 330px; padding: 28px; border-radius: 24px; }
.lobby-view .hub-illustrated-panel > .eyebrow { grid-column: 1 / -1; }
.lobby-view .hub-illustrated-panel > .hub-section-art { grid-column: 2; grid-row: 2; height: 185px; border-radius: 18px; }
.lobby-view .hub-panel-copy { grid-column: 1; grid-row: 2; min-width: 0; }
.lobby-view .hub-panel-copy h2 { margin: 0 0 12px; font-size: 29px; line-height: 1.13; letter-spacing: -.025em; }
.lobby-view .hub-panel-copy p { margin: 0; font-size: 14px; line-height: 1.55; }
.lobby-view .hub-panel-copy .hub-panel-summary { margin-top: 16px; color: #d4caff; }
.lobby-view .hub-illustrated-panel > .hub-button { grid-column: 1 / -1; margin-top: 0; justify-self: start; }
.lobby-view .cabinet-hero { grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 36px; }
.lobby-view .hub-next-lesson { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 8px 16px; min-width: 0; padding: 24px; color: var(--ink); background: var(--cabinet-panel); border: 1px solid #665782; }
.lobby-view .hub-next-lesson::before { display: none; }
.lobby-view .hub-next-lesson > .hub-section-art { grid-column: 2; grid-row: 2 / 5; height: 138px; align-self: center; border-radius: 14px; }
.lobby-view .hub-next-lesson > .next-lesson-kicker { grid-column: 1 / -1; color: #d4caff; }
.lobby-view .hub-next-lesson > strong { grid-column: 1; margin-top: 14px; font-size: 22px; overflow-wrap: anywhere; }
.lobby-view .hub-next-lesson > .next-lesson-time { grid-column: 1; margin: 0; font-size: 30px; overflow-wrap: anywhere; }
.lobby-view .hub-next-lesson > p { grid-column: 1; margin: 0; color: var(--muted); font-size: 12px; }
.lobby-view .hub-next-lesson > a { grid-column: 1 / -1; margin-top: 12px; border-color: var(--line); color: #d4caff; }
.lobby-view .hub-next-lesson > a:focus-visible { outline-color: var(--cabinet-accent); }
.lobby-view .hub-attendance-heading { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; align-items: center; gap: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--cabinet-panel); }
.lobby-view .hub-attendance-heading > div { min-width: 0; }
.lobby-view .hub-attendance-heading > .hub-section-art { height: 135px; border-radius: 16px; }
.lobby-view .hub-attendance-heading #studentProgressTitle { margin-top: 10px; }
.lobby-view .hub-detail-card > header { display: grid; grid-template-columns: minmax(0, 1fr) 106px; align-items: center; gap: 20px; min-height: 164px; padding: 24px; }
.lobby-view .hub-detail-card > header > .hub-section-art { height: 112px; border-radius: 14px; }
.lobby-view .hub-detail-card h3 { margin: 9px 0 7px; font-size: 23px; line-height: 1.15; }
.lobby-view .hub-detail-card header p { font-size: 13px; line-height: 1.5; }
.lobby-view .hub-detail-card .eyebrow { font-size: 10px; }
@media (min-width: 761px) and (max-width: 1050px) {
  .lobby-view .hub-section-card { grid-template-columns: minmax(0, 1fr) 106px; padding: 22px; gap: 16px; }
  .lobby-view .hub-section-card h2, .lobby-view .hub-panel-copy h2 { font-size: 25px; }
  .lobby-view .hub-section-card > .hub-section-art { height: 140px; }
  .lobby-view .hub-illustrated-panel { grid-template-columns: minmax(0, 1fr) 110px; padding: 24px; gap: 16px; }
  .lobby-view .hub-illustrated-panel > .hub-section-art { height: 145px; }
  .lobby-view .cabinet-hero { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 24px; }
}
@media (max-width: 760px) {
  .lobby-view .cabinet-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lobby-view .hub-section-cards { grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 20px 0 28px; }
  .lobby-view .hub-section-card { grid-template-columns: minmax(0, 1fr) 96px; min-height: 216px; padding: 20px; gap: 14px; border-radius: 20px; }
  .lobby-view .hub-section-card h2 { font-size: 25px; }
  .lobby-view .hub-section-card > .hub-section-art { height: 116px; }
  .lobby-view .hub-section-card .eyebrow { font-size: 10px; }
  .lobby-view .hub-section-link { margin-top: 12px; }
  .lobby-view .hub-illustrated-panel { grid-template-columns: minmax(0, 1fr) 96px; min-height: 260px; padding: 20px; gap: 16px 14px; border-radius: 20px; }
  .lobby-view .hub-panel-copy h2 { font-size: 25px; }
  .lobby-view .hub-illustrated-panel > .hub-section-art { height: 124px; }
  .lobby-view .hub-next-lesson { grid-template-columns: minmax(0, 1fr) 98px; gap: 8px 14px; padding: 20px; }
  .lobby-view .hub-next-lesson > .hub-section-art { height: 120px; }
  .lobby-view .hub-next-lesson > .next-lesson-time { font-size: 28px; }
  .lobby-view .hub-attendance-heading { grid-template-columns: minmax(0, 1fr) 88px; gap: 14px; padding: 20px; border-radius: 20px; }
  .lobby-view .hub-attendance-heading > .hub-section-art { height: 108px; }
  .lobby-view .hub-attendance-heading > .refresh-button { grid-column: 1 / -1; justify-self: start; }
  .lobby-view .hub-detail-card > header { grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; padding: 20px 16px; min-height: 142px; }
  .lobby-view .hub-detail-card > header > .hub-section-art { height: 94px; }
  .lobby-view .hub-detail-card h3 { font-size: 22px; }
}
@media (max-width: 360px) {
  .lobby-view .hub-section-card, .lobby-view .hub-illustrated-panel { grid-template-columns: minmax(0, 1fr) 76px; padding: 18px; gap: 14px 12px; }
  .lobby-view .hub-section-card h2, .lobby-view .hub-panel-copy h2 { font-size: 24px; }
  .lobby-view .hub-next-lesson { grid-template-columns: minmax(0, 1fr) 74px; padding: 18px; gap: 8px 12px; }
  .lobby-view .hub-next-lesson > strong { font-size: 20px; }
  .lobby-view .hub-next-lesson > .next-lesson-time { font-size: 26px; }
  .lobby-view .hub-attendance-heading { grid-template-columns: minmax(0, 1fr) 70px; padding: 18px; gap: 12px; }
  .lobby-view .hub-detail-card > header { grid-template-columns: minmax(0, 1fr) 68px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .lobby-view .hub-section-card { transition: none; } }
