:root {
  color-scheme: light;
  --md-primary: #6c5ce7;
  --md-on-primary: #ffffff;
  --md-primary-container: #e0dcfc;
  --md-on-primary-container: #1e1b4b;
  --md-secondary: #00b894;
  --md-secondary-container: #dffff5;
  --md-tertiary: #0984e3;
  --md-tertiary-container: #d6f0ff;
  --md-error: #ba1a1a;
  --md-surface: #f7fbf8;
  --md-surface-container: #ebefec;
  --md-surface-high: #ffffff;
  --md-outline: #6f7976;
  --md-outline-variant: #bec9c5;
  --md-text: #191c1b;
  --md-muted: #59615f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --md-primary: #7fd8cc;
  --md-on-primary: #003c36;
  --md-primary-container: #005047;
  --md-on-primary-container: #9cf2e4;
  --md-secondary: #b0ccc6;
  --md-secondary-container: #334b47;
  --md-tertiary: #b1c9e8;
  --md-tertiary-container: #31495f;
  --md-error: #ffb4ab;
  --md-surface: #09090b;
  --md-surface-container: #18181b;
  --md-surface-high: #27272a;
  --md-outline: #52525b;
  --md-outline-variant: #3f3f46;
  --md-text: #f4f4f5;
  --md-muted: #a1a1aa;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 28px rgba(0, 0, 0, .5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--md-surface);
  color: var(--md-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.landing-page {
  min-height: 100vh;
  padding: 24px;
  background: var(--md-surface);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.landing-page::before,
.landing-page::after {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  filter: blur(140px);
  -webkit-filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

.landing-page::before {
  top: -15%;
  left: -10%;
  background: rgba(108, 92, 231, 0.35);
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.landing-page::after {
  bottom: -20%;
  right: -10%;
  background: rgba(116, 185, 255, 0.35);
  animation: floatOrb 25s infinite alternate-reverse ease-in-out;
}

body[data-theme="dark"] .landing-page::before {
  background: rgba(108, 92, 231, 0.18);
}
body[data-theme="dark"] .landing-page::after {
  background: rgba(116, 185, 255, 0.15);
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6%, 10%) scale(1.1); }
  100% { transform: translate(-4%, -8%) scale(0.95); }
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 22px;
  padding: 10px 0;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--md-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
}

.landing-brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  animation: logoPulse 3.4s ease-in-out infinite;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--md-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.mobile-menu-toggle:hover {
  background: var(--md-surface-container);
}

.landing-actions,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 999px;
  background: var(--md-surface-high);
  color: var(--md-text);
  box-shadow: var(--shadow-1);
}

.theme-toggle:hover {
  border-color: rgba(0, 106, 96, .42);
}

.theme-toggle span {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  max-width: 900px;
  margin: 60px auto 0;
}

.landing-copy {
  position: relative;
  text-align: center;
  color: var(--md-text);
  animation: heroRise .65s ease-out both;
  width: 100%;
}

.landing-copy::after {
  display: none;
}

.landing-copy .crumb,
.landing-copy p {
  color: rgba(255, 255, 255, .86);
}

.slogan-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 14px 0 0;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .34);
  color: #ffffff;
  font-weight: 800;
}

.landing-copy h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.1;
  text-wrap: balance;
  margin: 20px auto 0;
  color: var(--md-text);
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-copy > p:not(.crumb) {
  margin: 24px auto 0;
  max-width: 640px;
  font-size: 19px;
  color: var(--md-muted);
}

.landing-copy .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.emoji-cloud, .word-stream {
  display: none;
}

.word-stream span {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #ffffff;
  font-weight: 700;
}

.landing-copy .filled-button {
  background: #6c5ce7;
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(108,92,231,0.25);
  transition: transform .2s, box-shadow .2s;
  border: none;
}
.landing-copy .filled-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,92,231,0.35);
}

.landing-copy .tonal-button,
.landing-copy .tonal-link {
  background: var(--md-surface-high);
  color: var(--md-text);
  border: 1px solid var(--md-outline-variant);
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  transition: transform .2s, border-color .2s;
  text-decoration: none;
}
.landing-copy .tonal-button:hover,
.landing-copy .tonal-link:hover {
  border-color: #a29bfe;
  color: #6c5ce7;
  transform: translateY(-2px);
}

