:root {
  --green: #4CAF50;
  --green-dark: #2E7D32;
  --ink: #17202a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

select:not(.admin-role-select):not(.admin-course-status-select) {
  min-height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid #d9e7db;
  border-radius: 12px;
  color: #203b28;
  background-color: #fff;
  background-image: linear-gradient(45deg, transparent 50%, #41654a 50%), linear-gradient(135deg, #41654a 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  box-shadow: 0 5px 14px rgba(45,85,54,.06);
  appearance: none;
  cursor: pointer;
  font-weight: 700;
}

select:not(.admin-role-select):not(.admin-course-status-select):focus-visible {
  outline: 0;
  border-color: rgba(61,173,79,.62);
  box-shadow: 0 0 0 4px rgba(82,185,87,.13);
}

select:disabled { cursor: not-allowed; opacity: .62; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[data-shell] {
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.main-nav,
.header-actions,
.course-meta,
.course-footer,
.row-actions,
.filters,
.auth-tabs,
.segmented,
.stat-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
  font-size: 1.15rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 22px rgba(76, 175, 80, 0.32);
}

.main-nav {
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.main-nav a { flex: 0 0 auto; white-space: nowrap; }

.main-nav a,
.auth-tabs button,
.segmented button {
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.main-nav a.active,
.main-nav a:hover,
.auth-tabs button.active,
.segmented button.active {
  color: var(--green-dark);
  background: #e9f7ec;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  color: #fff;
  background: var(--danger);
  font-size: 0.75rem;
  line-height: 20px;
}

.notification-panel {
  position: fixed;
  top: 74px;
  right: clamp(16px, 4vw, 64px);
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-panel article {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-panel article:last-child {
  border-bottom: 0;
}

.notification-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-top: 70px;
  padding: 34px clamp(18px, 4vw, 64px);
  color: #d8ead9;
  background: #1f3b24;
}

.site-footer .brand {
  color: #fff;
  justify-content: flex-start;
}

.site-footer p {
  max-width: 560px;
  color: #bdd6c0;
  line-height: 1.65;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.site-footer a {
  color: #e8f5e9;
  font-weight: 700;
}

.site-footer small {
  grid-column: 1 / -1;
  color: #a7c7ab;
}

.page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.home-hero {
  position: relative;
  min-height: clamp(430px, 56svh, 560px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 42%, rgba(255, 214, 77, 0.26), transparent 24%),
    radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.2), transparent 26%),
    linear-gradient(135deg, #355d16 0%, #4caf18 54%, #7ac836 100%);
}

.home-hero-inner,
.home-section {
  width: min(1260px, calc(100% - 44px));
  margin: 0 auto;
}

.home-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  align-items: center;
  gap: clamp(34px, 5vw, 72px);
  min-height: inherit;
  padding: 24px 0 30px;
}

.home-hero-copy {
  max-width: 720px;
}

.hero-badge,
.section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin: 0 0 16px;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
}

.hero-badge {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.home-hero h1 {
  margin: 0;
  max-width: 790px;
  font-size: clamp(2.45rem, 4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.home-hero-copy > p:not(.hero-badge) {
  max-width: 680px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  font-weight: 650;
  line-height: 1.55;
}

.btn-light {
  color: #355d16;
  background: #fff;
  box-shadow: 0 16px 35px rgba(31, 59, 36, 0.2);
}

.btn-glass {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 70px);
  margin-top: 18px;
}

.home-stats strong {
  display: block;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1;
}

.home-stats span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 750;
}

.hero-symbol {
  position: absolute;
  z-index: 1;
  color: rgba(255, 255, 255, 0.12);
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 900;
  pointer-events: none;
  animation: heroDrift 8s ease-in-out infinite;
}

.symbol-one { left: 6%; top: 38%; }
.symbol-two { left: 43%; bottom: 18%; animation-delay: 1.2s; }
.symbol-three { right: 36%; top: 9%; animation-delay: 2s; }
.symbol-four { right: 6%; top: 32%; animation-delay: 2.8s; }

@keyframes heroDrift {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-24px) rotate(5deg); }
}

.math-card-scene {
  position: relative;
  min-height: 330px;
}

.floating-card {
  position: absolute;
  display: grid;
  gap: 9px;
  min-width: 124px;
  padding: 16px;
  border-radius: 18px;
  color: #496045;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 50px rgba(31, 59, 36, 0.22);
  animation: cardFloat 5.5s ease-in-out infinite;
}

.floating-card span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #eff7ef;
  font-size: 1.45rem;
}

.floating-card strong {
  color: #48663f;
  font-size: 1.22rem;
}

.floating-card small {
  color: #87927f;
  font-weight: 700;
}

.card-sum { left: 22%; top: 12%; }
.card-pi { left: 4%; top: 43%; animation-delay: 0.8s; }
.card-integral { right: 16%; top: 6%; animation-delay: 1.4s; }
.card-chart { right: 0; top: 38%; animation-delay: 2s; }
.card-score { right: 28%; bottom: 3%; animation-delay: 2.6s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.home-section {
  padding: clamp(52px, 8svh, 86px) 0;
}

.home-section-head {
  max-width: 760px;
  margin: 0 auto 54px;
  text-align: center;
}

.home-section-head h2 {
  margin: 0;
  color: #405040;
  font-size: clamp(2.4rem, 5vw, 4.35rem);
  line-height: 1.1;
}

.home-section-head p {
  margin: 20px auto 0;
  max-width: 760px;
  color: #748070;
  font-size: 1.18rem;
  line-height: 1.75;
}

.section-badge {
  color: #496b41;
  background: #edf7ee;
}

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

.feature-card {
  min-height: 245px;
  padding: 38px 34px;
  border: 1px solid #edf1ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.045);
  text-align: center;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: #4caf50;
  box-shadow: 0 24px 52px rgba(76, 175, 80, 0.18);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.feature-card span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  border-radius: 18px;
  background: #eef7ef;
  font-size: 2rem;
}

.feature-card h3 {
  margin: 0 0 16px;
  color: #2f3a2f;
  font-size: 1.42rem;
}

.feature-card p {
  margin: 0;
  color: #7b8578;
  line-height: 1.65;
}

.steps-section {
  background: #fbfbf8;
}

.steps-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.steps-line::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: #a9c1a0;
}

.step-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.step-card > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #62b64f, #3f7d31);
  box-shadow: 0 12px 28px rgba(76, 175, 80, 0.28);
  font-size: 1.75rem;
  font-weight: 900;
}

.step-card h3 {
  margin: 10px 0 0;
  color: #394639;
  font-size: 1.18rem;
}

.step-card p {
  max-width: 250px;
  margin: 0;
  color: #7b8578;
  line-height: 1.6;
}

.course-section {
  background: #fff;
}

.course-toolbar {
  width: min(980px, 100%);
  margin: 0 auto 36px;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.055);
}

.course-discovery {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 26px 20px;
  width: min(1040px, 100%);
  margin: 0 auto 30px;
  padding: 18px;
  border: 1px solid #e1eadf;
  border-radius: 18px;
  background: #fbfdfb;
  box-shadow: 0 16px 42px rgba(35, 76, 38, 0.08);
}

.course-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #d7e3d5;
  border-radius: 12px;
  background: #fff;
}

.course-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.12);
}

.course-search > span {
  color: var(--green-dark);
  font-size: 1.65rem;
  line-height: 1;
  transform: rotate(-18deg);
}

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

.course-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 12px 0 16px;
  border: 1px solid #d7e3d5;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.course-sort label {
  font-size: 0.86rem;
  font-weight: 750;
}

.course-sort select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}

.course-categories {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(67, 139, 80, .34) transparent;
}

.course-categories::-webkit-scrollbar { height: 7px; }
.course-categories::-webkit-scrollbar-track { background: transparent; }
.course-categories::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(67, 139, 80, .28); }

.course-category-chip {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid #dbe7d9;
  border-radius: 999px;
  background: #fff;
  color: #536151;
  font-weight: 750;
  cursor: pointer;
  transition: 160ms ease;
}

.course-category-chip:hover,
.course-category-chip.active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(76, 175, 80, 0.2);
}

.course-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.course-results-head .course-subtitle {
  margin: 0;
}

#courseResultCount {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.course-subtitle {
  margin: 0 0 24px;
  color: #394639;
  font-size: 1.9rem;
}

.signup-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.85fr);
  gap: clamp(36px, 7vw, 90px);
  align-items: center;
}

.signup-copy h2,
.signup-card h2 {
  margin: 0;
  color: #3d4d3c;
}

.signup-copy h2 {
  max-width: 620px;
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 1.12;
}

.signup-copy p {
  max-width: 640px;
  color: #7b8578;
  font-size: 1.18rem;
  line-height: 1.7;
}

.signup-copy ul {
  display: grid;
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.signup-copy li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5f695d;
  font-weight: 750;
}

.signup-copy li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  color: #fff;
  background: #83c886;
}

.signup-card {
  display: grid;
  gap: 18px;
  padding: 42px;
  border: 1px solid #e2e8df;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(23, 32, 42, 0.1);
}

.signup-card h2 {
  margin-bottom: 8px;
  text-align: center;
}

.signup-card input {
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid #d4ddd1;
  border-radius: 12px;
  background: #fff;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input,
.signup-card .password-field input {
  width: 100%;
  padding-right: 58px;
}

.password-toggle,
.signup-card .password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #eff8ef;
}

.password-toggle svg,
.signup-card .password-field button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.optional-label {
  float: right;
  color: #879287;
  font-size: 0.78rem;
  font-weight: 500;
}

.signup-card .password-feedback {
  min-height: 18px;
  margin: -8px 2px -5px;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 650;
}

.password-feedback.is-error { color: var(--danger); }
.password-feedback.is-valid { color: var(--green-dark); }

.auth-card .password-feedback {
  min-height: 18px;
  margin: -8px 2px 0;
  color: var(--danger);
  text-align: left;
  font-size: 0.84rem;
  font-weight: 650;
}

.signup-card button {
  min-height: 64px;
  margin-top: 8px;
  font-size: 1.05rem;
}

.signup-card p {
  margin: 2px 0 0;
  color: #8a9388;
  text-align: center;
}

.signup-card a {
  color: var(--green-dark);
  font-weight: 850;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  align-items: center;
  gap: clamp(30px, 6vw, 72px);
  min-height: 620px;
  overflow: hidden;
}

.math-float {
  position: absolute;
  color: rgba(76, 175, 80, 0.14);
  font-weight: 900;
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}

.math-float:nth-child(1) { top: 12%; left: 4%; font-size: 76px; }
.math-float:nth-child(2) { top: 20%; right: 42%; font-size: 48px; animation-delay: 1s; }
.math-float:nth-child(3) { bottom: 10%; left: 38%; font-size: 60px; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-22px) rotate(5deg); }
}

.hero-copy h1,
.page-title h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p,
.page-title p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.home-hero .hero-actions {
  margin-top: 18px;
}

.hero-panel {
  min-height: 472px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat,
.panel,
.course-card,
.auth-card,
.metric,
.report-card,
.lesson-shell,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.stat {
  padding: 14px;
}

.stat strong,
.metric strong {
  display: block;
  font-size: 1.55rem;
}

.stat span,
.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  padding: 54px 0;
}

.personal-home {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
  align-items: center;
  margin: 28px 0 6px;
  padding: 24px;
  border: 1px solid #dbe7dc;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #edf8ef);
  box-shadow: 0 14px 38px rgba(23, 32, 42, 0.07);
}

.home-account-card {
  padding: 4px 2px 16px;
}

.home-account-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.home-account-card p {
  color: var(--muted);
  line-height: 1.65;
}

.personal-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.personal-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-panel .personal-cards,
.personal-cards,
.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-panel .personal-cards {
  grid-template-columns: 1fr;
}

.personal-cards article,
.path-card,
.study-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.personal-cards article,
.path-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.personal-cards span,
.path-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.personal-cards strong,
.path-card h3 {
  margin: 0;
  line-height: 1.25;
}

.personal-cards a {
  color: var(--green-dark);
  font-weight: 800;
}

