:root {
  --app-bg: #ffffff;
  --app-surface: #ffffff;
  --app-surface-soft: #f7f9fc;
  --app-text: #0e172a;
  --app-muted: #66758e;
  --app-primary: #0b76ff;
  --app-primary-strong: #055fcb;
  --app-danger: #da3b4a;
  --app-shadow-sm: 0 6px 18px rgba(15, 31, 56, 0.07);
  --app-shadow-md: 0 14px 32px rgba(15, 31, 56, 0.09);
  --app-header-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 253, 0.95) 100%);
  --app-header-line: rgba(114, 131, 153, 0.22);
  --app-header-shadow: 0 14px 34px rgba(15, 30, 52, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  --app-header-logo-w: 348px;
  --app-header-logo-w-mobile: 252px;
  --app-header-h: 90px;
  --app-header-h-mobile: 78px;
  --container-app-max: 920px;
  --container-app-pad: clamp(10px, 2.2vw, 20px);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--app-text);
  background: var(--app-bg);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(13, 41, 77, 0.04) 0.7px, transparent 0.7px),
    radial-gradient(rgba(13, 41, 77, 0.03) 0.7px, transparent 0.7px),
    linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
  background-position: 0 0, 12px 12px, 0 0;
}

body.whiteboard-page::before {
  display: none;
}

body.student-mode {
  overflow-x: hidden;
  --student-header-offset: calc(var(--app-header-h) + env(safe-area-inset-top));
  --student-header-gap: 0px;
}

body.student-login-page {
  overflow-x: hidden;
}

body.student-login-page::before {
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 100%;
  background-position: 0 0;
}

.container-app {
  width: min(100%, var(--container-app-max));
  padding-inline: var(--container-app-pad);
  padding-bottom: 0;
  --gf-footer-gap: 16px;
}

.student-login-page .container-app {
  --container-app-max: 620px;
  padding-bottom: 0 !important;
}

body.student-mode:not(.student-login-page) .container-app {
  padding-top: var(--student-header-offset) !important;
  padding-bottom: 0 !important;
}

body.student-mode:not(.student-login-page) .container-app.py-3 {
  /* Header clearance + same visual gap used between student blocks. */
  padding-top: calc(var(--student-header-offset) + var(--student-header-gap)) !important;
  padding-bottom: 0 !important;
}

body.student-mode .container-app.py-4,
body.student-mode .container-app.py-3 {
  padding-bottom: 0 !important;
}

body.student-login-page .container-app.py-4,
body.student-login-page .container-app.py-3 {
  padding-bottom: 0 !important;
}

.student-login-page .gf-topbar {
  position: relative;
  justify-content: center;
  margin-top: 2px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(114, 131, 153, 0.14);
  border-radius: 24px;
  background: var(--app-header-surface);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--app-header-shadow);
}

.student-login-page .gf-topbar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(130, 150, 175, 0) 0%, rgba(130, 150, 175, 0.42) 18%, rgba(130, 150, 175, 0.42) 82%, rgba(130, 150, 175, 0) 100%);
}

.student-login-page .gf-brand {
  justify-content: center;
}

.student-login-page .gf-brand-logo {
  height: clamp(60px, 8.4vw, 80px);
  max-width: min(86vw, 470px);
}

.student-login-page .app-shell {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.student-login-shell {
  margin-top: 30px;
}

.student-login-head {
  padding: 6px 2px 22px;
  text-align: center;
}

.student-login-title {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 4.8vw, 1.72rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #12243b;
}

.student-login-card {
  padding: 0;
  max-width: 480px;
  margin-inline: auto;
}

.student-login-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 12px;
  background: #eef2f6;
}

.student-login-switch-btn {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #55687d;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 10px;
}

.student-login-switch-btn.is-active {
  background: #ffffff;
  color: #20364f;
  box-shadow: 0 1px 2px rgba(13, 31, 56, 0.06);
}

.student-login-pane {
  display: grid;
  gap: 10px;
}

.student-login-page .student-login-pane .form-control {
  border: 1px solid #d9e2ee;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: none;
  padding: 10px 12px;
}

.student-login-page .student-login-pane .form-control:focus {
  border-color: #b9cbe3;
  background: #ffffff;
  box-shadow: 0 0 0 0.14rem rgba(84, 133, 197, 0.12);
}

.student-login-page .student-login-pane .btn-main {
  border-radius: 11px;
  background: #0b76ff;
  font-weight: 700;
  padding: 10px 12px;
}

.student-login-page .student-login-pane .btn-main:hover {
  background: #076ce8;
}

.student-login-page .student-login-pane .btn-sub {
  border-radius: 11px;
  border: 1px solid #d9e2ee;
  background: #ffffff;
  color: #233b58;
}

.student-login-error {
  margin-top: 10px;
  min-height: 20px;
  text-align: center;
}