.landing-course-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  border-radius: 24px;
  background: linear-gradient(135deg, #6c5ce7, #5a4bd1);
  color: #ffffff;
  border: none;
  box-shadow: 0 12px 40px rgba(108,92,231,0.2);
  margin-top: 20px;
}

body[data-theme="dark"] .landing-course-card,
body[data-theme="dark"] .impact-strip span,
body[data-theme="dark"] .landing-section,
body[data-theme="dark"] .home-section,
body[data-theme="dark"] .content-card,
body[data-theme="dark"] .lesson-card,
body[data-theme="dark"] .quiz-shell,
body[data-theme="dark"] .auth-card {
  background: var(--md-surface-high);
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] .info-section {
  background:
    linear-gradient(135deg, rgba(108, 92, 231, .1), rgba(116, 185, 255, .1)),
    var(--md-surface-high);
}

body[data-theme="dark"] .info-grid article,
body[data-theme="dark"] .feature-card,
body[data-theme="dark"] .team-card,
body[data-theme="dark"] .account-status,
body[data-theme="dark"] .answer-option,
body[data-theme="dark"] .question-card {
  background: rgba(24, 24, 27, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .rail,
body[data-theme="dark"] .progress-panel {
  background: #151b1a;
}

body[data-theme="dark"] .back-to-top {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

body[data-theme="dark"] .landing-course-card img,
body[data-theme="dark"] .landing-brand img {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .34);
}

.landing-course-card img {
  display: none;
}

.landing-course-card strong {
  display: block;
  font-size: 36px;
  color: #ffffff;
  margin: 10px 0;
}

.landing-course-card .hero-stats {
  display: flex;
  gap: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.landing-course-card .hero-stats span {
  font-size: 18px;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
}
.landing-course-card .hero-stats b {
  color: #ffffff;
}
.panel-label {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: bold;
}
.energy-stack {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.energy-stack span {
  background: #ffffff;
  color: #6c5ce7;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 700;
  margin: 0 !important;
}

.impact-strip {
  max-width: 1180px;
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.impact-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
  font-weight: 800;
  text-align: center;
  animation: popIn .45s ease-out both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.impact-strip span:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
}

.impact-strip span:nth-child(2) { animation-delay: .08s; }
.impact-strip span:nth-child(3) { animation-delay: .16s; }
.impact-strip span:nth-child(4) { animation-delay: .24s; }

.landing-section {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 40px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}

.landing-section h2 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.14;
}

.info-section {
  background: linear-gradient(135deg, rgba(108, 92, 231, .05), rgba(116, 185, 255, .08));
}

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

.info-grid article {
  min-height: 142px;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.info-grid article:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.4);
}

.info-grid strong,
.info-grid span {
  display: block;
}

.info-grid strong {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.1;
}

.info-grid span {
  color: var(--md-muted);
}

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

.rail,
.progress-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  padding: 22px;
  padding-bottom: 80px;
}

.rail {
  background: #eef5f1;
  border-right: 1px solid var(--md-outline-variant);
}

.progress-panel {
  background: #f4f7f4;
  border-left: 1px solid var(--md-outline-variant);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-logo,
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
}

.brand-mark {
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-weight: 800;
  font-size: 24px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.crumb,
.meta,
.muted {
  color: var(--md-muted);
}

.search-wrap {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--md-surface-high);
  border: 1px solid transparent;
  box-shadow: var(--shadow-1);
}

.search-wrap:focus-within {
  border-color: var(--md-primary);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.module {
  margin: 20px 0;
}

.module-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--md-secondary);
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin: 3px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--md-text);
  background: transparent;
  text-align: left;
  transition: background-color .15s ease, transform .15s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--md-secondary-container);
  transform: translateX(4px);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--md-surface-high);
  color: var(--md-secondary);
  font-size: 14px;
}

