:root {
  color-scheme: light dark;
  --topbar-height: 74px;
  --section-header-inset: 14px;
  --bg: #d6d6cf;
  --surface: #e9e9e2;
  --surface-2: #deded6;
  --text: #171717;
  --muted: #6a6a65;
  --line: #c7c7bd;
  --brand: #111111;
  --brand-contrast: #f1f1ef;
  --lingot-hue: 155;
  --accent: #3f403b;
  --accent-text: #ffffff;
  --lingot-gold: #d1941f;
  --lingot-gold-deep: #a7660a;
  --signal-wait: #fff3bf;
  --signal-wait-line: #e5c96a;
  --radius: 8px;
  --shadow: 0 12px 40px rgb(0 0 0 / 0.06);
  --safe-bottom: max(18px, env(safe-area-inset-bottom, 0px));
}

html {
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
  scrollbar-width: thin;
}

* {
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 62%, transparent);
  background-clip: content-box;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0c;
    --surface: #171716;
    --surface-2: #20201e;
    --text: #f2f1ec;
    --muted: #a8a69f;
    --line: #30302d;
    --brand: #f5f5f5;
    --brand-contrast: #111111;
    --accent: #a8a69f;
    --accent-text: #0d0d0c;
    --lingot-gold: #f1c85f;
    --lingot-gold-deep: #c88918;
    --signal-wait: #403713;
    --signal-wait-line: #8d7626;
    --shadow: none;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #d6d6cf;
  --surface: #e9e9e2;
  --surface-2: #deded6;
  --text: #171717;
  --muted: #6a6a65;
  --line: #c7c7bd;
  --brand: #111111;
  --brand-contrast: #f1f1ef;
  --accent: #3f403b;
  --accent-text: #ffffff;
  --lingot-gold: #d1941f;
  --lingot-gold-deep: #a7660a;
  --signal-wait: #fff3bf;
  --signal-wait-line: #e5c96a;
  --shadow: 0 12px 40px rgb(0 0 0 / 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c;
  --surface: #171716;
  --surface-2: #20201e;
  --text: #f2f1ec;
  --muted: #a8a69f;
  --line: #30302d;
  --brand: #f5f5f5;
  --brand-contrast: #111111;
  --accent: #a8a69f;
  --accent-text: #0d0d0c;
  --lingot-gold: #f1c85f;
  --lingot-gold-deep: #c88918;
  --signal-wait: #403713;
  --signal-wait-line: #8d7626;
  --shadow: none;
}

