:root {
  --green: #276749;
  --gold: #b7791f;
  --ink: #1a202c;
  --muted: #5f6b7a;
  --line: #d8e0ea;
  --paper: #f7fafc;
  --soft: #e6fffa;
  --danger: #c53030;
  --content-font-size: 17px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Arial, sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}
.topbar, .row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar { justify-content: space-between; margin-bottom: 18px; position: relative; min-height: 44px; }
.app-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  direction: ltr;
}
.app-nav .app-top-title {
  position: static;
  transform: none;
}
.top-nav-left {
  display: flex;
  justify-content: flex-start;
}
.language-toggle { width: 44px; min-width: 44px; padding-inline: 0; }
.app-nav .user-menu {
  flex-wrap: nowrap;
  margin: 0;
}
.brand h1 { margin: 0; font-size: 30px; }
.app-name {
  direction: rtl;
  letter-spacing: 0;
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Amiri", serif;
  font-weight: 800;
}
.app-top-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  direction: rtl;
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Amiri", serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0;
  white-space: nowrap;
}
.app-logo {
  display: block;
  width: auto;
  height: 56px;
  object-fit: contain;
}
.app-name .app-logo {
  height: 88px;
}
.lesson-term {
  color: var(--green);
  font-weight: 800;
}
.lesson-note {
  color: var(--danger);
  font-weight: 800;
}
.brand p { margin: 6px 0 0; color: var(--muted); }
.btn {
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.secondary {
  background: white;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn.danger {
  background: white;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.icon-only {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}
.home-top-button {
  background: white;
  color: #1f573e;
  border: 1px solid var(--green);
  font-size: 21px !important;
  font-weight: 900;
}
.home-top-button:hover { background: #f0faf5; }
.play-placeholder {
  display: inline-block;
  width: 44px;
  min-width: 44px;
  height: 44px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 18px;
}
.level-stage-header { margin: 8px 0 9px; }
.level-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.level-counter {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  background: #f1f6f3;
  color: #456456;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.level-stage-title {
  display: block;
  width: min(680px, calc(100% - 40px));
  margin: 8px auto 0;
  border: 0;
  background: transparent;
  color: #4a5568;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.level-stage-title.expanded { white-space: normal; overflow: visible; }
.level-action-buttons {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}
.level-action-buttons .btn.icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-color: #8aa99a;
  border-radius: 7px;
}
.user-menu { position: relative; justify-content: flex-end; }
.account-button { min-width: 150px; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  min-width: 210px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 6px;
}
.menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  background: white;
  color: var(--ink);
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 700;
}
.menu-panel button:hover { background: var(--paper); }
[dir="rtl"] .menu-panel { direction: rtl; text-align: right; }
[dir="rtl"] .menu-panel button { text-align: right; }
.menu-user-name { padding: 8px 10px 3px; color: var(--ink); font-size: 12px; font-weight: 800; }
.menu-section-label {
  margin: 4px 8px 2px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: #718096;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.rank-menu-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  padding: 7px 10px 11px;
  border-bottom: 1px solid var(--line);
}
.rank-menu-copy { display: grid; min-width: 0; }
.rank-menu-copy strong { color: var(--ink); font-size: 14px; line-height: 1.2; }
.rank-menu-copy span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.rank-menu-copy .rank-arabic { color: var(--green); font-family: "Noto Naskh Arabic", serif; font-size: 14px; font-weight: 800; }
.rank-progress { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 2px; background: #e8edf2; }
.rank-progress span { display: block; height: 100%; background: var(--green); }
.rank-badge {
  --rank-accent: var(--green);
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--rank-accent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--rank-accent) 12%, white);
  color: var(--rank-accent);
  box-shadow: inset 0 0 0 3px white;
  font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.rank-badge.small { width: 26px; height: 26px; border-width: 1px; box-shadow: inset 0 0 0 2px white; font-size: 12px; }
.rank-badge.large { width: 48px; height: 48px; font-size: 19px; }
.font-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
.font-stepper > div { display: grid; grid-template-columns: 34px 34px 34px; align-items: center; }
.font-stepper button {
  width: 34px;
  height: 32px;
  padding: 0;
  text-align: center;
  border: 1px solid var(--line);
}
.font-stepper button:disabled { color: #a0aec0; background: #edf2f7; cursor: default; }
.font-stepper output { text-align: center; color: var(--green); }
.home-course-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
}
.home-course-header h1 { margin: 0; font-size: 28px; }
.home-course-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.home-rank-line { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.home-rank-line p { margin: 0; min-width: 0; }
.btn.compact { padding: 7px 12px; font-size: 12px; }
.course-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 196px;
}
.course-card {
  --course-accent: var(--green);
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(26, 32, 44, .06);
  cursor: pointer;
}
.course-card:focus-visible { outline: 2px solid var(--course-accent); outline-offset: 2px; }
.course-accent { height: 4px; background: var(--course-accent); }
.course-card-content { height: calc(100% - 4px); display: flex; flex-direction: column; padding: 13px; }
.course-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-mark {
  width: auto;
  min-width: 44px;
  max-width: 64px;
  height: 44px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--course-accent);
  color: white;
  font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.course-state {
  padding: 4px 7px;
  border-radius: 6px;
  background: #edf2f7;
  color: #718096;
  font-size: 10px;
  font-weight: 800;
}
.course-card h2 {
  margin: 9px 0 0;
  font-size: 18px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[dir="rtl"] .course-card h2 { line-height: 1.5; }
[dir="rtl"] .course-card p { line-height: 1.65; }
.course-card-spacer { flex: 1; }
.course-progress { height: 3px; margin-bottom: 7px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--course-accent) 12%, white); }
.course-progress span { display: block; height: 100%; background: var(--course-accent); }
.course-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--course-accent); }
.course-card footer strong { min-width: 0; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.course-arrow { font-size: 22px; font-weight: 800; line-height: 1; }
[dir="rtl"] .course-arrow { transform: scaleX(-1); }
.course-card.disabled { opacity: .76; cursor: default; background: #f8fafc; }
.course-card.disabled .course-accent, .course-card.disabled .course-mark { background: #a0aec0; }
.course-admin-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--course-accent) 10%, white);
  color: var(--muted);
}
.course-admin-preview span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--course-accent); color: white; font-weight: 800; }
.rank-admin-error { margin: 10px 0; padding: 10px 12px; border: 1px solid #fed7d7; border-radius: 8px; background: #fff5f5; font-weight: 700; }
.rank-editor-preview, .rank-admin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.rank-editor-preview { width: min(100%, 420px); margin: 14px 0; padding: 12px; }
.rank-editor-preview > div, .rank-admin-copy { display: grid; min-width: 0; flex: 1; }
.rank-editor-preview span, .rank-admin-copy span { color: var(--green); font-family: "Noto Naskh Arabic", serif; font-size: 16px; font-weight: 800; }
.rank-editor-preview small, .rank-admin-copy small { color: var(--muted); font-weight: 700; }
.rank-admin-list { display: grid; gap: 9px; }
.rank-admin-card { padding: 11px 12px; }
.rank-unlocked {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #cfe2d9;
  border-radius: 8px;
  background: #f3faf7;
}
.rank-unlocked > div { display: grid; }
.rank-unlocked small { color: var(--muted); font-weight: 700; }
.rank-unlocked strong { color: var(--green); font-size: 17px; }
.rank-unlocked span { font-family: "Noto Naskh Arabic", serif; font-weight: 800; }
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.admin-level-filter {
  min-height: 44px;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
}
.admin-level-filter input { width: 18px; height: 18px; }
.grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.level-card, .panel, .mini-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.level-card {
  padding: 12px;
  min-width: 0;
}
.level-card.clickable { cursor: pointer; }
.level-card.clickable:hover { border-color: #9fb9ad; }
.level-card.disabled {
  opacity: .68;
  background: #f7fafc;
}
.level-card.passed {
  background: var(--soft);
  border-color: #9ae6b4;
}
.polished-level {
  --course-accent: var(--green);
  padding: 0;
  overflow: hidden;
  border-color: #dde5e1;
  box-shadow: 0 2px 8px rgba(26, 32, 44, .055);
}
.polished-level.clickable:hover {
  border-color: color-mix(in srgb, var(--course-accent) 48%, white);
  box-shadow: 0 4px 13px rgba(26, 32, 44, .08);
}
.polished-level.passed {
  background: #f4fbf7;
  border-color: color-mix(in srgb, var(--course-accent) 38%, white);
}
.polished-level .level-accent { height: 4px; background: var(--course-accent); }
.polished-level.disabled .level-accent { background: #a0aec0; }
.level-card-body { padding: 13px 14px 12px; }
.level-copy { min-width: 0; }
.level-status {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--course-accent) 9%, white);
  color: var(--course-accent);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}
.level-status.disabled { color: #718096; background: #edf2f7; }
.level-status.locked { color: #718096; background: #edf2f7; }
.level-status.locked::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 10px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}
.level-status.locked i {
  position: absolute;
  top: 13px;
  width: 15px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}
.level-meta-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 7px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--course-accent) 6%, white);
}
.level-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.level-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #355b4a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.level-metrics b { color: var(--course-accent); font-size: 10px; }
.polished-level .btn.play,
.polished-level .play-placeholder {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
}
.polished-level .btn.play { background: var(--course-accent); border-color: var(--course-accent); border-radius: 8px; }
.level-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.level-title { margin: 0; font-size: 17px; }
.level-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.level-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #edf7f5;
  color: var(--green);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.spacer { flex: 1; }
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.panel { padding: 18px; }
.lesson-content {
  margin-top: 16px;
  padding: 22px;
  border-color: #dde5e1;
  box-shadow: 0 2px 9px rgba(26, 32, 44, .05);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.lesson-content.page-turn-next { animation: page-turn-next .18s ease-out; }
.lesson-content.page-turn-back { animation: page-turn-back .18s ease-out; }
@keyframes page-turn-next {
  from { opacity: .78; transform: perspective(900px) translateX(18px) rotateY(-4deg); }
  to { opacity: 1; transform: perspective(900px) translateX(0) rotateY(0); }
}
@keyframes page-turn-back {
  from { opacity: .78; transform: perspective(900px) translateX(-18px) rotateY(4deg); }
  to { opacity: 1; transform: perspective(900px) translateX(0) rotateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .lesson-content.page-turn-next,
  .lesson-content.page-turn-back { animation: none; }
}
.lesson-footer {
  flex-wrap: nowrap;
  margin-top: 14px;
}
.lesson-footer .btn {
  flex: 1;
  min-height: 46px;
  border-radius: 8px;
}
.lesson-nav {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
}
.lesson-nav .btn {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  font-size: 29px;
  line-height: 1;
}
.slide-title { font-size: 28px; margin: 0 0 12px; }
.slide-body { color: #2d3748; font-size: var(--content-font-size); line-height: 1.55; }
.term-word { color: #1f6f54; font-weight: 800; }
.slide-note {
  margin-top: 14px;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  background: #fff5f5;
  color: #c53030;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 12px;
  font-size: var(--content-font-size);
}
.examples {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.example {
  background: #f7fafc;
  border-radius: 8px;
  padding: 10px;
}
.example.term { background: #e6fffa; }
.example.warning { background: #fff5f5; }
.arabic {
  direction: rtl;
  text-align: center;
  color: #1a202c;
  font-weight: 800;
  font-size: calc(var(--content-font-size) + 6px);
}
.example.term .arabic { color: #1f6f54; }
.example.warning .arabic { color: #c53030; }
.meaning {
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  font-size: var(--content-font-size);
}
.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 10px 0 22px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}
.answers {
  display: grid;
  gap: 10px;
}
.answer {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font-size: var(--content-font-size);
}
.question-prompt { font-size: calc(var(--content-font-size) + 5px); }
.answer.correct { background: #c6f6d5; border-color: var(--green); }
.answer.wrong { background: #fed7d7; border-color: var(--danger); }
.text-answer {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  color: var(--ink);
}
.match-grid, .group-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.match-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.match-column {
  display: grid;
  gap: 10px;
  align-content: start;
}
.match-tile {
  min-height: 56px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  font-size: var(--content-font-size);
}
.match-tile.selected {
  border-color: var(--green);
  background: #e6fffa;
  box-shadow: 0 0 0 2px rgba(39, 103, 73, 0.16);
}
.match-tile.wrong {
  border-color: var(--danger);
  background: #fed7d7;
}
.match-alert {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #9b2c2c;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(155, 44, 44, .1);
  font-size: var(--content-font-size);
}
.match-alert > span {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  color: white;
  background: var(--danger);
  border-radius: 50%;
  font-weight: 800;
}

.match-corrections {
  margin-top: 14px;
}

.match-corrections > strong {
  display: block;
  margin-bottom: 8px;
  color: #276749;
}

.match-correction-list {
  display: grid;
  gap: 6px;
}

.match-correction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f0fff4;
  text-align: center;
}

.match-correction-row span:first-child {
  color: #276749;
  font-weight: 700;
}

.match-correction-row b {
  color: #718096;
}
.hint {
  color: var(--muted);
  margin: 8px 0;
}
.penalty {
  color: var(--danger);
  font-weight: 700;
  margin: 8px 0;
}
.sort-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, .7fr);
  gap: 14px;
  align-items: start;
}
.sort-targets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.sort-target {
  min-height: 150px;
  border: 1px dashed var(--green);
  background: #f7fffb;
  border-radius: 8px;
  padding: 12px;
}
.placed-words, .word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.word-bank {
  margin-top: 0;
}
.word-chip, .placed-word {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--content-font-size);
  font-weight: 700;
}
.placed-word {
  padding: 5px 8px;
  font-size: max(10px, calc(var(--content-font-size) - 2px));
  line-height: 1.15;
}
.word-chip {
  cursor: grab;
}
.word-chip.selected {
  border-color: var(--green);
  background: #e6fffa;
}
.match-row, .group-box {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 12px;
}
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.group-box p {
  margin: 6px 0 0;
  color: var(--muted);
}
.feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  font-size: var(--content-font-size);
}
.hint, .penalty { font-size: var(--content-font-size); }
.text-answer { font-size: var(--content-font-size); }
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  margin: -4px 0 12px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  white-space: nowrap;
}
.breadcrumbs button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 4px 2px;
  font-weight: 700;
}
.inner-course-header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  margin-top: 8px;
}
.inner-course-title { display: grid; width: 100%; justify-items: center; gap: 3px; min-width: 0; text-align: center; }
.inner-course-title h1 { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inner-course-title p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.category-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(260px, 70vw);
  margin: 0 0 5px;
  border: 0;
  background: transparent;
  color: var(--course-accent, var(--green));
  padding: 5px 1px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.category-back b { font-size: 20px; line-height: .8; }
.compact-admin-toolbar { margin: 8px 0 14px; }
.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.category-card {
  --course-accent: var(--green);
  min-width: 0;
  height: 166px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 7px rgba(26, 32, 44, .06);
}
.category-card-content { height: calc(100% - 4px); display: flex; flex-direction: column; padding: 12px; }
.category-card h2 { margin: 8px 0 0; font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-card-spacer { flex: 1; }
.category-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--course-accent); }
.category-card footer strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.category-card.disabled { opacity: .72; background: #f8fafc; }
.category-card.disabled .course-accent, .category-card.disabled .course-mark { background: #a0aec0; }
[dir="rtl"] .category-card h2 { line-height: 1.55; }
.category-arrow { color: var(--green); font-size: 28px; line-height: 1; }
[dir="rtl"] .category-arrow { transform: scaleX(-1); }
.level-list { margin-top: 10px; }
.empty-state { text-align: center; color: var(--muted); }
.category-admin-list { display: grid; gap: 8px; }
.category-admin-row { margin-inline-start: min(calc(var(--category-depth) * 24px), 120px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.category-admin-copy { display: grid; gap: 3px; }
.category-admin-copy span, .category-admin-copy small { color: var(--muted); }
.category-editor { margin-bottom: 14px; }
.editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(26, 32, 44, .42);
}
.inline-editor {
  width: min(780px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0,0,0,.2);
  padding: 18px;
}
.inline-editor header, .inline-editor footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inline-editor header { margin-bottom: 14px; }
.inline-editor header h2, .inline-editor header p { margin: 0; }
.inline-editor header p { margin-top: 4px; color: var(--muted); }
.inline-editor footer { justify-content: flex-end; margin-top: 16px; }
.inline-editor .field small { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field { display: grid; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 13px; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}
textarea { min-height: 90px; resize: vertical; }
.password-control { position: relative; }
.password-control input { padding-inline-end: 46px; }
.password-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  display: grid;
  width: 38px;
  height: 36px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { background: #edf7f1; outline: none; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.account-settings-shell { width: min(680px, 100%); margin: 20px auto 0; }
.account-settings-panel { padding: 20px; }
.account-settings-panel > header h1 { margin: 0; font-size: 24px; }
.account-settings-panel > header p { margin: 4px 0 0; color: var(--muted); }
.account-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e8eeeb; }
.account-section h2 { margin: 0 0 10px; font-size: 16px; }
.account-helper { margin: -4px 0 10px; color: var(--muted); font-size: 12px; }
.account-status { margin: 14px 0 0; padding: 10px 12px; border-radius: 7px; font-weight: 700; }
.account-status.success { background: #edf7f1; color: var(--green); }
.account-status.error { background: #fff5f5; color: var(--danger); }
.account-actions { margin-top: 18px; }
.mini-card {
  padding: 12px;
  margin: 10px 0;
}
.mini-card h3 { margin: 0 0 10px; }
.status { color: var(--green); font-weight: 700; margin-top: 10px; }
.error { color: var(--danger); }
.result-shell {
  --result-accent: var(--green);
  --result-soft: #f0fff4;
  display: grid;
  gap: 14px;
  max-width: 680px;
  margin: 24px auto 0;
}
.result-shell.result-retry {
  --result-accent: #a66a12;
  --result-soft: #fffaf0;
}
.result-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 22px;
  border: 1px solid color-mix(in srgb, var(--result-accent) 34%, white);
  border-radius: 8px;
  background: var(--result-soft);
  text-align: center;
}
.result-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--result-accent);
  color: white;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}
.result-hero h1 { margin: 2px 0 0; font-size: 26px; line-height: 1.25; }
.result-hero p { max-width: 540px; margin: 0; color: #4a5568; font-size: var(--content-font-size); line-height: 1.55; }
.result-hero small { color: #8b5d13; font-weight: 800; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 15px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(26, 32, 44, .05);
  direction: ltr;
}
.result-stats div { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.result-stats div + div { border-left: 1px solid #edf2f7; }
.result-stats strong { color: var(--result-accent); font-size: 20px; white-space: nowrap; }
.result-stats span { color: #718096; font-size: 11px; font-weight: 700; }
.result-penalty { margin: -4px 0 0; color: var(--danger); font-size: 13px; font-weight: 800; text-align: center; }
.result-unlock { margin: 0; color: var(--result-accent); font-size: 13px; font-weight: 800; text-align: center; }
.result-actions {
  display: flex;
  direction: ltr;
  gap: 10px;
}
.result-actions .btn { flex: 1; min-height: 50px; }
.result-actions .result-primary { flex-basis: 100%; }
.community-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.community-quick-actions .btn {
  min-height: 42px;
  gap: 8px;
  border-color: #b8cec3;
  background: #fbfdfc;
  font-size: 13px;
}
.community-quick-actions .btn b { font-size: 17px; line-height: 1; }
.community-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding-bottom: 34px;
}
.community-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.community-heading h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.community-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.compact-community-action { flex: 0 0 auto; gap: 7px; min-height: 38px; }
.community-loading,
.community-notice,
.community-error {
  margin: 12px 0;
  border: 1px solid #cfe2d9;
  border-radius: 8px;
  background: #f3faf7;
  color: #365c4b;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
}
.community-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: #feb2b2;
  background: #fff5f5;
  color: var(--danger);
}
.profile-overview {
  --profile-accent: var(--green);
  overflow: hidden;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 9px rgba(26, 32, 44, .055);
}
.profile-accent { height: 5px; background: var(--profile-accent); }
.profile-overview-body { padding: 16px; }
.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}
.profile-identity h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.profile-identity span { display: block; color: var(--muted); font-size: 12px; direction: ltr; text-align: start; }
.profile-identity small {
  padding: 4px 7px;
  border-radius: 6px;
  background: #edf2f7;
  color: #5f6b7a;
  font-size: 10px;
  font-weight: 800;
}
.profile-rank { display: block; margin: 13px 0 0; color: var(--profile-accent); font-size: 15px; }
.profile-bio { margin: 8px 0 0; color: #4a5568; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-xp { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; }
.profile-xp b { color: var(--profile-accent); font-size: 17px; }
.profile-xp span { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 700; text-align: end; }
.profile-rank-progress { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: #e8edf2; }
.profile-rank-progress span { display: block; height: 100%; background: var(--profile-accent); }
.profile-next-rank { margin: 5px 0 0; color: var(--muted); font-size: 11px; text-align: end; }
.dashboard-section {
  margin-top: 12px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: white;
  padding: 14px;
}
.dashboard-section h2 { margin: 0 0 11px; font-size: 16px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #e4eae7; border-radius: 7px; background: #e4eae7; }
.dashboard-metrics div { display: grid; min-width: 0; justify-items: center; gap: 3px; padding: 11px 5px; background: #fafcfb; text-align: center; }
.dashboard-metrics b { color: var(--green); font-size: 18px; }
.dashboard-metrics span { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.3; }
.dashboard-course-list { display: grid; gap: 9px; }
.dashboard-course-list article { display: grid; gap: 7px; }
.dashboard-course-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.dashboard-course-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dashboard-course-list small { color: var(--muted); font-size: 10px; font-weight: 700; }
.dashboard-course-list .course-progress { width: 100%; margin: 0; }
.achievement-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.achievement-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px; border: 1px solid #e3e9e6; border-radius: 7px; background: #fafcfb; }
.achievement-list article > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; background: #e7f4ed; color: var(--green); font-size: 17px; font-weight: 900; }
.achievement-list strong { display: block; font-size: 13px; }
.achievement-list p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.edit-profile-button { width: 100%; min-height: 40px; margin-top: 10px; }
.profile-editor { margin-top: 10px; padding: 14px; }
.profile-editor h2 { margin: 0; font-size: 17px; }
.profile-slug { margin: 2px 0 12px; color: var(--muted); direction: ltr; text-align: start; font-size: 11px; }
.profile-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; padding: 10px 0 0; border-top: 1px solid #edf2f7; }
.profile-switch span { display: grid; min-width: 0; }
.profile-switch b { font-size: 13px; }
.profile-switch small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.profile-switch input { flex: 0 0 auto; width: 18px; height: 18px; }
.profile-editor .row { margin-top: 13px; justify-content: flex-end; }
.leaderboard-list { display: grid; gap: 7px; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 36px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
.leaderboard-row:hover { border-color: #9fb9ad; background: #fbfdfc; }
.leaderboard-row.current { border-color: #8bbda5; background: #f3faf7; }
.leader-position { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; background: #edf2f7; color: #4a5568; font-size: 12px; font-weight: 900; }
.leader-position.p1 { background: #fff4cf; color: #946200; }
.leader-position.p2 { background: #eef1f4; color: #52606d; }
.leader-position.p3 { background: #f4e6dc; color: #8a4b27; }
.leader-identity { display: grid; min-width: 0; }
.leader-identity strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.leader-identity strong i { margin-inline-start: 5px; color: var(--green); font-size: 9px; font-style: normal; }
.leader-identity span { color: var(--muted); font-size: 10px; direction: ltr; text-align: start; }
.leader-identity small { margin-top: 2px; color: #718096; font-size: 9px; }
.leader-xp { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: end; column-gap: 3px; min-width: 58px; color: var(--green); text-align: end; }
.leader-xp b { font-size: 15px; }
.leader-xp span { font-size: 9px; font-weight: 800; }
.leader-xp i { grid-column: 1 / -1; color: #789386; font-size: 16px; font-style: normal; line-height: .7; }
.privacy-footnote { margin: 12px 2px 0; color: #718096; font-size: 10px; text-align: center; }
.text-back { margin: 8px 0 12px; border: 0; background: transparent; color: var(--green); padding: 5px 0; font-size: 12px; font-weight: 800; }
.auth-app {
  width: 100%;
  max-width: 1120px;
}
.auth-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(400px, 1.18fr);
  align-items: center;
  gap: clamp(40px, 7vw, 86px);
  min-height: calc(100svh - 40px);
  padding: 64px 22px 40px;
}
.auth-language {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 2;
  width: 48px;
  min-width: 48px;
  min-height: 40px;
  padding: 0;
  direction: ltr;
  font-size: 12px;
  letter-spacing: 0;
}
.auth-brand-panel {
  min-width: 0;
  align-self: center;
}
.auth-brand-logo {
  display: flex;
  min-height: 128px;
  align-items: center;
  margin-bottom: 20px;
}
.auth-brand-logo .app-logo {
  width: auto;
  height: 124px;
}
.auth-eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-brand-panel h1 {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.04;
  letter-spacing: 0;
}
.auth-brand-copy {
  max-width: 430px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.auth-card {
  width: 100%;
  max-width: 520px;
  justify-self: end;
  padding: 28px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 34px rgba(26, 55, 43, .08);
}
.auth-card-header { margin-bottom: 20px; }
.auth-card-header h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}
.auth-card-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.auth-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f4b7b7;
  border-radius: 7px;
  background: #fff7f7;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}
.auth-form-grid { grid-template-columns: 1fr; gap: 13px; }
.auth-card.is-register .auth-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-card .field label { font-size: 12px; font-weight: 800; }
.auth-card .field input {
  min-height: 46px;
  border-color: #cbd7d1;
  background: #fbfdfc;
}
.auth-card .field input:focus {
  outline: 2px solid rgba(39, 103, 73, .16);
  border-color: var(--green);
  background: white;
}
.auth-card .password-control input { width: 100%; }
.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 17px;
}
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 13px;
  color: #89958f;
  font-size: 11px;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; background: #e1e8e4; }
.auth-google {
  width: 100%;
  min-height: 44px;
  gap: 9px;
}
.auth-google b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #dbe4df;
  border-radius: 50%;
  background: white;
  color: #33413a;
  font-family: Arial, sans-serif;
  font-size: 12px;
}
.auth-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.auth-secondary-actions .btn { min-height: 42px; padding-inline: 10px; font-size: 12px; }
.auth-recovery {
  display: block;
  width: 100%;
  margin-top: 15px;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 5px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.auth-recovery:hover { text-decoration: underline; }
.auth-panel {
  width: min(100%, 560px);
  margin: 20px auto;
  padding: 18px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 10px rgba(26, 32, 44, .055);
}
.auth-panel h1 { margin: 0 0 4px; font-size: 24px; }
.auth-panel > p { margin: 0 0 14px; color: var(--muted); }
.auth-notice,
.password-rules {
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.auth-notice { padding: 10px 12px; border-radius: 7px; background: #f2f7f4; color: #365c4b; }
.link-button { border: 0; background: transparent; color: var(--green); padding: 6px 0; font-weight: 800; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.segmented .btn { width: 100%; }
.impersonation-return { color: #8b5d13 !important; background: #fffaf0 !important; }
.admin-users-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-users-heading h1 { margin: 0; font-size: 25px; }
.admin-users-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.admin-users-heading > span { display: grid; min-width: 38px; height: 38px; place-items: center; border-radius: 7px; background: #e7f4ed; color: var(--green); font-weight: 900; }
.user-admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto;
  gap: 8px;
  margin-bottom: 12px;
}
.user-admin-filters input,
.user-admin-filters select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 8px 10px; }
.user-search-control { position: relative; min-width: 0; }
.user-search-control input { padding-inline-end: 38px; }
.user-search-control button {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #607269;
  font-size: 18px;
}
.user-search-control button:hover { background: #edf5f1; color: var(--green); }
.admin-user-list { display: grid; gap: 9px; }
.admin-user-card { padding: 14px; border: 1px solid #dbe4df; border-radius: 8px; background: white; box-shadow: 0 2px 8px rgba(26, 32, 44, .045); }
.admin-user-card.disabled { border-color: #f1b7b7; background: #fffafa; }
.admin-user-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.admin-user-main h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.admin-user-main p { margin: 3px 0; color: var(--muted); font-size: 11px; direction: ltr; text-align: start; }
.admin-user-main small { display: block; min-width: 0; overflow: hidden; color: #4a5568; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-stats { display: grid; justify-items: end; gap: 2px; color: var(--green); }
.admin-user-stats span { color: var(--muted); font-size: 10px; }
.admin-user-flags { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0; }
.admin-user-flags span { padding: 4px 7px; border-radius: 5px; background: #edf2f7; color: #536171; font-size: 9px; font-weight: 800; }
.admin-user-flags .ok { background: #e8f5ee; color: var(--green); }
.admin-user-flags .danger { background: #fff0f0; color: var(--danger); }
.admin-user-card footer,
.user-editor footer { display: flex; justify-content: flex-end; gap: 8px; }
.user-editor { width: min(760px, 100%); }
.user-editor > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.user-editor > header h2 { margin: 0; font-size: 21px; }
.user-editor > header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; direction: ltr; text-align: start; }
.user-editor textarea { min-height: 84px; resize: vertical; }
.checkline { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid #edf2f7; border-radius: 7px; color: #3e4b58; font-size: 12px; font-weight: 700; }
.checkline input { width: 17px; height: 17px; }
.danger-line { border-color: #fed7d7; color: #9b2c2c; background: #fffafa; }
.rtl { direction: rtl; text-align: right; }
@media (max-width: 720px) {
  .auth-app { padding: 0 16px; }
  .auth-screen {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 24px;
    min-height: 100svh;
    padding: 72px 0 28px;
  }
  .auth-language { top: 18px; right: 0; }
  .auth-brand-panel { text-align: center; }
  .auth-brand-logo { min-height: 82px; justify-content: center; margin-bottom: 10px; }
  .auth-brand-logo .app-logo { height: 80px; }
  .auth-eyebrow { margin-bottom: 5px; font-size: 10px; }
  .auth-brand-panel h1 { font-size: 31px; }
  .auth-brand-copy { max-width: 420px; margin: 9px auto 0; font-size: 13px; line-height: 1.55; }
  .auth-card { max-width: 520px; justify-self: center; padding: 20px 18px; }
  .auth-card-header { margin-bottom: 16px; }
  .auth-card-header h2 { font-size: 21px; }
  .auth-card.is-register .auth-form-grid { grid-template-columns: 1fr; }
  .auth-secondary-actions { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sort-layout, .sort-targets { grid-template-columns: 1fr; }
  .level-bar { flex-wrap: nowrap; }
  .btn.play { flex: 0 0 44px; }
  .level-card:not(.polished-level) { padding: 11px; }
  .level-card-body { padding: 12px; }
  .level-title { font-size: 16px; }
  .level-subtitle { font-size: 12px; }
  .app-nav { grid-template-columns: minmax(68px, 1fr) 44px minmax(128px, 1fr); gap: 6px; }
  .app-nav .app-logo { height: 44px; max-width: 44px; }
  .app-nav .user-menu { gap: 6px; }
  .app-nav .btn { padding: 8px 9px; font-size: 13px; }
  .app-nav .account-button { min-width: 0; }
  .admin-actions .btn { flex: 1 1 76px; padding: 8px; font-size: 12px; }
  .level-action-buttons { gap: 4px; }
  .level-action-buttons .btn.icon-only { width: 34px; min-width: 34px; height: 34px; }
  .level-counter { font-size: 11px; padding-inline: 8px; }
  .level-stage-title { width: calc(100% - 24px); font-size: 12px; }
  .level-metrics { gap: 6px; }
  .level-metrics span { font-size: 10px; }
  .lesson-content { padding: 16px; }
  .result-shell { margin-top: 14px; }
  .result-hero { padding: 20px 15px; }
  .result-hero h1 { font-size: 22px; }
  .result-stats strong { font-size: 17px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card { min-height: 112px; }
  .category-card h2 { font-size: 16px; }
  .category-admin-row { grid-template-columns: 1fr; margin-inline-start: min(calc(var(--category-depth) * 12px), 48px); }
  .editor-backdrop { padding: 8px; }
  .inline-editor { max-height: calc(100vh - 16px); padding: 13px; }
  .community-heading { align-items: center; }
  .community-heading h1 { font-size: 20px; }
  .community-heading p { font-size: 11px; }
  .compact-community-action span { display: none; }
  .compact-community-action { width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-list { grid-template-columns: 1fr; }
  .profile-overview-body { padding: 13px; }
  .profile-identity { grid-template-columns: auto minmax(0, 1fr); }
  .profile-identity small { grid-column: 2; justify-self: start; }
  .profile-editor .form-grid { grid-template-columns: 1fr; }
  .leaderboard-row { grid-template-columns: 30px 25px minmax(0, 1fr) auto; gap: 7px; padding: 9px; }
  .leader-identity small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .profile-editor .row { flex-direction: column-reverse; }
  .profile-editor .row .btn { width: 100%; }
  .user-admin-filters { grid-template-columns: 1fr; }
  .admin-user-main { gap: 8px; }
  .admin-user-card footer,
  .user-editor footer { flex-direction: column; }
  .admin-user-card footer .btn,
  .user-editor footer .btn { width: 100%; }
}