.nav-item.active .nav-icon {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.nav-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check {
  color: var(--md-primary);
}

.workspace {
  padding: 24px 28px 44px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  margin-bottom: 18px;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  font-size: 28px;
  line-height: 1.15;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  min-height: 40px;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 999px;
  background: #ffffff;
  color: var(--md-text);
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}

.account-status:hover {
  border-color: rgba(0, 106, 96, .42);
}

.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-size: 14px;
  font-weight: 800;
}

.account-avatar-img {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--md-outline-variant);
  background: #ffffff;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  color: var(--md-text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.landing-account {
  max-width: 240px;
}

.account-menu {
  position: fixed;
  z-index: 30;
  width: min(300px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--md-surface-high);
  border: 1px solid var(--md-outline-variant);
  box-shadow: var(--shadow-2);
}

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

.account-menu label {
  display: grid;
  gap: 6px;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 800;
}

.account-menu input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  background: var(--md-surface);
  color: var(--md-text);
  outline: 0;
}

.account-menu input:focus {
  border-color: var(--md-primary);
}

.icon-button,
.filled-button,
.tonal-button,
.text-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
}

.icon-button {
  display: none;
  width: 44px;
  padding: 0;
  background: var(--md-surface-container);
}

.filled-button {
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--shadow-1);
}

.filled-button:disabled {
  background: #c7cfcb;
  color: #68706d;
  box-shadow: none;
  cursor: default;
}

.tonal-button {
  background: var(--md-secondary-container);
  color: #06201c;
}

.compact-action {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  flex: 0 0 auto;
}

.tonal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--md-secondary-container);
  color: #06201c;
  text-decoration: none;
  white-space: nowrap;
}

.tonal-link.compact-action,
.tonal-button.compact-action {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 32px;
}

.text-button {
  background: transparent;
  color: var(--md-primary);
}

.auth-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(0, 32, 28, .48);
}

.auth-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .22);
  box-shadow: var(--shadow-2);
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-surface-high);
  color: var(--md-text);
  outline: 0;
}

.auth-card input:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, .14);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  min-height: 36px;
  width: 36px;
  background: var(--md-surface-container);
}

.auth-message {
  min-height: 20px;
  color: var(--md-primary);
  font-size: 13px;
}

.auth-message.error {
  color: var(--md-error);
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 999px;
  background: #ffffff;
  color: var(--md-text);
  box-shadow: var(--shadow-1);
}

.google-button .google-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.google-button:disabled {
  color: var(--md-muted);
  cursor: default;
  opacity: .72;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--md-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--md-outline-variant);
}

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

.stat-card,
.lesson-card,
.quiz-shell,
.empty-state,
.content-card {
  background: var(--md-surface-high);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(111, 121, 118, .16);
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stat-card span {
  color: var(--md-muted);
  font-size: 14px;
}

.certificate-card {
  display: grid;
  align-content: start;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(156, 242, 228, .36), rgba(208, 228, 255, .28)),
    var(--md-surface-high);
}

.certificate-card strong {
  color: var(--md-primary);
}

.certificate-card .compact-action,
.certificate-panel .compact-action {
  width: fit-content;
  margin-top: 4px;
}

.certificate-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.certificate-panel span {
  color: inherit;
  font-size: 13px;
}

.content-view {
  outline: 0;
}

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
  gap: 18px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(0, 106, 96, .95), rgba(73, 97, 122, .92)),
    url("/assets/edteacher-logo.png") center/cover;
  color: #ffffff;
  box-shadow: var(--shadow-2);
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}

.hero-copy .crumb,
.hero-copy .hero-lead {
  color: rgba(255, 255, 255, .86);
}

.hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: var(--shadow-2);
  margin-bottom: 28px;
}

.hero-copy h2 {
  position: relative;
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
}

.hero-lead {
  position: relative;
  max-width: 620px;
  font-size: 18px;
  margin: 18px 0 0;
}

.hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-actions .filled-button {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.hero-panel strong {
  display: block;
  font-size: 28px;
  line-height: 1.14;
}

.panel-label {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 700;
  font-size: 13px;
}

.hero-stats {
  display: grid;
  gap: 10px;
}

.hero-stats span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--md-outline-variant);
  color: var(--md-muted);
}