.personal-cards small {
  color: var(--muted);
}

.path-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
}

.study-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff, #f1f8f2);
}

.study-hero h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.study-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-head,
.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2,
.dashboard-head h1,
.panel h2,
.auth-card h1 {
  margin: 0;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.filters {
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filters .field {
  min-width: 190px;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn.is-loading {
  cursor: wait;
  box-shadow: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 720ms linear infinite;
}

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

.btn-primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(76, 175, 80, 0.24);
}

.btn-outline {
  color: var(--green-dark);
  border-color: #a7d9aa;
  background: #fff;
}

.btn-ghost {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

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

.course-card {
  overflow: hidden;
}

.course-image {
  position: relative;
  display: block;
}

.course-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.course-image span {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 32, 42, 0.76);
}

.course-body,
.panel,
.auth-card,
.metric,
.report-card,
.lesson-shell,
.table-wrap {
  padding: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.course-body h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.course-body p {
  color: var(--muted);
  line-height: 1.55;
}

.course-meta,
.course-footer,
.row-actions,
.stat-row {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.course-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.course-footer {
  margin-top: 16px;
}

.auth-page {
  min-height: 100vh;
  background: #f8faf8;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.04fr) minmax(420px, 1fr);
  min-height: calc(100vh - 69px);
}

.notice-dialog {
  max-width: 460px;
  padding: 38px;
  border: 0;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(15, 35, 18, 0.25);
}

.notice-dialog::backdrop {
  background: rgba(14, 27, 17, 0.58);
  backdrop-filter: blur(4px);
}

.notice-dialog .notice-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #66c96a, #2e7d32);
  box-shadow: 0 12px 28px rgba(76, 175, 80, 0.3);
  font-size: 1.8rem;
  font-weight: 900;
}

.notice-dialog h2 {
  margin: 0;
  font-size: 1.65rem;
}

.notice-dialog p {
  margin: 14px 0 26px;
  color: var(--muted);
  line-height: 1.65;
}

.notice-dialog .btn {
  min-width: 150px;
}

.auth-welcome {
  display: flex;
  align-items: center;
  padding: clamp(34px, 8vw, 92px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(46, 125, 50, 0.93), rgba(76, 175, 80, 0.9)),
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.28), transparent 32%),
    var(--green);
}

.auth-welcome > div {
  max-width: 620px;
}

.auth-welcome h1 {
  margin: 0 0 30px;
  max-width: 560px;
  font-size: clamp(2.8rem, 5.7vw, 4.7rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.auth-welcome p {
  margin: 0 0 56px;
  max-width: 610px;
  color: rgba(12, 36, 16, 0.9);
  font-size: 1.22rem;
  line-height: 1.65;
}

.auth-welcome ul {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-welcome li {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.08rem;
  font-weight: 750;
}

.auth-welcome li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(650px, calc(100% - 56px));
  padding: 30px 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #151b23;
  font-size: clamp(2rem, 3vw, 2.65rem);
  font-weight: 900;
}

.auth-logo > span:last-child span {
  color: var(--green);
}

.auth-logo-icon {
  font-size: 2rem;
}

.auth-subtitle {
  margin: 18px 0 36px;
  color: #3e4a3f;
  font-size: 1.14rem;
  text-align: center;
}

.auth-tabs {
  gap: 8px;
  padding: 6px;
  margin: 0 0 34px;
  border-radius: 8px;
  background: #e1e1e1;
}

.auth-tabs button {
  flex: 1;
  min-height: 58px;
  color: #2f352f;
  font-weight: 750;
}

.auth-tabs button.active {
  background: #fff;
  box-shadow: 0 1px 5px rgba(23, 32, 42, 0.14);
}

.form-stack {
  display: grid;
  gap: 20px;
}

.auth-card .field {
  gap: 9px;
}

.auth-card .field label {
  color: #1f2a21;
  font-size: 1rem;
  font-weight: 700;
}

.auth-card .field input {
  min-height: 60px;
  border-color: #d7ddd8;
  border-radius: 8px;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.auth-card .field input::placeholder {
  color: #747b76;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4a554c;
}

.remember input {
  width: 18px;
  height: 18px;
}

.link-button {
  padding: 0;
  border: 0;
  color: #69736b;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}

.link-button:hover {
  color: var(--green-dark);
}

.auth-submit {
  width: 100%;
  min-height: 64px;
  margin-top: 8px;
  font-size: 1.08rem;
}

.auth-divider {
  position: relative;
  display: grid;
  place-items: center;
  color: #667066;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #dfe4df;
}

.auth-divider span {
  position: relative;
  padding: 0 18px;
  background: #f8faf8;
}

.auth-google {
  width: 100%;
  min-height: 58px;
  color: #1f2a21;
  border-color: #d3dad4;
  background: #fff;
  font-size: 1.02rem;
}

.auth-google span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1a73e8;
}

.auth-panel-title {
  text-align: center;
}

.auth-panel-title h2 {
  margin: 0 0 8px;
}

.auth-panel-title p {
  margin: 0;
  color: var(--muted);
}

.dashboard {
  padding: 34px 0 70px;
}

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

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.panel + .panel {
  margin-top: 18px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eef5;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress.is-skeleton span {
  width: 62%;
  background: linear-gradient(90deg, #e6eef0, #f7faf7, #e6eef0);
  background-size: 220% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.item-list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--green-dark);
  background: #e9f7ec;
  font-weight: 700;
}

.pill.warn {
  color: #92400e;
  background: #fef3c7;
}

.pill.danger {
  color: #991b1b;
  background: #fee2e2;
}

.muted-text {
  color: var(--muted);
  line-height: 1.6;
}

.user-chip {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.profile-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.profile-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-grid strong {
  overflow-wrap: anywhere;
}

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

.page-title {
  padding: 42px 0 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
  padding-bottom: 70px;
}

.detail-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.accordion {
  display: grid;
  gap: 10px;
}

.accordion details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.accordion summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

.accordion a {
  display: block;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.lesson-shell {
  margin: 30px auto 70px;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-content {
  line-height: 1.8;
  font-size: 1.04rem;
}

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

.question {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.question > strong {
  display: block;
  margin-bottom: 14px;
  line-height: 1.45;
}

.question label {
  display: block;
  margin-top: 8px;
}

.question > strong + label { margin-top: 0; }

.report-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-chart div {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.bar-chart span:nth-child(2) {
  height: 12px;
  border-radius: 99px;
  background: var(--green);
}

#panel-stats .teacher-overview-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
}

#courseProgressChart > div {
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px 14px;
}

#courseProgressChart > div > span:first-child {
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
}

#courseProgressChart > div > span:nth-child(2) {
  grid-column: 1 / -1;
  grid-row: 2;
}

#courseProgressChart > div > strong {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}

@media (max-width: 1280px) {
  #panel-stats .teacher-overview-grid { grid-template-columns: 1fr; }
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-dark);
  box-shadow: var(--shadow);
}

.toast-error {
  background: var(--danger);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed #b6c4d4;
  border-radius: 8px;
  text-align: center;
}

.loading {
  opacity: 0.65;
  pointer-events: none;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.reveal {
  transform: translateY(20px);
  opacity: 0;
  transition: 480ms ease;
}

.reveal.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.content-section {
  padding: 78px 0;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 42px;
  text-align: center;
}

.section-heading h2 {
  margin: 12px 0 14px;
  color: #3f513f;
  font-size: clamp(2.1rem, 4vw, 3.65rem);
  line-height: 1.12;
}

.section-heading p {
  margin: 0 auto;
  color: #6f7c6c;
  line-height: 1.7;
}

.subpage-hero,
.manager-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 80% 38%, rgba(255, 224, 97, 0.22), transparent 24%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #28581f 0%, #4caf50 58%, #86c94a 100%);
}

.subpage-hero {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
}

.subpage-hero-inner {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100% - 36px));
}

.subpage-hero h1,
.manager-hero h1 {
  margin: 12px 0;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.subpage-hero p:not(.section-badge),
.manager-hero p {
  margin: 0 auto;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-icon {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 2rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  animation: cardFloat 4.8s ease-in-out infinite;
}

.hero-float {
  position: absolute;
  color: rgba(255, 255, 255, 0.1);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  pointer-events: none;
  animation: heroDrift 8s ease-in-out infinite;
}

.float-one { left: 9%; top: 24%; }
.float-two { right: 13%; top: 14%; animation-delay: 1.1s; }
.float-three { left: 43%; bottom: 3%; animation-delay: 2s; }

.tips-page {
  background: #fbfcf8;
}

.tips-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 34px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #dfe8dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.04);
}

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

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #cddbc9;
  border-radius: 999px;
  color: #596756;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.pill-button span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #6c7969;
  background: #eef4ec;
  font-size: 0.8rem;
}

.pill-button.active,
.pill-button:hover {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 12px 26px rgba(76, 175, 80, 0.2);
}

.pill-button.active span,
.pill-button:hover span {
  color: var(--green-dark);
  background: #fff;
}

.tip-card {
  overflow: hidden;
  border: 1px solid #e4ebe1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.055);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.tip-card:hover {
  transform: translateY(-8px);
  border-color: var(--green);
  box-shadow: 0 24px 54px rgba(76, 175, 80, 0.16);
}

.tip-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #16251a;
  cursor: pointer;
}

.tip-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.86;
}

.tip-thumb span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2.5rem;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.tip-thumb:disabled { cursor: default; }
.tip-thumb.local-video-thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1d5f32, #57bd61); }
.tip-thumb .tip-video-placeholder { position: static; display: block; color: #fff; font-size: 4rem; opacity: .72; text-shadow: none; }

.tip-content {
  padding: 20px;
}

.tip-content h3 {
  margin: 0 0 10px;
  color: #243124;
  line-height: 1.26;
}

.tip-content p {
  color: #687565;
  line-height: 1.65;
}

.video-modal {
  width: min(920px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: #0f172a;
}

.video-modal iframe,
.video-modal video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #050b16;
}

.video-modal [hidden] { display: none; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #17202a;
  background: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.lesson-mastery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 22px;
  padding: 14px 18px;
  border: 1px solid #cfe5d2;
  border-radius: 18px;
  color: #245832;
  background: #edf8ee;
}

.lesson-mastery-status[hidden] { display: none; }
.lesson-mastery-status span { color: #607166; font-size: .9rem; font-weight: 700; }
.lesson-mastery-status strong { font-size: 1rem; }

.manager-hero {
  min-height: 250px;
}

.manager-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(1260px, calc(100% - 44px));
  margin: 0 auto;
  padding: 54px 0;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.manager-actions .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
}

.manager-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 34px 0 70px;
}

.manager-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e0e9dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(23, 32, 42, 0.055);
}

.manager-side-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: #5f6c5c;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.manager-side-button.active,
.manager-side-button:hover {
  color: var(--green-dark);
  background: #edf7ee;
}

.manager-panel {
  display: grid;
  gap: 22px;
}

.manager-panel[hidden] {
  display: none;
}