:root[data-hue-custom="true"] {
  --bg: color-mix(in srgb, #d6d6cf 88%, hsl(var(--lingot-hue) 36% 54%));
  --surface: color-mix(in srgb, #e9e9e2 91%, hsl(var(--lingot-hue) 38% 66%));
  --surface-2: color-mix(in srgb, #deded6 88%, hsl(var(--lingot-hue) 36% 60%));
  --accent: hsl(var(--lingot-hue) 32% 28%);
}

@media (prefers-color-scheme: dark) {
  :root[data-hue-custom="true"] {
    --bg: color-mix(in srgb, #0d0d0c 84%, hsl(var(--lingot-hue) 36% 18%));
    --surface: color-mix(in srgb, #171716 87%, hsl(var(--lingot-hue) 36% 22%));
    --surface-2: color-mix(in srgb, #20201e 85%, hsl(var(--lingot-hue) 36% 25%));
    --accent: hsl(var(--lingot-hue) 31% 65%);
  }
}

:root[data-theme="light"][data-hue-custom="true"] {
  --bg: color-mix(in srgb, #d6d6cf 88%, hsl(var(--lingot-hue) 36% 54%));
  --surface: color-mix(in srgb, #e9e9e2 91%, hsl(var(--lingot-hue) 38% 66%));
  --surface-2: color-mix(in srgb, #deded6 88%, hsl(var(--lingot-hue) 36% 60%));
  --accent: hsl(var(--lingot-hue) 32% 28%);
}

:root[data-theme="dark"][data-hue-custom="true"] {
  --bg: color-mix(in srgb, #0d0d0c 84%, hsl(var(--lingot-hue) 36% 18%));
  --surface: color-mix(in srgb, #171716 87%, hsl(var(--lingot-hue) 36% 22%));
  --surface-2: color-mix(in srgb, #20201e 85%, hsl(var(--lingot-hue) 36% 25%));
  --accent: hsl(var(--lingot-hue) 31% 65%);
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: clip;
}

.site-shell {
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  position: fixed;
  z-index: 50;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  border-radius: 0 0 14px 14px;
  padding: 20px 14px;
  background: var(--bg);
  box-shadow: 0 14px 22px -20px rgb(0 0 0 / 0.48);
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 720;
  letter-spacing: 0;
}

.brand img {
  display: block;
  object-fit: contain;
}

.brand.wordmark img {
  width: 116px;
  height: auto;
  max-height: 34px;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
}

.brand.iconmark {
  display: none;
}

.brand.iconmark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.topbar-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.topbar-partner-mark {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.topbar-organization-logo {
  display: block;
  width: auto;
  max-width: 132px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 650;
}

@media (prefers-color-scheme: dark) {
  .brand.wordmark img,
  .brand.iconmark img,
  .topbar-organization-logo {
    filter: brightness(0) saturate(100%) invert(96%) sepia(7%) saturate(93%) hue-rotate(11deg) brightness(102%) contrast(92%);
  }
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 550;
}

.topnav a:hover { color: var(--text); }

.topnav a.is-active {
  color: var(--text);
  font-weight: 650;
}

.nav-with-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.theme-toggle {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--muted) 54%, var(--line));
}

.theme-toggle .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-size: 19px;
  font-weight: normal;
  line-height: 1;
}

.topbar-theme-toggle {
  margin-left: 0;
}

.public-menu-toggle {
  display: inline-flex;
}

.header-action-pill,
.target-language-pill {
  display: inline-flex;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.header-action-pill {
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text);
  padding: 0 12px;
}

.header-action-pill:hover {
  background: color-mix(in srgb, var(--surface-2) 86%, var(--surface));
  color: var(--text);
}

.target-language-pill {
  min-width: 34px;
  margin-left: -8px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--text);
  color: var(--brand-contrast);
  padding: 0 9px;
}

.target-language-pill:hover {
  background: color-mix(in srgb, var(--text) 88%, var(--surface));
  color: var(--brand-contrast);
}

.admin-shell .topbar {
  gap: 14px;
}

.admin-shell .topbar-identity {
  gap: 10px;
}

.admin-shell .topbar-actions {
  flex: 0 0 auto;
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}

.admin-shell .header-action-pill,
.admin-shell .target-language-pill {
  height: 30px;
  margin-right: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-shell .header-action-pill:first-child {
  border-left: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
}

.admin-shell .target-language-pill {
  min-width: auto;
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.admin-shell .topbar-theme-toggle {
  margin-left: 0;
}

.app-language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
  height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  padding: 0;
  overflow: hidden;
}

.app-language-switcher button {
  min-width: 34px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 5px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.app-language-switcher button + button {
  border-left: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.app-language-switcher button:hover {
  color: var(--text);
}

.app-language-switcher button.is-active {
  background: var(--text);
  color: var(--brand-contrast);
  border-left-color: var(--text);
}

:root[data-theme="light"] .brand.wordmark img,
:root[data-theme="light"] .brand.iconmark img {
  filter: brightness(0) saturate(100%);
}

:root[data-theme="dark"] .brand.wordmark img,
:root[data-theme="dark"] .brand.iconmark img,
:root[data-theme="dark"] .topbar-organization-logo {
  filter: brightness(0) saturate(100%) invert(96%) sepia(7%) saturate(93%) hue-rotate(11deg) brightness(102%) contrast(92%);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  overflow: hidden;
}

.language-switcher a {
  display: inline-flex;
  min-width: 34px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  padding: 0 8px;
  line-height: 1.2;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.language-switcher a + a {
  border-left: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.language-switcher a.is-active {
  background: var(--brand);
  color: var(--brand-contrast);
  border-left-color: var(--brand);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 28px) 0 calc(72px + var(--safe-bottom));
}

.site-shell .page {
  width: 100%;
}

.site-shell.public-home-shell .page,
.site-shell .page:has(.hero-bleed) {
  padding-top: 0;
}

.page:has(.lesson-room) {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  padding-top: calc(var(--topbar-height) + 10px);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}

.app-shell:has(.lesson-room) {
  height: 100dvh;
  overflow: hidden;
}

.footer-logo {
  display: grid;
  gap: 0;
  justify-content: center;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 calc(28px + var(--safe-bottom));
  color: color-mix(in srgb, var(--muted) 42%, transparent);
  font-size: 12px;
  line-height: 1.28;
  text-align: center;
}

.footer-logo b {
  font-weight: 650;
}

.footer-claim {
  font-size: 11px;
}

:root[data-theme="dark"] .footer-logo {
  color: color-mix(in srgb, var(--muted) 34%, transparent);
}

.hero {
  min-height: 58vh;
  display: grid;
  align-content: center;
  gap: 18px;
  max-width: 780px;
}

.hero-split {
  max-width: 1040px;
  grid-template-columns: minmax(240px, 420px) minmax(0, 560px);
  align-items: center;
  align-content: center;
  column-gap: clamp(28px, 6vw, 72px);
}

.hero-media {
  width: 100%;
  margin: 0;
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
}

.hero-copy {
  display: grid;
  max-width: 540px;
  gap: 14px;
}

.hero-intro {
  min-height: auto;
  max-width: 820px;
  padding: 18px 0 34px;
}

.site-shell .hero-intro,
.site-shell .pricing-grid,
.site-shell .home-languages,
.site-shell .topup-section {
  width: min(1120px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
}

.hero-intro .lead {
  max-width: 620px;
}

.hero-bleed {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0 0 34px;
  background: #050505;
}

.hero-bleed img,
.hero-bleed video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: clamp(520px, 78vh, 860px);
  object-fit: cover;
  object-position: center center;
}

.hero-bleed video {
  object-fit: contain;
  background: transparent;
}

.hero-bleed::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.28), transparent 22%, transparent 78%, rgb(0 0 0 / 0.28)),
    linear-gradient(180deg, rgb(0 0 0 / 0.14), transparent 34%, rgb(0 0 0 / 0.16));
}

[id] {
  scroll-margin-top: calc(var(--topbar-height) + 22px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-copy .eyebrow,
.chat-message .eyebrow,
.homework-panel .eyebrow {
  margin-left: 0;
}

.not-found-shell .page {
  min-height: calc(100svh - var(--topbar-height) - 80px);
  display: grid;
  place-items: center;
}

.not-found-page {
  width: min(760px, calc(100% - 32px));
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: clamp(44px, 9vw, 86px) 0;
}

.not-found-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.not-found-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.not-found-page h1 {
  max-width: 680px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.02;
}

.not-found-page .lead {
  max-width: 560px;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.lead {
  max-width: 500px;
  color: var(--muted);
  font-size: 19px;
}

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

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-contrast);
}

.app-dialog {
  width: min(680px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: calc(100dvh - 40px);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 0;
  overflow: hidden;
}

.app-dialog::backdrop {
  background: rgb(0 0 0 / 0.26);
  backdrop-filter: blur(8px);
}

.app-dialog-panel {
  display: grid;
  position: relative;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(0 0 0 / 0.24);
  padding: 24px;
  max-height: calc(100dvh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
}

.dialog-close {
  display: inline-flex;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--text);
  border-color: var(--muted);
}

.dialog-close .material-symbols-rounded {
  font-size: 20px;
}

.global-loading {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgb(0 0 0 / 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background-color 140ms ease;
}

.global-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: color-mix(in srgb, var(--brand) 70%, var(--accent));
  transform: translateX(-100%);
}

.global-loading span {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-top-color: var(--text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.global-loading.is-active {
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  opacity: 1;
}

.global-loading.is-active::before {
  animation: globalLoadingBar 1s ease-in-out infinite;
}

.global-loading.is-active span {
  animation: globalLoadingSpin 760ms linear infinite;
}

.is-loading-page {
  cursor: wait;
}

@keyframes globalLoadingBar {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(-12%); }
  100% { transform: translateX(100%); }
}

@keyframes globalLoadingSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.system-dialog {
  width: min(420px, calc(100% - 28px));
}

.nav-dialog {
  width: min(420px, calc(100% - 28px));
}

.nav-dialog-panel {
  gap: 18px;
}

.nav-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-dialog-header .dialog-close {
  position: static;
  flex: 0 0 auto;
}

.dialog-nav {
  display: grid;
  gap: 8px;
}

.dialog-nav a {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0 14px;
  color: var(--text);
  font-weight: 650;
}

.dialog-nav-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.dialog-nav-label .material-symbols-rounded {
  width: 22px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.dialog-nav a:hover,
.dialog-nav a.is-active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.dialog-nav a:hover .material-symbols-rounded,
.dialog-nav a.is-active .material-symbols-rounded {
  color: var(--text);
}

.system-dialog-panel {
  gap: 18px;
}

.system-dialog-panel h2 {
  margin-right: 0;
  margin-bottom: 0;
}

.system-dialog-message {
  margin: 0;
  color: var(--muted);
}

.dialog-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}

.dialog-checkbox input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.system-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

.homework-submit-actions .button {
  min-height: 52px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  text-align: left;
}

.homework-submit-actions .button small {
  display: block;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0.72;
}

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

.compact-metrics {
  margin-top: 12px;
}

.plan,
.panel,
.metrics article,
.narrow {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.plan {
  display: grid;
  align-content: start;
  gap: 12px;
}

.plan h2,
.plan p {
  margin-bottom: 0;
}

.plan .button {
  width: fit-content;
  margin-top: 4px;
}

.featured-plan {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  box-shadow:
    0 14px 32px color-mix(in srgb, var(--accent) 12%, transparent),
    var(--shadow);
}

.plan strong {
  font-size: 26px;
}

.plan-lts {
  margin-top: -6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.home-languages {
  display: grid;
  gap: 18px;
  margin-bottom: 46px;
}

.home-languages-head {
  max-width: 680px;
  padding-inline: var(--section-header-inset);
}

.home-languages-head h2,
.home-languages-head p {
  margin-bottom: 0;
}

.home-languages-head p {
  color: var(--muted);
  font-size: 17px;
}

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

.language-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.language-card:hover,
.language-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow-strong);
  transform: translateY(-2px);
}

.language-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.language-card strong {
  overflow-wrap: anywhere;
  padding-right: 54px;
  font-size: 17px;
  line-height: 1.2;
}

.language-native {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
}

.language-card small {
  position: absolute;
  top: 12px;
  right: 12px;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.home-organizations {
  margin-bottom: 46px;
}

.organization-logo-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 28px;
  padding-inline: var(--section-header-inset);
}

.organization-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 58px;
  color: inherit;
  text-decoration: none;
}

.organization-logo img {
  display: block;
  max-width: 220px;
  max-height: 52px;
  object-fit: contain;
}

:root[data-theme="dark"] .organization-logo img {
  filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .organization-logo img {
    filter: brightness(0) invert(1);
  }
}

.topup-section {
  display: grid;
  gap: 18px;
  margin-bottom: 46px;
}

.topup-intro {
  max-width: 680px;
  padding-inline: var(--section-header-inset);
}

.topup-intro h2,
.topup-intro p {
  margin-bottom: 0;
}

.topup-intro h2,
.home-testimonials-head h2 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
}

.topup-intro h2 {
  color: var(--lingot-gold);
}

.topup-intro p {
  color: var(--muted);
  font-size: 17px;
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.topup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  container-type: inline-size;
  min-width: 0;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px 20px;
}

.topup-price-main {
  display: inline-grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: start;
  column-gap: 7px;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.topup-price-figure {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.topup-price-figure strong {
  font-size: clamp(27px, 2.7vw, 32px);
  line-height: 0.95;
  font-weight: 740;
  letter-spacing: 0;
}

.topup-price-symbol {
  color: var(--muted);
  font-size: clamp(27px, 2.7vw, 32px);
  line-height: 0.95;
  font-weight: 740;
  transform: none;
}

.topup-price-meta {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  color: var(--muted);
  line-height: 1;
  transform: translateY(1px);
}

.topup-price-meta span {
  color: color-mix(in srgb, var(--ink) 70%, var(--muted));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.topup-price-meta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

.topup-action-form {
  margin: 0;
}

.topup-card .button {
  width: fit-content;
  min-height: 38px;
  padding-inline: 14px;
}

@container (max-width: 285px) {
  .topup-price-main {
    grid-template-columns: max-content;
    align-content: center;
    row-gap: 4px;
  }

  .topup-price-meta {
    grid-template-columns: max-content max-content;
    grid-template-rows: auto;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
    transform: none;
  }
}

.home-testimonials,
.learn-hero,
.learn-nav,
.learn-section,
.learn-cta {
  width: min(1120px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
}

.home-testimonials {
  display: grid;
  gap: 18px;
  margin-bottom: 46px;
}

.home-testimonials-head {
  padding-inline: var(--section-header-inset);
}

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

.home-testimonial {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.home-testimonial blockquote {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.42;
}

.home-testimonial figcaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.learn-hero {
  display: grid;
  min-height: 48vh;
  align-content: end;
  gap: 18px;
  padding: 54px var(--section-header-inset) 34px;
}

.learn-hero h1 {
  max-width: 920px;
  font-size: clamp(42px, 7vw, 82px);
}

.learn-hero .lead {
  max-width: 760px;
}

.learn-nav {
  display: flex;
  position: sticky;
  z-index: 12;
  top: calc(var(--topbar-height) + 8px);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  padding: 0;
  overflow-x: auto;
}

.learn-nav a {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  border-right: 1px solid var(--line);
  padding: 0 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.learn-nav a:last-child {
  border-right: 0;
}

.learn-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.learn-section {
  display: grid;
  gap: 18px;
  padding: 70px 0 0;
  scroll-margin-top: calc(var(--topbar-height) + 64px);
}

.learn-section-copy {
  max-width: 760px;
  padding-inline: var(--section-header-inset);
}

.learn-section-copy h2,
.learn-cta h2 {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.02;
}

.learn-section-copy p:not(.eyebrow),
.learn-cta p {
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

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

.learn-card,
.learn-steps article,
.learn-faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.learn-card h3,
.learn-steps h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.learn-card p,
.learn-steps p {
  margin: 0;
  color: var(--muted);
}

.learn-steps article {
  display: grid;
  align-content: start;
  gap: 8px;
}

.learn-steps span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.learn-faq-list details {
  padding: 0;
  overflow: hidden;
}

.learn-faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 800;
}

.learn-faq-list details p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 16px 24px 22px;
  color: var(--muted);
}

.learn-cta {
  display: grid;
  gap: 14px;
  margin-top: 72px;
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 46px);
}

.learn-cta .button {
  width: fit-content;
}

.muted,
.metrics span {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.dashboard {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-inline: var(--section-header-inset);
}

.dashboard h1 {
  margin-left: 0;
  font-size: 48px;
}

.homework-generate-form {
  margin: 0;
}

.metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metrics article {
  display: grid;
  gap: 8px;
}

.metrics strong {
  font-size: 22px;
}

.metric-estimate {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-link {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.metric-link:hover {
  color: var(--text);
}

.dashboard-learning-panel {
  display: grid;
  gap: 18px;
}

.quick-lesson-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-lesson-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: var(--section-header-inset);
}

.quick-lesson-head h2 {
  margin: 0;
  font-size: 18px;
}

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

.quick-lesson-button {
  display: grid;
  width: 100%;
  min-height: 88px;
  gap: 4px;
  align-content: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.quick-lesson-button strong {
  font-size: 24px;
  line-height: 1;
}

.quick-lesson-button span {
  color: var(--muted);
  font-size: 13px;
}

.quick-lesson-button:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.curriculum-home-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.curriculum-home-head {
  padding: 0 var(--section-header-inset, 14px);
}

.curriculum-home-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.15;
}

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

.curriculum-home-link,
.curriculum-gate {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.curriculum-home-link {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.curriculum-home-link span,
.curriculum-gate span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.curriculum-home-link strong {
  font-size: 18px;
}

.curriculum-home-link:hover,
.curriculum-gate:hover,
.curriculum-gate.is-active {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.curriculum-hero .eyebrow,
.curriculum-panel .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.curriculum-gate {
  display: grid;
  min-height: 138px;
  gap: 8px;
  align-content: start;
  padding: 18px;
}

.curriculum-gate strong {
  font-size: 22px;
}

.curriculum-gate small,
.curriculum-gate em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.curriculum-gate em {
  margin-top: auto;
  font-weight: 750;
}

.curriculum-panel {
  display: grid;
  gap: 16px;
}

.curriculum-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-inline: var(--section-header-inset);
}

.curriculum-panel-head h2 {
  margin: 0;
}

.curriculum-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.curriculum-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(0, 1.6fr) minmax(190px, 0.8fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.curriculum-code,
.curriculum-main,
.curriculum-row-actions {
  display: grid;
  gap: 5px;
}

.curriculum-code span {
  font-weight: 850;
}

.curriculum-code small,
.curriculum-main p {
  color: var(--muted);
  font-size: 12px;
}

.curriculum-main h3,
.curriculum-main p {
  margin: 0;
}

.curriculum-row-actions {
  justify-items: end;
}

.curriculum-row-actions form {
  margin: 0;
}

.compact-button {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.curriculum-study-panel {
  display: grid;
  gap: 18px;
  max-width: 900px;
  margin-inline: auto;
}

.curriculum-study-panel p {
  margin: 0;
}

.curriculum-study-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-inline: var(--section-header-inset);
}

.curriculum-study-head span:first-child {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.curriculum-study-head h2,
.curriculum-study-block h3 {
  margin: 0;
}

.curriculum-study-block {
  display: grid;
  gap: 10px;
}

.curriculum-phrase-list,
.curriculum-drill-list {
  display: grid;
  gap: 8px;
}

.curriculum-phrase,
.curriculum-drill {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.curriculum-phrase strong {
  font-size: 20px;
}

.curriculum-phrase small,
.curriculum-phrase span,
.curriculum-phrase em,
.curriculum-drill p {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.curriculum-drill summary {
  cursor: pointer;
  font-weight: 800;
}

.curriculum-final-check {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted);
}

.curriculum-practice-form {
  margin: 0;
}

.dashboard-learning-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-inline: var(--section-header-inset);
}

.dashboard-learning-head h2,
.dashboard-report h3 {
  margin: 0;
}

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

.dashboard-learning-grid > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.dashboard-learning-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-learning-grid strong {
  font-size: 18px;
}

.dashboard-report {
  display: grid;
  gap: 8px;
}

.usage-page {
  display: grid;
  gap: 18px;
  max-width: 100%;
  overflow-x: clip;
}

.usage-page > * {
  min-width: 0;
}

.usage-page .dashboard,
.usage-page .metrics {
  margin-bottom: 0;
}

.usage-note {
  max-width: min(980px, calc(100vw - 52px));
  margin: 12px 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.lingot-strip {
  display: grid;
  min-width: 0;
  width: calc(100% - 20px);
  max-width: 100%;
  margin-left: 10px;
}

.billing-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.billing-page .dashboard,
.billing-page .metrics {
  margin-bottom: 0;
}

.billing-page .panel,
.billing-page .metrics article,
.billing-page form {
  min-width: 0;
}

.billing-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.billing-package {
  display: grid;
  min-width: 0;
  align-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px;
}

.billing-package.is-featured {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.billing-package-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.billing-package h3 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1;
}

.billing-package p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-heading-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 16px;
}

.panel-heading-row h2,
.panel-heading-row p {
  margin-bottom: 0;
}

.billing-currency-pill {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.billing-topup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 10px;
  min-width: 0;
}

.billing-topup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  container-type: inline-size;
  min-width: 0;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px 16px;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-settings-group {
  display: grid;
  gap: 14px;
}

.admin-setting-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px);
  gap: 16px;
  align-items: center;
}

.admin-setting-row span {
  display: grid;
  gap: 4px;
}

.admin-setting-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.admin-setting-row.is-stripe-amount {
  border: 1px solid color-mix(in srgb, var(--lingot-gold) 58%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--lingot-gold) 10%, var(--surface));
  padding: 12px;
}

.admin-setting-row.is-stripe-amount strong::after {
  content: " must match Stripe";
  color: var(--lingot-gold);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-setting-warning {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--lingot-gold) 62%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--lingot-gold) 11%, var(--surface));
  padding: 12px 14px;
}

.admin-setting-warning strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.admin-setting-warning span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.admin-setting-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

.admin-setting-divider span {
  display: block;
  white-space: nowrap;
}

.admin-business-input {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.admin-business-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.admin-pricing-contexts {
  gap: 18px;
}

.admin-settings-fieldset {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  min-width: 0;
}

.admin-settings-fieldset legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 800;
}

.admin-settings-fieldset p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.admin-fx-reference {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.admin-fx-reference > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-fx-reference small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.admin-fx-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-fx-values span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 750;
}

.admin-fx-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 780px) {
  .admin-fx-reference {
    grid-template-columns: 1fr;
  }

  .admin-fx-actions {
    justify-content: flex-start;
  }

  .admin-setting-divider span {
    white-space: normal;
  }
}

.admin-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legacy-login-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.legacy-login-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.legacy-login-panel form {
  margin-top: 14px;
}

.admin-inline-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px 10px;
  font-weight: 700;
}

.admin-model-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-model-map article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.admin-model-map span,
.admin-model-map small {
  color: var(--muted);
}

.admin-model-map strong {
  font-size: 16px;
}

.admin-one-lts-table {
  min-width: 920px;
}

.admin-one-lts-table td:nth-child(4),
.admin-one-lts-table td:nth-child(5) {
  max-width: 320px;
}

.admin-sales-table {
  min-width: 1180px;
}

.admin-sales-table td:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.admin-package {
  display: grid;
  gap: 18px;
}

.admin-organization-new,
.admin-organization-card {
  display: grid;
  gap: 18px;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.admin-student-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-student-create-form .button {
  min-height: 44px;
}

.admin-student-card {
  display: grid;
  gap: 18px;
}

.admin-student-meta {
  display: grid;
  gap: 8px;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-language-fieldset {
  align-self: stretch;
}

.admin-checkbox-field > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 700;
}

.admin-commission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.admin-commission-summary h3 {
  width: 100%;
  margin: 0;
  font-size: 14px;
}

.admin-commission-summary span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.admin-language-grid label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 9px 10px;
  min-width: 0;
}

.admin-language-grid span {
  min-width: 0;
  font-weight: 750;
}

.admin-language-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.admin-delete-form {
  display: none;
}

.admin-package-head,
.admin-checks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-checks {
  justify-content: flex-end;
}

.admin-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.admin-price-table input {
  min-height: 36px;
}

.admin-package-translations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-translation-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.admin-translation-card h3 {
  margin: 0;
  font-size: 14px;
}

.lingot-bars {
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: 26px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--muted) 28%, var(--surface-2)) 0 7px,
      transparent 7px 10px
    );
}

.lingot-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--lingot-gold) 0%, var(--lingot-gold-deep) 100%);
  box-shadow: none;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 10px);
  mask-image: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 10px);
}

:root[data-theme="dark"] .lingot-bars {
  background:
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--muted) 20%, var(--surface-2)) 0 7px,
      transparent 7px 10px
    );
}

.ledger-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ledger-type.is-reward {
  color: color-mix(in srgb, #d49b1e 72%, var(--text));
  font-weight: 850;
}

.ling-reward-glyph {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.narrow {
  max-width: 520px;
  margin: 48px auto;
}

.narrow h1 {
  margin-left: 10px;
  margin-bottom: 22px;
  font-size: 42px;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.lesson-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px;
}

.lesson-row:hover {
  border-color: var(--muted);
}

.lesson-row span:first-child {
  display: grid;
  gap: 2px;
  align-self: center;
}

.lesson-row small,
.lesson-row span:not(:first-child) {
  color: var(--muted);
  font-size: 13px;
}

.lesson-row span:nth-child(2) {
  display: flex;
  min-width: 0;
  align-items: center;
  align-self: center;
  justify-self: start;
  line-height: 1.4;
  text-align: left;
}

.lesson-row .status-pill,
.lesson-row .score-pill {
  justify-self: end;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.context-choice {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.context-choice legend {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 7px;
  padding: 0;
}

.context-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(116px, 100%), 1fr));
  gap: 8px;
  min-width: 0;
}

.context-choice-card {
  display: block;
  min-width: 0;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
}

.context-choice-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.context-choice-card span {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  padding: 9px 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.context-choice-card:hover span {
  border-color: color-mix(in srgb, var(--muted) 48%, var(--line));
  color: var(--text);
}

.context-choice-card input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--text) 35%, transparent);
  outline-offset: 2px;
}

.context-choice-card input:checked + span {
  border-color: var(--text);
  background: var(--text);
  color: var(--brand-contrast);
}

.advanced-options {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 54%, transparent);
  padding: 0;
}

.advanced-options summary {
  color: var(--muted);
  padding: 11px 13px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.advanced-options[open] {
  padding-bottom: 13px;
}

.advanced-options .form-grid-2 {
  padding: 0 13px;
}

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

.form-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  font-size: max(16px, 1em);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

select::-ms-expand {
  display: none;
}

.notice {
  border: 1px solid color-mix(in srgb, #b35b5b 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, #b35b5b 10%, var(--surface));
  color: #b35b5b;
  padding: 11px 13px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.035);
}

.notice.good {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 19%, var(--surface));
  color: #174d38;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 13%, transparent);
}

.notice.warning {
  border-color: color-mix(in srgb, #b58b21 54%, var(--line));
  background: color-mix(in srgb, #d9a928 14%, var(--surface));
  color: #7c5b0e;
}

.notice.info {
  border-color: color-mix(in srgb, #4e7da8 52%, var(--line));
  background: color-mix(in srgb, #4e7da8 12%, var(--surface));
  color: #315f83;
}

:root[data-theme="dark"] .notice:not(.good):not(.warning):not(.info) {
  color: #d77f7f;
}

:root[data-theme="dark"] .notice.good {
  color: #93c9ae;
  border-color: color-mix(in srgb, #93c9ae 62%, var(--line));
  background: color-mix(in srgb, #315f4d 28%, var(--surface));
}

:root[data-theme="dark"] .notice.warning {
  color: #d9bb70;
}

:root[data-theme="dark"] .notice.info {
  color: #8eb8dc;
}

.account-page {
  display: grid;
  gap: 16px;
}

.account-header {
  margin-bottom: 0;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.account-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.account-card h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.account-card-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.hue-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.hue-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

.hue-control small {
  display: inline-flex;
  min-width: 52px;
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.hue-reset {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  border-radius: 999px;
  background: var(--accent);
  cursor: pointer;
}

.hue-reset:hover {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.target-language-select {
  background-color: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.account-affiliation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.account-affiliation img {
  width: 104px;
  max-width: 28vw;
  height: 40px;
  object-fit: contain;
  object-position: right center;
}

.account-card-wide,
.account-actions {
  grid-column: 1 / -1;
}

.account-hint {
  margin: -2px 0 0;
  font-size: 13px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
}

.floating-save-form {
  padding-bottom: calc(76px + var(--safe-bottom));
}

.floating-save-actions {
  display: flex;
  position: sticky;
  z-index: 35;
  right: 0;
  bottom: var(--safe-bottom);
  justify-self: end;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.floating-save-actions .button {
  min-width: 116px;
  box-shadow: 0 14px 36px rgb(0 0 0 / 0.22);
}

.save-status {
  max-width: min(52vw, 420px);
  border: 1px solid color-mix(in srgb, #b35b5b 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, #b35b5b 11%, var(--surface));
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.14);
  color: #b35b5b;
  padding: 9px 12px;
  font-size: 13px;
}

.save-status.good {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: #174d38;
}

:root[data-theme="dark"] .save-status {
  color: #d77f7f;
}

:root[data-theme="dark"] .save-status.good {
  color: #93c9ae;
  border-color: color-mix(in srgb, #93c9ae 62%, var(--line));
  background: color-mix(in srgb, #315f4d 28%, var(--surface));
}

.lesson-room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.lesson-axis {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lesson-chat-axis {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 2px 4px;
}

.lesson-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  opacity: 0.18;
  border-radius: var(--radius);
  animation: lessonMarkPulse 5.6s ease-in-out infinite;
  transition: opacity 180ms ease, filter 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.lesson-mark img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
}

@media (prefers-color-scheme: dark) {
  .lesson-mark img {
    filter: brightness(0) saturate(100%) invert(96%) sepia(7%) saturate(93%) hue-rotate(11deg) brightness(102%) contrast(92%);
  }

  .lesson-mark.is-listening img,
  .lesson-mark.is-connecting img,
  .lesson-mark.is-updating img {
    filter: brightness(0) saturate(100%) invert(59%) sepia(31%) saturate(687%) hue-rotate(101deg) brightness(91%) contrast(87%);
  }
}

@keyframes lessonMarkPulse {
  0%, 100% { opacity: 0.12; transform: scale(0.96); }
  50% { opacity: 0.28; transform: scale(1); }
}

.lesson-mark.is-listening {
  background: color-mix(in srgb, var(--surface) 42%, transparent);
  box-shadow:
    0 0 0 6px color-mix(in srgb, #22b86f 10%, transparent),
    0 0 18px color-mix(in srgb, #22b86f 18%, transparent);
  opacity: 0.95;
  animation-duration: 2.4s;
}

.lesson-mark.is-listening img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(94%) saturate(519%) hue-rotate(92deg) brightness(88%) contrast(98%);
}

.lesson-mark.is-connecting,
.lesson-mark.is-updating {
  background: color-mix(in srgb, var(--surface) 42%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, #22b86f 8%, transparent);
  opacity: 0.74;
  animation-duration: 1.8s;
}

.lesson-mark.is-connecting img,
.lesson-mark.is-updating img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(94%) saturate(519%) hue-rotate(92deg) brightness(88%) contrast(98%);
}

.lesson-mark.is-error {
  background: color-mix(in srgb, #b35b5b 14%, transparent);
  opacity: 0.68;
}

:root[data-theme="light"] .lesson-mark img {
  filter: brightness(0) saturate(100%);
}

:root[data-theme="dark"] .lesson-mark img {
  filter: brightness(0) saturate(100%) invert(96%) sepia(7%) saturate(93%) hue-rotate(11deg) brightness(102%) contrast(92%);
}

:root[data-theme="dark"] .lesson-mark.is-listening img,
:root[data-theme="dark"] .lesson-mark.is-connecting img,
:root[data-theme="dark"] .lesson-mark.is-updating img {
  filter: brightness(0) saturate(100%) invert(75%) sepia(67%) saturate(416%) hue-rotate(91deg) brightness(96%) contrast(91%);
}

.chat {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.chat.is-empty {
  align-content: start;
}

.lesson-start-panel {
  display: grid;
  min-height: 180px;
  place-items: center;
}

.lesson-start-button {
  display: inline-grid;
  position: relative;
  overflow: hidden;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.lesson-start-button::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(110deg, transparent 0 30%, rgb(255 255 255 / 0.34) 46%, transparent 62% 100%);
  transform: translateX(-120%);
  animation: voiceActiveShine 2.4s ease-in-out infinite;
  pointer-events: none;
}

.lesson-start-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 34px rgb(0 0 0 / 0.2);
}

.lesson-start-button:active {
  transform: translateY(0) scale(0.98);
}

.lesson-start-button img {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.lesson-start-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.voice-panel {
  display: flex;
  position: sticky;
  z-index: 80;
  top: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.08);
  backdrop-filter: blur(12px);
  padding: 7px 10px;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.voice-panel.is-connecting,
.voice-panel.is-updating {
  border-color: var(--signal-wait-line);
  background: var(--signal-wait);
}

.voice-panel.is-error {
  border-color: #b35b5b;
  background: color-mix(in srgb, #b35b5b 12%, var(--surface));
}

.inline-select {
  display: flex;
  flex: 0 1 160px;
  align-items: center;
  grid-template-columns: none;
  gap: 0;
}

.inline-select select {
  width: 100%;
  min-width: 132px;
  padding: 9px 10px;
}

.lesson-advanced-controls {
  position: relative;
}

.lesson-advanced-controls summary {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, var(--paper));
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.lesson-advanced-controls summary::-webkit-details-marker {
  display: none;
}

.lesson-advanced-controls[open] summary,
.lesson-advanced-controls summary:hover {
  color: var(--ink);
  background: var(--paper);
}

.lesson-advanced-controls summary .material-symbols-rounded {
  font-size: 22px;
}

.lesson-advanced-grid {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  width: min(560px, calc(100vw - 44px));
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.16);
  padding: 10px;
}

.lesson-advanced-grid .inline-select {
  flex: 1 1 auto;
}

.voice-state {
  display: flex;
  min-width: 112px;
  align-items: baseline;
  gap: 6px;
}

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

.voice-floating-button {
  position: relative;
  overflow: hidden;
  min-width: 152px;
  box-shadow:
    0 16px 36px rgb(0 0 0 / 0.24),
    0 0 0 1px rgb(255 255 255 / 0.08) inset;
}

.voice-floating-button.is-active {
  border-color: #ff6b6b;
  background: #c92f2f;
  color: #fff;
  box-shadow:
    0 18px 40px rgb(201 47 47 / 0.34),
    0 0 0 4px rgb(201 47 47 / 0.14),
    0 0 0 1px rgb(255 255 255 / 0.14) inset;
}

.voice-floating-button.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 28%, rgb(255 255 255 / 0.26) 45%, transparent 62% 100%);
  transform: translateX(-110%);
  animation: voiceActiveShine 1.9s ease-in-out infinite;
  pointer-events: none;
}

.voice-floating-button.is-active:hover {
  background: #b92828;
  color: #fff;
}

@keyframes voiceActiveShine {
  0%, 42% { transform: translateX(-110%); }
  72%, 100% { transform: translateX(110%); }
}

.voice-interrupt-notice {
  display: grid;
  position: fixed;
  z-index: 140;
  inset: 0;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 0.28);
  backdrop-filter: blur(6px);
}

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

.voice-interrupt-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  justify-items: center;
  border: 1px solid color-mix(in srgb, #c92f2f 28%, var(--line));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(0 0 0 / 0.24);
  padding: 24px;
  text-align: center;
}

.voice-interrupt-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, #c92f2f 13%, var(--surface-2));
  color: #c92f2f;
  font-size: 30px;
}

.voice-interrupt-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

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

.voice-interrupt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.usage-table th,
.usage-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.usage-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.evaluation-panel {
  display: grid;
  gap: 14px;
}

.evaluation-section-head {
  display: grid;
  gap: 4px;
  padding-inline: var(--section-header-inset);
}

.evaluation-section-head h2,
.evaluation-section-head p {
  margin: 0;
}

.evaluation-table {
  min-width: 900px;
}

.evaluation-table td:last-child {
  max-width: 360px;
}

.chat-message {
  display: grid;
  position: relative;
  gap: 5px;
  width: 100%;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px;
}

.chat-message.student {
  justify-self: end;
  width: calc(100% - 18px);
  margin-left: 18px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.chat-message.lesson-note {
  border-style: dashed;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.chat-message.assistant.is-latest {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.06);
}

.chat-message span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.bubble-audio-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-top: 6px;
  opacity: 0.58;
  transition: opacity 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.bubble-audio-player.is-cached {
  opacity: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 7%, transparent);
  padding: 6px 8px;
}

.bubble-audio-toggle {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.bubble-audio-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}

.bubble-audio-toggle:disabled {
  cursor: pointer;
  opacity: 0.6;
}

.bubble-audio-player.is-loading .bubble-audio-toggle .material-symbols-rounded {
  animation: audioSpinner 900ms linear infinite;
}

.bubble-audio-toggle .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-size: 18px;
  font-weight: normal;
  line-height: 1;
}

@keyframes audioSpinner {
  to { transform: rotate(360deg); }
}

.bubble-audio-seek {
  height: 26px;
  border: 0;
  background: transparent;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.bubble-audio-seek:disabled {
  cursor: default;
  opacity: 0.45;
}

.bubble-audio-time {
  display: inline-flex;
  min-width: 72px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.chat-body,
.chat-message p {
  margin: 0;
}

.chat-body p {
  margin: 0;
}

.chat-body p + p,
.chat-body ul + p,
.chat-body p + ul {
  margin-top: 8px;
}

.chat-body ul {
  margin: 0;
  padding-left: 18px;
}

.chat-body li + li {
  margin-top: 4px;
}

.chat-body code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 1px 5px;
  font-size: 0.92em;
}

.chat-message.thinking {
  width: 72px;
}

.chat-message.thinking span {
  display: none;
}

.chat-message.thinking .chat-body,
.chat-message.thinking p {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 18px;
}

.chat-message.thinking i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.35;
  animation: thinkingPulse 1s ease-in-out infinite;
}

.chat-message.thinking i:nth-child(2) {
  animation-delay: 0.12s;
}

.chat-message.thinking i:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes thinkingPulse {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(-2px); }
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-top: auto;
  min-height: 0;
}

.composer textarea {
  min-height: 96px;
  max-height: 20dvh;
  resize: vertical;
  padding: 14px 15px 18px;
  line-height: 1.5;
  background: color-mix(in srgb, var(--surface-2) 86%, var(--surface));
}

.composer textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.composer-actions {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  min-width: 152px;
}

.composer-voice {
  display: inline-flex;
  min-height: 48px;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  text-align: center;
  white-space: pre-line;
}

.composer-voice small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.82;
}

.composer-voice-note {
  display: none;
  max-width: 152px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.composer-send {
  display: inline-flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--brand-contrast);
  cursor: pointer;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
}

.composer-send:hover {
  transform: translateY(-1px);
}

.composer-send:active {
  transform: translateY(0);
}

.composer-send .material-symbols-rounded {
  font-size: 21px;
}

.homework-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.homework-panel h2,
.homework-panel p {
  margin-bottom: 0;
}

.homework-correction {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.homework-correction h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.homework-correction h3:first-child {
  margin-top: 0;
}

.homework-correction p {
  margin: 0 0 14px;
  line-height: 1.72;
}

.homework-correction p:last-child,
.homework-correction ul:last-child {
  margin-bottom: 0;
}

.homework-correction ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.homework-correction li {
  margin-bottom: 7px;
  line-height: 1.62;
}

.mytext-original {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px;
}

.mytext-original summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 750;
}

.mytext-original-body {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

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

.myinfo-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  padding-top: 10px;
}

.info-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

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

.myinfo-memory-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.myinfo-memory-item small,
.myinfo-memory-item p {
  margin: 0;
  color: var(--muted);
}

.myinfo-wide {
  display: grid;
  gap: 12px;
}

.myinfo-wide details summary {
  cursor: pointer;
  font-weight: 800;
}

.myinfo-pre {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.homework-correction.is-empty {
  display: none;
}

.chat-body s,
.homework-correction s {
  color: var(--muted);
}

.homework-page {
  display: grid;
  gap: 14px;
}

.homework-row {
  text-decoration: none;
}

.status-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.good {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.status-pill.warning {
  border-color: color-mix(in srgb, #d9a928 56%, var(--line));
  background: color-mix(in srgb, #d9a928 15%, var(--surface));
  color: #7c5b0e;
}

.status-pill.info {
  border-color: color-mix(in srgb, #4e7da8 52%, var(--line));
  background: color-mix(in srgb, #4e7da8 12%, var(--surface));
  color: #315f83;
}

.homework-detail {
  display: grid;
  gap: 14px;
}

.homework-context-meta {
  margin: 6px 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.homework-assignment,
.homework-submission,
.homework-result {
  display: grid;
  gap: 14px;
}

.homework-result-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.score-pill {
  border-color: var(--text);
  background: var(--text);
  color: var(--brand-contrast);
}

.score-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.score-pill.is-muted {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .status-pill.warning {
  color: #d9bb70;
}

:root[data-theme="dark"] .status-pill.info {
  color: #8eb8dc;
}

@media (max-width: 900px) {
  .topbar {
    width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 102px;
    --section-header-inset: 6px;
    --safe-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }

  :root:has(.app-shell) {
    --topbar-height: 66px;
  }

  [id],
  .learn-section {
    scroll-margin-top: calc(var(--topbar-height) + 8px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 12px 48px 12px 12px;
  }

  .topbar-theme-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    margin-left: 0;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .page {
    width: min(1120px, calc(100% - 20px));
    padding-top: calc(var(--topbar-height) + 18px);
    padding-bottom: calc(92px + var(--safe-bottom));
  }

  .app-shell .page {
    width: min(1120px, calc(100% - 18px));
    max-width: calc(100% - 18px);
  }

  .public-login-shell .page {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .public-login-shell .narrow {
    width: 100%;
    max-width: 420px;
    margin-right: auto;
    margin-left: auto;
  }

  .usage-page .lingot-strip {
    width: calc(100vw - 40px);
    max-width: 100%;
  }

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

  .info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .page:has(.lesson-room) {
    height: 100dvh;
    min-height: 0;
    padding-top: calc(var(--topbar-height) + 8px);
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
  }

  .app-shell .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    overflow: hidden;
    padding: 12px;
  }

  .app-shell .topbar-actions {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    gap: 7px;
    font-size: 12px;
  }

  .admin-shell .topbar {
    overflow: hidden;
  }

  .admin-shell .topbar-actions {
    flex: 0 0 auto;
    gap: 7px;
    min-width: 0;
    max-width: none;
    overflow: visible;
  }

  .app-shell .topbar-theme-toggle {
    position: static;
    top: auto;
    right: auto;
  }

  .target-language-pill {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    font-size: 11px;
  }

  .header-action-pill {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .app-language-switcher button {
    min-width: 32px;
    padding: 0 5px;
    font-size: 11px;
  }

  .app-dialog {
    width: min(680px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }

  .app-dialog-panel {
    padding: 20px;
  }

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

  .dashboard-learning-grid {
    grid-template-columns: 1fr;
  }

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

  .quick-lesson-button {
    min-height: 64px;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    align-content: center;
    text-align: left;
  }

  .curriculum-home-grid,
  .curriculum-gates {
    grid-template-columns: 1fr;
  }

  .curriculum-gate {
    min-height: 0;
  }

  .curriculum-panel-head {
    align-items: start;
    flex-direction: column;
  }

  .curriculum-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .curriculum-row-actions {
    justify-items: stretch;
  }

  .curriculum-row-actions .button {
    width: 100%;
  }

  .app-shell .brand.wordmark {
    flex: 0 1 auto;
    min-width: 0;
  }

  .app-shell .brand.wordmark img {
    width: 96px;
    max-width: 100%;
  }

  .app-shell .topbar-identity {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    overflow: hidden;
  }

  .app-shell .topbar-organization-logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 112px;
    height: 28px;
  }

  .site-shell .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    overflow: hidden;
    padding: 12px;
  }

  .site-shell .brand.wordmark {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-shell .topbar-actions {
    flex: 0 0 auto;
    gap: 7px;
  }

  .site-shell .topbar-theme-toggle {
    position: static;
    top: auto;
    right: auto;
  }

  .site-shell .language-switcher {
    flex: 0 0 auto;
    gap: 1px;
  }

  .site-shell .language-switcher a {
    min-width: 25px;
    padding: 0 5px;
    text-align: center;
    font-size: 0;
  }

  .site-shell .language-switcher a::before {
    content: attr(data-short);
    font-size: 12px;
  }

  .site-shell .public-menu-toggle {
    display: inline-flex;
  }

  .lesson-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 0;
  }

  .lesson-row span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 2px;
  }

  .app-shell .language-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .pricing-grid,
  .metrics,
  .language-grid,
  .billing-topup-grid,
  .topup-grid,
  .home-testimonial-grid,
  .learn-card-grid,
  .learn-steps,
  .form-grid-2,
  .admin-inline-form,
  .admin-student-create-form,
  .account-form {
    grid-template-columns: 1fr;
  }

  .billing-page {
    gap: 12px;
    overflow-x: clip;
  }

  .billing-page .panel,
  .billing-page .metrics article {
    padding: 16px;
  }

  .billing-page .metrics {
    gap: 10px;
  }

  .panel-heading-row {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .billing-currency-pill {
    width: fit-content;
  }

  .billing-topup-card {
    padding: 14px;
  }

  .billing-topup-card .button {
    min-height: 38px;
    padding-inline: 13px;
  }

  .table-wrap {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .billing-page .usage-table {
    min-width: 0;
  }

  .billing-page .usage-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .billing-page .usage-table,
  .billing-page .usage-table tbody,
  .billing-page .usage-table tr,
  .billing-page .usage-table td {
    display: block;
    width: 100%;
  }

  .billing-page .usage-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  .billing-page .usage-table tr:last-child {
    border-bottom: 0;
  }

  .billing-page .usage-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
    padding: 5px 0;
    overflow-wrap: anywhere;
  }

  .billing-page .usage-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .account-card {
    padding: 18px;
  }

  .account-actions {
    justify-content: stretch;
  }

  .floating-save-actions {
    bottom: var(--safe-bottom);
    justify-self: stretch;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .account-actions .button,
  .floating-save-actions .button {
    width: 100%;
  }

  .save-status {
    max-width: none;
    width: 100%;
  }

  .dashboard {
    align-items: stretch;
    flex-direction: column;
  }

  .account-affiliation {
    justify-content: flex-start;
  }

  .account-affiliation img {
    object-position: left center;
  }

  .hero {
    min-height: 52vh;
  }

  .hero-split {
    grid-template-columns: 1fr;
  }

  .hero-media {
    max-width: 360px;
  }

  .hero-intro {
    min-height: auto;
    align-content: start;
    padding-top: 4px;
    padding-bottom: 24px;
  }

  .hero-bleed {
    margin-bottom: 28px;
  }

  .hero-bleed img,
  .hero-bleed video {
    height: clamp(360px, 58vh, 520px);
    object-position: 64% center;
  }

  .hero-bleed video {
    object-fit: cover;
  }

  .lesson-mark {
    width: 30px;
    height: 30px;
  }

  .lesson-mark img {
    width: 24px;
    height: 24px;
  }

  .composer textarea {
    min-height: 88px;
    padding: 12px 13px 16px;
  }

  .voice-panel {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    top: 4px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
  }

  .chat {
    padding: 10px;
  }

  .chat-message {
    padding: 10px 12px;
  }

  .voice-state {
    min-width: 96px;
  }

  .inline-select {
    flex: 1 1 150px;
  }

  .inline-select select {
    min-width: 0;
  }

  .lesson-advanced-controls {
    flex: 0 0 auto;
  }

  .lesson-advanced-grid {
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - 28px));
    grid-template-columns: 1fr;
  }

  .voice-actions {
    margin-left: 0;
  }

  .voice-floating-button {
    min-width: 136px;
  }

  .lesson-layout,
  .lesson-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell .topbar-identity {
    flex: 0 0 auto;
  }

  .app-shell .brand.wordmark,
  .app-shell .topbar-partner-mark,
  .app-shell .topbar-organization-logo {
    display: none;
  }

  .app-shell .brand.iconmark {
    display: inline-flex;
  }
}

@media (max-width: 430px) {
  .app-shell .page {
    width: calc(100% - 14px);
    max-width: calc(100% - 14px);
  }

  .billing-page .panel,
  .billing-page .metrics article {
    padding: 14px;
  }

  .billing-topup-card {
    gap: 10px;
  }

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

  .composer-actions {
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-rows: auto;
    min-width: 0;
  }

  .composer-voice {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .composer-send {
    grid-column: 2;
    grid-row: 1;
  }

  .composer-voice-note {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    text-align: left;
  }

  .composer-send {
    height: 44px;
  }

  .site-shell .topbar {
    width: 100%;
    gap: 8px;
  }

  .site-shell .brand.wordmark img {
    width: 92px;
  }

  .site-shell .topbar-actions {
    gap: 6px;
  }
}