.hero-stats b {
  color: var(--md-text);
}

.home-section {
  margin-top: 22px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.home-section h2 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.15;
}

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

.feature-card,
.team-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover,
.team-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.4);
}

.feature-card span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0edff 0%, #e8f4ff 100%);
  color: #6c5ce7;
  font-weight: 800;
  font-size: 24px;
}

.feature-card h3 {
  margin: 14px 0 6px;
}

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

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

.team-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(145deg, rgba(248, 251, 248, .95), rgba(232, 246, 242, .95)),
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(0, 106, 96, .08) 12px 13px);
}

.team-card strong {
  display: block;
  font-size: 26px;
}

.team-card span {
  color: var(--md-muted);
}

.content-card,
.lesson-card,
.quiz-shell {
  padding: 26px;
}

.course-description h3:first-child,
.lesson-body h1:first-child,
.lesson-body h2:first-child,
.lesson-body h3:first-child {
  margin-top: 0;
}

.lesson-header,
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--md-tertiary-container);
  color: #031d34;
  font-size: 13px;
}

.lesson-body {
  max-width: 920px;
}

.lesson-body table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 18px 0;
}

.lesson-body th,
.lesson-body td {
  border: 1px solid var(--md-outline-variant);
  padding: 10px;
  text-align: left;
}

.lesson-body th {
  background: #eef5f1;
}

body[data-theme="dark"] .lesson-body th {
  background: #26322f;
}

body[data-theme="dark"] .lesson-body td,
body[data-theme="dark"] .lesson-body th {
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] .lesson-body blockquote {
  background: #182522;
  border-color: var(--md-primary);
}

body[data-theme="dark"] input,
body[data-theme="dark"] .search-wrap {
  background: var(--md-surface-container);
  color: var(--md-text);
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] .tonal-button,
body[data-theme="dark"] .tonal-link {
  color: var(--md-text);
}

body[data-theme="dark"] .filled-button {
  color: var(--md-on-primary);
}

.lesson-body img,
.lesson-body iframe {
  max-width: 100%;
}

.lesson-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--md-primary);
  background: #eef8f4;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.video-callout {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  border-radius: var(--radius-md);
}

.quiz-form {
  display: grid;
  gap: 14px;
}

.quiz-intro {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #eef5f1;
}

.question-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #f8fbf8;
  border: 1px solid var(--md-outline-variant);
}

.question-card.is-correct {
  border-color: rgba(0, 106, 96, .45);
  background: #effbf7;
}

.question-card.is-wrong {
  border-color: rgba(186, 26, 26, .45);
  background: #fff8f7;
}

.question-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

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

.answer-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--md-surface-high);
  border: 1px solid var(--md-outline-variant);
}

.answer-feedback {
  display: none;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--md-surface-high);
  border: 1px solid var(--md-outline-variant);
}

.answer-feedback strong,
.answer-feedback span {
  display: block;
}

.is-correct .answer-feedback,
.is-wrong .answer-feedback {
  display: grid;
}

.is-correct .answer-feedback strong {
  color: var(--md-primary);
}

.is-wrong .answer-feedback strong {
  color: var(--md-error);
}

.blank-input {
  width: min(100%, 420px);
  min-height: 48px;
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--md-surface-high);
  outline: 0;
}

.blank-input:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, .14);
}

.result-panel {
  display: none;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.result-panel.visible {
  display: block;
}

.progress-panel h2 {
  margin: 0 0 14px;
}

.progress-summary {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--md-outline-variant);
}

.meter {
  width: 100%;
  height: 10px;
  margin: 18px 0;
  border-radius: 999px;
  background: var(--md-surface-container);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--md-primary);
  border-radius: inherit;
  transition: width .2s ease;
}

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

.score-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--md-surface-high);
  border: 1px solid var(--md-outline-variant);
}

.score-card strong,
.score-card span {
  display: block;
}

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

.empty-state {
  padding: 26px;
  text-align: center;
}

.teacher-dialog {
  width: min(520px, calc(100vw - 28px));
}

.teacher-studio {
  display: grid;
  gap: 18px;
}

