:root {
  --red: #dc2626;
  --red-dark: #991b1b;
  --ink: #0f172a;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --panel: #eef2f7;
  --white: #fff;
  --green: #16a34a;
  --blue: #2563eb;
  --shadow: 0 18px 60px rgba(15, 23, 42, .10);
  --radius: 14px;
}

/* Secure classroom gate and student CRM schedule */
.live-gate-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: radial-gradient(circle at 15% 10%, rgba(239, 68, 68, .18), transparent 30%), linear-gradient(135deg, #0b1120 0%, #111827 52%, #07111f 100%);
  color: #f8fafc;
}

.live-gate-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 24px;
}

.live-gate-copy,
.live-gate-side {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(15, 23, 42, .82);
  box-shadow: 0 24px 70px rgba(0,0,0,.32);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 42px);
}

.live-gate-copy h1 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: .98;
  letter-spacing: 0;
}

.live-gate-copy p,
.live-gate-side p,
.live-gate-side li {
  color: #cbd5e1;
  line-height: 1.65;
}

.live-gate-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.live-gate-details span {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #f8fafc;
  font-weight: 800;
}

.live-gate-details b {
  color: #94a3b8;
  font-size: .72rem;
  text-transform: uppercase;
}

.live-gate-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.live-gate-actions .btn,
.live-gate-actions .link-soft {
  min-height: 44px;
}

.live-gate-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.live-gate-side ul {
  margin: 18px 0 0;
  padding-left: 18px;
}

.student-teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.student-teacher-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.student-teacher-card h3,
.student-schedule-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: 0;
}

.student-teacher-card p,
.student-schedule-item p {
  margin: 0;
  color: var(--muted);
}

.teacher-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.teacher-kpis span {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  font-size: .78rem;
}

.teacher-kpis b {
  color: var(--ink);
  font-size: .95rem;
}

.student-teacher-card .link-soft {
  grid-column: 1 / -1;
}

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

.student-schedule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.schedule-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-meta span {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 900;
  font-size: .78rem;
}

@media (max-width: 860px) {
  .live-gate-card,
  .live-gate-details,
  .student-schedule-item {
    grid-template-columns: 1fr;
  }

  .schedule-meta {
    justify-content: flex-start;
  }
}

/* Professional auth and live classroom overrides */
.auth-body .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.auth-body .auth-page {
  min-height: auto;
  grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
}

.auth-body .auth-top {
  display: none;
}

.auth-body .auth-brand {
  padding-top: 42px;
}

.auth-body .auth-form {
  align-items: center;
}

.auth-body .divider,
.auth-body .social-row,
.auth-body .form-row a[href="#"],
.classroom-lobby .join-options {
  display: none;
}

.study-body {
  background: #f6f7fb;
}

.study-page {
  min-height: 100vh;
  background: #f6f7fb;
}

.study-hero {
  background: #111827;
  color: #fff;
  padding: 28px 0;
}

.study-hero .wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 170px;
  gap: 22px;
  align-items: center;
}

.study-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: 0;
}

.study-hero p {
  margin: 0;
  color: #cbd5e1;
}

.study-progress {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.study-progress b {
  display: block;
  font-size: 30px;
}

.study-progress span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.study-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  padding-block: 24px 40px;
}

.study-sidebar,
.study-reader,
.study-work article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}

.study-sidebar {
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 92px;
}

.study-sidebar h2,
.study-task h2,
.study-work h3 {
  margin: 0;
  letter-spacing: 0;
}

.study-sidebar p,
.study-task p,
.study-work p {
  color: var(--muted);
  line-height: 1.65;
}

.study-sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.study-sidebar a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
}

.study-sidebar a.on {
  border-color: rgba(220, 38, 38, .38);
  background: #fff5f5;
}

.study-sidebar a.done {
  border-color: rgba(22, 163, 74, .32);
}

.study-sidebar a span {
  font-weight: 900;
}

.study-sidebar a small {
  color: var(--muted);
  font-weight: 800;
}

.study-reader {
  padding: 18px;
  min-width: 0;
}

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

.study-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  padding-top: 18px;
}

.study-pdf {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  min-height: 680px;
}

.study-pdf iframe {
  width: 100%;
  height: 100%;
  min-height: 680px;
  border: 0;
  background: #fff;
}

.study-work {
  display: grid;
  gap: 14px;
  align-content: start;
}

.study-work article {
  padding: 16px;
}

.study-notes-form {
  display: grid;
  gap: 12px;
}

.study-notes-form textarea {
  min-height: 150px;
  resize: vertical;
}

.study-check {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.study-preview-note {
  color: var(--muted);
}

.exam-body {
  background: #f6f7fb;
}

.exam-page {
  min-height: 100vh;
  background: #f6f7fb;
}

.exam-hero {
  background: #111827;
  color: #fff;
  padding: 28px 0;
}

.exam-hero .wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 210px;
  gap: 22px;
  align-items: center;
}

.exam-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: 0;
}

.exam-hero p {
  margin: 0;
  color: #cbd5e1;
}

.exam-shell {
  padding-block: 24px 42px;
}

.exam-form {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.exam-question {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}

.exam-question > div:first-child {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.exam-question > div:first-child > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fee2e2;
  color: var(--red);
  font-weight: 900;
  flex: 0 0 auto;
}

.exam-question h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.exam-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.exam-options label {
  display: grid;
  grid-template-columns: auto 28px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
}

.exam-options label.correct {
  border-color: rgba(22, 163, 74, .45);
  background: #f0fdf4;
}

.exam-options label.wrong {
  border-color: rgba(220, 38, 38, .45);
  background: #fef2f2;
}

.exam-options b {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.exam-explain {
  margin: 6px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.exam-result-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.exam-result-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  margin: 8px 0;
}

.exam-result-card p {
  margin-bottom: 12px;
}

.exam-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.exam-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 18px;
  min-height: 190px;
}

.exam-card h3 {
  margin: 4px 0 8px;
}

.exam-card p {
  color: var(--muted);
  margin: 0;
  font-weight: 700;
}

.exam-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  align-self: end;
}

.exam-public-card {
  display: grid;
  gap: 12px;
}

.classroom-lobby {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, .16), transparent 32%),
    linear-gradient(180deg, #10131a 0%, #0b0f17 100%);
}

.lobby-main,
.lobby-side {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15, 23, 42, .82);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.lobby-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 68px);
  border-radius: 18px;
}

.lobby-badge {
  width: fit-content;
  background: rgba(220, 38, 38, .16);
  border: 1px solid rgba(248, 113, 113, .35);
  color: #fecaca;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.lobby-main h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  margin: 18px 0 16px;
}

.lobby-main p {
  max-width: 680px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.65;
}

.live-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.live-meta-grid span,
.lobby-panel {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 14px;
  color: #e5e7eb;
}