.student-activate-result {
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.student-activate-result i {
  font-size: 1.06rem;
  line-height: 1;
}

.student-activate-result.is-success {
  background: #edf8f1;
  color: #235d3a;
}

.student-activate-result.is-warning {
  background: #fff5e9;
  color: #7b4f18;
}

.student-login-page .app-footer {
  margin-top: 34px;
}

.student-login-page .app-footer a {
  font-weight: 500;
}

.gf-topbar {
  min-height: 72px;
  padding: 9px 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--app-header-line);
}

body.student-mode:not(.student-login-page) .gf-topbar {
  min-height: var(--app-header-h);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: 8px;
  padding-left: max(
    calc((100vw - var(--container-app-max)) / 2 + var(--container-app-pad)),
    calc(var(--container-app-pad) + env(safe-area-inset-left))
  );
  padding-right: max(
    calc((100vw - var(--container-app-max)) / 2 + var(--container-app-pad)),
    calc(var(--container-app-pad) + env(safe-area-inset-right))
  );
  border-bottom: 1px solid var(--app-header-line);
  background: var(--app-header-surface);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--app-header-shadow);
}

@media (max-width: 960px) {
  body.student-mode {
    --student-header-offset: calc(var(--app-header-h-mobile) + env(safe-area-inset-top));
  }
  body.student-mode:not(.student-login-page) .gf-topbar {
    min-height: var(--app-header-h-mobile);
  }
  body.student-mode:not(.student-login-page) .gf-brand-logo {
    width: min(var(--app-header-logo-w-mobile), 62vw);
    max-width: min(var(--app-header-logo-w-mobile), 62vw);
    height: auto;
  }
}

.gf-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.gf-brand-logo {
  height: clamp(36px, 5.5vw, 50px);
  width: auto;
  max-width: min(70vw, 380px);
  object-fit: contain;
}

/* Header logo size aligned with admin header (desktop). */
body.student-mode:not(.student-login-page) .gf-brand-logo {
  width: min(var(--app-header-logo-w), 46vw);
  max-width: min(var(--app-header-logo-w), 46vw);
  height: auto;
}

.gf-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Header actions: icon-only on every app page. */
.gf-topbar .gf-topbar-actions .btn-install {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  gap: 0;
  font-size: 0;
}