.teacher-hero,
.lesson-flow {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.teacher-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(156, 242, 228, .35), rgba(208, 228, 255, .32)),
    var(--md-surface-high);
}

.teacher-hero h2,
.teacher-hero p,
.lesson-flow h3 {
  margin: 0;
}

.teacher-hero h2 {
  font-size: 32px;
  line-height: 1.1;
}

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

.teacher-command {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 210px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.teacher-command > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-weight: 800;
}

.teacher-command strong {
  font-size: 20px;
}

.teacher-command p {
  min-height: 50px;
  margin: 0;
  color: var(--md-muted);
}

.teacher-command .compact-action {
  width: fit-content;
  align-self: end;
}

.lesson-flow {
  display: grid;
  gap: 14px;
}

.flow-list {
  display: grid;
  gap: 8px;
}

.flow-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-surface-high);
  color: var(--md-text);
  text-align: left;
}

.flow-list button:hover {
  border-color: rgba(0, 106, 96, .42);
  box-shadow: var(--shadow-1);
}

.flow-list strong,
.flow-list span {
  display: block;
}

.flow-list span {
  color: var(--md-muted);
  font-size: 13px;
}

.whiteboard-dialog {
  width: min(1180px, calc(100vw - 24px));
  height: min(820px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.whiteboard-dialog::backdrop {
  background: rgba(0, 32, 28, .62);
}

.teacher-generator {
  display: grid;
  gap: 14px;
}

.generator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.generator-header h2,
.generator-header p {
  margin: 0;
}

.generator-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline-variant);
}

.generator-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--md-text);
  font-weight: 700;
}

.generator-tabs button.active {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.test-builder {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.question-bank,
.paper-preview-panel,
.saved-test-card {
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .16);
  box-shadow: var(--shadow-1);
}

.question-bank {
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding: 18px;
}

.bank-header,
.paper-actions,
.saved-test-card,
.saved-test-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bank-header h3,
.bank-questions h3,
.custom-question-form h3 {
  margin: 0;
}

.bank-header p {
  margin: 3px 0 0;
  font-size: 13px;
}

.level-list,
.bank-questions,
.custom-question-form,
.saved-tests {
  display: grid;
  gap: 10px;
}

.level-list {
  margin: 14px 0;
}

.bank-level {
  display: grid;
  gap: 6px;
}

.bank-level h4 {
  margin: 0;
  color: var(--md-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.bank-level button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--md-text);
  text-align: left;
}

.bank-level button.active,
.bank-level button:hover {
  background: var(--md-secondary-container);
}

.bank-level button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-level button strong {
  display: grid;
  place-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--md-surface-high);
  color: var(--md-secondary);
  font-size: 12px;
}

.bank-question {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline-variant);
  cursor: grab;
}

.bank-question:active {
  cursor: grabbing;
}

.bank-question strong {
  font-size: 14px;
  line-height: 1.25;
}

.bank-question span {
  color: var(--md-muted);
  font-size: 12px;
}

.bank-question .compact-action {
  justify-self: start;
}

.custom-question-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--md-outline-variant);
}

.custom-question-form label,
.paper-actions label {
  display: grid;
  gap: 6px;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 700;
}

.custom-question-form input,
.custom-question-form textarea,
.paper-actions input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-surface-high);
  color: var(--md-text);
}

.paper-preview-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.paper-actions {
  align-items: end;
}

.paper-actions label {
  flex: 1;
}

.paper-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.test-paper {
  width: min(100%, 820px);
  min-height: 980px;
  margin: 0 auto;
  padding: 34px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #191c1b;
  border: 1px solid #d7dfdc;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .12);
}

.test-paper.drag-over {
  outline: 3px solid rgba(0, 106, 96, .24);
}

.paper-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid #c7d0cc;
}

.paper-title h3,
.paper-title p {
  margin: 0;
}

.paper-title h3 {
  font-size: 28px;
  line-height: 1.15;
}

.paper-title p {
  margin-top: 8px;
  color: #59615f;
}

.paper-title img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.student-line {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  margin: 24px 0;
}

.student-line span {
  min-height: 32px;
  border-bottom: 1px solid #59615f;
}