.manager-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.manager-panel-head h2 {
  margin: 0;
  color: #253225;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.manager-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.manager-card,
.manager-table-card {
  border: 1px solid #e1eadf;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.055);
}

.manager-card {
  padding: 22px;
}

.manager-table-card {
  overflow-x: auto;
}

.manager-table {
  min-width: 840px;
}

.metric.soft {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 22px;
  border-radius: 12px;
}

.metric.soft span:first-child {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #eef7ef;
  font-size: 1.9rem;
}

.metric.soft strong {
  color: #16231a;
  font-size: 2.1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e9f7ec;
  font-weight: 800;
}

.status-badge.warn {
  color: #9a5b10;
  background: #fff2cc;
}

.status-badge.danger {
  color: #9f1d1d;
  background: #fee2e2;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-row .search-box {
  flex: 1;
  min-width: 260px;
}

.filter-row select {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #dfe8dc;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 920px) {
  .site-header,
  .hero,
  .home-hero-inner,
  .signup-section,
  .dashboard-layout,
  .detail-layout,
  .auth-layout,
  .personal-home {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: start;
    overflow-x: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .header-actions {
    justify-content: start;
  }

  .hero {
    min-height: auto;
    padding: 40px 0;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero-inner {
    padding: 48px 0 64px;
  }

  .math-card-scene {
    min-height: 430px;
  }

  .floating-card {
    min-width: 132px;
    padding: 18px;
  }

  .feature-grid,
  .steps-line,
  .signup-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps-line::before {
    display: none;
  }

  .auth-layout {
    min-height: auto;
  }

  .auth-welcome {
    min-height: 360px;
  }

  .auth-card {
    width: min(620px, calc(100% - 32px));
    padding: 34px 0 48px;
  }

  .course-grid,
  .tips-grid,
  .metrics-grid,
  .report-grid,
  .personal-cards,
  .path-grid,
  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tips-toolbar,
  .manager-shell {
    grid-template-columns: 1fr;
  }

  .category-pills {
    justify-content: flex-start;
  }

  .manager-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-hero-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .manager-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 24px, 1180px);
  }

  .course-grid,
  .tips-grid,
  .metrics-grid,
  .report-grid,
  .feature-grid,
  .steps-line,
  .signup-section,
  .stat-grid,
  .personal-cards,
  .path-grid,
  .profile-grid,
  .compact-metrics {
    grid-template-columns: 1fr;
  }

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

  .home-hero-inner,
  .home-section {
    width: min(100% - 26px, 1260px);
  }

  .home-hero h1 {
    font-size: clamp(2.45rem, 15vw, 4.4rem);
  }

  .math-card-scene {
    min-height: 520px;
  }

  .floating-card {
    min-width: 148px;
  }

  .card-sum { left: 6%; top: 5%; }
  .card-pi { left: 0; top: 36%; }
  .card-integral { right: 0; top: 16%; }
  .card-chart { right: 4%; top: 50%; }
  .card-score { left: 24%; bottom: 0; right: auto; }

  .home-section {
    padding: 62px 0;
  }

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

  .feature-card,
  .signup-card {
    padding: 26px 20px;
  }

  .course-discovery {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .course-sort {
    justify-content: space-between;
  }

  .course-categories {
    grid-column: 1;
  }

  .course-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head,
  .dashboard-head {
    align-items: start;
    flex-direction: column;
  }

  .hero-copy h1,
  .page-title h1 {
    font-size: 2.35rem;
  }

  .auth-welcome {
    padding: 34px 24px;
  }

  .auth-welcome h1 {
    font-size: 2.45rem;
  }

  .auth-welcome p {
    margin-bottom: 30px;
    font-size: 1rem;
  }

  .auth-welcome ul {
    gap: 14px;
  }

  .auth-card {
    width: min(100% - 28px, 620px);
  }

  .auth-tabs button {
    min-height: 50px;
  }

  .auth-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .subpage-hero {
    min-height: 280px;
  }

  .manager-sidebar {
    grid-template-columns: 1fr;
  }

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

/* Teacher workspace */
.manager-content { min-width: 0; }
.teacher-overview-grid,
.teacher-card-grid,
.teacher-editor-layout,
.teacher-quiz-layout { display: grid; gap: 22px; }
.teacher-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.teacher-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.teacher-class-card { display: grid; gap: 16px; }
.teacher-class-card h2,
.manager-card h2 { margin: 4px 0 10px; }
.class-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); }
.class-code span { color: var(--muted); font-size: .82rem; font-weight: 800; }
.class-code button { border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font: inherit; font-weight: 900; letter-spacing: .08em; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.member-chips > span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: #31513a; background: #edf5ee; font-size: .84rem; font-weight: 700; }
.member-chips button { border: 0; color: #8d3030; background: transparent; cursor: pointer; font-size: 1rem; }
.member-chips .member-group-button { padding: 3px 7px; border-radius: 999px; color: #496b51; background: rgba(255,255,255,.8); font-size: .7rem; font-weight: 800; }
.wide-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.muted-text { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.danger-text, .mini-action.danger { color: #a52626; }
.teacher-editor-layout { grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); align-items: start; }
.editor-list,
.chapter-manager,
.lesson-manager,
.question-builder { display: grid; gap: 12px; }
.editor-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.editor-summary > div { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: #f2f8f2; }
.editor-summary span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.editor-summary strong { color: var(--green-dark); font-size: 1.35rem; }
.editor-list-row,
.editor-lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid #deeadf; border-radius: 16px; background: #fbfdfb; }
.chapter-select { flex: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.chapter-select > span,
.lesson-order { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--green-dark); background: var(--green-soft); font-weight: 900; }
.chapter-select.active strong { color: var(--green-dark); }
.chapter-select small,
.editor-lesson-row span { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.editor-lesson-row > div:nth-child(2) { flex: 1; min-width: 0; }
.mini-action { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 9px; border: 1px solid #dbe7dc; border-radius: 10px; color: #31513a; background: #fff; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; text-decoration: none; }
.teacher-quiz-layout { grid-template-columns: minmax(250px, .58fr) minmax(0, 1.42fr); align-items: start; }
.quiz-library { position: sticky; top: 92px; }
.quiz-library-item { width: 100%; padding: 13px; border: 1px solid #dfe9df; border-radius: 14px; color: inherit; background: #fff; cursor: pointer; text-align: left; }
.quiz-library-item strong,
.quiz-library-item span { display: block; }
.quiz-library-item span { margin-top: 5px; color: var(--muted); font-size: .82rem; }
.quiz-library-item.active { border-color: #69bd72; background: var(--green-soft); }
.question-bank-head { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #dfe9df; }
.question-bank-head h2 { margin: 4px 0 0; }
.question-bank-head select { min-height: 44px; padding: 0 10px; border: 1px solid #dbe7dc; border-radius: 12px; background: #fff; }
.question-bank-list { display: grid; gap: 9px; max-height: 440px; margin-top: 12px; overflow-y: auto; }
.question-bank-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid #e0e9df; border-radius: 13px; background: #fbfdfb; }
.question-bank-item > div { min-width: 0; }
.question-bank-item strong,
.question-bank-item span { display: block; }
.question-bank-item strong { font-size: .87rem; line-height: 1.45; }
.question-bank-item span { margin-top: 5px; color: var(--muted); font-size: .74rem; }
.quiz-builder-head,
.question-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quiz-builder-head { margin-top: 10px; }
.quiz-builder-head h2,
.quiz-builder-head p { margin: 0 0 6px; }
.question-editor { display: grid; gap: 15px; padding: 20px; border: 1px solid #dce8dd; border-radius: 18px; background: #fbfdfb; }
.question-preview { padding: 13px 15px; border-radius: 12px; color: #274d32; background: var(--green-soft); line-height: 1.65; }
.file-button { cursor: pointer; }
.report-section,
.report-comment-section { margin-top: 24px; }
.report-student-picker { flex: 1; min-width: 260px; }
.report-course-picker { min-width: 260px; }
.report-table-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.report-table-title h2 { margin: 0; }
.share-link-box { display: flex; gap: 10px; }
.share-link-box input { min-width: 0; flex: 1; }
.text-button { border: 0; padding: 0; color: var(--green-dark); background: transparent; cursor: pointer; font: inherit; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.auth-dialog { width: min(520px, calc(100vw - 32px)); text-align: left; }
.auth-dialog .panel-heading { margin-bottom: 4px; }
.auth-dialog .field { text-align: left; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: #dce8dd; }
.public-report { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.public-report > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.public-report-head { padding: clamp(26px, 5vw, 54px); border-radius: 28px; color: #fff; background: linear-gradient(145deg, #276f39, #55bd59); }
.public-report-head h1 { margin: 6px 0; font-size: clamp(2rem, 5vw, 4rem); }
.public-report-head p { margin: 0; }
.assignment-panel { margin-top: 24px; }
.assignment-student-list { display: grid; gap: 10px; }
.assignment-student-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #dce8dd; border-radius: 16px; color: inherit; background: #fbfdfb; text-decoration: none; }
.assignment-student-row > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px 10px; min-width: 0; }
.assignment-student-row strong { min-width: 0; }
.assignment-student-row small { grid-column: 1 / -1; color: var(--muted); }
.assignment-student-row > span { flex: 0 0 auto; color: var(--green-dark); font-weight: 800; }

@media (max-width: 920px) {
  .teacher-overview-grid,
  .teacher-card-grid,
  .teacher-editor-layout,
  .teacher-quiz-layout { grid-template-columns: 1fr; }
  .quiz-library { position: static; }
}
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .manager-panel-head,
  .quiz-builder-head,
  .question-editor-head { align-items: flex-start; flex-direction: column; }
  .editor-list-row,
  .editor-lesson-row { align-items: flex-start; flex-direction: column; }
  .share-link-box { flex-direction: column; }
  .editor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-student-row { align-items: flex-start; flex-direction: column; }
}
@media print {
  [data-shell], .no-print, .site-footer, .public-report > header .btn { display: none !important; }
  body { background: #fff; }
  .page, .public-report { width: 100%; padding: 0; }
  .manager-card, .manager-table-card, .report-card { break-inside: avoid; box-shadow: none; }
}

@media print {
  .site-header,
  .notification-panel,
  .report-toolbar,
  .btn,
  .filters {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .panel,
  .report-card,
  .table-wrap {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* MathZone Clay design system */
:root {
  --green: #52b957;
  --green-dark: #226b39;
  --green-soft: #dff5df;
  --ink: #17251f;
  --muted: #617169;
  --line: rgba(62, 106, 77, 0.13);
  --surface: rgba(255, 255, 255, 0.94);
  --soft: #f3f8f4;
  --clay-blue: #dcecff;
  --clay-purple: #eee3ff;
  --clay-yellow: #fff0bd;
  --clay-peach: #ffe3d5;
  --clay-pink: #ffe2ec;
  --clay-shadow: 12px 14px 28px rgba(37, 77, 50, 0.11), inset 0 2px 1px rgba(255, 255, 255, 0.92), inset 0 -2px 3px rgba(58, 104, 70, 0.06);
  --clay-shadow-hover: 16px 20px 38px rgba(37, 77, 50, 0.16), inset 0 2px 1px rgba(255, 255, 255, 0.95), inset 0 -3px 4px rgba(58, 104, 70, 0.08);
  --shadow: var(--clay-shadow);
}

body {
  background:
    radial-gradient(circle at 8% 8%, rgba(222, 243, 224, 0.68), transparent 24rem),
    radial-gradient(circle at 92% 38%, rgba(225, 236, 255, 0.52), transparent 26rem),
    #f5f9f6;
}

.site-header {
  min-height: 72px;
  gap: 14px;
  padding: 12px clamp(16px, 2vw, 32px);
  border-bottom-color: rgba(60, 103, 73, 0.1);
  background: rgba(252, 255, 252, 0.9);
  box-shadow: 0 8px 30px rgba(31, 72, 44, 0.06);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #6ad46e, #39a84a);
  box-shadow: 7px 8px 17px rgba(41, 125, 58, 0.24), inset 0 2px 2px rgba(255, 255, 255, 0.48), inset 0 -2px 3px rgba(24, 109, 45, 0.2);
}

.main-nav {
  padding: 5px;
  gap: 2px;
  justify-content: safe center;
  border-radius: 18px;
  background: rgba(234, 245, 235, 0.58);
}

.main-nav a { padding: 9px; font-size: .84rem; }
.site-header .brand { white-space: nowrap; }
.header-actions { gap: 8px; white-space: nowrap; }
.header-actions .user-chip { max-width: 132px; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.header-actions .btn { flex-shrink: 0; padding: 10px 14px; font-size: .84rem; white-space: nowrap; }
.header-actions .icon-btn { flex-shrink: 0; }

.main-nav a,
.auth-tabs button,
.segmented button {
  border-radius: 13px;
}

.main-nav a.active,
.main-nav a:hover,
.auth-tabs button.active,
.segmented button.active {
  background: #fff;
  box-shadow: 5px 6px 13px rgba(44, 92, 57, 0.1), inset 0 1px 1px #fff;
}

.icon-btn {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff6c9, #ffe28a);
  box-shadow: 6px 7px 15px rgba(116, 93, 27, 0.15), inset 0 2px 1px rgba(255, 255, 255, 0.8);
}

.notification-panel {
  padding: 14px;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--clay-shadow-hover);
}

.notification-panel article {
  border-radius: 14px;
  border-bottom: 0;
  background: var(--soft);
}

.notification-panel article + article { margin-top: 8px; }

.btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: linear-gradient(145deg, #63ca67, #3cac4b);
  box-shadow: 7px 9px 18px rgba(44, 142, 62, 0.24), inset 0 2px 1px rgba(255, 255, 255, 0.32), inset 0 -2px 3px rgba(26, 111, 43, 0.18);
}

.btn-outline,
.btn-ghost {
  border-color: rgba(67, 139, 80, 0.2);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 4px 6px 13px rgba(48, 87, 59, 0.08), inset 0 1px 1px #fff;
}

.field input,
.field select,
.field textarea,
.filter-row select,
.search-box,
.course-search,
.course-sort {
  border-color: rgba(55, 108, 71, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 3px 4px 9px rgba(50, 87, 61, 0.055), inset -2px -2px 4px rgba(255, 255, 255, 0.9);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: rgba(61, 173, 79, 0.62);
  box-shadow: 0 0 0 4px rgba(82, 185, 87, 0.13), inset 2px 3px 7px rgba(50, 87, 61, 0.05);
}

.stat,
.panel,
.course-card,
.auth-card,
.metric,
.report-card,
.lesson-shell,
.table-wrap,
.manager-card,
.manager-table-card,
.tip-card,
.feature-card,
.signup-card,
.study-hero,
.personal-home,
.path-card,
.personal-cards article {
  border-color: rgba(63, 111, 77, 0.1);
  border-radius: 22px;
  box-shadow: var(--clay-shadow);
}

.panel,
.metric,
.report-card,
.manager-card,
.manager-table-card,
.table-wrap,
.lesson-shell {
  background: rgba(255, 255, 255, 0.92);
}

.course-card,
.tip-card,
.feature-card,
.path-card,
.personal-cards article,
.metric {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.course-card:hover,
.tip-card:hover,
.feature-card:hover,
.path-card:hover,
.personal-cards article:hover,
.metric:hover {
  transform: translateY(-5px);
  box-shadow: var(--clay-shadow-hover);
}

.course-image img,
.detail-media img { border-radius: 20px 20px 12px 12px; }
.course-image { padding: 8px 8px 0; }
.course-image span { left: 20px; top: 20px; border-radius: 10px; backdrop-filter: blur(7px); }

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

.feature-card { grid-column: span 2; min-height: 230px; }
.feature-card:nth-child(1), .feature-card:nth-child(6) { background: linear-gradient(145deg, #f8fff7, var(--green-soft)); }
.feature-card:nth-child(2) { background: linear-gradient(145deg, #fff, var(--clay-blue)); }
.feature-card:nth-child(3) { background: linear-gradient(145deg, #fff, var(--clay-purple)); }
.feature-card:nth-child(4) { background: linear-gradient(145deg, #fff, var(--clay-yellow)); }
.feature-card:nth-child(5) { background: linear-gradient(145deg, #fff, var(--clay-peach)); }

.feature-card span,
.path-card span,
.hero-icon {
  border-radius: 20px;
  box-shadow: 7px 9px 18px rgba(50, 90, 62, 0.13), inset 0 2px 2px rgba(255, 255, 255, 0.84), inset 0 -2px 3px rgba(50, 90, 62, 0.09);
}

.steps-line::before { height: 4px; border-radius: 99px; background: #cae5c9; }
.step-card > span {
  border: 7px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(145deg, #72d574, #3bab4a);
  box-shadow: 8px 11px 23px rgba(41, 128, 56, 0.24), inset 0 3px 2px rgba(255, 255, 255, 0.38);
}

.course-discovery {
  border: 0;
  border-radius: 24px;
  background: linear-gradient(145deg, #fafffa, #e8f5e9);
  box-shadow: var(--clay-shadow);
}

.course-category-chip,
.pill-button,
.pill,
.status-badge {
  border-radius: 999px;
  box-shadow: 4px 5px 11px rgba(45, 91, 57, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.82);
}

.signup-section { position: relative; }
.signup-card { background: linear-gradient(145deg, #fff, #eff8f0); }

.auth-page { background: #f2f8f3; }
.auth-welcome {
  background:
    radial-gradient(circle at 22% 22%, rgba(255,255,255,.22), transparent 25%),
    radial-gradient(circle at 80% 75%, rgba(255,224,120,.18), transparent 28%),
    linear-gradient(145deg, #28783c, #55bd5a);
}
.auth-card { padding: 34px; background: rgba(255,255,255,.72); backdrop-filter: blur(16px); }
.auth-tabs { border-radius: 17px; background: #e3eee5; box-shadow: inset 3px 4px 8px rgba(53, 91, 63, 0.08); }
.auth-logo-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: var(--clay-yellow); box-shadow: var(--clay-shadow); }

.dashboard-head { margin-bottom: 28px; }
.dashboard-head h1 { font-size: clamp(2rem, 4vw, 3.15rem); letter-spacing: -0.045em; }
.study-hero { padding: 28px; background: linear-gradient(135deg, #fff, #e2f6e3); }
.study-hero > div { display: grid; gap: 13px; }
.study-hero > div > * { margin-top: 0; margin-bottom: 0; }
.study-hero > div > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.metrics-grid .metric:nth-child(4n + 1) { background: linear-gradient(145deg, #fff, var(--green-soft)); }
.metrics-grid .metric:nth-child(4n + 2) { background: linear-gradient(145deg, #fff, var(--clay-blue)); }
.metrics-grid .metric:nth-child(4n + 3) { background: linear-gradient(145deg, #fff, var(--clay-purple)); }
.metrics-grid .metric:nth-child(4n + 4) { background: linear-gradient(145deg, #fff, var(--clay-yellow)); }
.metric strong { font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -0.04em; }
.metric-action {
  position: relative;
  width: 100%;
  border: 1px solid rgba(63, 111, 77, .1);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.metric-action::after { content: "↘"; position: absolute; top: 14px; right: 16px; color: var(--green-dark); font-size: 1rem; font-weight: 900; }
.metric-action:focus-visible { outline: 3px solid rgba(67, 170, 80, .28); outline-offset: 3px; }
#completedLessonsDialog {
  width: min(860px, calc(100vw - 32px));
  max-width: none;
  box-sizing: border-box;
}
.completed-lessons-list { width: 100%; min-width: 0; max-height: 60vh; overflow-y: auto; overflow-x: hidden; }
.completed-lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.completed-lesson-row span { display: grid; min-width: 0; gap: 4px; }
.completed-lesson-row time { flex: 0 0 auto; white-space: nowrap; }
.completed-lesson-row small, .completed-lesson-row time { color: var(--muted); font-size: .82rem; }

.list-item,
.question,
.accordion details,
.profile-grid div {
  border-color: rgba(61, 107, 75, 0.1);
  border-radius: 16px;
  background: rgba(249, 252, 249, 0.9);
  box-shadow: inset 2px 2px 6px rgba(49, 87, 60, 0.04);
}

.progress { height: 12px; background: #dfe9e2; box-shadow: inset 2px 3px 5px rgba(39, 77, 50, 0.1); }
.progress span { background: linear-gradient(90deg, #43aa50, #74d979); box-shadow: inset 0 2px 2px rgba(255,255,255,.34); }

.page-title { padding-top: 54px; }
.detail-layout { gap: 28px; }
.accordion details { overflow: hidden; }
.accordion summary { padding: 18px 20px; }
.accordion a:hover { background: var(--green-soft); color: var(--green-dark); }
.video-frame { border-radius: 20px; box-shadow: 12px 16px 32px rgba(18, 35, 24, 0.19); }

.subpage-hero,
.manager-hero {
  background:
    radial-gradient(circle at 78% 32%, rgba(255, 226, 116, 0.25), transparent 24%),
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.2), transparent 27%),
    linear-gradient(145deg, #276f39, #54bd58 68%, #81d269);
}

.subpage-hero { min-height: clamp(250px, 36svh, 330px); }
.tips-page { background: transparent; }
.tips-toolbar { padding: 16px; border-radius: 22px; background: rgba(232, 245, 233, 0.74); box-shadow: var(--clay-shadow); }
.tip-card:nth-child(3n + 1) { background: linear-gradient(145deg, #fff, #edf8ed); }
.tip-card:nth-child(3n + 2) { background: linear-gradient(145deg, #fff, #edf4ff); }
.tip-card:nth-child(3n + 3) { background: linear-gradient(145deg, #fff, #fff4d7); }
.tip-thumb { margin: 8px; width: calc(100% - 16px); border-radius: 18px; overflow: hidden; }
.video-modal { border: 0; border-radius: 24px; padding: 12px; }

.manager-hero { border-radius: 0 0 34px 34px; }
.manager-shell { gap: 24px; }
.manager-sidebar {
  padding: 12px;
  border-radius: 22px;
  background: rgba(230, 243, 232, 0.86);
  box-shadow: var(--clay-shadow);
}
.manager-side-button { border-radius: 14px; }
.manager-side-button.active { box-shadow: 6px 8px 16px rgba(42, 134, 59, 0.2), inset 0 2px 1px rgba(255,255,255,.25); }
.manager-table-card { overflow: hidden; }
th { color: #557063; background: rgba(226, 241, 229, 0.58); }
tbody tr:hover { background: rgba(229, 244, 231, 0.55); }

.report-card:nth-child(4n + 1) { background: linear-gradient(145deg, #fff, var(--green-soft)); }
.report-card:nth-child(4n + 2) { background: linear-gradient(145deg, #fff, var(--clay-blue)); }
.report-card:nth-child(4n + 3) { background: linear-gradient(145deg, #fff, var(--clay-purple)); }
.report-card:nth-child(4n + 4) { background: linear-gradient(145deg, #fff, var(--clay-yellow)); }

.site-footer {
  border-radius: 36px 36px 0 0;
  background: linear-gradient(145deg, #173d29, #245e37);
}

dialog { border: 0; border-radius: 24px; box-shadow: 18px 24px 60px rgba(20, 45, 28, 0.25); }
.toast { border-radius: 16px; box-shadow: var(--clay-shadow-hover); }
.empty-state { border-radius: 16px; background: rgba(243, 249, 244, 0.78); }

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 16px;
    padding: 12px clamp(14px, 3vw, 26px);
  }

  .site-header > .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    min-width: 0;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 920px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card { grid-column: span 1; }
  .auth-card { padding: 28px; }
}

@media (max-width: 620px) {
  .site-header {
    gap: 8px 10px;
    min-height: 0;
    border-radius: 0 0 20px 20px;
  }
  .brand { font-size: 1rem; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .header-actions { gap: 6px; }
  .header-actions .user-chip { display: none; }
  .header-actions .btn { padding: 8px 10px; }
  .icon-btn { width: 38px; height: 38px; }
  .main-nav { gap: 3px; padding: 4px; }
  .main-nav a { padding: 8px 11px; }
  .feature-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 22px 18px; }
  .stat, .panel, .course-card, .metric, .report-card, .lesson-shell, .table-wrap, .manager-card, .manager-table-card, .tip-card, .feature-card, .signup-card { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Teacher overview and course management */
.teacher-role-badge {
  color: #245f34 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 8px 20px rgba(20, 70, 36, 0.18);
}

#teacherMetrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.teacher-metric { min-height: 142px; }
.teacher-metric > div { display: grid; gap: 3px; min-width: 0; }
.teacher-metric small { margin-top: 5px; color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.4; }
.panel-note { margin: -6px 0 18px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.list-item-button { width: 100%; color: inherit; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.list-item-button:hover { border-color: rgba(67, 170, 80, .45); background: var(--green-soft); }

.course-status-help { display: flex; flex-wrap: wrap; gap: 9px; }
.course-status-help span { padding: 8px 11px; border-radius: 999px; color: #4f6757; background: #eef6ef; font-size: .78rem; line-height: 1.4; }
.access-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: #315d3b; background: #eaf5eb; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.access-badge.edit { color: #2d5786; background: #eaf2fc; }
.access-badge.view { color: #735d21; background: #fff4d6; }
.action-cell { position: relative; overflow: visible; }
.action-menu { position: relative; min-width: 112px; }
.action-menu summary { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #dbe7dc; border-radius: 11px; color: #31513a; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 800; list-style: none; white-space: nowrap; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu summary::after { content: "▾"; font-size: .72rem; }
.action-menu[open] summary::after { transform: rotate(180deg); }
.action-menu > div { position: fixed; z-index: 10000; display: grid; gap: 4px; width: 220px; padding: 8px; border: 1px solid #dfe9df; border-radius: 13px; background: #fff; box-shadow: 8px 12px 24px rgba(35, 72, 45, .18); }
.action-menu a, .action-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; color: #31513a; background: transparent; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 750; text-align: left; text-decoration: none; }
.action-menu a:hover, .action-menu button:hover { background: var(--green-soft); }
.confirm-dialog { width: min(470px, calc(100vw - 32px)); padding: 28px; text-align: center; }
.confirm-dialog-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 18px; color: #9c2c2c; background: #fde9e6; font-size: 1.5rem; font-weight: 900; }
.confirm-dialog h2 { margin: 5px 0 10px; }
.confirm-dialog p { color: var(--muted); line-height: 1.6; }
.confirm-dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.btn-danger { color: #fff; background: #b63a32; box-shadow: 0 8px 18px rgba(182,58,50,.2); }
.admin-delete-confirm-field { margin-top: 18px; text-align: left; }
.admin-delete-confirm-field label { display: block; margin-bottom: 8px; color: var(--text); }
.admin-status-control { position: relative; display: inline-grid; grid-template-columns: 9px minmax(70px, 1fr); align-items: center; gap: 7px; width: 100%; min-width: 0; padding-left: 10px; border: 1px solid #d8e5da; border-radius: 12px; background: #f5faf6; box-shadow: 0 5px 13px rgba(42,78,50,.08); overflow: hidden; }
.admin-status-control::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: currentColor; font-size: .72rem; pointer-events: none; }
.admin-status-control > span { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.admin-status-control.status-published { color: #226b38; border-color: #bee0c7; background: #eaf7ed; }
.admin-status-control.status-draft { color: #8a5a0a; border-color: #eed79f; background: #fff5d8; }
.admin-status-control.status-archived { color: #a43b35; border-color: #efc4bf; background: #feeae7; }
.admin-course-status-select { width: 100%; min-width: 0; min-height: 44px; padding: 0 32px 0 0; border: 0; outline: 0; color: inherit; background: transparent; appearance: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 800; }
.admin-course-actions { display: grid; grid-template-columns: 58px 82px minmax(82px, 1fr); gap: 7px; align-items: center; width: 100%; min-width: 0; }
.admin-course-actions.is-trash { grid-template-columns: minmax(88px, .9fr) minmax(112px, 1.15fr); }
.admin-course-actions .btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 7px 6px; line-height: 1.2; white-space: nowrap; }
.manager-hero .admin-role-badge { color: #164f28 !important; background: #fff !important; border: 2px solid rgba(255,255,255,.92) !important; box-shadow: 0 10px 28px rgba(18,69,32,.2); }
.admin-role-control { position: relative; display: inline-grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 8px; min-width: 154px; padding-left: 11px; border: 1px solid #cfe0d1; border-radius: 12px; color: #193b24; background: #f6fbf7; box-shadow: 0 5px 13px rgba(42,78,50,.08); overflow: hidden; }
.admin-role-control::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .72rem; pointer-events: none; }
.admin-role-control.role-viewer { color: #7d4d06; border-color: #efd89f; background: #fff4d2; }
.admin-role-control.role-student { color: #225d35; border-color: #bfe0c7; background: #eaf7ed; }
.admin-role-control.role-teacher { color: #245487; border-color: #bed6ee; background: #eaf3fc; }
.admin-role-control.role-admin { color: #74306d; border-color: #ddc2e0; background: #f8ebf7; }
.admin-role-select { width: 100%; min-height: 44px; padding: 0 34px 0 0; border: 0; outline: 0; color: inherit; background: transparent; appearance: none; cursor: pointer; font: inherit; font-weight: 800; }
.admin-role-select:focus-visible { box-shadow: inset 0 0 0 3px rgba(76,175,80,.22); }
.admin-user-actions { flex-wrap: nowrap; min-width: 178px; }
.admin-user-actions .btn { min-height: 40px; padding: 8px 13px; }
.admin-user-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.tip-current-video { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; color: #31563a; background: #edf7ee; }
.tip-current-video a { color: #1f6d35; font-weight: 800; }
.tip-resource-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; border: 1px solid #dce9de; border-radius: 18px; background: #f7fbf8; }
.tip-resource-editor > div:first-child { grid-column: 1 / -1; display: grid; gap: 4px; }
.tip-resource-editor > div:first-child strong { color: #214c2d; font-size: 1rem; }
.tip-resource-editor > div:first-child small { color: var(--muted); }
.tip-resource-editor > label { display: grid; align-content: start; gap: 8px; font-weight: 750; }
.tip-resource-editor .tip-current-video,
.tip-resource-editor .checkbox-row { grid-column: 1 / -1; }
.tip-resource-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tip-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.tip-card-heading > div { min-width: 0; }
.tip-resource-links a,
.tip-exercise-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 8px 11px; border-radius: 11px; color: #245d34; background: #eaf6ec; font-size: .82rem; font-weight: 800; text-decoration: none; }
.tip-exercise-link { margin-top: 8px; }
.admin-bulk-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid #cce2d0; border-radius: 16px; color: #245631; background: #edf8ef; box-shadow: 0 8px 22px rgba(44,91,55,.08); }
.admin-bulk-toolbar strong { white-space: nowrap; }
.admin-bulk-toolbar select { min-height: 40px !important; }
.admin-bulk-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 8px; width: auto; }
.admin-bulk-actions .btn { min-height: 40px; padding: 8px 14px; white-space: nowrap; }
.admin-course-bulk-actions select { width: 190px; }
.selection-column { width: 52px; padding-right: 4px !important; padding-left: 4px !important; text-align: center !important; }
.selection-column input {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 21px;
  height: 21px;
  margin: 0;
  border: 2px solid #9ab09f;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.selection-column input:hover { border-color: var(--green); box-shadow: 0 0 0 4px rgba(82,185,87,.12); }
.selection-column input:checked { border-color: var(--green-dark); background-color: var(--green-dark); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m3.2 8.2 3 3 6.6-7'/%3E%3C/svg%3E"); }
.selection-column input:indeterminate { border-color: var(--green-dark); background: linear-gradient(#fff,#fff) center / 10px 2px no-repeat var(--green-dark); }
.selection-column input:focus-visible { outline: 3px solid rgba(82,185,87,.25); outline-offset: 2px; }
.selection-column input:disabled { opacity: .45; cursor: not-allowed; }

.admin-manager-shell #panel-courses .manager-table { width: 100%; min-width: 0; table-layout: fixed; }
.admin-manager-shell #panel-courses .manager-table th,
.admin-manager-shell #panel-courses .manager-table td { padding: 12px 9px; vertical-align: middle; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(1) { width: 4%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(2) { width: 27%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(3) { width: 11%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(4) { width: 10%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(5) { width: 6%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(6) { width: 6%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(7) { width: 13%; }
.admin-manager-shell #panel-courses .manager-table th:nth-child(8) { width: 23%; }
.admin-manager-shell #panel-courses .manager-table td:nth-child(2),
.admin-manager-shell #panel-courses .manager-table td:nth-child(3),
.admin-manager-shell #panel-courses .manager-table td:nth-child(4) { overflow-wrap: anywhere; }
.admin-course-copy { display: grid; gap: 4px; }
.admin-course-copy .muted-text { line-height: 1.45; }
.admin-course-owner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-course-owner > span { min-width: 0; overflow-wrap: anywhere; }
.admin-course-owner .mini-action { flex: 0 0 auto; padding: 5px 8px; }
.admin-owner-dialog { text-align: left; }
.admin-owner-dialog .field { margin-top: 18px; }

.admin-manager-shell { width: min(1600px, calc(100% - 36px)); grid-template-columns: 220px minmax(0, 1fr); }
.admin-manager-shell > div { min-width: 0; }
.admin-manager-shell .manager-table-card { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
#panel-users .manager-table { min-width: 0; table-layout: fixed; }
#panel-users .manager-table th,
#panel-users .manager-table td { padding: 11px 9px; }
#panel-users .manager-table th:nth-child(1) { width: 4%; }
#panel-users .manager-table th:nth-child(2) { width: 11%; }
#panel-users .manager-table th:nth-child(3) { width: 24%; }
#panel-users .manager-table th:nth-child(4) { width: 10%; }
#panel-users .manager-table th:nth-child(5) { width: 16%; }
#panel-users .manager-table th:nth-child(6) { width: 9%; }
#panel-users .manager-table th:nth-child(7) { width: 9%; }
#panel-users .manager-table th:nth-child(8) { width: 17%; }
#panel-users .manager-table td:nth-child(2),
#panel-users .manager-table td:nth-child(3) { overflow-wrap: anywhere; }
#panel-users .admin-role-control { width: 100%; min-width: 0; grid-template-columns: auto minmax(0, 1fr); }
#panel-users .admin-role-select { min-width: 0; font-size: .82rem; }
#panel-users .status-badge { max-width: 100%; padding: 5px 8px; font-size: .76rem; line-height: 1.25; text-align: center; }
#panel-users .admin-user-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-width: 0; }
#panel-users .admin-user-actions .btn { width: 100%; min-height: 36px; padding: 7px 8px; font-size: .76rem; white-space: nowrap; }

@media (max-width: 1240px) {
  .admin-bulk-toolbar { grid-template-columns: 1fr; }
  .admin-bulk-actions { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .admin-course-bulk-actions { display: grid; grid-template-columns: minmax(160px, 1fr) auto auto; overflow: visible; }
  .admin-course-bulk-actions select { width: 100%; }
  .admin-manager-shell #panel-courses .manager-table-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .admin-manager-shell #panel-courses .manager-table { display: block; min-width: 0; }
  .admin-manager-shell #panel-courses .manager-table thead { display: none; }
  .admin-manager-shell #panel-courses .manager-table tbody { display: grid; gap: 14px; }
  .admin-manager-shell #panel-courses .manager-table tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 18px; border: 1px solid #dce9de; border-radius: 18px; background: #fff; box-shadow: 7px 10px 24px rgba(42,78,50,.09); }
  .admin-manager-shell #panel-courses .manager-table td { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .admin-manager-shell #panel-courses .manager-table td::before { content: attr(data-label); color: #698071; font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .admin-manager-shell #panel-courses .manager-table td.selection-column { position: absolute; top: 16px; right: 16px; display: block; width: auto; }
  .admin-manager-shell #panel-courses .manager-table td.selection-column::before { display: none; }
  .admin-manager-shell #panel-courses .manager-table td:nth-child(2),
  .admin-manager-shell #panel-courses .manager-table td:last-child { grid-column: 1 / -1; }
  .admin-manager-shell #panel-courses .admin-status-control { width: 100%; }
  .admin-manager-shell #panel-courses .admin-course-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; }
  .admin-manager-shell #panel-courses .admin-course-actions.is-trash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-users .manager-table-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  #panel-users .manager-table { display: block; min-width: 0; }
  #panel-users .manager-table thead { display: none; }
  #panel-users .manager-table tbody { display: grid; gap: 14px; }
  #panel-users .manager-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .8fr); gap: 12px 18px; padding: 18px; border: 1px solid #dce9de; border-radius: 18px; background: #fff; box-shadow: 7px 10px 24px rgba(42,78,50,.09); }
  #panel-users .manager-table td { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  #panel-users .manager-table td::before { content: attr(data-label); color: #698071; font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  #panel-users .manager-table tr { position: relative; }
  #panel-users .manager-table td.selection-column { position: absolute; top: 16px; right: 16px; display: block; width: auto; }
  #panel-users .manager-table td.selection-column::before { display: none; }
  #panel-users .manager-table td:nth-child(2),
  #panel-users .manager-table td:nth-child(3),
  #panel-users .manager-table td:last-child { grid-column: 1 / -1; }
  #panel-users .admin-role-control { width: 100%; min-width: 0; }
  #panel-users .admin-user-actions { width: 100%; min-width: 0; }
  #panel-users .admin-user-actions .btn { flex: 1; }
}

@media (max-width: 860px) {
  .admin-manager-shell { width: min(100% - 24px, 720px); grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .tip-resource-editor { grid-template-columns: 1fr; padding: 14px; }
  .admin-bulk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-bulk-actions .btn { width: 100%; }
  .admin-bulk-actions .btn-danger { grid-column: 1 / -1; }
  .admin-course-bulk-actions { grid-template-columns: 1fr 1fr; }
  .admin-course-bulk-actions select { grid-column: 1 / -1; }
  .admin-manager-shell #panel-courses .manager-table tr { grid-template-columns: 1fr; }
  .admin-manager-shell #panel-courses .manager-table td:not(.selection-column),
  .admin-manager-shell #panel-courses .manager-table td:nth-child(2),
  .admin-manager-shell #panel-courses .manager-table td:last-child { grid-column: 1; }
  #panel-users .manager-table tr { grid-template-columns: 1fr; }
  #panel-users .manager-table td:not(.selection-column),
  #panel-users .manager-table td:nth-child(2),
  #panel-users .manager-table td:nth-child(3),
  #panel-users .manager-table td:last-child { grid-column: 1; }
}
.manager-table tr.is-highlighted { animation: teacherRowHighlight 2.4s ease; }
@keyframes teacherRowHighlight { 0%, 45% { background: #fff2c8; } 100% { background: transparent; } }

.access-list { display: grid; gap: 9px; padding-top: 18px; border-top: 1px solid #e1ebe2; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 14px; background: #f3f8f3; }
.access-row span { display: grid; gap: 4px; }
.access-row small, .form-hint { color: var(--muted); font-size: .82rem; line-height: 1.5; }

.resource-label-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; border-radius: 10px; background: #e7f4e9; }
.resource-label-icon.homework { background: #fff1ce; }
.lesson-resource-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.lesson-resource-links a { padding: 5px 8px; border-radius: 9px; color: #315c3a; background: #edf6ee; font-size: .76rem; font-weight: 800; text-decoration: none; }
.lesson-resource-links a:nth-child(2) { color: #725d22; background: #fff3d2; }
.lesson-download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lesson-download-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; align-items: center; padding: 16px; border: 1px solid #dce9de; border-radius: 16px; color: #294e32; background: #f4faf5; text-decoration: none; }
.lesson-download-card > span { grid-row: 1 / 3; font-size: 1.6rem; }
.lesson-download-card small { color: var(--muted); }
.lesson-download-card.homework { color: #69551c; background: #fff8e5; }

@media (max-width: 1180px) { #teacherMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  #teacherMetrics, .lesson-download-grid { grid-template-columns: 1fr; }
  .teacher-metric { min-height: 118px; }
}

/* Student learning experience */
.panel-heading,
.lesson-navigation,
.diagnostic-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading { margin-bottom: 18px; }
.panel-heading h2, .panel-heading p { margin: 0; }
.panel-heading > div,
.dashboard-head > div,
.manager-panel-head > div { display: grid; gap: 9px; }
.dashboard-head > div > *,
.manager-panel-head > div > * { margin-top: 0; margin-bottom: 0; }
.dashboard-head > div > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.eyebrow { line-height: 1.4; }
.panel > h2:not(:last-child) { margin-bottom: 18px; line-height: 1.18; }
.student-tabs { width: fit-content; padding: 5px; margin-bottom: 26px; background: #e6f1e8; border-radius: 16px; }
.student-tabs button { padding: 10px 16px; }
.my-course-card .course-body { display: grid; gap: 14px; }
.my-course-card .course-body h2 { font-size: 1.25rem; margin: 0; }
.course-enrollment { margin-top: 18px; }

.learning-list { display: grid; gap: 14px; padding-left: 22px; color: var(--muted); }
.review-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, var(--clay-yellow));
  box-shadow: var(--clay-shadow);
}
.review-card h3 { margin-top: 6px; }
.review-card details { margin: 10px 0; padding: 12px 14px; border-radius: 13px; background: rgba(255,255,255,.7); }
.review-card summary { cursor: pointer; font-weight: 700; }

.skill-map { display: grid; gap: 12px; }
.skill-item { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, .8fr) auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: #f6faf7; }
.skill-item > div:first-child { display: grid; gap: 4px; }
.skill-item > div:first-child span { color: var(--muted); font-size: .88rem; }
.skill-item.mastered { background: var(--green-soft); }
.skill-item.review { background: var(--clay-yellow); }
.skill-item.learning { background: var(--clay-blue); }

.lesson-page { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 40px; padding-bottom: 70px; }
.lesson-sidebar { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; padding: 18px; border-radius: 22px; background: rgba(233,245,235,.94); box-shadow: var(--clay-shadow); }
.lesson-sidebar h2 { font-size: 1.05rem; margin: 20px 0 14px; }
.lesson-sidebar nav, .lesson-sidebar section { display: grid; gap: 6px; }
.lesson-sidebar section { margin-bottom: 14px; }
.lesson-sidebar section > strong { padding: 8px; font-size: .9rem; }
.lesson-sidebar a { padding: 10px; border-radius: 12px; color: var(--muted); font-size: .9rem; }
.lesson-sidebar a.active, .lesson-sidebar a:hover { color: var(--green-dark); background: #fff; box-shadow: 4px 6px 12px rgba(44,92,57,.09); }
.lesson-sidebar .back-link {
  display: block;
  width: 100%;
  line-height: 1.4;
  overflow-wrap: anywhere;
  color: var(--green-dark) !important;
  font-weight: 750;
}
.lesson-sidebar .back-link:hover { transform: none; }
.lesson-main { min-width: 0; }
.lesson-main > h1 { margin: 10px 0 26px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.08; }
.watch-progress { margin: 18px 0 12px; }
.inline-notice { margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; background: var(--clay-yellow); }

/* Account, course reviews and notification behavior */
.notification-panel {
  max-height: calc(100dvh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 10px;
  padding: 16px 18px 12px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}
.notification-panel-head span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  margin-top: 9px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.notification-item:hover { transform: translateY(-1px); border-color: rgba(82,185,87,.28); background: #f8fcf8; }
.notification-item.is-unread { border-color: rgba(82,185,87,.2); background: #e4f5e7; }
.notification-item.is-read { border-color: #e3e9e4; background: #fff; opacity: 1; }
.notification-state { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.notification-item.is-unread .notification-state { background: var(--green); box-shadow: 0 0 0 4px rgba(82,185,87,.13); }
.notification-item strong,
.notification-body,
.notification-action { display: block; }
.notification-item strong { line-height: 1.35; }
.notification-body { margin-top: 5px; color: var(--muted); font-size: .88rem; line-height: 1.48; }
.notification-action { margin-top: 8px; color: var(--green-dark); font-size: .82rem; font-weight: 850; }
.notification-empty { padding: 18px 8px; text-align: center; }

.account-settings { align-self: start; }
.account-setting-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-top: 12px; padding: 16px; border: 1px solid #dce8dd; border-radius: 16px; color: var(--ink); background: #f8fbf8; cursor: pointer; font: inherit; text-align: left; }
.account-setting-link:hover { border-color: rgba(82,185,87,.34); background: #f3faf4; }
.account-setting-link > span:first-child { display: grid; gap: 4px; }
.account-setting-link small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.account-setting-info { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 16px; border: 1px solid #dce8dd; border-radius: 16px; background: #fff; }
.account-setting-info > span:first-child { display: grid; gap: 5px; min-width: 0; }
.account-setting-info small { overflow-wrap: anywhere; color: var(--muted); font-size: .78rem; font-weight: 600; }
.security-settings { margin-top: 20px; border: 1px solid #dce8dd; border-radius: 16px; background: #f8fbf8; overflow: hidden; }
.security-settings summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; cursor: pointer; list-style: none; }
.security-settings summary::-webkit-details-marker { display: none; }
.security-settings summary span:first-child { display: grid; gap: 4px; }
.security-settings summary small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.security-settings[open] summary { border-bottom: 1px solid #dce8dd; }
.security-settings[open] summary > span:last-child { transform: rotate(180deg); }
.security-settings form { padding: 18px; }

.rating-note { margin: -7px 0 8px; color: var(--muted); font-size: .78rem; text-align: right; }
.course-review-form { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.course-review-form > div:first-child { display: grid; gap: 4px; }
.course-review-form > div:first-child span { color: var(--muted); font-size: .8rem; }
.course-review-stars { display: flex; gap: 4px; }
.course-review-stars button { padding: 0; border: 0; color: #cbd5cc; background: transparent; cursor: pointer; font-size: 1.8rem; line-height: 1; transition: color 140ms ease, transform 140ms ease; }
.course-review-stars button:hover { transform: translateY(-2px); }
.course-review-stars button.active { color: #f5b51b; text-shadow: 0 3px 8px rgba(193,130,0,.18); }
.course-review-form textarea { resize: vertical; }
#assignments { scroll-margin-top: 96px; }

.course-detail-title {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(300px, 360px);
  justify-content: space-between;
  gap: 42px;
  align-items: center;
}
.course-detail-title .course-title-copy h1 { max-width: 780px; font-size: clamp(2.45rem, 3.7vw, 3.7rem); line-height: 1.06; }
.course-detail-title .course-title-copy > p:last-child { max-width: 760px; }
.course-title-meta { display: grid; gap: 14px; padding: 22px; border: 1px solid rgba(63,111,77,.1); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: var(--clay-shadow); }
.course-title-meta > p { margin: 0; }
.course-title-meta > div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid #e3ece4; }
.course-title-meta > div > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); font-size: 1.1rem; }
.course-title-meta > div > span:last-child { display: grid; gap: 3px; }
.course-title-meta small { color: var(--muted); font-size: .78rem; }
.course-title-meta strong { color: var(--ink); font-size: 1rem; line-height: 1.35; }
.course-review-submit:hover:not(:disabled), .course-review-submit:focus-visible { color: #fff; border-color: #3cac4b; background: linear-gradient(145deg, #63ca67, #3cac4b); box-shadow: 7px 9px 18px rgba(44,142,62,.24); }

.teacher-course-row { cursor: pointer; transition: background 160ms ease, box-shadow 160ms ease; }
.teacher-course-row:hover { background: rgba(232,247,234,.72); box-shadow: inset 4px 0 0 var(--green); }
.teacher-course-row:focus-visible { outline: 3px solid rgba(82,185,87,.3); outline-offset: -3px; }

.notification-detail-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; padding: 26px; border: 0; border-radius: 22px; box-shadow: 0 28px 80px rgba(20,49,29,.25); }
.notification-detail-dialog::backdrop { background: rgba(14,27,17,.48); backdrop-filter: blur(4px); }
.notification-detail-dialog > p { margin: 18px 0 22px; color: var(--muted); font-size: 1rem; line-height: 1.65; }

@media (max-width: 920px) {
  .course-detail-title { grid-template-columns: 1fr; gap: 18px; }
  .course-detail-title .course-title-copy h1 { font-size: 2.35rem; }
  .course-title-meta { grid-template-columns: 1fr; }
}
.lesson-quiz { margin-top: 34px; }
.lesson-navigation { margin-top: 28px; }
.lesson-navigation .btn { max-width: 48%; }
.quiz-feedback { margin-bottom: 18px; padding: 18px; border-radius: 16px; }
.quiz-feedback.passed { background: var(--green-soft); }
.quiz-feedback.retry { background: var(--clay-yellow); }
.answer-feedback { margin: 10px 0; padding: 13px 15px; border-radius: 14px; }
.answer-feedback.correct { background: #e4f6e5; }
.answer-feedback.wrong { background: #fff0d2; }
.answer-feedback details { margin-top: 8px; }
.quiz-submit-rule { margin: 4px 0 16px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.quiz-attempt-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.quiz-attempt-summary span { display: grid; gap: 5px; padding: 12px 14px; border-radius: 14px; background: #f2f7f3; }
.quiz-attempt-summary small { color: var(--muted); font-size: .76rem; }
.quiz-attempt-summary strong { color: var(--green-dark); font-size: 1.05rem; }

.narrow-page { max-width: 900px; }
.goal-rule,
.progress-rule {
  margin: 12px 0 0;
  font-size: .86rem;
  line-height: 1.55;
}

.diagnostic-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 22px;
  background: linear-gradient(145deg, #fff, var(--clay-blue));
}
.diagnostic-picker h2 { margin: 5px 0 8px; }
.diagnostic-picker p { margin-bottom: 0; }
.diagnostic-picker .field { margin: 0; }
.question-context {
  display: block;
  width: fit-content;
  margin-bottom: 9px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: .78rem;
  font-weight: 800;
}
.question small { display: block; margin-top: 10px; color: var(--muted); }
.diagnostic-result { justify-content: flex-start; padding: 20px; }
.score-ring { flex: 0 0 auto; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; color: var(--green-dark); font-size: 2rem; font-weight: 900; background: var(--green-soft); box-shadow: var(--clay-shadow), inset 0 0 0 10px rgba(255,255,255,.7); }
.diagnostic-section { margin-top: 30px; }
.diagnostic-section > h2 { margin-bottom: 14px; }
.path-list,
.answer-review { display: grid; gap: 11px; }
.path-list .list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.path-list .list-item > span:first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 850;
}
.answer-review details { margin: 0; }
.answer-review summary { cursor: pointer; }
.reading-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
}
.reading-checks span {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2ee;
  font-size: .82rem;
  font-weight: 750;
}
.reading-checks span.done { color: var(--green-dark); background: var(--green-soft); }
#completeLesson:disabled:not(.is-loading) { cursor: not-allowed; opacity: .58; }
.lesson-complete-btn:disabled:not(.is-loading) {
  border-color: #cbd3ce;
  color: #7e8983;
  background: #e3e7e4;
  box-shadow: inset 2px 3px 6px rgba(52, 67, 58, .08);
}
.completion-control { position: relative; display: inline-flex; margin: 2px 0 24px; outline: none; }
.completion-help {
  position: absolute;
  z-index: 8;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(310px, 78vw);
  padding: 9px 11px;
  border-radius: 10px;
  color: #fff;
  background: #26362e;
  box-shadow: 5px 8px 18px rgba(23, 42, 31, .2);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}
.completion-help::after { content: ""; position: absolute; left: 22px; top: 100%; border: 6px solid transparent; border-top-color: #26362e; }
.completion-control.is-locked:hover .completion-help,
.completion-control.is-locked:focus .completion-help,
.completion-control.is-locked:focus-within .completion-help { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 920px) {
  .lesson-page { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; max-height: 330px; }
  .lesson-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .panel-heading, .diagnostic-result { align-items: flex-start; flex-direction: column; }
  .diagnostic-picker { grid-template-columns: 1fr; gap: 18px; }
  .path-list .list-item { grid-template-columns: 32px minmax(0, 1fr); }
  .path-list .list-item > span:last-child { grid-column: 2; }
  .student-tabs { width: 100%; overflow-x: auto; }
  .student-tabs button { flex: 0 0 auto; }
  .skill-item { grid-template-columns: 1fr; }
  .lesson-sidebar nav { grid-template-columns: 1fr; }
  .lesson-sidebar { max-height: 250px; }
  .lesson-navigation .btn { max-width: 52%; padding: 10px; font-size: .82rem; }
  .score-ring { width: 108px; height: 108px; }
  .completed-lesson-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .quiz-attempt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Teacher quiz workflow */
.locked-course { min-height: 48px; display: flex; align-items: center; padding: 0 15px; border: 1px solid #dce7dd; border-radius: 13px; color: #2f5839; background: #f1f7f2; font-weight: 800; }
.document-import { display: grid; gap: 15px; margin: 8px 0 12px; padding: 20px; border: 1px solid #dbe8dc; border-radius: 20px; background: linear-gradient(145deg, #f6fbf6, #eef8ef); }
.document-import-copy { display: flex; align-items: flex-start; gap: 13px; }
.document-import-copy .document-icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; background: #fff; box-shadow: 0 7px 18px rgba(42,93,54,.09); font-size: 1.25rem; }
.document-import h2 { margin: 0 0 6px; font-size: 1.1rem; }
.document-import p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.document-drop { display: grid; place-items: center; gap: 6px; min-height: 126px; padding: 20px; border: 2px dashed #9ccca2; border-radius: 17px; color: #315c3c; background: rgba(255,255,255,.76); cursor: pointer; text-align: center; transition: .2s ease; }
.document-drop:hover, .document-drop.is-dragging { border-color: #43a950; background: #fff; transform: translateY(-1px); }
.document-drop span { color: var(--muted); font-size: .78rem; font-weight: 600; }
.document-files { display: grid; gap: 8px; }
.document-file { display: grid; grid-template-columns: auto minmax(0,1fr) repeat(3, 34px); align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #dce8dd; border-radius: 13px; background: #fff; }
.document-file > span { font-size: 1.1rem; }
.document-file strong, .document-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-file small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.document-file button { width: 32px; height: 32px; border: 1px solid #dce8dd; border-radius: 9px; color: #31513a; background: #fff; cursor: pointer; }
.import-progress { position: relative; overflow: hidden; padding: 12px 14px; border-radius: 12px; color: #285333; background: #dff1e1; font-size: .8rem; }
.import-progress > span { position: absolute; inset: 0; width: 35%; background: rgba(72,176,84,.2); animation: importProgress 1.3s ease-in-out infinite alternate; }
.import-progress strong { position: relative; }
.import-progress.is-complete > span { display: none; }
@keyframes importProgress { to { transform: translateX(190%); } }
.question-editor-head > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.question-source { padding: 4px 7px; border-radius: 999px; color: #58705e; background: #edf4ee; font-size: .68rem; font-weight: 750; }
.math-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 8px; }
.math-toolbar button { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid #dce7dd; border-radius: 9px; color: #284d31; background: #fff; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; }
.math-toolbar button:hover { border-color: #61b96b; background: var(--green-soft); }
.quiz-option-grid { display: grid; gap: 8px; }
.quiz-option-row { display: grid; grid-template-columns: auto 24px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #dfe9df; border-radius: 12px; background: #fff; }
.quiz-option-row:has(input[type="radio"]:checked) { border-color: #5cb867; background: #f0f9f1; }
.quiz-option-row input[type="radio"] { width: 18px; height: 18px; accent-color: #3fa34a; }
.quiz-option-row input:last-child { min-height: 38px; border: 0; padding: 0 8px; background: transparent; box-shadow: none; }
.field-help { display: block; margin-top: 7px; color: var(--muted); font-size: .75rem; }
.quiz-save-bar { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; padding: 14px 16px; border: 1px solid #d8e6da; border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(34,76,43,.14); backdrop-filter: blur(12px); }
.quiz-save-bar > div:first-child { display: grid; gap: 4px; }
.quiz-save-bar span { color: var(--muted); font-size: .75rem; }
@media (max-width: 720px) { .quiz-save-bar { position: static; align-items: stretch; flex-direction: column; } .quiz-save-bar .row-actions .btn { flex: 1; } .document-file { grid-template-columns: auto minmax(0,1fr) repeat(3, 30px); } }

/* Quiz authoring refinements */
.question-editor [data-question-prompt] { min-height: 112px; overflow-y: hidden; resize: vertical; line-height: 1.65; }
.question-live-preview { min-height: 52px; margin-top: 9px; padding: 12px 14px; border-radius: 12px; color: #294b32; background: #edf7ee; font-size: .9rem; line-height: 1.65; overflow-wrap: anywhere; }
.question-live-preview::before { content: "Học sinh sẽ thấy: "; color: #64806b; font-size: .72rem; font-weight: 800; }
.quiz-preview-dialog { width: min(850px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 36px); overflow-y: auto; }
.quiz-preview-questions { display: grid; gap: 14px; margin: 20px 0; }
.preview-question { padding: 18px; border: 1px solid #dce8dd; border-radius: 17px; background: #fbfdfb; }
.preview-question > strong { display: block; margin-bottom: 13px; font-size: 1rem; line-height: 1.65; }
.preview-options { display: grid; gap: 8px; }
.preview-options label { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid #e0e9e1; border-radius: 11px; background: #fff; cursor: pointer; line-height: 1.45; }
.preview-question textarea { width: 100%; min-height: 92px; padding: 12px; border: 1px solid #dce7dd; border-radius: 12px; font: inherit; line-height: 1.55; }
.preview-score { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 12px; padding: 15px 17px; border-radius: 14px; color: #285333; background: #e5f5e7; }
.preview-score span { color: var(--muted); font-size: .8rem; }

.teacher-quiz-page .field select,
.teacher-quiz-page .question-bank-head select { min-height: 48px; padding: 0 42px 0 14px; border: 1px solid #d9e7db; border-radius: 13px; color: #203b28; background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, #41654a 50%), linear-gradient(135deg, #41654a 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; box-shadow: 0 5px 14px rgba(45,85,54,.06); appearance: none; cursor: pointer; font: inherit; font-weight: 700; }
.teacher-quiz-page .field select:focus,
.teacher-quiz-page .question-bank-head select:focus { border-color: #55ad61; outline: 3px solid rgba(78,174,90,.14); }
.quiz-save-bar { display: grid; grid-template-columns: minmax(210px, 1fr) auto; }
.quiz-save-bar .row-actions { flex-wrap: nowrap; }
.quiz-save-bar .btn { white-space: nowrap; }
@media (max-width: 1180px) {
  .quiz-save-bar { grid-template-columns: 1fr; }
  .quiz-save-bar .row-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
}
@media (max-width: 680px) {
  .quiz-save-bar .row-actions { grid-template-columns: 1fr; }
}

/* Keep question actions stable and make long quizzes quick to extend. */
.question-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.question-editor-head .row-actions { display: grid; grid-template-columns: repeat(3, max-content); align-items: center; gap: 7px; flex-wrap: nowrap; }
.question-editor-head .mini-action { min-width: 40px; white-space: nowrap; }
.question-insert-row { display: flex; justify-content: center; padding-top: 14px; border-top: 1px dashed #d7e5d9; }
.question-insert-row .btn { min-height: 38px; padding: 8px 13px; font-size: .78rem; }
.question-editor.is-new { border-color: #56b662; box-shadow: 0 0 0 4px rgba(76, 175, 80, .12); }
@media (max-width: 520px) {
  .question-editor-head { grid-template-columns: 1fr; }
  .question-editor-head .row-actions { justify-content: start; }
}

/* Learning reports */
.report-app-page,
.public-report-page { overflow-x: hidden; }
.report-workspace { width: min(1480px, calc(100% - 32px)); }
.report-page-head { margin-bottom: 24px; }
.report-control-panel,
.report-preview-shell,
.report-history {
  border: 1px solid rgba(47, 102, 61, .1);
  border-radius: 28px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--clay-shadow);
}
.report-control-panel { margin-bottom: 26px; padding: 22px; }
.report-filter-grid { display: grid; grid-template-columns: 1.25fr 1.25fr .85fr .85fr; gap: 14px; }
.report-filter-grid .field,
.report-authoring-grid .field { margin: 0; }
.report-filter-grid select,
.report-filter-grid input,
.report-authoring-grid input,
.report-authoring-grid textarea {
  width: 100%;
  border: 1px solid #d9e7dc;
  border-radius: 14px;
  background: #fbfdfb;
}
.report-filter-grid select,
.report-filter-grid input,
.report-authoring-grid input { min-height: 46px; padding: 0 13px; }
.report-authoring-grid textarea { min-height: 132px; padding: 13px; resize: vertical; }
.report-authoring-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e4ece5; }
.report-goal-inputs { display: grid; gap: 9px; }
.report-control-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.report-control-foot small { color: var(--muted); line-height: 1.5; }
.report-preview-shell { overflow: hidden; padding: 0 26px 30px; }
#reportPreview { scroll-margin-top: 94px; }
#reportPreview:focus { outline: none; }
.report-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -26px 26px;
  padding: 28px 32px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 20%, rgba(255,255,255,.18), transparent 18rem),
    linear-gradient(135deg, #226b39, #4eb956);
}
.report-document-head p { margin: 0 0 5px; font-size: .75rem; font-weight: 900; letter-spacing: .13em; }
.report-document-head h1,
.report-document-head h2 { margin: 0 0 7px; color: inherit; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.report-document-head span { color: rgba(255,255,255,.82); font-size: .9rem; }
.report-document-head > div:last-child { display: grid; justify-items: end; gap: 8px; }
.report-document-head small { color: rgba(255,255,255,.78); }
.report-period-chip { padding: 10px 14px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; color: #fff !important; background: rgba(255,255,255,.13); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.report-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.report-kpi { min-width: 0; padding: 19px; border: 1px solid rgba(45,94,57,.08); border-radius: 21px; box-shadow: 6px 8px 18px rgba(38,78,49,.08), inset 0 2px 1px rgba(255,255,255,.88); }
.report-kpi.green { background: #e3f6e5; }.report-kpi.blue { background: #e4efff; }.report-kpi.purple { background: #eee7ff; }.report-kpi.yellow { background: #fff1c8; }.report-kpi.red { background: #ffe3df; }
.report-kpi span,
.report-kpi strong,
.report-kpi small { display: block; }
.report-kpi span { color: #53675b; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.report-kpi strong { margin: 8px 0 5px; color: var(--ink); font-size: clamp(1.8rem,3vw,2.7rem); line-height: 1; }
.report-kpi small { color: #5d7064; line-height: 1.4; }
.report-visual-grid,
.report-insight-grid,
.report-plan-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.report-panel { min-width: 0; padding: 22px; border: 1px solid #e0ebe2; border-radius: 22px; background: #fbfdfb; }
.report-visual-grid > *,
.report-insight-grid > *,
.report-plan-grid > * { min-width: 0; max-width: 100%; }
.report-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.report-panel-head span { display: block; margin-bottom: 4px; color: var(--green-dark); font-size: .7rem; font-weight: 900; letter-spacing: .11em; }
.report-panel-head h2 { margin: 0; font-size: clamp(1.15rem,2vw,1.5rem); }
.report-panel-head small { max-width: 280px; color: var(--muted); text-align: right; }
.report-wide { margin-top: 18px; }
.report-progress-list { display: grid; gap: 18px; }
.report-progress-row { display: grid; grid-template-columns: minmax(130px,.9fr) minmax(120px,1.35fr) 48px; align-items: center; gap: 13px; }
.report-progress-row > div:first-child { min-width: 0; }
.report-progress-row strong,
.report-progress-row span { display: block; }
.report-progress-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.report-progress-row div:first-child span { margin-top: 4px; color: var(--muted); font-size: .74rem; }
.report-progress-row b { color: var(--green-dark); text-align: right; }
.report-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e5eee6; box-shadow: inset 0 2px 4px rgba(35,78,47,.08); }
.report-progress-track span { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#47aa54,#74cf72); }
.report-line-wrap { min-height: 230px; }
.report-line-chart { display: block; width: 100%; height: auto; overflow: visible; }
.report-line-chart line { stroke: #dce7de; stroke-width: 1; }
.report-line-chart text { fill: #718078; font-size: 11px; }
.report-line-chart polyline { fill: none; stroke: #3da852; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.report-line-chart circle { fill: #fff; stroke: #3da852; stroke-width: 4; }
.report-line-chart .point-value { fill: #226b39; font-weight: 800; }
.report-line-chart .target-line { stroke: #d39a2f; stroke-width: 2; stroke-dasharray: 8 7; }
.report-line-chart .target-label { fill: #9a6815; font-size: 10px; font-weight: 800; }
.report-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 10px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.report-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.report-chart-legend i { width: 22px; height: 3px; border-radius: 999px; background: #3da852; }
.report-chart-legend span:last-child i { height: 2px; background: repeating-linear-gradient(90deg,#d39a2f 0 6px,transparent 6px 10px); }
.report-chart-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.report-week-chart,
.report-content-chart { display: grid; gap: 14px; }
.report-week-chart > div { display: grid; grid-template-columns: 70px 1fr 58px; align-items: center; gap: 10px; font-size: .8rem; }
.report-week-chart > div > div,
.report-content-chart > div > div { height: 13px; overflow: hidden; border-radius: 999px; background: #e6eee7; }
.report-week-chart i,
.report-content-chart i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#50b65b,#86d77f); }
.report-week-chart strong { text-align: right; }
.report-content-chart > div { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(110px,1fr) 45px 42px; align-items: center; gap: 9px; }
.report-content-chart span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .82rem; }
.report-content-chart strong { color: var(--green-dark); text-align: right; }
.report-content-chart small { color: var(--muted); text-align: right; }
.report-content-chart i.mid { background: #e5b644; }.report-content-chart i.low { background: #dd695d; }
.report-panel.positive { background: #eef9ef; }.report-panel.attention { background: #fff7e4; }
.report-note-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.report-note-list li { position: relative; padding-left: 28px; color: #395244; line-height: 1.55; }
.report-note-list li::before { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: #47a955; content: "✓"; font-size: .68rem; font-weight: 900; }
.report-panel.attention .report-note-list li::before { background: #d79435; content: "!"; }
.report-empty { display: grid; place-items: center; min-height: 100px; padding: 24px; border: 1px dashed #d5e3d7; border-radius: 16px; color: var(--muted); background: rgba(244,249,245,.68); text-align: center; line-height: 1.5; overflow-wrap: anywhere; }
.report-table-scroll { overflow-x: auto; }
.report-detail-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.report-detail-table th { color: #627268; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.report-detail-table th,
.report-detail-table td { padding: 13px 12px; border-bottom: 1px solid #e4ece5; text-align: left; }
.report-detail-table td { font-size: .86rem; }
.report-detail-table td:first-child { font-weight: 750; }
.report-detail-table td small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.report-detail-table a { color: var(--green-dark); }
.status-badge.danger { color: #9b2929; background: #ffe1dd; }
.teacher-note p { margin: 0; color: #40554a; line-height: 1.75; white-space: pre-line; }
.report-history { margin-top: 26px; padding: 24px; }
.report-section-heading h2 { margin: 4px 0 18px; }
.report-history-list { display: grid; gap: 10px; }
.report-history-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid #e0e9e1; border-radius: 16px; background: #fbfdfb; }
.report-history-row strong,
.report-history-row span { display: block; }
.report-history-row > div:first-child span { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.parent-report-intro { margin-bottom: 20px; padding: 18px 20px; border-radius: 17px; background: #f0f7f1; }
.parent-report-intro p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.public-report-page { background: #eff5f0; }
.public-report-toolbar { margin-bottom: 22px; }
.parent-report-shell { padding-bottom: 26px; }
.report-document-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 28px 2px 0; padding-top: 22px; border-top: 1px solid #dfe9e0; }
.report-document-footer strong,
.report-document-footer span { display: block; }
.report-document-footer span,
.report-document-footer small { margin-top: 4px; color: var(--muted); }
.public-report-error { display: grid; place-items: center; min-height: 480px; padding: 40px; text-align: center; }
.public-report-error > span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; color: #fff; background: #d9655a; font-size: 1.7rem; font-weight: 900; }
.public-report-error h1 { margin: 18px 0 4px; }
.public-report-error p { color: var(--muted); }
.student-report-filter .report-filter-grid { grid-template-columns: repeat(2,minmax(200px,360px)); }

/* Report motion */
.report-animate-ready .report-kpi,
.report-animate-ready .report-panel,
.report-animate-ready .parent-report-intro,
.report-animate-ready .report-document-head,
.report-animate-ready .report-document-footer { animation: reportReveal .52s cubic-bezier(.2,.75,.25,1) both; }
.report-animate-ready .report-kpi:nth-child(2) { animation-delay: .05s; }
.report-animate-ready .report-kpi:nth-child(3) { animation-delay: .1s; }
.report-animate-ready .report-kpi:nth-child(4) { animation-delay: .15s; }
.report-animate-ready .report-visual-grid:nth-of-type(2) .report-panel { animation-delay: .12s; }
.report-animate-ready .report-visual-grid:nth-of-type(3) .report-panel { animation-delay: .2s; }
.report-animate-ready .report-insight-grid .report-panel { animation-delay: .26s; }
.report-animate-ready .report-wide { animation-delay: .3s; }
.report-animate-ready .report-plan-grid .report-panel,
.report-animate-ready .report-document-footer { animation-delay: .36s; }
.report-animate-ready .report-progress-track span,
.report-animate-ready .report-week-chart i,
.report-animate-ready .report-content-chart i { animation: reportBarGrow .78s cubic-bezier(.2,.8,.25,1) both; transform-origin: left center; }
.report-animate-ready .report-line-chart .score-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: reportLineDraw .95s .18s ease-out forwards; }
.report-animate-ready .report-line-chart .score-point,
.report-animate-ready .report-line-chart .point-value { animation: reportPointPop .38s .72s ease-out both; transform-box: fill-box; transform-origin: center; }
.report-kpi,
.report-panel { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
@media (hover:hover) {
  .report-kpi:hover,
  .report-panel:hover { transform: translateY(-3px); border-color: rgba(67,151,82,.28); box-shadow: 0 15px 30px rgba(36,81,49,.09); }
  .report-line-chart .score-point:hover { r: 8; cursor: help; }
}
@keyframes reportReveal { from { opacity: 0; transform: translateY(14px) scale(.988); } to { opacity: 1; transform: none; } }
@keyframes reportBarGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes reportLineDraw { to { stroke-dashoffset: 0; } }
@keyframes reportPointPop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .report-animate-ready *,
  .report-kpi,
  .report-panel { animation: none !important; transition: none !important; }
}

@media (max-width: 1000px) {
  .report-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .report-workspace { width: min(100% - 20px,1480px); }
  .report-authoring-grid,
  .report-visual-grid,
  .report-insight-grid,
  .report-plan-grid { grid-template-columns: 1fr; }
  .report-preview-shell { padding: 0 14px 20px; }
  .report-workspace,
  .report-preview-shell,
  .report-panel,
  .report-table-scroll { max-width: 100%; box-sizing: border-box; }
  .report-document-head { align-items: flex-start; flex-direction: column; margin: 0 -14px 20px; padding: 22px 18px; }
  .report-document-head > div:last-child { justify-items: start; }
  .report-kpi-grid { gap: 10px; }
  .report-kpi { padding: 15px; border-radius: 17px; }
  .report-progress-row { grid-template-columns: 1fr 44px; }
  .report-progress-track { grid-column: 1 / -1; grid-row: 2; }
  .report-progress-row b { grid-column: 2; grid-row: 1; }
  .report-history-row { grid-template-columns: 1fr auto; }
  .report-history-row .row-actions { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .report-filter-grid,
  .student-report-filter .report-filter-grid,
  .report-kpi-grid { grid-template-columns: 1fr; }
  .report-control-foot { align-items: stretch; flex-direction: column; }
  .report-content-chart > div { grid-template-columns: 1fr 45px 38px; }
  .report-content-chart > div > div { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  .report-animate-ready *,
  .report-kpi,
  .report-panel { animation: none !important; transform: none !important; transition: none !important; }
  .report-workspace,
  .public-report { width: 100%; max-width: none; margin: 0; padding: 0; }
  .report-preview-shell { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .report-panel,
  .report-kpi { break-inside: avoid; box-shadow: none; }
  .report-document-head { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-kpi,
  .report-progress-track,
  .report-week-chart i,
  .report-content-chart i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-detail-table { min-width: 0; }
}