.live-meta-grid b,
.lobby-panel strong {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lobby-main label {
  color: #e5e7eb;
  font-weight: 800;
}

.lobby-main input {
  background: #fff;
  color: var(--ink);
}

.lobby-actions {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  align-items: center;
  gap: 12px;
}

.lobby-side {
  border-radius: 18px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.live-orbit {
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: #111827;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.live-orbit span,
.live-orbit i {
  position: absolute;
  border: 1px solid rgba(248,113,113,.35);
  inset: 36px;
  border-radius: 28px;
}

.live-orbit i {
  inset: 72px 48px;
  border-color: rgba(148,163,184,.28);
}

.live-orbit b {
  position: relative;
  font-size: 28px;
  letter-spacing: 0;
}

.lobby-panel span {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.classroom-shell {
  background: #0b0f17;
}

.cls-header {
  min-height: 72px;
  background: rgba(17, 24, 39, .96);
}

.cls-header .live-title {
  min-width: 0;
}

.cls-header .live-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(46vw, 680px);
}

.video-stage {
  padding: 18px;
}

.video-frame {
  height: 100%;
  min-height: calc(100vh - 166px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  background: #020617;
  position: relative;
}

.video-stage iframe {
  border-radius: 0;
  min-height: 100%;
}

.live-connection-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(15, 23, 42, .84);
  color: #e5e7eb;
  box-shadow: 0 14px 34px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
}

.live-connection-tools span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.live-connection-tools button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.lesson-panel {
  width: 390px;
}

.chat-box form {
  grid-template-columns: 1fr 86px;
}

.chat-box button {
  width: auto;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.control-bar {
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(17, 24, 39, .96);
}

.control-bar span {
  color: #cbd5e1;
  font-weight: 900;
  margin-right: auto;
}

@media (max-width: 980px) {
  .auth-body .auth-page,
  .classroom-lobby,
  .classroom-layout {
    grid-template-columns: 1fr;
  }

  .lobby-side {
    display: none;
  }

  .lesson-panel {
    width: auto;
    min-height: 420px;
  }

  .live-meta-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 680px) {
  .classroom-lobby {
    padding: 18px;
  }

  .lobby-main {
    padding: 24px;
  }

  .lobby-actions,
  .live-meta-grid,
  .join-options {
    grid-template-columns: 1fr;
  }

  .cls-header {
    gap: 8px;
    min-height: 86px;
  }

  .cls-header .brand span:not(.brand-mark),
  .cls-header .live-title strong {
    display: none;
  }
}

/* Final responsive containment: panels keep their own overflow on narrow screens. */
.panel-app,
.panel-main,
.panel-main .page,
.panel-main .card,
.panel-main .grid-2,
.panel-main .grid-3,
.panel-main .stat-grid,
.panel-main .toolbar,
.panel-main .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.panel-main .card {
  overflow: hidden;
}

.panel-main .table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.toolbar [data-table-count] {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap tr[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .panel-main .grid-2,
  .panel-main .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-main .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .panel-main .toolbar input,
  .panel-main .toolbar select {
    flex: 1 1 180px;
  }
}

@media (max-width: 640px) {
  .panel-main {
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
    margin-left: 64px;
    padding: 76px 10px 30px;
  }

  .panel-top {
    padding: 0 10px 0 72px;
  }

  .panel-top .brand {
    gap: 6px;
    font-size: 15px;
  }

  .panel-top .brand-mark {
    width: 32px;
    height: 32px;
  }

  .panel-top .logo-suffix {
    display: none;
  }

  .panel-user > span {
    display: none;
  }

  .page.on {
    width: 100%;
    max-width: 100%;
  }

  .page-head {
    margin-bottom: 18px;
  }

  .page-head h1 {
    font-size: 25px;
    line-height: 1.12;
  }

  .page-head p {
    font-size: 13px;
  }

  .card,
  .stat-card {
    padding: 15px;
  }

  .card-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .panel-main .table-wrap table {
    min-width: 620px;
  }

  .panel-main .toolbar > * {
    flex: 1 1 100%;
    width: 100%;
  }

  .toolbar [data-table-count] {
    margin-left: 0;
  }
}

/* Classroom remains usable on phone without clipping teacher or student tools. */
@media (max-width: 680px) {
  .classroom-shell {
    grid-template-rows: auto auto auto;
    width: 100%;
    min-height: 100dvh;
  }

  .cls-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 64px;
    padding: 8px;
  }

  .cls-header .brand {
    min-width: 34px;
  }

  .cls-header .brand > span:not(.brand-mark),
  .cls-header .logo-suffix {
    display: none;
  }

  .cls-header .live-title {
    min-width: 0;
    justify-content: center;
    gap: 5px;
  }

  .cls-header .live-title strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cls-header .live-title span {
    display: none;
  }

  .cls-header .live-title small {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .classroom-actions {
    display: flex;
    gap: 4px;
  }

  .classroom-actions .btn,
  .classroom-actions .link-soft {
    min-height: 34px;
    padding: 0 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .classroom-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .video-stage {
    width: 100%;
    padding: 0;
  }

  .video-frame,
  .jitsi-api-frame,
  .video-stage iframe {
    width: 100%;
    min-height: 55dvh;
    border-radius: 0;
  }

  .live-connection-tools {
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px;
  }

  .live-connection-tools > * {
    flex: 0 0 auto;
  }

  .lesson-panel {
    width: 100%;
    min-height: 440px;
  }

  .lesson-panel .tabs {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
  }

  .lesson-panel .tabs button {
    flex: 1 0 76px;
    min-height: 48px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .control-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    width: 100%;
    max-width: 100vw;
    justify-content: flex-start;
    gap: 7px;
    overflow-x: auto;
    padding: 9px;
  }

  .control-bar > * {
    flex: 0 0 auto;
  }

  .control-bar > span {
    display: none;
  }

  .control-bar button,
  .control-bar a {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .panel-top .logo-suffix {
    display: none;
  }
}

/* Professional live classroom override */
.classroom-body {
  background: #080b12;
  color: #f8fafc;
}

.classroom-page {
  min-height: 100vh;
  background: #080b12;
}

.classroom-lobby {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 28px;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.lobby-main,
.lobby-side,
.video-frame,
.lesson-panel {
  border: 1px solid rgba(226, 232, 240, .12);
  background: #111827;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.lobby-main,
.lobby-side {
  border-radius: 8px;
  padding: 28px;
}

.lobby-main h1 {
  margin: 12px 0 10px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.02;
  color: #fff;
  letter-spacing: 0;
}

.lobby-main p,
.lobby-main label,
.lobby-side {
  color: #cbd5e1;
}

.live-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.live-meta-grid span {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(226, 232, 240, .1);
  color: #e2e8f0;
  font-weight: 900;
}

.live-meta-grid b {
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
}

.classroom-lobby .join-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.classroom-lobby .join-options label {
  width: auto;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0f172a;
}

.classroom-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr) 74px;
}

.cls-header {
  padding: 0 24px;
  background: #0f172a;
  border-bottom: 1px solid rgba(226, 232, 240, .12);
}

.cls-header .brand {
  color: #fff;
}

.live-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
}

.live-title strong {
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.live-title span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.live-title small {
  color: #cbd5e1;
  font-weight: 900;
}

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

.classroom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  min-height: 0;
  background: #080b12;
}

.video-stage {
  min-width: 0;
  padding: 18px;
  background: #080b12;
}

.video-frame {
  position: relative;
  min-height: calc(100vh - 186px);
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #020617;
}

.jitsi-api-frame,
.jitsi-api-frame iframe,
.video-stage iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 186px);
  border: 0;
  background: #020617;
}

.live-connection-tools {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  width: auto;
  pointer-events: none;
}

.live-connection-tools span,
.live-connection-tools button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
  pointer-events: auto;
}

.live-connection-tools span {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(12px);
}

.live-connection-tools button {
  padding: 0 14px;
  background: #dc2626;
}

.lesson-panel {
  min-width: 0;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  background: #111827;
}

.lesson-panel .tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid rgba(226, 232, 240, .1);
}

.lesson-panel .tabs button {
  min-height: 58px;
  border: 0;
  border-right: 1px solid rgba(226, 232, 240, .08);
  background: #172033;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
}

.lesson-panel .tabs button.on {
  background: #dc2626;
  color: #fff;
}

.live-tab {
  display: none;
  flex: 1;
  min-height: 0;
}

.live-tab.on {
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.messages p {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2937;
  color: #e5e7eb;
  line-height: 1.45;
}

.chat-box form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(226, 232, 240, .1);
}

.chat-box input,
.notes-box textarea {
  border: 1px solid rgba(226, 232, 240, .14);
  background: #1f2937;
  color: #fff;
}

.chat-box button {
  width: auto;
  min-height: 48px;
  border-radius: 8px;
  border: 0;
  background: #dc2626;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.board-box,
.notes-box,
.people-box,
.rooms-box {
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.board-command-strip,
.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-command-strip {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, .1);
  background: #172033;
}

.board-command-strip span,
.tool-head span,
.host-tools p,
.room-tools p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
}

.board-command-strip button,
.host-command-grid button,
.room-tools button,
.participant-row button,
.wb-tools button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.wb-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wb-tools button.on {
  background: #16a34a;
}

.wb-tools button:disabled,
.wb-tools input:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.wb-tools input[type=color],
.wb-tools input[type=range] {
  min-height: 38px;
  margin: 0;
}

.board-box canvas {
  width: 100%;
  max-height: min(56vh, 620px);
  border: 1px solid rgba(226, 232, 240, .12);
  border-radius: 8px;
  background: #fff;
}

.notes-box textarea {
  flex: 1;
  min-height: 360px;
  resize: vertical;
}

.host-tools,
.room-tools,
.participant-row,
.room-grid span {
  border: 1px solid rgba(226, 232, 240, .1);
  border-radius: 8px;
  background: #172033;
}

.host-tools,
.room-tools {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

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

.participant-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.participant-row > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.participant-row strong {
  display: block;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-row small {
  color: #94a3b8;
}

.participant-row button {
  padding: 0 12px;
  background: #243047;
}

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

.room-grid span {
  display: block;
  padding: 12px;
  color: #e5e7eb;
  font-weight: 900;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #0f172a;
  border-top: 1px solid rgba(226, 232, 240, .12);
}

.control-bar span {
  margin-right: auto;
  color: #e2e8f0;
  font-weight: 900;
}

.control-bar button,
.control-bar a {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #1f2937;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.control-bar .red,
.control-bar a.red {
  background: #dc2626;
}

@media (max-width: 1180px) {
  .classroom-layout {
    grid-template-columns: 1fr;
  }

  .lesson-panel {
    border-left: 0;
    border-top: 1px solid rgba(226, 232, 240, .12);
    min-height: 460px;
  }

  .video-frame,
  .jitsi-api-frame,
  .jitsi-api-frame iframe,
  .video-stage iframe {
    min-height: 580px;
  }
}

@media (max-width: 760px) {
  .classroom-lobby {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 560px);
  }

  .live-meta-grid,
  .host-command-grid,
  .room-grid {
    grid-template-columns: 1fr;
  }

  .classroom-shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .cls-header {
    gap: 12px;
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .live-title {
    order: 3;
    width: 100%;
    justify-items: start;
  }

  .live-title strong {
    max-width: 100%;
  }

  .video-stage {
    padding: 10px;
  }

  .video-frame,
  .jitsi-api-frame,
  .jitsi-api-frame iframe,
  .video-stage iframe {
    min-height: 460px;
  }

  .lesson-panel .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-command-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-box form {
    grid-template-columns: 1fr;
  }

  .participant-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .participant-row button {
    grid-column: 1 / -1;
  }

  .control-bar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .control-bar span {
    display: none;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--white);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg, canvas, iframe { max-width: 100%; }

.wrap {
  width: min(1136px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
}

.brand span span {
  color: var(--red);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .28);
}

.logo-suffix {
  margin-left: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  color: #475569;
  font-weight: 600;
  font-size: 14px;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--red);
}

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

.btn,
.btn-ghost,
.soft,
.link-soft {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  font-weight: 800;
  font-size: 14px;
}

.btn-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 14px 28px rgba(220, 38, 38, .20);
}

.btn-red:hover { background: #b91c1c; }
.btn-white { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 12px 30px rgba(15, 23, 42, .08); }
.btn-ghost { color: #475569; background: transparent; }
.btn-dark-outline { color: #fff; border-color: rgba(255,255,255,.35); }
.btn-lg { min-height: 50px; padding-inline: 28px; }
.btn.sm, .soft, .link-soft { min-height: 34px; padding-inline: 14px; font-size: 13px; }
.soft, .link-soft { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: none; }
.soft.on { border-color: var(--red); color: var(--red); background: #fff1f2; }
.soft.danger { color: var(--red); }
.full { width: 100%; }

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  vertical-align: middle;
}

.inline-form button {
  white-space: nowrap;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  margin-left: auto;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 4px auto;
}

.hero2 {
  min-height: 512px;
  padding: 72px 0 54px;
  background:
    radial-gradient(circle at 78% 20%, rgba(220, 38, 38, .08), transparent 34%),
    linear-gradient(180deg, #fff 0%, #f8fafc 55%, #f1f5f9 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  gap: 54px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: var(--red);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 18px;
}

.pill span {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(220, 38, 38, .10);
}

.hero-copy h1 {
  margin: 0;
  font-size: 50px;
  line-height: 1.05;
  letter-spacing: 0;
  color: #080b12;
}

.hero-copy h1 span {
  display: block;
  color: transparent;
  background: linear-gradient(135deg, var(--red), #7c3aed);
  background-clip: text;
}

.hero-copy p {
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  max-width: 580px;
}

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

.check-row {
  margin-top: 28px;
  color: #64748b;
  font-size: 13px;
}

.check-row span { margin-left: 8px; }

.hero-visual {
  min-height: 360px;
  position: relative;
}

.avatar-stack {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  z-index: 2;
}

.avatar-stack span,
.avatar-stack strong,
.teacher-bubble span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #2563eb);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.avatar-stack span + span,
.avatar-stack strong {
  margin-left: -10px;
}

.avatar-stack strong {
  background: #111827;
  font-size: 12px;
}

.float-card {
  position: absolute;
  background: rgba(255,255,255,.93);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.float-card.live {
  top: 42px;
  left: 40px;
  width: 260px;
  padding: 20px;
}

.float-card.live small,
.float-card.test small,
.float-card.mini small {
  color: #94a3b8;
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.float-card.live div {
  display: flex;
  gap: 8px;
  padding: 14px 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.float-card.live div span {
  font-size: 12px;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 8px;
}

.float-card.live em {
  position: absolute;
  top: 20px;
  right: 18px;
  font-style: normal;
  color: var(--red);
  background: #fee2e2;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.float-card.mini {
  width: 130px;
  padding: 18px;
  text-align: center;
}

.float-card.mini b {
  display: block;
  font-size: 24px;
  margin-top: 6px;
}

.float-card.one { top: 40px; right: 38px; }
.float-card.two { left: 104px; bottom: 44px; }

.teacher-bubble {
  position: absolute;
  left: 20px;
  bottom: 132px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px 10px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 2;
}

.teacher-bubble strong {
  color: var(--red);
  font-size: 14px;
}

.teacher-bubble small {
  grid-column: 1 / -1;
  color: #64748b;
  font-weight: 800;
}

.float-card.test {
  right: 16px;
  top: 162px;
  width: 210px;
  padding: 18px;
  transform: rotate(3deg);
}

.bar {
  height: 7px;
  background: #f1f5f9;
  border-radius: 99px;
  margin: 14px 0 10px;
  overflow: hidden;
}

.bar i {
  display: block;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #f97316);
}

.partner-strip {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.partner-strip p,
.section-head span,
.subhero span,
.eyebrow {
  color: var(--red);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
}

.partner-strip div div {
  display: flex;
  gap: 44px;
  justify-content: center;
  flex-wrap: wrap;
  color: #94a3b8;
  font-weight: 800;
}

.section {
  padding: 72px 0;
}

.section.light {
  background: var(--soft);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.section-head.left {
  text-align: left;
  margin-left: 0;
}

.section-head h2,
.subhero h1,
.cta-dark h2 {
  margin: 8px 0 12px;
  color: var(--ink);
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: 0;
}

.section-head p,
.subhero p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

.feature-grid,
.level-grid,
.process-grid,
.testimonial-grid,
.teacher-grid,
.room-grid {
  display: grid;
  gap: 20px;
}

.feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-grid.classroom-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.process-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.testimonial-grid, .teacher-grid, .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.testimonial-grid.two,
.teacher-grid.single {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 820px;
  margin-inline: auto;
}

.teacher-grid.single {
  grid-template-columns: minmax(280px, 420px);
}

.feature-card,
.level-card,
.process-card,
.testimonial-grid article,
.teacher-card,
.room-card,
.certificate-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .05);
}

.feature-card div,
.process-card div,
.room-card span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff1f2;
  color: var(--red);
  font-weight: 900;
}

.feature-card h3,
.level-card h3,
.process-card h3,
.teacher-card h3,
.room-card h3 {
  margin: 16px 0 8px;
  color: var(--ink);
}

.feature-card p,
.level-card p,
.process-card p,
.teacher-card p,
.room-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.feature-card strong {
  display: block;
  margin-bottom: 10px;
  color: #334155;
}

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

.home-stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.home-stats b {
  display: block;
  color: var(--red);
  font-size: 28px;
}

.home-stats span {
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
}

.level-card span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--red);
  color: #fff;
  border-radius: 14px;
  font-weight: 900;
}

.level-card small,
.process-card small {
  display: block;
  margin-top: 16px;
  color: var(--red);
  font-weight: 900;
}

.level-card ul,
.check-list {
  padding-left: 18px;
  color: #475569;
  line-height: 1.8;
}

.classroom-grid,
.certificate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.mini-feature {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 14px;
  margin-top: 12px;
}

.mini-feature p {
  color: var(--muted);
  margin-bottom: 0;
}

.classroom-mock {
  border: 1px solid var(--line);
  background: #0f172a;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.screen-head {
  height: 28px;
  display: flex;
  gap: 7px;
}

.screen-head span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #94a3b8;
}

.screen-main {
  height: 280px;
  background: #f8fafc;
  border-radius: 14px;
  padding: 20px;
}

.teacher-tile {
  width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  font-weight: 800;
}

.board-lines {
  width: 72%;
  height: 140px;
  margin: 35px auto 0;
  background: repeating-linear-gradient(180deg, transparent, transparent 22px, #e2e8f0 23px);
}

.control-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 16px;
}

.control-row i {
  width: 38px;
  height: 38px;
  border-radius: 99px;
  background: #1e293b;
}

.certificate-card {
  width: min(360px, 100%);
  margin: auto;
  text-align: center;
  border: 8px solid #f8fafc;
}

.certificate-card h3 {
  font-size: 34px;
  margin: 12px 0;
}

.qr {
  width: 88px;
  height: 88px;
  margin: 20px auto;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 20px 20px,
    #fff;
  border: 8px solid #fff;
  box-shadow: inset 0 0 0 2px #111;
}

.teacher-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reference-teacher small {
  color: #64748b;
  font-weight: 800;
}

/* Reference-home parity pass */
.home-ref .site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #e2e8f0;
}

.home-ref .nav-wrap {
  min-height: 64px;
  max-width: 1200px;
}

.home-ref main {
  padding-top: 64px;
}

.home-ref .brand {
  font-size: 18px;
}

.home-ref .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: none;
}

.home-ref .site-nav {
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 0;
}

.home-ref .site-nav a {
  padding: 8px 12px;
  border-radius: 6px;
}

.home-ref .nav-actions {
  margin-left: auto;
}

.home-ref .btn,
.home-ref .btn-ghost {
  min-height: 38px;
  padding-inline: 18px;
  font-size: 13px;
}

.home-ref .hero2 {
  min-height: 424px;
  padding: 72px 0 56px;
  background:
    radial-gradient(circle at 86% 7%, rgba(220, 38, 38, .10), transparent 32%),
    radial-gradient(circle at 5% 96%, rgba(124, 58, 237, .07), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f8fafc 55%, #f1f5f9 100%);
}

.home-ref .hero-grid {
  max-width: 1200px;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: 48px;
}

.home-ref .hero-copy h1 {
  max-width: 520px;
  font-size: 48px;
  letter-spacing: -0.03em;
}

.home-ref .hero-copy p {
  max-width: 440px;
  font-size: 16px;
  margin: 14px 0 24px;
}

.home-ref .pill {
  padding: 6px 14px;
  font-size: 12px;
  margin-bottom: 16px;
}

.home-ref .hero-actions .btn {
  min-height: 46px;
  padding-inline: 28px;
  font-size: 15px;
}

.home-ref .check-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

.home-ref .check-row span {
  margin-left: 0;
}

.home-ref .hero-visual {
  min-height: 360px;
}

.home-ref .avatar-stack {
  left: auto;
  right: 238px;
  top: 246px;
}

.home-ref .avatar-stack span,
.home-ref .avatar-stack strong,
.home-ref .teacher-bubble span {
  width: 28px;
  height: 28px;
  border-width: 2px;
  font-size: 10px;
  box-shadow: none;
}

.home-ref .avatar-stack strong {
  font-size: 9px;
}

.home-ref .float-card {
  border-radius: 16px;
  border-color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0,0,0,.10);
}

.home-ref .float-card.live {
  width: 260px;
  top: 36px;
  left: 56px;
}

.home-ref .float-card.one {
  width: 130px;
  top: 42px;
  right: 48px;
}

.home-ref .float-card.test {
  width: 200px;
  top: 168px;
  right: 18px;
  transform: rotate(2deg);
}

.home-ref .float-card.two {
  left: 136px;
  bottom: 42px;
  width: 170px;
}

.home-ref .teacher-bubble {
  left: 76px;
  bottom: 106px;
  width: 210px;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.home-ref .teacher-bubble small {
  grid-column: auto;
  white-space: nowrap;
}

.home-ref .partner-strip {
  padding: 24px 0;
}

.home-ref .partner-strip p,
.home-ref .section-head span {
  letter-spacing: .08em;
}

.home-ref .section {
  padding: 64px 0;
}

.home-ref .section-head {
  margin-bottom: 32px;
}

.home-ref .section-head h2 {
  font-size: 36px;
  letter-spacing: -0.02em;
}

.home-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
  align-items: center;
  gap: 48px;
}

.feature-list-ref {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.feature-row-ref {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: .15s;
}

.feature-row-ref:hover {
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(220,38,38,.06);
}

.feature-row-ref > div {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--red);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.feature-row-ref h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 14px;
}

.feature-row-ref p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.home-ref .home-stats {
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-ref .home-stats article {
  padding: 20px;
  text-align: left;
  border-radius: 16px;
  box-shadow: none;
}

.home-ref .home-stats b {
  font-size: 28px;
  line-height: 1;
}

.level-track-ref {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0 0;
}

.level-track-ref::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,#ef4444,#f97316,#eab308,#22c55e,#3b82f6,#8b5cf6);
  border-radius: 3px;
}

.level-item-ref {
  position: relative;
  flex: 1;
  min-width: 150px;
  text-align: center;
  z-index: 1;
}

.level-dot-ref {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  font-weight: 800;
}

.level-card-ref {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  transition: .2s;
}

.level-card-ref:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  transform: translateY(-4px);
}

.level-card-ref small {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.level-card-ref h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
}

.level-card-ref p {
  margin: 0 0 8px;
  color: #94a3b8;
  font-size: 13px;
}

.level-card-ref ul {
  padding: 0;
  margin: 0;
  color: #64748b;
  line-height: 2;
  font-size: 13px;
}

.level-card-ref li {
  list-style: none;
  position: relative;
  padding-left: 16px;
}

.level-card-ref li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 11px;
}

.home-ref .classroom-cards,
.home-ref .process-grid {
  gap: 20px;
}

.home-ref .level-card-ref li::before {
  content: "";
  left: 2px;
  top: .82em;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--red);
  color: transparent;
}

.home-ref .feature-card,
.home-ref .process-card,
.home-ref .testimonial-grid article,
.home-ref .teacher-card {
  border-color: #e2e8f0;
  border-radius: 16px;
  box-shadow: none;
}

.home-ref .teacher-grid.single {
  max-width: 400px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-inline: auto;
}

.home-ref .reference-teacher {
  text-align: center;
  align-items: center;
  padding: 24px;
  gap: 12px;
}

.home-ref .reference-teacher .avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  background: var(--red);
  font-size: 26px;
}

.home-ref .reference-teacher h3 {
  font-size: 16px;
  margin: 0;
}

.home-ref .reference-teacher p {
  font-size: 13px;
  line-height: 1.45;
}

.teacher-pill-ref {
  display: inline-block;
  background: #fef2f2;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.teacher-meta-ref {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: #94a3b8;
  font-size: 12px;
}

.certificate-ref {
  width: 100%;
  min-height: 230px;
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  box-shadow: none;
  background: linear-gradient(135deg,#fff 0%,#f8fafc 100%);
  padding: 40px 24px;
}

.certificate-ref .cert-trophy {
  font-size: 40px;
  margin-bottom: 10px;
}

.certificate-ref h3 {
  font-size: 16px;
  margin: 4px 0 14px;
}

.certificate-ref i {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin: 0 auto 14px;
}

.certificate-ref .qr {
  display: none;
}

.home-ref .testimonial-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.faq-wrap-ref {
  max-width: 640px;
}

.faq-ref-section .section-head {
  margin-bottom: 32px;
}

.faq-item-ref {
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}

.faq-head-ref {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}

.faq-head-ref b {
  font-size: 16px;
  transition: .3s;
}

.faq-content-ref {
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: .3s;
}

.faq-item-ref.on .faq-content-ref {
  max-height: 200px;
  opacity: 1;
  padding-bottom: 16px;
}

.faq-item-ref.on .faq-head-ref b {
  transform: rotate(180deg);
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

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

.tags span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  font-size: 12px;
}

.badge.ok { background: #dcfce7; color: #15803d; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }

.testimonial-grid article span {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  margin-right: 10px;
}

.testimonial-grid b { color: #facc15; }
.testimonial-grid p { color: #334155; line-height: 1.7; }
.testimonial-grid small { display: block; color: var(--muted); margin-top: 4px; }

.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.faq summary {
  font-weight: 900;
  cursor: pointer;
}

.faq p {
  color: var(--muted);
  margin-bottom: 0;
}

.cta-dark {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 48px 0;
}

.cta-dark h2 { color: #fff; }
.cta-dark p { color: #cbd5e1; }

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 44px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}

.footer p,
.footer a,
.footer-bottom {
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.footer a { display: block; }
.footer h4 { color: var(--ink); margin: 0 0 10px; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }

.subhero {
  padding: 74px 0 48px;
  text-align: center;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border-bottom: 1px solid var(--line);
}

.subhero .wrap { max-width: 760px; }

.room-card {
  text-align: left;
}

.auth-body {
  background: #fff;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: .92fr 1.08fr;
}

.auth-brand {
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 48px 40px;
  display: flex;
  align-items: flex-start;
}

.auth-brand > div {
  width: min(520px, 100%);
  margin-top: 32px;
}

.auth-brand h1 {
  color: var(--ink);
  font-size: 38px;
  line-height: 1.1;
  margin: 64px 0 22px;
}

.auth-brand p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 17px;
}

.auth-testimonial {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 34px 0 18px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .05);
}

.auth-testimonial span {
  float: right;
  color: #facc15;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.auth-stats span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-stats b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-form {
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-top nav {
  display: flex;
  gap: 24px;
  color: #475569;
  font-weight: 600;
  font-size: 14px;
}

.form-shell {
  width: min(480px, 100%);
  margin: 84px auto 0;
}

.form-shell h1 {
  color: var(--ink);
  font-size: 34px;
  margin: 18px 0 8px;
}

.form-shell > p {
  color: var(--muted);
  margin-bottom: 30px;
}

label {
  display: block;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 18px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
  margin-top: 8px;
}

textarea {
  min-height: 120px;
  padding-top: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #fca5a5;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .08);
}

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

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 20px;
  color: var(--muted);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.form-row a,
.auth-bottom a {
  color: var(--red);
  font-weight: 900;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  margin: 22px 0;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-row button {
  height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  font-weight: 800;
}

.auth-bottom {
  text-align: center;
  color: var(--muted);
  margin-top: 22px;
}

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

.price-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.price-card small {
  color: var(--red);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.price-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.price-card p {
  margin: 0;
  color: var(--muted);
}

.price-card p b {
  color: var(--ink);
  font-size: 22px;
}

.price-card ul {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  line-height: 1.8;
}

.price-card form {
  margin-top: auto;
}

.provider-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 800;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.err {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #fecaca;
}

.panel-body {
  background: var(--panel);
  overflow-x: hidden;
}

.panel-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.panel-user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.panel-user form { margin: 0; }

.panel-user button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 14px;
  font-weight: 800;
}

.side {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  width: 256px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px 28px;
  overflow-y: auto;
}

.ns {
  margin: 12px 8px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.ni {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  font-weight: 800;
  text-align: left;
  margin-bottom: 5px;
}

.ni:hover,
.ni.on {
  background: #fff1f2;
  color: var(--red);
}

.ico {
  width: 20px;
  display: inline-grid;
  place-items: center;
}

.panel-main {
  margin-left: 256px;
  padding: 88px 28px 48px;
}

.page {
  display: none;
  max-width: 1120px;
}

.page.on { display: block; }

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 92px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card > span {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f3e8ff;
  display: grid;
  place-items: center;
}

.stat-card b {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card small {
  color: var(--muted);
  font-weight: 600;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

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

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.card h3 {
  margin: 0 0 16px;
  color: var(--ink);
}

.card-head,
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 180px;
  margin: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td {
  color: #1f2937;
  font-weight: 600;
}

.empty,
.empty-cell {
  color: #94a3b8;
  text-align: center;
  padding: 38px 12px;
}

.quick {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick button,
.quick a {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.status-list p,
.list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.status-list span,
.list span {
  color: var(--green);
  font-weight: 900;
}

.status-list .warn-text {
  color: var(--red);
}

.status-list .ok-text {
  color: var(--green);
}

.check-list {
  margin: 0;
  padding-left: 20px;
  color: #475569;
  line-height: 1.8;
}

.chart-card {
  min-height: 236px;
}

.bars {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 18px;
  padding: 20px;
  border-radius: 12px;
  background: #f8fafc;
}

.bars i {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--red), #fb7185);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  margin: 0;
}

.new-class-form {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.new-class-form h3 span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  margin-right: 8px;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-row button {
  min-height: 72px;
  border-radius: 14px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 18px;
}

.mode-row small {
  color: inherit;
  opacity: .75;
  font-weight: 700;
}

.alert {
  padding: 13px 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
}

.alert.ok {
  background: #dcfce7;
  color: #166534;
}

.rating-bars p {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.rating-bars span {
  height: 9px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.rating-bars i {
  display: block;
  height: 100%;
  background: #facc15;
}

.satisfaction strong {
  display: block;
  font-size: 54px;
  color: var(--red);
  margin: 30px 0 8px;
}

.profile-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-head h3,
.profile-head p {
  margin: 0;
}

.profile-head p {
  color: var(--muted);
}

.classroom-body {
  background: #111827;
  color: #fff;
}

.classroom-page {
  min-height: 100vh;
  background: #0f172a;
}

.join-card {
  width: min(420px, calc(100% - 32px));
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.join-card h2,
.join-card p,
.join-card label {
  color: #fff;
}

.join-card p,
.join-options {
  color: #cbd5e1;
}

.join-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.join-options input {
  width: 16px;
  min-height: 16px;
}

.classroom-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr 76px;
}

.cls-header {
  background: #1e293b;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cls-header .brand,
.cls-header .logo-suffix,
.cls-header .brand span {
  color: #fff;
}

.cls-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.classroom-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cls-header span {
  color: #fff;
  background: var(--red);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.classroom-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 0;
}

.video-stage {
  background: #020617;
  padding: 14px;
}

.video-stage iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 154px);
  border: 0;
  border-radius: 14px;
  background: #020617;
}

.lesson-panel {
  background: #111827;
  border-left: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.tabs button {
  height: 48px;
  border: 0;
  background: #1f2937;
  color: #cbd5e1;
  font-weight: 900;
}

.tabs button.on {
  color: #fff;
  background: var(--red);
}

.live-tab {
  display: none;
  flex: 1;
  min-height: 0;
}

.live-tab.on {
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
  color: #e5e7eb;
}

.messages p {
  background: #1f2937;
  border-radius: 12px;
  padding: 10px 12px;
}

.chat-box form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.chat-box input {
  margin: 0;
  background: #1f2937;
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

.chat-box button {
  width: 48px;
  border: 0;
  background: var(--red);
  color: #fff;
  border-radius: 12px;
  font-size: 24px;
}

.board-box {
  padding: 12px;
  gap: 10px;
}

.notes-box {
  padding: 12px;
  gap: 12px;
}

.notes-box textarea {
  min-height: 260px;
  resize: vertical;
  background: #1f2937;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
}

.wb-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wb-tools button {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: #1f2937;
  color: #fff;
  font-weight: 800;
}

.wb-tools button.on {
  background: var(--red);
}

.wb-tools input[type=color] {
  width: 42px;
  min-height: 34px;
  padding: 2px;
  margin: 0;
}

.wb-tools input[type=range] {
  width: 88px;
  min-height: 34px;
  margin: 0;
}

.board-box canvas {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  height: auto;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #1e293b;
  border-top: 1px solid rgba(255,255,255,.1);
}

.control-bar button,
.control-bar a {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #334155;
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
}

.control-bar .on {
  background: #16a34a;
}

.control-bar .red {
  background: var(--red);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .site-nav,
  .nav-actions {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .site-nav.open {
    display: grid;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 70px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
  }

  .hero-grid,
  .classroom-grid,
  .certificate-grid,
  .auth-page,
  .grid-2,
  .grid-3,
  .pricing-grid,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 26px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-visual {
    min-height: 330px;
  }

  .feature-grid,
  .level-grid,
  .process-grid,
  .testimonial-grid,
  .teacher-grid,
  .room-grid,
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid.classroom-cards {
    grid-template-columns: 1fr;
  }

  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-brand {
    display: none;
  }

  .auth-form {
    padding: 32px 22px;
  }

  .auth-top nav {
    display: none;
  }

  .form-shell {
    margin-top: 48px;
  }

  .side {
    width: 86px;
  }

  .side .ni span:last-child,
  .ns {
    display: none;
  }

  .ni {
    justify-content: center;
  }

  .panel-main {
    margin-left: 86px;
    padding: 84px 18px 36px;
  }

  .classroom-layout {
    grid-template-columns: 1fr;
  }

  .lesson-panel {
    min-height: 420px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.1);
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 28px, 1136px);
  }

  .hero-copy h1,
  .section-head h2,
  .subhero h1,
  .cta-dark h2 {
    font-size: 32px;
  }

  .hero-actions,
  .two,
  .mode-row,
  .social-row,
  .feature-grid,
  .level-grid,
  .process-grid,
  .testimonial-grid,
  .teacher-grid,
  .room-grid,
  .stat-grid,
  .footer-grid,
  .auth-stats {
    grid-template-columns: 1fr;
  }

  .feature-grid.classroom-cards,
  .testimonial-grid.two,
  .teacher-grid.single,
  .home-stats {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
  }

  .float-card.live {
    left: 0;
    width: 230px;
  }

  .float-card.one {
    right: 0;
  }

  .float-card.test {
    right: 0;
    top: 180px;
  }

  .panel-top {
    padding: 0 12px;
  }

  .panel-user span {
    display: none;
  }

  .side {
    width: 64px;
    padding-inline: 8px;
  }

  .panel-main {
    margin-left: 64px;
    padding-inline: 12px;
  }

  .stat-card {
    min-height: 82px;
  }

  .card {
    padding: 16px;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .cls-header {
    padding: 0 10px;
  }

  .classroom-actions {
    gap: 6px;
  }

  .cls-header > div strong {
    display: none;
  }

  .control-bar {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 12px;
  }
}

/* Final cascade for professional auth and classroom screens */
.auth-body .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.auth-body .auth-page {
  min-height: auto;
  grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
}

.auth-body .auth-top {
  display: none;
}

.auth-body .auth-form {
  align-items: center;
}

.auth-body .divider,
.auth-body .social-row,
.auth-body .form-row a[href="#"],
.classroom-lobby .join-options {
  display: none;
}

.classroom-shell {
  background: #0b0f17;
  grid-template-rows: 72px 1fr 72px;
}

.cls-header {
  min-height: 72px;
  background: rgba(17, 24, 39, .96);
}

.cls-header .live-title {
  min-width: 0;
}

.cls-header .live-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(46vw, 680px);
}

.classroom-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.video-stage {
  padding: 18px;
}

.video-frame {
  height: 100%;
  min-height: calc(100vh - 166px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  background: #020617;
}

.video-stage iframe {
  border-radius: 0;
  min-height: 100%;
}

.lesson-panel {
  width: 390px;
}

.chat-box form {
  display: grid;
  grid-template-columns: 1fr 86px;
}

.chat-box button {
  width: auto;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.control-bar {
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(17, 24, 39, .96);
}

.control-bar span {
  color: #cbd5e1;
  font-weight: 900;
  margin-right: auto;
}

@media (max-width: 980px) {
  .auth-body .auth-page,
  .classroom-lobby,
  .classroom-layout,
  .study-hero .wrap,
  .study-shell,
  .study-grid,
  .exam-hero .wrap,
  .exam-card-grid {
    grid-template-columns: 1fr;
  }

  .lobby-side {
    display: none;
  }

  .lesson-panel {
    width: auto;
    min-height: 420px;
  }

  .study-sidebar {
    position: static;
  }

  .study-progress {
    text-align: left;
  }

  .exam-result-card {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .classroom-lobby {
    padding: 18px;
  }

  .lobby-main {
    padding: 24px;
  }

  .lobby-actions,
  .live-meta-grid,
  .join-options {
    grid-template-columns: 1fr;
  }

  .cls-header {
    gap: 8px;
    min-height: 86px;
  }

  .cls-header .brand span:not(.brand-mark),
  .cls-header .live-title strong {
    display: none;
  }

  .study-hero {
    padding: 20px 0;
  }

  .study-task {
    display: grid;
  }

  .study-pdf,
  .study-pdf iframe {
    min-height: 520px;
  }

  .exam-options label {
    grid-template-columns: auto 24px 1fr;
  }

  .exam-card-foot {
    display: grid;
  }
}

.ai-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.ai-score-grid p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.ai-score-grid b {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.ai-score-grid span,
.ai-profile-card small,
.homework-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-tags {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-tags strong {
  color: var(--ink);
  font-size: 13px;
}

.ai-tags div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-dna,
.ai-quality-card {
  display: grid;
  gap: 10px;
}

.ai-dna > strong {
  color: var(--ink);
  font-size: 13px;
}

.ai-bar {
  display: grid;
  gap: 6px;
}

.ai-bar span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.ai-bar span b {
  color: var(--ink);
}

.ai-bar i {
  height: 8px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.ai-bar em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc2626, #f97316);
}

.ai-bar.good em {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.ai-bar.warn em {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.ai-plan-card,
.ai-practice-card {
  align-self: start;
}

.ai-summary {
  margin: 0 0 12px;
  color: #334155;
  line-height: 1.58;
}

.ai-plan-days {
  display: grid;
  gap: 8px;
}

.ai-plan-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ai-plan-day summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  list-style: none;
}

.ai-plan-day summary::-webkit-details-marker {
  display: none;
}

.ai-plan-day summary b {
  color: var(--ink);
}

.ai-plan-day summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.ai-plan-day ul,
.ai-practice-results {
  margin: 0;
  padding: 0 12px 12px 28px;
  color: #334155;
  line-height: 1.55;
}

.ai-inline-action {
  margin-top: 14px;
}

.ai-practice-question {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.ai-practice-question h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.ai-practice-question > div {
  display: grid;
  gap: 8px;
}

.ai-practice-question label {
  display: grid;
  grid-template-columns: auto 28px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.ai-practice-question label:has(input:checked) {
  border-color: #dc2626;
  background: #fff7ed;
}

.ai-practice-results {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.ai-practice-results li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.ai-practice-results small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.ai-export-links {
  margin-top: 14px;
}

.ai-chat-log {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.ai-msg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.ai-msg.bot {
  background: #fff7ed;
  border-color: #fed7aa;
}

.ai-msg.user {
  background: #f8fafc;
}

.ai-msg b {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.ai-msg p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.ai-msg small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.ai-chat-form {
  margin-top: 14px;
}

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

.homework-card {
  gap: 14px;
}

.homework-card > p {
  color: #334155;
  line-height: 1.6;
}

.ai-feedback {
  border: 1px solid #bae6fd;
  border-radius: 12px;
  background: #f0f9ff;
  padding: 12px;
  color: #075985;
}

.ai-feedback b {
  display: block;
  margin-bottom: 6px;
}

.ai-feedback p {
  margin: 0;
  line-height: 1.55;
}

.study-ai {
  display: grid;
  gap: 12px;
}

.live-external-frame {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 460px;
  padding: 34px;
  text-align: center;
  background: radial-gradient(circle at top, #1f2937 0, #020617 56%);
  color: #fff;
}

.live-external-frame strong {
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.1;
}

.live-external-frame p {
  max-width: 620px;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.live-external-frame .link-soft {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.live-external-frame small {
  color: #94a3b8;
  font-weight: 800;
}

.ai-exam-tip {
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 10px;
}

/* Homepage polish: keep the reference structure, fix responsive balance. */
.home-ref {
  overflow-x: hidden;
}

.home-ref .partner-strip div div {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 18px 28px;
  align-items: center;
}

.home-ref .partner-strip span {
  min-width: 0;
  white-space: nowrap;
}

.home-ref .hero-visual {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}

.home-ref .float-card.live div {
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .home-ref .hero2 {
    min-height: auto;
    padding: 54px 0 42px;
  }

  .home-ref .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .home-ref .hero-copy h1 {
    max-width: 620px;
    font-size: 44px;
  }

  .home-ref .hero-copy p {
    max-width: 620px;
  }

  .home-ref .hero-visual {
    max-width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
  }

  .home-ref .avatar-stack,
  .home-ref .float-card,
  .home-ref .teacher-bubble {
    position: static;
    inset: auto;
    transform: none;
  }

  .home-ref .avatar-stack {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 4px;
  }

  .home-ref .float-card.live {
    grid-column: 1 / -1;
    width: 100%;
    padding: 18px;
  }

  .home-ref .float-card.one,
  .home-ref .float-card.two,
  .home-ref .float-card.test {
    width: 100%;
    min-height: 132px;
  }

  .home-ref .float-card.test {
    padding: 18px;
  }

  .home-ref .teacher-bubble {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255,255,255,.94);
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15,23,42,.08);
  }

  .home-ref .teacher-bubble small {
    grid-column: auto;
    white-space: normal;
  }

  .home-ref .partner-strip div div {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .home-ref .wrap {
    width: min(100% - 28px, 1136px);
  }

  .home-ref .hero2 {
    padding: 38px 0 30px;
  }

  .home-ref .hero-copy h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.08;
    overflow-wrap: break-word;
  }

  .home-ref .hero-copy h1 span {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .home-ref .hero-copy p {
    font-size: 15px;
    line-height: 1.65;
    margin: 16px 0 22px;
  }

  .home-ref .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-ref .hero-actions .btn,
  .home-ref .hero-actions .btn-ghost {
    width: 100%;
  }

  .home-ref .check-row {
    display: grid;
    gap: 8px;
  }

  .home-ref .hero-grid,
  .home-ref .hero-copy,
  .home-ref .hero-visual {
    min-width: 0;
    max-width: 100%;
  }

  .home-ref .hero-visual {
    grid-template-columns: 1fr;
  }

  .home-ref .float-card.live div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-ref .float-card.live div span {
    min-width: 0;
    text-align: center;
    padding-inline: 4px;
    white-space: normal;
    line-height: 1.25;
  }

  .home-ref .float-card,
  .home-ref .teacher-bubble,
  .home-ref .avatar-stack {
    max-width: 100%;
  }

  .home-ref .float-card.mini,
  .home-ref .float-card.test {
    min-height: 118px;
    padding: 14px;
  }

  .home-ref .float-card.mini b {
    font-size: 22px;
  }

  .home-ref .teacher-bubble {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-ref .teacher-bubble strong {
    justify-self: end;
  }

  .home-ref .teacher-bubble small {
    grid-column: 1 / -1;
  }

  .home-ref .partner-strip {
    padding: 20px 0;
  }

  .home-ref .partner-strip div div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    font-size: 13px;
  }

  .home-ref .home-feature-ref {
    padding-top: 48px;
  }

  .home-feature-layout,
  .feature-list-ref,
  .home-ref .home-stats {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .home-ref .level-track-ref {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    overflow: visible;
    padding-top: 0;
  }

  .home-ref .level-track-ref::before {
    display: none;
  }

  .home-ref .level-item-ref {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-width: 0;
    text-align: left;
  }

  .home-ref .level-dot-ref {
    margin: 0;
  }

  .home-ref .level-card-ref {
    min-width: 0;
  }
}

/* DeutschUM live classroom control layer */
.lesson-panel .tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lesson-panel .tabs button {
  font-size: 12px;
  letter-spacing: 0;
  padding: 0 6px;
}

.people-box,
.rooms-box {
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.host-tools,
.room-tools,
.participant-row,
.room-grid span {
  border: 1px solid rgba(255,255,255,.1);
  background: #172033;
  border-radius: 12px;
}

.host-tools,
.room-tools {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.host-tools strong,
.room-tools strong {
  color: #fff;
}

.host-tools span,
.room-tools small,
.participant-row small {
  color: #94a3b8;
}

.host-tools button,
.room-tools button,
.participant-row button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.host-tools.student-mode button {
  display: none;
}

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

.participant-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.participant-row > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.participant-row strong {
  display: block;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-row button {
  padding: 0 12px;
  background: #243047;
}

.room-grid {
  display: grid;
  gap: 10px;
}

.room-grid span {
  display: block;
  padding: 12px;
  color: #e5e7eb;
  font-weight: 900;
}

.control-bar button[data-live-tab-shortcut] {
  background: #243047;
}

.classroom-body,
.classroom-page,
.classroom-shell {
  overflow-x: hidden;
}

.classroom-layout,
.video-stage,
.video-frame,
.lesson-panel {
  min-width: 0;
}

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

  .lesson-panel .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lesson-panel {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .ai-score-grid {
    grid-template-columns: 1fr;
  }

  .ai-plan-day summary {
    display: grid;
  }

  .ai-plan-day summary span {
    text-align: left;
  }

  .classroom-shell {
    grid-template-rows: auto auto auto;
  }

  .cls-header {
    padding: 8px 12px;
    flex-wrap: wrap;
  }

  .cls-header .live-title strong {
    max-width: calc(100vw - 132px);
  }

  .classroom-layout {
    width: 100%;
  }

  .video-stage {
    padding: 10px;
  }

  .video-frame {
    min-height: 420px;
  }

  .video-stage iframe {
    min-height: 420px;
  }

  .lesson-panel .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-bar {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 10px;
  }

  .control-bar span {
    min-width: max-content;
  }

  .participant-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .participant-row button {
    grid-column: 1 / -1;
  }
}

/* Authoritative final layout rules. Keep this block last in the cascade. */
@media (min-width: 981px) {
  .home-ref .avatar-stack,
  .home-ref .teacher-bubble {
    display: none;
  }
}

@media (max-width: 680px) {
  .cls-header .brand {
    grid-column: 1;
    order: 0;
  }

  .cls-header .live-title {
    grid-column: 2;
    order: 0;
  }

  .cls-header .classroom-actions {
    grid-column: 3;
    order: 0;
    flex-wrap: nowrap;
  }
}

.panel-app,
.panel-main,
.panel-main .page,
.panel-main .card,
.panel-main .grid-2,
.panel-main .grid-3,
.panel-main .stat-grid,
.panel-main .toolbar,
.panel-main .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.panel-main .card {
  overflow: hidden;
}

.panel-main .table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.toolbar [data-table-count] {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap tr[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .panel-main .grid-2,
  .panel-main .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-main .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .panel-main .toolbar input,
  .panel-main .toolbar select {
    flex: 1 1 180px;
  }
}

@media (max-width: 640px) {
  .panel-main {
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
    margin-left: 64px;
    padding: 76px 10px 30px;
  }

  .panel-top {
    padding: 0 10px 0 72px;
  }

  .panel-top .brand {
    gap: 6px;
    font-size: 15px;
  }

  .panel-top .brand-mark {
    width: 32px;
    height: 32px;
  }

  .panel-top .logo-suffix {
    max-width: 72px;
    margin-left: 2px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
  }

  .panel-user > span {
    display: none;
  }

  .page.on {
    width: 100%;
    max-width: 100%;
  }

  .page-head {
    margin-bottom: 18px;
  }

  .page-head h1 {
    font-size: 25px;
    line-height: 1.12;
  }

  .page-head p {
    font-size: 13px;
  }

  .card,
  .stat-card {
    padding: 15px;
  }

  .card-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .panel-main .table-wrap table {
    min-width: 620px;
  }

  .panel-main .toolbar > * {
    flex: 1 1 100%;
    width: 100%;
  }

  .toolbar [data-table-count] {
    margin-left: 0;
  }
}

@media (max-width: 680px) {
  .classroom-shell {
    grid-template-rows: auto auto auto;
    width: 100%;
    min-height: 100dvh;
  }

  .cls-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 64px;
    padding: 8px;
  }

  .cls-header .brand {
    min-width: 34px;
  }

  .cls-header .brand > span:not(.brand-mark),
  .cls-header .logo-suffix {
    display: none;
  }

  .cls-header .live-title {
    min-width: 0;
    justify-content: center;
    gap: 5px;
  }

  .cls-header .live-title strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cls-header .live-title span {
    display: none;
  }

  .cls-header .live-title small {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .classroom-actions {
    display: flex;
    gap: 4px;
  }

  .classroom-actions .btn,
  .classroom-actions .link-soft {
    min-height: 34px;
    padding: 0 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .classroom-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .video-stage {
    width: 100%;
    padding: 0;
  }

  .video-frame,
  .jitsi-api-frame,
  .video-stage iframe {
    width: 100%;
    min-height: 55dvh;
    border-radius: 0;
  }

  .live-connection-tools {
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px;
  }

  .live-connection-tools > * {
    flex: 0 0 auto;
  }

  .lesson-panel {
    width: 100%;
    min-height: 440px;
  }

  .lesson-panel .tabs {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
  }

  .lesson-panel .tabs button {
    flex: 1 0 76px;
    min-height: 48px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .control-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    width: 100%;
    max-width: 100vw;
    justify-content: flex-start;
    gap: 7px;
    overflow-x: auto;
    padding: 9px;
  }

  .control-bar > * {
    flex: 0 0 auto;
  }

  .control-bar > span {
    display: none;
  }

  .control-bar button,
  .control-bar a {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
    white-space: nowrap;
  }
}