.paper-question-list {
  padding-left: 22px;
}

.paper-question-list > li {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #d7dfdc;
  border-radius: 12px;
}

.paper-empty {
  color: #59615f;
}

.paper-question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.paper-question-head strong {
  line-height: 1.3;
}

.blank-line {
  height: 38px;
  margin-top: 12px;
  border-bottom: 1px solid #191c1b;
}

.answer-key-line {
  margin: 12px 0 0;
  color: #006a60;
}

.saved-tests {
  grid-template-columns: 1fr;
}

.saved-test-card {
  padding: 16px;
}

.saved-test-card strong,
.saved-test-card span {
  display: block;
}

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

.auth-message.error {
  color: var(--md-error);
}

.whiteboard-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--md-surface-high);
  border: 1px solid rgba(111, 121, 118, .22);
  box-shadow: var(--shadow-2);
}

.whiteboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
  background: var(--md-surface-high);
}

.whiteboard-toolbar h2,
.whiteboard-toolbar p {
  margin: 0;
}

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

.tool-button,
.color-swatch {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 999px;
  background: var(--md-surface-container);
  color: var(--md-text);
  font-weight: 800;
}

.tool-button.active,
.color-swatch.active {
  outline: 3px solid rgba(0, 106, 96, .22);
  border-color: var(--md-primary);
}

.size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 999px;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 700;
}

.size-control input {
  width: 110px;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-swatch::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, .14);
}

.whiteboard-close {
  display: grid;
  place-items: center;
  background: var(--md-surface-container);
}

#whiteboardCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  background:
    linear-gradient(var(--md-outline-variant) 1px, transparent 1px),
    linear-gradient(90deg, var(--md-outline-variant) 1px, transparent 1px),
    #ffffff;
  background-size: 32px 32px;
  touch-action: none;
  cursor: crosshair;
}

body[data-theme="dark"] .teacher-hero,
body[data-theme="dark"] .lesson-flow,
body[data-theme="dark"] .teacher-command,
body[data-theme="dark"] .flow-list button,
body[data-theme="dark"] .generator-header,
body[data-theme="dark"] .question-bank,
body[data-theme="dark"] .paper-preview-panel,
body[data-theme="dark"] .saved-test-card,
body[data-theme="dark"] .whiteboard-shell,
body[data-theme="dark"] .whiteboard-toolbar {
  background: var(--md-surface-high);
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] .bank-question,
body[data-theme="dark"] .generator-tabs {
  background: var(--md-surface-container);
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] .custom-question-form input,
body[data-theme="dark"] .custom-question-form textarea,
body[data-theme="dark"] .paper-actions input {
  background: var(--md-surface-container);
  color: var(--md-text);
  border-color: var(--md-outline-variant);
}

body[data-theme="dark"] #whiteboardCanvas {
  background:
    linear-gradient(rgba(63, 73, 70, .45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 73, 70, .45) 1px, transparent 1px),
    #ffffff;
  background-size: 32px 32px;
}

.hidden {
  display: none !important;
}

html.fast-route-learn #landingPage {
  display: none !important;
}

html.fast-route-learn #appShell {
  display: grid !important;
}

@media (max-width: 840px) {
  html.fast-route-learn #appShell {
    display: block !important;
  }
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(22px) rotate(1deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes floatTile {
  0%, 100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-16px) rotate(4deg);
  }
}