.gf-topbar .gf-topbar-actions .btn-install i {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.gf-topbar .gf-topbar-actions .btn-install.is-active {
  background: #0b76ff;
  color: #ffffff;
}

.gf-topbar .gf-topbar-actions .btn-install.is-inactive {
  background: #eef3f9;
  color: #30435c;
}

.gf-pill {
  border-radius: 999px;
  background: #f2f6fc;
  color: #43536b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 12px;
}

.btn-install {
  border: 0;
  background: #f1f5fb;
  color: #15233a;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  line-height: 1.2;
}

.btn-install:hover {
  background: #e8eff8;
  color: #15233a;
}

.btn-install:disabled,
.btn-install[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.app-shell {
  margin-top: 14px;
  padding: clamp(12px, 2.4vw, 20px);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--app-shadow-md);
  backdrop-filter: blur(3px);
}

/* Student pages: avoid nested containers (box-in-box). */
body.student-mode .app-shell {
  margin-top: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.lesson-now-banner {
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #ffffff 0%, #eef4fd 100%);
  padding: 14px;
  box-shadow: var(--app-shadow-sm);
}

.lesson-now-label {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 800;
  color: #4a5f7b;
}

.lesson-now-value {
  margin-top: 5px;
  font-size: clamp(1.2rem, 4.2vw, 1.58rem);
  line-height: 1.12;
  font-weight: 800;
  color: #0e1930;
}

.install-row {
  margin: 12px 0;
}

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

.action-card {
  border-radius: var(--radius-lg);
  padding: 12px;
  background: #fff;
  text-decoration: none;
  color: var(--app-text);
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--app-shadow-sm);
}

.action-card:hover,
.action-card:focus-visible {
  color: var(--app-text);
  transform: translateY(-1px);
}

button.action-card {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.action-card--live {
  background: linear-gradient(170deg, #ffffff 0%, #f4f8ff 100%);
}

.action-card--menu-toggle {
  grid-template-columns: 62px 1fr auto;
}

.action-card--menu-open {
  background: linear-gradient(170deg, #ffffff 0%, #f4f8ff 100%);
}

.action-card--menu-close {
  background: linear-gradient(170deg, #ffffff 0%, #f6f9ff 100%);
}

.action-card--menu-close .action-icon {
  background: #ecf3ff;
  color: #274f83;
}

.action-card.is-disabled {
  background: #f3f5f8;
  color: #8a96a8;
  box-shadow: none;
  transform: none;
  pointer-events: none;
  cursor: not-allowed;
}

.action-card.is-disabled .action-icon {
  background: #e8ecf2;
  color: #8a96a8;
}

.action-card.is-disabled .action-main {
  color: #7f8b9d;
}

.action-card.is-disabled .action-micro,
.action-card.is-disabled .recap-counters,
.action-card.is-disabled .action-go {
  color: #9aa6b7;
}

.action-icon {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: #eaf1fb;
  color: #154a86;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.action-icon i {
  font-size: 1.72rem;
  line-height: 1;
}

.app-notify-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e53948;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding-inline: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-notify-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e53948;
  color: #fff;
  padding-inline: 5px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.action-main {
  font-size: 1.04rem;
  line-height: 1.17;
  font-weight: 800;
  color: #101b2f;
}

.action-micro,
.recap-counters {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--app-muted);
  font-weight: 700;
}

.action-go {
  color: #8594aa;
  font-size: 1.5rem;
  line-height: 1;
}

.card-app {
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

body.student-mode .card-app {
  border-radius: 20px;
}

.app-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.small-muted,
.app-subtitle {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.materials-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.materials-item {
  border-radius: 12px;
  background: #f8fbff;
  text-decoration: none;
  color: #112038;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.materials-item:hover,
.materials-item:focus-visible {
  background: #eff4fb;
  color: #112038;
}

.materials-item-youtube {
  background: #fff6f7;
}

.materials-item-back {
  opacity: 0.9;
}

.materials-badge {
  min-width: 45px;
  border-radius: 999px;
  background: #e7effb;
  color: #345179;
  padding: 4px 8px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.materials-badge-youtube {
  background: #fbdde1;
  color: #9a2434;
}

.materials-badge-folder {
  background: #dceeff;
  color: #1e5b99;
}

.materials-name {
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.files-app-frame {
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--app-shadow-sm);
  overflow: hidden;
}

.files-app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(121, 142, 170, 0.2);
}

.files-app-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1f3553;
}

.files-app-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #647b99;
  border-radius: 999px;
  background: #ecf3ff;
  padding: 4px 9px;
}

.files-app-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.files-app-item {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e8eef8;
  text-decoration: none;
  color: #0f1f34;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.files-app-item:hover,
.files-app-item:focus-visible {
  color: #0f1f34;
  background: #f4f8ff;
  border-color: #dce8fa;
}

.files-app-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e8f0ff;
  color: #1d5fae;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.files-app-item-icon i {
  font-size: 1.18rem;
  line-height: 1;
}

.files-app-item-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.files-app-item-name {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.files-app-item-meta {
  font-size: 0.74rem;
  color: #6c829e;
  font-weight: 700;
}

.files-app-item-go {
  color: #8aa0bc;
  font-size: 0.9rem;
}

.files-app-item--youtube .files-app-item-icon {
  background: #ffe8eb;
  color: #c5283d;
}

.files-app-empty {
  border-radius: 12px;
  background: #f4f8ff;
  color: #6d809b;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  padding: 16px 12px;
}

.chat-frame {
  border-radius: var(--radius-xl);
  background: #f2f5fa;
  overflow: hidden;
  box-shadow: var(--app-shadow-sm);
}

.chat-head {
  padding: 12px;
  background: #fff;
}

.chat-head-title {
  font-size: 1.04rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-head-meta {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--app-muted);
  font-weight: 700;
}

.chat-thread {
  max-height: 52vh;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f1f3f8;
}

.chat-turn {
  display: grid;
}

.chat-bubble {
  max-width: min(88%, 580px);
  border-radius: 19px;
  padding: 10px 12px;
}

.chat-bubble--me {
  justify-self: end;
  background: var(--app-primary);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.chat-bubble--teacher {
  justify-self: start;
  background: #e6eaf1;
  color: #101b31;
  border-bottom-left-radius: 8px;
}

.chat-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.35;
}

.chat-bubble-meta {
  margin-top: 5px;
  font-size: 0.7rem;
  opacity: 0.84;
  font-weight: 700;
}

.q-photo-thumb {
  max-width: 180px;
  width: 100%;
  border-radius: 10px;
  cursor: zoom-in;
}

.student-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  background: rgba(8, 14, 24, 0.84);
  backdrop-filter: blur(4px);
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.student-photo-lightbox.is-open {
  display: flex;
}

.student-photo-lightbox__dialog {
  position: relative;
  width: min(96vw, 1100px);
  max-height: 92vh;
  display: grid;
  place-items: center;
  touch-action: pan-x pan-y pinch-zoom;
}

.student-photo-lightbox__img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.student-photo-lightbox__close {
  position: absolute;
  top: max(4px, env(safe-area-inset-top));
  right: max(4px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.student-photo-lightbox__close i {
  font-size: 1rem;
  line-height: 1;
}

body.student-lightbox-open {
  overflow: hidden;
  touch-action: none;
}

.chat-composer {
  background: #fff;
  padding: 12px;
}

.chat-system-stack {
  background: transparent;
  padding: 0;
  display: grid;
  gap: 8px;
}

.chat-system-stack .alert {
  margin: 0;
}

.composer-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.composer-row-message {
  grid-template-columns: auto auto 1fr auto;
}

.composer-row-message--imessage {
  align-items: end;
}

.chat-mini-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: #eef2f8;
  color: #3b4e68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-mini-btn i {
  font-size: 1.15rem;
}

.form-control {
  border: 0;
  border-radius: 14px;
  background: #eef2f8;
  color: #15233b;
  padding: 10px 12px;
  font-size: 0.93rem;
}

.form-control:focus {
  background: #e7edf7;
  box-shadow: 0 0 0 0.18rem rgba(11, 118, 255, 0.16);
}

.form-label {
  margin-bottom: 5px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #33435a;
}

.chat-input-message {
  min-height: 50px;
  max-height: 130px;
  resize: vertical;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--app-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn i {
  font-size: 1.12rem;
}

.chat-send-btn:disabled {
  opacity: 0.5;
}

.chat-photo-name {
  margin-top: 8px;
  font-size: 0.84rem;
}

.chat-composer-support {
  display: grid;
  gap: 2px;
}

.chat-composer-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-quota-meta {
  margin-left: auto;
  text-align: right;
  color: #5f7088;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-files-wrap {
  margin-top: 8px;
  border-radius: 12px;
  background: #f6f8fc;
  padding: 8px 10px;
}

.chat-files-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #607189;
  margin-bottom: 4px;
}

.chat-files-list {
  margin: 0;
  padding-left: 16px;
  color: #4f6079;
  font-size: 0.84rem;
  font-weight: 700;
}

.chat-files-list li {
  line-height: 1.25;
}

.question-counter-ok {
  color: #6a7b92;
}

.question-counter-bad {
  color: #b91c1c;
  font-weight: 800;
}

.student-chat-page .container-app {
  --container-app-max: 980px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.student-chat-page .app-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.student-chat-page .chat-imessage-stage {
  flex: 1 1 auto;
  min-height: min(760px, calc(100dvh - 180px));
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: 22px;
  overflow: hidden;
  background: #f8fafd;
  box-shadow: none;
}

.student-chat-page .chat-thread--imessage {
  grid-row: 1;
  max-height: none;
  min-height: 0;
  align-content: start;
  padding: 14px 12px 10px;
  background: transparent;
}

.student-chat-page .chat-thread.chat-thread--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chat-empty-text {
  color: #7a8aa1;
  font-size: 0.94rem;
  font-weight: 700;
  padding: 6px 4px;
}

.student-chat-page .chat-composer--imessage {
  grid-row: 2;
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #ffffff;
  padding: 10px 10px 12px;
  margin: 0 10px 10px;
  border-radius: 20px;
  box-shadow: none;
}

.student-chat-page .chat-input-message {
  min-height: 52px;
  border-radius: 20px;
  background: #f3f6fb;
}

.student-chat-page .chat-mini-btn {
  background: #f2f5fa;
}

.student-chat-page .chat-send-btn {
  width: 46px;
  height: 46px;
}

.student-chat-page .chat-bubble--teacher {
  background: #edf2f8;
  color: #42566f;
}

.student-chat-page .chat-bubble--me {
  background: #1a86ff;
}

.student-chat-page .chat-composer-meta .small-muted,
.student-chat-page .chat-quota-meta {
  color: #7688a0;
}

.student-chat-page .chat-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.student-chat-page .chat-shell__frame {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.student-chat-page .chat-roster,
.student-chat-page .chat-room {
  border-radius: 24px;
  border: 1px solid rgba(124, 145, 171, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.96) 100%);
  box-shadow:
    0 22px 46px rgba(15, 31, 56, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(140%);
}

.student-chat-page .chat-roster {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: min(74vh, 820px);
}

.student-chat-page .chat-roster__head,
.student-chat-page .chat-room__head {
  padding: 16px 16px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(125, 145, 170, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 255, 0.92) 100%);
}

.chat-roster__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: #607189;
}

.chat-roster__title {
  margin: 4px 0 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #10213a;
}

.chat-roster__meta {
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: #eef4fb;
  color: #2c4667;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.chat-icon-btn--soft {
  background: #f1f4f8;
}

.chat-roster__section {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.chat-roster__section-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: #607189;
}

.chat-roster-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.chat-roster-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: rgba(244, 247, 252, 0.95);
  color: var(--app-text);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-roster-item:hover,
.chat-roster-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(109, 143, 194, 0.22);
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 12px 22px rgba(15, 31, 56, 0.08);
}

.chat-roster-item.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border-color: rgba(156, 187, 240, 0.55);
  box-shadow: 0 12px 24px rgba(15, 31, 56, 0.1);
}

.chat-roster-item.is-locked {
  background: #f5f7fb;
}

.chat-roster-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eaf1fb 0%, #dde9fb 100%);
  color: #154a86;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.chat-roster-avatar--lesson {
  background: linear-gradient(180deg, #edf4ff 0%, #e1ebff 100%);
  color: #1f56a0;
}

.chat-roster-avatar--group {
  background: linear-gradient(180deg, #f4efff 0%, #e8e0ff 100%);
  color: #5e3db2;
}

.chat-roster-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-roster-title {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.2;
  color: #10213a;
}

.chat-roster-subtitle {
  font-size: 0.79rem;
  color: #607189;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-roster-end {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.chat-roster-state {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-roster-pill {
  border-radius: 999px;
  background: #eaf1fb;
  color: #215588;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.chat-roster-pill--warning {
  background: #fff0d8;
  color: #9c5d13;
}

.chat-roster-icon {
  color: #7f8ea7;
  font-size: 0.88rem;
}

.chat-roster-empty {
  border-radius: 16px;
  background: #f5f8fd;
  color: #6d809a;
  padding: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.chat-room {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: min(74vh, 820px);
}

.chat-room__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-room__avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(180deg, #edf3ff 0%, #dde8fb 100%);
  color: #154a86;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex: 0 0 auto;
}

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

.chat-room__title {
  font-size: 1.06rem;
  font-weight: 800;
  color: #10213a;
}

.chat-room__subtitle {
  margin-top: 4px;
  color: #607189;
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-room__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chat-room__chip {
  border-radius: 999px;
  background: #eef4ff;
  color: #214f85;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 6px 10px;
}

.chat-room__chip--soft {
  background: #f1f4f8;
  color: #5e6e83;
}

.chat-room__banner {
  margin: 12px 12px 0;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-room__banner--locked {
  background: #edf5ff;
  border: 1px solid #d7e6fd;
}

.chat-room__banner--warning {
  background: #fff6e8;
  border: 1px solid #f4d7a5;
}

.chat-room__banner-copy {
  min-width: 0;
}

.chat-room__banner-title {
  font-weight: 800;
  color: #10213a;
}

.chat-room__banner-text {
  margin-top: 4px;
  color: #5d6f86;
  font-size: 0.84rem;
  font-weight: 600;
}

.chat-thread--student {
  max-height: none;
  min-height: 0;
  padding: 14px 14px 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.chat-thread--student.chat-thread--empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.student-chat-page .chat-thread.chat-thread--student.chat-thread--empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.chat-message {
  display: grid;
  margin-bottom: 10px;
}

.chat-message--me {
  justify-items: end;
}

.chat-message__bubble {
  max-width: min(84%, 620px);
  border-radius: 18px;
  padding: 11px 12px;
  box-shadow: 0 6px 16px rgba(15, 31, 56, 0.08);
}

.chat-message--me .chat-message__bubble {
  background: linear-gradient(180deg, #1a86ff 0%, #0f74ea 100%);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.chat-message--teacher .chat-message__bubble,
.chat-message--other .chat-message__bubble {
  background: #edf2f8;
  color: #31445f;
  border-bottom-left-radius: 8px;
}

.chat-message__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.45;
}

.chat-message__meta {
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.82;
}

.chat-message__media {
  border: 0;
  padding: 0;
  background: none;
  display: block;
  width: 100%;
  margin-top: 8px;
  cursor: zoom-in;
}

.chat-message__thumb {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 14px;
}

.chat-message__file {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  text-decoration: none;
}

.chat-message__file-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(26, 134, 255, 0.12);
  color: #1a86ff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.chat-message__file-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-message__file-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chat-message__file-sub {
  font-size: 0.74rem;
  opacity: 0.8;
}

.chat-lock-state__title {
  font-weight: 800;
  color: #10213a;
}

.chat-lock-state__text {
  margin-top: 4px;
  color: #5d6f86;
  font-size: 0.84rem;
  font-weight: 600;
}

.chat-composer--student {
  padding: 12px 14px 14px;
  background: #fff;
  border-top: 1px solid rgba(125, 145, 170, 0.14);
  display: grid;
  gap: 10px;
}

.chat-composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.chat-input-message {
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  border-radius: 18px;
  background: #f3f6fb;
}

.chat-send-btn {
  width: 46px;
  height: 46px;
}

.chat-attachment-preview {
  border-radius: 16px;
  padding: 10px 12px;
  background: #f5f8fc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #e1e9f3;
}

.chat-attachment-preview__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-attachment-preview__thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 12px;
}

.chat-attachment-preview__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eaf1fb;
  color: #1a86ff;
  display: grid;
  place-items: center;
}

.chat-attachment-preview__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-attachment-preview__name {
  font-weight: 800;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.chat-attachment-preview__meta {
  font-size: 0.76rem;
  color: var(--app-muted);
  font-weight: 700;
}

.chat-attachment-preview__actions {
  flex: 0 0 auto;
}

.chat-composer-status {
  min-height: 18px;
  font-size: 0.8rem;
}

.chat-composer-counter {
  color: #6f8196;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-room__banner .btn-main--compact {
  width: auto;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
}

.btn-main {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--app-primary), var(--app-primary-strong));
  color: #fff;
  font-weight: 800;
  padding: 11px 12px;
}

.btn-sub {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: #eef3fb;
  color: #15233a;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 12px;
}

.name-onboarding-open {
  overflow: hidden;
}

.student-remote-alert-open {
  overflow: hidden;
}

.name-onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 20, 35, 0.45);
  backdrop-filter: blur(6px);
}

.name-onboarding-modal {
  width: min(100%, 420px);
  border-radius: 20px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--app-shadow-md);
}

.name-onboarding-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #eaf1fb;
  color: #1d4d85;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 10px;
}

.name-onboarding-modal h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.name-onboarding-modal p {
  margin: 6px 0 12px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.student-remote-alert {
  position: fixed;
  inset: 0;
  z-index: 1140;
  display: grid;
  place-items: center;
  padding:
    max(18px, calc(18px + env(safe-area-inset-top)))
    max(18px, calc(18px + env(safe-area-inset-right)))
    max(18px, calc(18px + env(safe-area-inset-bottom)))
    max(18px, calc(18px + env(safe-area-inset-left)));
  background: rgba(10, 20, 35, 0.58);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.student-remote-alert.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.student-remote-alert__card {
  width: min(100%, 460px);
  border-radius: 24px;
  padding: 24px 22px 22px;
  color: #fff;
  background: linear-gradient(160deg, #a81625 0%, #d93f32 62%, #f37d2b 100%);
  box-shadow: 0 26px 52px rgba(14, 22, 38, 0.3);
  text-align: center;
}

.student-remote-alert[data-mode="blocked"] .student-remote-alert__card {
  background: linear-gradient(160deg, #7e214a 0%, #b03c72 58%, #da6a7a 100%);
}

.student-remote-alert[data-mode="ready"] .student-remote-alert__card {
  background: linear-gradient(160deg, #185a39 0%, #238a53 58%, #39b46f 100%);
}

.student-remote-alert__eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 8px;
}

.student-remote-alert__title {
  margin-top: 0;
  font-size: 1.22rem;
  line-height: 1.2;
  font-weight: 800;
}

.student-remote-alert__text {
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.student-remote-alert__actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.student-remote-alert__actions .btn-main {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  box-shadow: none;
}

.student-remote-alert__enable {
  background: #fff;
  color: #8d1d1d;
}

.student-notif-inline {
  margin-top: 10px;
  margin-bottom: 12px;
  border-radius: 18px;
  border: 1px solid #d8e4f3;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--app-shadow-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
}

.student-notif-inline-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eaf2ff;
  color: #245e9f;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.student-notif-inline-main h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #10263f;
}

.student-notif-inline-main p {
  margin: 4px 0 10px;
  color: #536883;
  font-size: 0.88rem;
  line-height: 1.32;
}

.student-notif-inline-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.student-notif-inline-actions .btn-main,
.student-notif-inline-actions .btn-sub {
  width: 100%;
}

.student-notif-modal {
  width: min(100%, 460px);
}

.student-notif-modal__hint {
  margin-top: -2px;
  color: #42566f;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 600;
}

.student-notif-modal__status {
  min-height: 20px;
  margin-top: 10px;
  color: #6f8096;
  font-size: 0.84rem;
  line-height: 1.35;
}

.student-notif-modal__actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.student-notif-modal__actions .btn-main,
.student-notif-modal__actions .btn-sub {
  width: 100%;
}

.student-notif-settings-modal {
  width: min(100%, 468px);
  padding: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(124, 145, 171, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.96) 100%);
  box-shadow:
    0 22px 46px rgba(15, 31, 56, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.student-notif-settings-modal .name-onboarding-badge {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #edf5ff 0%, #e3eefc 100%);
  color: #18538e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.student-notif-settings-modal h2 {
  font-size: 1.04rem;
  line-height: 1.15;
}

.student-notif-settings-modal > p {
  margin: -2px 0 0;
  max-width: 40ch;
  color: #607089;
  font-size: 0.84rem;
  line-height: 1.4;
}

.student-notif-settings__status {
  margin-top: 0;
  min-height: 0;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(203, 219, 238, 0.78);
  background: rgba(241, 247, 255, 0.92);
  color: #42566f;
  font-size: 0.81rem;
  line-height: 1.4;
  font-weight: 700;
}

.student-notif-settings__switch {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 0;
  padding: 9px 11px;
  border-radius: 13px;
  border: 1px solid rgba(213, 225, 241, 0.9);
  background: rgba(248, 251, 255, 0.96);
  color: #1d3957;
  font-size: 0.87rem;
  font-weight: 700;
}

.student-notif-settings__switch input {
  margin: 0;
  accent-color: var(--app-primary);
}

.student-notif-settings__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
}

.student-notif-settings__field {
  display: grid;
  gap: 5px;
  color: #465d79;
  font-size: 0.78rem;
  font-weight: 700;
}

.student-notif-settings__field input {
  width: 100%;
  min-height: 41px;
  border-radius: 11px;
  border: 1px solid #d4dfef;
  background: rgba(255, 255, 255, 0.96);
  padding: 9px 11px;
  color: #18314c;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.student-notif-settings__days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}

.student-notif-settings__day {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid #d9e3f1;
  background: rgba(255, 255, 255, 0.98);
  color: #204160;
  font-size: 0.8rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.student-notif-settings__day input {
  margin: 0;
  accent-color: var(--app-primary);
}

.student-notif-settings__summary {
  margin-top: 0;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(203, 219, 238, 0.74);
  background: linear-gradient(180deg, #f3f8ff 0%, #edf5ff 100%);
  color: #36506d;
  font-size: 0.8rem;
  line-height: 1.4;
  font-weight: 700;
}

.student-notif-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

.student-notif-settings__actions .btn-main,
.student-notif-settings__actions .btn-sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.student-notif-settings__actions .btn-main i,
.student-notif-settings__actions .btn-sub i {
  font-size: 0.82rem;
  line-height: 1;
}

.student-notif-settings__actions .btn-main {
  min-width: 88px;
  background: linear-gradient(180deg, var(--app-primary) 0%, var(--app-primary-strong) 100%);
  box-shadow: 0 10px 18px rgba(11, 118, 255, 0.18);
}

.student-notif-settings__actions .btn-sub {
  border: 1px solid rgba(205, 217, 233, 0.9);
  background: rgba(255, 255, 255, 0.9);
  color: #233954;
}

@media (min-width: 640px) {
  .student-notif-inline-actions {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  .student-notif-inline-actions .btn-main,
  .student-notif-inline-actions .btn-sub {
    width: auto;
    min-width: 148px;
    padding-inline: 14px;
  }

  .student-notif-modal__actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .student-notif-settings-modal {
    width: min(100%, 430px);
    padding: 14px;
  }

  .student-notif-settings__grid {
    grid-template-columns: 1fr;
  }

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

  .student-notif-settings__actions {
    justify-content: flex-start;
  }

  .student-notif-settings__actions .btn-main,
  .student-notif-settings__actions .btn-sub {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }
}

.student-whiteboard-stage {
  border-radius: 14px;
  background: #f5f8fc;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.teacher-whiteboard-stage {
  border-radius: 14px;
  background: #f5f8fc;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.student-whiteboard-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.student-whiteboard-empty {
  color: var(--app-muted);
  font-weight: 700;
  text-align: center;
  padding: 14px;
}

:fullscreen::backdrop,
:-moz-full-screen::backdrop {
  background: #000 !important;
}

html:fullscreen,
html:-webkit-full-screen,
html:-moz-full-screen,
html:fullscreen body,
html:-webkit-full-screen body,
html:-moz-full-screen body,
body:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen {
  background: #000 !important;
}

.wb-student-fullscreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  height: var(--wb-vh, 100dvh);
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
}

.wb-student-fullscreen.is-open {
  display: flex;
}

.wb-student-fullscreen-image {
  max-width: 100%;
  max-height: calc(var(--wb-vh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  border-radius: 10px;
}

.wb-student-fullscreen-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
}

.wb-student-fullscreen-empty {
  color: #d7deea;
  font-weight: 700;
}

@media (orientation: landscape) {
  .wb-student-fullscreen {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .wb-student-fullscreen-image {
    max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px);
    max-height: calc(var(--wb-vh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
  }

  .wb-student-fullscreen-close {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }
}

#wbStudentStage:fullscreen,
#wbStudentStage:-webkit-full-screen,
#wbStudentStage:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
  margin: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
}

#wbStudentStage:fullscreen .student-whiteboard-image,
#wbStudentStage:-webkit-full-screen .student-whiteboard-image,
#wbStudentStage:-moz-full-screen .student-whiteboard-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: default;
}

#wbStudentStage:fullscreen .student-whiteboard-empty,
#wbStudentStage:-webkit-full-screen .student-whiteboard-empty,
#wbStudentStage:-moz-full-screen .student-whiteboard-empty {
  color: #d7deea;
}

.teacher-mode .container-app {
  --container-app-max: 1240px;
  width: min(100%, var(--container-app-max));
}

.teacher-shell {
  border-radius: 22px;
}

.teacher-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-whiteboard-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-whiteboard-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 12px;
  background: #eef3fb;
  padding: 7px 10px;
  font-weight: 700;
}

.teacher-whiteboard-tool i {
  font-size: 1.15rem;
}

.teacher-whiteboard-tool input[type="range"] {
  width: 130px;
}

.teacher-whiteboard-tool input[type="color"] {
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
}

.teacher-whiteboard-canvas {
  width: 100%;
  height: min(72vh, 760px);
  display: block;
  touch-action: none;
  background: #fff;
}

.btn-settings-danger {
  color: #9f1f32;
  background: #fdf2f4;
}

.btn-settings-primary {
  color: #17477f;
  background: #eaf2ff;
}

.app-footer {
  position: relative;
  font-family: "Raleway", "Segoe UI", Arial, sans-serif;
  margin: 32px 0 30px;
  padding: 0;
  text-align: center;
  color: #627489;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.32;
}

.app-footer::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, rgba(216, 225, 235, 0) 0%, rgba(216, 225, 235, 0.86) 24%, rgba(216, 225, 235, 1) 50%, rgba(216, 225, 235, 0.86) 76%, rgba(216, 225, 235, 0) 100%);
}

.app-footer a {
  color: #1f4f82;
  text-decoration: none;
  font-weight: 500;
}

.app-footer a:hover {
  text-decoration: underline;
}

.alert {
  border-radius: 12px;
  border-width: 1px;
  font-size: 0.9rem;
  margin: 10px 12px 0;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .container-app {
    --container-app-pad: 10px;
    padding-inline: var(--container-app-pad);
  }

  .gf-topbar {
    min-height: 78px;
    padding: 6px 0 10px;
  }

  .gf-brand-logo {
    max-width: min(var(--app-header-logo-w-mobile), 62vw);
    height: auto;
  }

  .btn-install {
    font-size: 0.82rem;
    padding: 7px 10px;
  }

  .app-shell {
    border-radius: 16px;
    padding: 10px;
  }

  body.student-mode .app-shell {
    border-radius: 0;
    padding: 0;
  }

  .student-chat-page .chat-shell__frame {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .student-chat-page .chat-roster,
  .student-chat-page .chat-room {
    border-radius: 18px;
  }

  .student-chat-page .chat-roster {
    min-height: auto;
  }

  .student-chat-page .chat-room {
    min-height: calc(100dvh - 210px);
  }

  .student-chat-page .chat-roster__head,
  .student-chat-page .chat-room__head {
    padding: 14px;
  }

  .student-chat-page .chat-roster__section {
    padding: 10px;
  }

  .student-chat-page .chat-roster-list {
    max-height: 34vh;
  }

  .student-chat-page .chat-roster-item {
    padding: 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .student-chat-page .chat-roster-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .student-chat-page .chat-room__avatar {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .student-chat-page .chat-room__chips {
    justify-content: flex-start;
  }

  .student-chat-page .chat-room__banner {
    margin: 10px 10px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .student-chat-page .chat-thread--student {
    padding: 10px;
  }

  .student-chat-page .chat-message__bubble {
    max-width: 92%;
  }

  .student-chat-page .chat-composer--student {
    padding: 10px;
  }

  .student-chat-page .chat-attachment-preview {
    padding: 9px 10px;
    align-items: flex-start;
  }

  .student-chat-page .chat-attachment-preview__main {
    align-items: flex-start;
  }

  .student-chat-page .chat-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .action-card {
    border-radius: 14px;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  .action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .action-icon i {
    font-size: 1.5rem;
  }

  .action-main {
    font-size: 0.96rem;
  }

  .files-app-toolbar {
    padding: 10px 11px;
  }

  .files-app-list {
    padding: 8px;
    gap: 7px;
  }

  .files-app-item {
    border-radius: 12px;
    padding: 9px;
    gap: 9px;
  }

  .files-app-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .files-app-item-icon i {
    font-size: 1.05rem;
  }

  .chat-frame {
    border-radius: 16px;
  }

  .chat-thread {
    max-height: 48vh;
    padding: 10px;
  }

  .student-chat-page .chat-imessage-stage {
    min-height: calc(100dvh - 176px);
    border-radius: 18px;
  }

  .student-chat-page .chat-thread--imessage {
    padding: 10px;
  }

  .chat-composer-meta {
    align-items: flex-start;
    gap: 6px;
  }

  .chat-quota-meta {
    max-width: 62%;
    font-size: 0.74rem;
    line-height: 1.2;
  }

  .chat-mini-btn {
    width: 36px;
    height: 36px;
  }

  .chat-send-btn {
    width: 40px;
    height: 40px;
  }

  .teacher-whiteboard-canvas {
    height: min(58vh, 540px);
  }
}