@keyframes wordDrift {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes ribbonSlide {
  0%, 100% {
    transform: translateX(0) rotate(-12deg);
  }
  50% {
    transform: translateX(-34px) rotate(-8deg);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

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

  .progress-panel {
    display: none;
  }

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

@media (max-width: 840px) {
  .landing-page {
    padding: 12px;
  }

  .landing-nav {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }

  .landing-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .landing-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-toggle {
    display: block;
    margin-left: auto;
  }

  .landing-nav {
    flex-wrap: wrap;
  }

  .landing-actions {
    display: none;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--md-outline-variant);
  }

  .landing-nav.menu-open .landing-actions {
    display: flex;
  }

  .landing-actions .theme-toggle {
    flex: 0 0 40px;
  }
  
  .landing-actions .account-status,
  .landing-actions .tonal-button {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .landing-actions .filled-button {
    flex: 0 0 100%;
    width: 100%;
    justify-content: center;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .landing-copy,
  .landing-course-card {
    min-height: auto;
    border-radius: 24px;
  }

  .landing-copy {
    padding: 22px;
  }

  .landing-copy h1 {
    margin-top: 18px;
    font-size: clamp(34px, 12vw, 48px);
    line-height: 1.02;
  }

  .landing-copy > p:not(.crumb) {
    font-size: 16px;
  }

  .landing-copy .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .landing-copy .hero-actions > * {
    width: 100%;
    min-height: 44px;
  }

  .emoji-cloud {
    position: relative;
    inset: auto;
    width: 100%;
    height: 82px;
    margin-bottom: 12px;
  }

  .emoji-cloud span {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .word-stream {
    margin-top: 24px;
    padding-bottom: 2px;
  }

  .landing-section {
    padding: 20px;
    border-radius: 24px;
  }

  .landing-section h2 {
    font-size: 25px;
  }

  .impact-strip {
    grid-template-columns: 1fr;
  }

  .landing-course-card {
    gap: 18px;
    padding: 22px;
  }

  .app-shell {
    display: block;
  }

  .rail {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(88vw, 340px);
    box-shadow: var(--shadow-2);
  }

  .rail.open {
    display: block;
  }

  .workspace {
    padding: 16px;
  }

  .icon-button {
    display: grid;
    place-items: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    display: flex;
  }

  .topbar .account-name {
    display: none;
  }

  .topbar-actions .filled-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 44px;
    font-size: 0;
  }
  .topbar-actions .filled-button::before {
    content: '→';
    font-size: 24px;
  }

  .dashboard,
  .welcome-grid,
  .home-hero,
  .feature-grid,
  .info-grid,
  .team-grid,
  .teacher-command-grid,
  .test-builder {
    grid-template-columns: 1fr;
  }

  .teacher-hero,
  .whiteboard-toolbar,
  .generator-header,
  .paper-actions,
  .saved-test-card {
    display: grid;
    align-items: start;
  }

  .generator-tabs {
    width: 100%;
  }

  .generator-tabs button {
    flex: 1;
  }

  .question-bank {
    max-height: none;
  }

  .paper-actions > div,
  .saved-test-actions {
    justify-content: flex-start;
  }

  .test-paper {
    min-height: 720px;
    padding: 22px;
  }

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

  .paper-title h3 {
    font-size: 22px;
  }

  .teacher-hero h2 {
    font-size: 26px;
  }

  .whiteboard-dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .whiteboard-tools {
    justify-content: flex-start;
  }

  .size-control {
    width: 100%;
    justify-content: space-between;
  }

  .size-control input {
    width: min(180px, 48vw);
  }

  .flow-list button {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy,
  .hero-panel {
    min-height: auto;
  }

  .lesson-header,
  .quiz-header {
    display: block;
  }
}

@media (max-width: 460px) {
  .landing-actions .account-status {
    flex: 1;
    min-width: 150px; /* Force to take remaining space */
  }

  .landing-actions .tonal-button {
    flex: 0 0 100%;
    width: 100%;
  }

  .landing-copy {
    padding: 18px;
  }

  .landing-copy h1 {
    font-size: 34px;
  }

  .impact-strip span,
  .info-grid article,
  .feature-card,
  .team-card {
    border-radius: 18px;
  }
}


.certificate-verify-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(156, 242, 228, .55), transparent 34%),
    linear-gradient(240deg, rgba(208, 228, 255, .72), transparent 38%),
    var(--md-surface);
}

body[data-theme="dark"] .certificate-verify-page {
  background:
    linear-gradient(120deg, rgba(0, 106, 96, .26), transparent 34%),
    linear-gradient(240deg, rgba(73, 97, 122, .28), transparent 40%),
    var(--md-surface);
}

.certificate-verify-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--md-surface-high);
  border: 1px solid var(--md-outline-variant);
  box-shadow: var(--shadow-2);
  text-align: center;
}

.certificate-verify-card img {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 20px;
}

.certificate-verify-card h1 { margin: 0; font-size: 24px; }
.certificate-verify-card .crumb { margin: 0; }

.certificate-details {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 16px 0;
  border-top: 1px solid var(--md-outline-variant);
  border-bottom: 1px solid var(--md-outline-variant);
  text-align: left;
}

.certificate-details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.certificate-details span { color: var(--md-muted); }.certificate-verify-card .filled-button {
  text-decoration: none;
  justify-self: center;
}

.nav-separator { display: flex; align-items: center; margin: 32px 16px 12px; } 
.nav-separator span { background: var(--md-sys-color-primary-container, #d9f5ef); color: var(--md-sys-color-on-primary-container, #00201c); padding: 6px 14px; border-radius: 16px; font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--md-sys-color-primary, #006a60); box-shadow: var(--shadow-1); } 
.nav-separator::after { content: ""; flex: 1; height: 2px; background: var(--md-sys-color-primary, #006a60); opacity: 0.2; margin-left: 16px; border-radius: 2px; }

.landing-footer {
  text-align: center;
  padding: 40px 20px 20px;
  border-top: 1px solid var(--md-outline-variant);
  margin-top: 40px;
}
.landing-footer .copyright {
  color: var(--md-muted);
  font-size: 0.85rem;
  margin-top: 16px;
}
.social-links, .rail-social {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.rail-social {
  margin-top: auto;
  padding: 24px 0 12px;
}
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-highest, #e1e3e1);
  color: var(--md-sys-color-on-surface-variant, #444746);
  transition: all 0.2s ease;
}
.social-icon-btn:hover {
  background: var(--md-sys-color-primary, #006a60);
  color: white;
  transform: translateY(-2px);
}
[data-theme="dark"] .social-icon-btn {
  background: var(--md-sys-color-surface-container-highest, #333635);
  color: var(--md-sys-color-on-surface-variant, #c4c7c5);
}
[data-theme="dark"] .social-icon-btn:hover {
  background: var(--md-sys-color-primary, #64ffda);
  color: #00201c;
}

/* ── Maintenance Mode Screen ─────────────────────────── */

.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #004d40 0%, #00796b 50%, #009688 100%);
  padding: 24px;
}
.maintenance-screen.hidden { display: none; }

.maintenance-card {
  text-align: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 28px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.maintenance-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.maintenance-card h1 {
  font-size: 2rem;
  margin: 0 0 12px;
  font-weight: 800;
}
.maintenance-card p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0;
}
.maintenance-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}
.maintenance-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  animation: maintenancePulse 1.4s ease-in-out infinite;
}
.maintenance-dots span:nth-child(2) { animation-delay: 0.2s; }
.maintenance-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes maintenancePulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Marketing Popup ─────────────────────────────────── */

.marketing-popup {
  border: none;
  border-radius: 24px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  background: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-on-surface, #1d1b20);
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  overflow: visible;
}
.marketing-popup::backdrop {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.popup-card {
  padding: 32px 28px 24px;
  position: relative;
}
.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--md-sys-color-surface-container-highest, #e1e3e1);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface, #1d1b20);
  transition: background 0.2s;
}
.popup-close:hover {
  background: var(--md-sys-color-error, #d32f2f);
  color: #fff;
}
.popup-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 12px;
  padding-right: 32px;
}
.popup-card p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 24px;
  color: var(--md-sys-color-on-surface-variant, #444746);
}
.popup-cta {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
}

[data-theme="dark"] .marketing-popup {
  background: #2b2930;
  color: #e6e0e9;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
[data-theme="dark"] .popup-card h2 {
  color: #e6e0e9;
}
[data-theme="dark"] .popup-card p {
  color: #c4c0c9;
}
[data-theme="dark"] .popup-close {
  background: #3b383e;
  color: #e6e0e9;
}
[data-theme="dark"] .popup-close:hover {
  background: #d32f2f;
  color: #fff;
}
[data-theme="dark"] .popup-cta {
  background: #64ffda;
  color: #00201c;
}
[data-theme="dark"] .popup-cta:hover {
  background: #80ffdf;
}