/* Let's Learn Theme */
:root {
  --primary: #22c55e;
  --primary-dark: #15803d;
  --accent: #84cc16;
  --accent-light: #ecfccb;
  --bg: #f7fee7;
  --bg-card: #ffffff;
  --text: #14532d;
  --text-muted: #4d7c0f;
  --border: #bbf7d0;
  --shadow: 0 8px 32px rgba(34, 197, 94, 0.15);
  --radius: 24px;
  --font-display: 'Baloo 2', sans-serif;
  --font-body: 'Quicksand', sans-serif;
  --gradient: linear-gradient(135deg, #22c55e 0%, #84cc16 50%, #16a34a 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem 1rem 2.75rem;
  background: var(--bg-card);
  box-shadow: 0 2px 20px rgba(14, 165, 233, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.nav-river {
  position: relative;
  flex: 1 1 auto;
  min-width: 12rem;
  height: 3.55rem;
  margin: 0 1.25rem;
  overflow: hidden;
  border-radius: 18px;
  pointer-events: none;
  /* Warm dawn sky — distinct from blue river below */
  background: linear-gradient(
    180deg,
    #fff7ed 0%,
    #ffedd5 22%,
    #fed7aa 48%,
    transparent 48%
  );
}

.nav-river-banks {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 55% at 8% 100%, rgba(134, 239, 172, 0.55), transparent 70%),
    radial-gradient(ellipse 35% 50% at 92% 100%, rgba(167, 243, 208, 0.5), transparent 70%);
  z-index: 1;
}

.nav-river-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Water sits in the lower band; fish leap above it then dive under */
.nav-river-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  z-index: 4;
  background:
    linear-gradient(
      180deg,
      rgba(56, 189, 248, 0.55) 0%,
      rgba(14, 165, 233, 0.72) 38%,
      rgba(3, 105, 161, 0.78) 100%
    );
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.nav-river-water::before {
  content: '';
  position: absolute;
  left: -40%;
  top: 0;
  width: 180%;
  height: 100%;
  background:
    radial-gradient(ellipse 18% 40% at 20% 30%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 22% 45% at 55% 45%, rgba(255, 255, 255, 0.22), transparent 65%),
    radial-gradient(ellipse 16% 35% at 80% 25%, rgba(255, 255, 255, 0.28), transparent 60%);
  animation: navRiverShimmer 7s linear infinite;
}

.nav-wave {
  position: absolute;
  left: -20%;
  height: 0.28rem;
  width: 140%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  animation: navWaveDrift 5.5s linear infinite;
}

.nav-wave-a { top: 22%; opacity: 0.5; animation-duration: 6s; }
.nav-wave-b { top: 58%; opacity: 0.3; animation-duration: 7.5s; animation-delay: -2s; }

/* Short curved “river strokes” like current lines */
.nav-stroke {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: navStrokeDrift 4.8s linear infinite;
  opacity: 0.55;
}

.nav-stroke-a { top: 18%; left: 4%; width: 14%; animation-delay: 0s; }
.nav-stroke-b { top: 32%; left: 22%; width: 16%; animation-delay: -0.8s; }
.nav-stroke-c { top: 48%; left: 40%; width: 20%; animation-delay: -1.6s; }
.nav-stroke-d { top: 28%; left: 58%; width: 15%; animation-delay: -2.2s; }
.nav-stroke-e { top: 62%; left: 68%; width: 17%; animation-delay: -3s; }
.nav-stroke-f { top: 40%; left: 82%; width: 12%; animation-delay: -3.6s; }

/* Cute sun: rises once from the river, then stays up shining */
.nav-sun {
  position: absolute;
  top: 0.18rem;
  right: 0.85rem;
  left: auto;
  bottom: auto;
  width: 1.55rem;
  height: 1.55rem;
  z-index: 2;
  transform-origin: center center;
  animation: navSunRise 3.2s cubic-bezier(0.33, 1, 0.45, 1) forwards;
  will-change: transform, opacity;
}

.nav-sun-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.55));
}

.nav-sun-body {
  fill: #fbbf24;
  stroke: #f59e0b;
  stroke-width: 0.8;
}

.nav-sun-cheek { fill: #fdba74; opacity: 0.85; }
.nav-sun-face { fill: #92400e; stroke: none; }
.nav-sun-ray { fill: #fcd34d; }

.nav-sun-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.55) 0%, transparent 68%);
  opacity: 0;
  animation: navSunGlow 2.4s ease-in-out 3.1s infinite;
  pointer-events: none;
}

.nav-sun-rays {
  transform-origin: 20px 20px;
  animation: navSunShine 3.5s linear 3.1s infinite;
}

.nav-fish {
  position: absolute;
  bottom: 42%;
  width: 1.85rem;
  height: 1.05rem;
  color: #ea580c;
  z-index: 3;
  opacity: 0;
  filter: drop-shadow(0 1px 1px rgba(154, 52, 18, 0.25));
  animation: navFishLeap 4.6s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  will-change: transform, opacity;
}

.nav-fish-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.nav-fish-a {
  left: 14%;
  animation-delay: 0.4s;
}

.nav-fish-b {
  left: 44%;
  width: 1.65rem;
  height: 0.95rem;
  color: #f59e0b;
  animation-delay: 1.9s;
  animation-duration: 5s;
}

.nav-fish-c {
  left: 68%;
  width: 1.5rem;
  height: 0.85rem;
  color: #fb923c;
  animation-delay: 3.3s;
  animation-duration: 4.4s;
}

.nav-rower {
  position: absolute;
  top: 0.1rem;
  left: 0;
  width: 4.4rem;
  height: 3.05rem;
  z-index: 6;
  animation: navRowerSail 18s linear infinite;
  will-change: transform;
}

.nav-rower-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.18));
  animation: navRowerBob 1.6s ease-in-out infinite;
}

.nav-hull { fill: #9a3412; }
.nav-hull-top { fill: #d97706; }
.nav-sailor-head { fill: #fdba74; }
.nav-sailor-hat { fill: #1d4ed8; }
.nav-sailor-body { fill: #16a34a; }
.nav-sailor-hand { fill: #fdba74; }

/* Facing-side oar: pivots at the hand, blade dips into water */
.nav-oar-group {
  transform-origin: 52px 28px;
  animation: navOarRowFacing 1.15s ease-in-out infinite;
}
.nav-oar-shaft {
  stroke: #57534e;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.nav-oar-blade { fill: #a8a29e; stroke: #78716c; stroke-width: 0.6; }

.nav-rower-splash {
  position: absolute;
  left: 52%;
  bottom: 0.2rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%);
  opacity: 0;
  transform: translateX(-50%);
  animation: navOarSplash 1.15s ease-in-out infinite;
}

@keyframes navRiverShimmer {
  from { transform: translateX(0); }
  to { transform: translateX(18%); }
}

@keyframes navWaveDrift {
  from { transform: translateX(0); }
  to { transform: translateX(12%); }
}

@keyframes navStrokeDrift {
  0% { transform: translateX(0); opacity: 0.15; }
  40% { opacity: 0.7; }
  100% { transform: translateX(28px); opacity: 0.1; }
}

@keyframes navRowerSail {
  0% { transform: translateX(-25%); }
  100% { transform: translateX(115%); }
}

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

/* Oar swings toward/away from viewer on the facing side */
@keyframes navOarRowFacing {
  0% { transform: rotate(-28deg); }
  50% { transform: rotate(34deg); }
  100% { transform: rotate(-28deg); }
}

@keyframes navOarSplash {
  0%, 35%, 100% { opacity: 0; transform: translateX(-50%) scale(0.35); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.15); }
  65% { opacity: 0.25; transform: translateX(-50%) scale(1.4); }
}

/* Start under water → leap clear above surface → dive back in */
@keyframes navFishLeap {
  0%, 8% {
    opacity: 0;
    transform: translate(0, 12px) rotate(18deg) scale(0.8);
  }
  14% {
    opacity: 1;
    transform: translate(5px, 3px) rotate(6deg) scale(0.95);
  }
  28% {
    opacity: 1;
    transform: translate(16px, -14px) rotate(-22deg) scale(1.05);
  }
  40% {
    opacity: 1;
    transform: translate(26px, -4px) rotate(4deg) scale(1);
  }
  52% {
    opacity: 0.85;
    transform: translate(34px, 7px) rotate(16deg) scale(0.9);
  }
  60%, 100% {
    opacity: 0;
    transform: translate(40px, 16px) rotate(28deg) scale(0.75);
  }
}

/* Rise from river once, settle fully visible in the sky */
@keyframes navSunRise {
  0% {
    opacity: 0.35;
    transform: translateY(1.65rem) scale(0.55);
  }
  55% {
    opacity: 1;
    transform: translateY(0.08rem) scale(1.05);
  }
  75%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes navSunShine {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes navSunGlow {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 0.85; transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-river-water::before,
  .nav-wave,
  .nav-stroke,
  .nav-rower,
  .nav-rower-svg,
  .nav-oar-group,
  .nav-rower-splash,
  .nav-fish,
  .nav-sun,
  .nav-sun-rays,
  .nav-sun-glow {
    animation: none !important;
  }

  .nav-rower {
    left: 38%;
  }

  .nav-fish {
    opacity: 0.95;
    transform: translateY(-10px) rotate(-8deg);
  }

  .nav-sun {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-sun-glow { opacity: 0.55; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: var(--accent-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--accent-light);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { color: var(--primary); }

/* Login page */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-hero {
  background: var(--gradient);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.login-hero h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
}

.login-hero p {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 400px;
  position: relative;
}

.login-hero .mascot {
  font-size: 6rem;
  margin-bottom: 1.5rem;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

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

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.role-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--bg);
  padding: 0.35rem;
  border-radius: 14px;
}

.role-tab {
  flex: 1;
  padding: 0.65rem;
  border: none;
  background: transparent;
  border-radius: 11px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.role-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.auth-method-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-method-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-method-tab.active {
  background: #f0fdf4;
  border-color: var(--primary);
  color: var(--primary);
}

.otp-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.otp-resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.otp-resend-row button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0;
}

.otp-resend-row button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.otp-pin-input {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 0.35rem;
}

.otp-pin-digit {
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  text-align: center;
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  background: white;
  color: var(--text);
  caret-color: transparent;
}

.otp-pin-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.otp-pin-digit.filled {
  border-color: var(--primary);
  background: #f0fdf4;
}

.form-group input[readonly] {
  background: #f8fafc;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle-btn {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
}

.password-toggle-btn:hover {
  background: #f0fdf4;
  color: var(--primary);
}

.password-toggle-btn svg {
  fill: currentColor;
  height: 1.2rem;
  width: 1.2rem;
}

.password-toggle-btn .icon-eye-closed {
  display: none;
}

.password-toggle-btn.is-visible .icon-eye-open {
  display: none;
}

.password-toggle-btn.is-visible .icon-eye-closed {
  display: block;
}

.captcha-group {
  margin-bottom: 1rem;
}

.captcha-math-label {
  color: var(--text);
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.captcha-math-row {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.captcha-math-question {
  background: #f0fdf4;
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 700;
  min-width: 6.5rem;
  padding: 0.85rem 1rem;
  text-align: center;
}

.captcha-math-row input {
  flex: 1;
  max-width: 8rem;
}

.captcha-refresh-btn {
  min-width: 2.5rem;
  padding-inline: 0.5rem;
}

.turnstile-mount {
  min-height: 65px;
}

.login-card .btn-primary { width: 100%; margin-top: 0.5rem; padding: 1rem; }

.login-error {
  background: #fff0f0;
  border: 1px solid #ffb3b3;
  border-radius: 10px;
  color: #c0392b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.forgot-link {
  display: inline-block;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
  width: 100%;
}

.login-success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  border-radius: 10px;
  color: #276749;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.btn-secondary.btn-loading,
.btn-primary.btn-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.btn-primary.btn-loading::after {
  animation: btn-spin 0.7s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #fff;
  content: '';
  height: 1.25rem;
  left: 50%;
  margin-left: -0.625rem;
  margin-top: -0.625rem;
  position: absolute;
  top: 50%;
  width: 1.25rem;
}

.btn-secondary.btn-loading::after {
  animation: btn-spin 0.7s linear infinite;
  border: 2px solid rgba(51, 65, 85, 0.2);
  border-radius: 50%;
  border-top-color: #334155;
  content: '';
  height: 1.25rem;
  left: 50%;
  margin-left: -0.625rem;
  margin-top: -0.625rem;
  position: absolute;
  top: 50%;
  width: 1.25rem;
}

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

.page-loader {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 2000;
}

.page-loader.show {
  display: flex;
}

.page-loader-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 1.5rem 2rem;
  text-align: center;
}

.page-loader-spinner {
  animation: btn-spin 0.7s linear infinite;
  border: 3px solid rgba(76, 175, 80, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  height: 2.5rem;
  margin: 0 auto 1rem;
  width: 2.5rem;
}

/* Dashboard */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-section {
  padding: 2.5rem 0 2rem;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-light);
  color: var(--primary-dark);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hero-section h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.hero-section .lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  height: 100%;
}

.hero-video {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
}

.hero-hi-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.28));
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.hero-hi-overlay.is-dismissed {
  opacity: 0;
}

.hero-hi-btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 148px;
  padding: 0.7rem 1.1rem 0.65rem;
  border: 2.5px solid #fff;
  border-radius: 18px;
  background: linear-gradient(145deg, #fef9c3 0%, #bbf7d0 45%, #86efac 100%);
  box-shadow:
    0 4px 0 #16a34a,
    0 10px 20px rgba(20, 83, 45, 0.28);
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--primary-dark);
  transition: transform 0.12s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.12s ease, filter 0.12s ease;
  animation: hi-btn-pulse 2s ease-in-out infinite;
}

.hero-hi-btn:hover {
  transform: translateY(-4px) scale(1.05) rotate(-1.5deg);
  box-shadow:
    0 7px 0 #16a34a,
    0 14px 24px rgba(20, 83, 45, 0.34);
  filter: brightness(1.04);
}

.hero-hi-btn:active,
.hero-hi-btn.is-popping {
  transform: translateY(3px) scale(0.94);
  box-shadow:
    0 1px 0 #16a34a,
    0 4px 12px rgba(20, 83, 45, 0.22);
}

.hero-hi-btn.is-popping {
  animation: hi-btn-pop 0.32s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.hero-hi-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.hero-hi-wave {
  font-size: 1.55rem;
  line-height: 1;
  opacity: 0.72;
  animation: hi-wave 0.9s ease-in-out infinite;
  transform-origin: 70% 90%;
}

.hero-hi-label {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}

@keyframes hi-btn-pulse {
  0%, 100% {
    box-shadow: 0 4px 0 #16a34a, 0 10px 20px rgba(20, 83, 45, 0.28);
  }
  50% {
    box-shadow:
      0 4px 0 #16a34a,
      0 10px 20px rgba(20, 83, 45, 0.28),
      0 0 0 5px rgba(134, 239, 172, 0.28);
  }
}

@keyframes hi-btn-pop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(4px) scale(0.9); }
  65% { transform: translateY(-2px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes hi-wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(18deg); }
  40% { transform: rotate(-6deg); }
  60% { transform: rotate(14deg); }
  80% { transform: rotate(-3deg); }
}

.hero-video, .hero-video iframe,
.hero-video video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: cover;
}

.hero-video.video-playing,
.video-thumb.video-playing {
  position: relative;
}

.plant-volume {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  width: 34px;
  height: 124px;
  pointer-events: none;
}

.plant-volume-track {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
  padding-top: 18px;
}

.plant-volume-speaker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1.5px rgba(134, 239, 172, 0.9), 0 2px 5px rgba(20, 83, 45, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.plant-speaker-icon {
  width: 13px;
  height: 13px;
  display: block;
}

.plant-volume.is-loud .plant-volume-speaker {
  background: #fef9c3;
  box-shadow: 0 0 0 1.5px #facc15, 0 0 8px rgba(250, 204, 21, 0.4);
}

.plant-volume.is-loud .plant-speaker-icon path:nth-child(3),
.plant-volume.is-loud .plant-speaker-icon path:nth-child(4) {
  stroke: #fbbf24;
}

.plant-stake {
  display: none;
}

.plant-assembly {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.plant-pot {
  width: 30px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}

.plant-pot-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.plant-vine-shell {
  width: 28px;
  min-height: 6px;
  overflow: visible;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: height 0.07s ease;
}

.plant-vine-grow {
  width: 100%;
  height: 100%;
  transform-origin: bottom center;
  transition: transform 0.07s ease;
}

.plant-vine-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 2px rgba(20, 83, 45, 0.18));
}

.plant-volume.is-dragging .plant-vine-grow {
  animation: plant-stretch 0.35s ease infinite;
}

@keyframes plant-stretch {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.03); }
}

.hero-video video::-webkit-media-controls,
.video-thumb video::-webkit-media-controls {
  display: none !important;
}

.hero-video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transition: transform 0.2s;
  z-index: 2;
}

.hero-play:hover { transform: scale(1.08); }

.hero-video-unavailable {
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  padding: 1rem;
}

.hero-video-unavailable span {
  font-size: 2rem;
}

.hero-video-unavailable p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.vision-card {
  background: white;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  overflow: hidden;
  position: relative;
}

.vision-card-playful {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  height: 100%;
}

.vision-garden-scene {
  position: relative;
  flex: 1;
  min-height: 168px;
  overflow: hidden;
  background: linear-gradient(180deg, #bae6fd 0%, #ecfccb 58%, #bbf7d0 100%);
  border-bottom: 2px dashed rgba(34, 197, 94, 0.25);
}

.vision-sky-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.75), transparent 42%),
    radial-gradient(circle at 82% 12%, rgba(254, 240, 138, 0.35), transparent 35%);
  pointer-events: none;
}

.vision-sun {
  position: absolute;
  top: 0.65rem;
  right: 1rem;
  width: 3.2rem;
  height: 3.2rem;
  animation: visionSunPulse 4s ease-in-out infinite;
}

.vision-sun-core {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(234, 179, 8, 0.35));
}

.vision-sun-ray {
  position: absolute;
  inset: -0.15rem;
  border: 2px dashed rgba(250, 204, 21, 0.45);
  border-radius: 50%;
  animation: visionSunSpin 16s linear infinite;
}

.vision-sun-ray:nth-child(3) { inset: -0.45rem; animation-duration: 22s; opacity: 0.7; }
.vision-sun-ray:nth-child(4) { inset: -0.75rem; animation-duration: 28s; opacity: 0.45; }
.vision-sun-ray:nth-child(5) { inset: -1rem; animation-duration: 34s; opacity: 0.25; }

.vision-cloud {
  position: absolute;
  width: 3.4rem;
  height: 1.2rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow:
    -1rem 0.2rem 0 -0.15rem rgba(255, 255, 255, 0.88),
    1rem 0.15rem 0 -0.1rem rgba(255, 255, 255, 0.88);
  opacity: 0.9;
}

.vision-cloud-a {
  top: 1.4rem;
  left: 8%;
  animation: visionCloudDrift 18s ease-in-out infinite;
}

.vision-cloud-b {
  top: 2.5rem;
  left: 42%;
  transform: scale(0.82);
  animation: visionCloudDrift 24s ease-in-out infinite reverse;
}

.vision-sunflower {
  position: absolute;
  bottom: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 100%;
}

.vision-sunflower-a {
  left: 0.85rem;
  animation: visionSunflowerSway 3.6s ease-in-out infinite;
}

.vision-sunflower-b {
  right: 4.5rem;
  animation: visionSunflowerSwayB 4.2s ease-in-out infinite 0.8s;
}

.vision-sunflower-head {
  font-size: 1.85rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.vision-sunflower-stem {
  width: 3px;
  height: 1.35rem;
  margin-top: -0.15rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #15803d);
}

.vision-butterfly {
  position: absolute;
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: visionButterflyFlutter 5.5s ease-in-out infinite;
}

.vision-butterfly-a {
  top: 2rem;
  left: 28%;
}

.vision-butterfly-b {
  top: 3.2rem;
  left: 58%;
  font-size: 1.1rem;
  animation-delay: 1.4s;
  animation-duration: 6.2s;
}

.vision-tiger {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  transform: translate(-50%, -50%);
  animation: visionTigerBounce 2.8s ease-in-out infinite;
  pointer-events: none;
}

.vision-tiger-bubble {
  position: relative;
  padding: 0.28rem 0.72rem;
  border-radius: 14px;
  background: #fff;
  border: 2.5px solid #fbbf24;
  box-shadow: 0 3px 0 #d97706, 0 6px 14px rgba(146, 64, 14, 0.18);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  color: #92400e;
  white-space: nowrap;
  animation: visionTigerHiPop 2.8s ease-in-out infinite;
}

.vision-tiger-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border-width: 7px 6px 0;
  border-style: solid;
  border-color: #fff transparent transparent;
  filter: drop-shadow(0 2px 0 #d97706);
}

.vision-tiger-face {
  width: 4.5rem;
  height: 4.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.16));
  animation: visionTigerWiggle 2.8s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.vision-caterpillar-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.15rem;
  height: 1.6rem;
  overflow: hidden;
}

.vision-caterpillar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 5.5rem;
  height: auto;
  animation: visionCaterpillarCrawl 14s linear infinite;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.vision-cat-seg,
.vision-cat-head {
  fill: #84cc16;
  stroke: #4d7c0f;
  stroke-width: 1.2;
}

.vision-cat-head { fill: #65a30d; }
.vision-cat-eye { fill: #14532d; }
.vision-cat-antenna {
  fill: none;
  stroke: #4d7c0f;
  stroke-width: 1;
  stroke-linecap: round;
}

.vision-monkey {
  position: absolute;
  right: 0.55rem;
  bottom: 0.2rem;
  font-size: 2rem;
  line-height: 1;
  transform-origin: 50% 100%;
  animation: visionMonkeyPeek 3.8s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
}

.vision-grass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1rem;
  background:
    repeating-linear-gradient(
      90deg,
      #22c55e 0 6px,
      #16a34a 6px 12px
    );
  opacity: 0.35;
  mask-image: linear-gradient(180deg, transparent, #000 70%);
}

.vision-leaf {
  position: absolute;
  font-size: 1rem;
  opacity: 0.75;
  animation: visionLeafFloat 7s ease-in-out infinite;
}

.vision-leaf-a {
  top: 3.4rem;
  left: 18%;
}

.vision-leaf-b {
  top: 2.2rem;
  right: 22%;
  animation-delay: 2s;
  transform: scaleX(-1);
}

.vision-card-body {
  position: relative;
  z-index: 1;
  padding: 1.35rem 1.5rem 1.6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff 24%);
}

.vision-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vision-card-body p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

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

@keyframes visionSunSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes visionCloudDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(18px); }
}

@keyframes visionSunflowerSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

@keyframes visionSunflowerSwayB {
  0%, 100% { transform: scale(0.88) rotate(-4deg); }
  50% { transform: scale(0.88) rotate(5deg); }
}

@keyframes visionButterflyFlutter {
  0%, 100% { transform: translate(0, 0) rotate(-6deg) scale(1); }
  25% { transform: translate(12px, -8px) rotate(8deg) scale(1.05); }
  50% { transform: translate(24px, 2px) rotate(-4deg) scale(0.95); }
  75% { transform: translate(10px, -4px) rotate(10deg) scale(1.02); }
}

@keyframes visionTigerBounce {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  45% { transform: translate(-50%, -50%) translateY(-7px); }
  55% { transform: translate(-50%, -50%) translateY(-4px); }
}

@keyframes visionTigerHiPop {
  0%, 100% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.08) rotate(-2deg); }
  40% { transform: scale(1) rotate(2deg); }
  60% { transform: scale(1.06) rotate(-1deg); }
}

@keyframes visionTigerWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.03); }
  50% { transform: rotate(4deg) scale(1); }
  75% { transform: rotate(-3deg) scale(1.02); }
}

@keyframes visionCaterpillarCrawl {
  0% { left: -12%; }
  50% { left: 46%; }
  100% { left: 96%; }
}

@keyframes visionMonkeyPeek {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  40% { transform: translateY(-6px) rotate(3deg); }
  60% { transform: translateY(-3px) rotate(0deg); }
}

@keyframes visionLeafFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.55; }
  50% { transform: translateY(-8px) rotate(12deg); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .vision-garden-scene *,
  .vision-garden-scene *::before,
  .vision-garden-scene *::after {
    animation: none !important;
  }
}

.vision-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.vision-card p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Filters */
.section {
  padding: 2.5rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.dashboard-section .section-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.dashboard-section-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.dashboard-section .section-header .subtitle {
  max-width: 40rem;
  margin: 0;
}

.dashboard-section-free {
  padding-top: 1.5rem;
}

.dashboard-section-assigned {
  margin-top: 0.25rem;
}

.account-page {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 40% at 10% 0%, rgba(187, 247, 208, 0.4), transparent 55%),
    radial-gradient(ellipse 50% 35% at 90% 5%, rgba(186, 230, 253, 0.35), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #eef7f1 100%);
}

.account-main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.account-hero {
  margin-bottom: 1.25rem;
}

.account-hero h1 {
  font-family: var(--font-display);
  margin: 0.25rem 0 0.4rem;
  color: var(--primary-dark);
}

.account-profile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.account-profile-avatar {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(145deg, #bbf7d0, #86efac);
  border: 2px solid rgba(34, 197, 94, 0.35);
}

.account-profile-info {
  flex: 1;
  min-width: 12rem;
}

.account-profile-info h2 {
  font-family: var(--font-display);
  margin: 0 0 0.2rem;
  color: var(--primary-dark);
}

.account-empty-panel {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed #bbf7d0;
}

.account-empty-panel .icon {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.account-empty-panel h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4rem;
}

.account-empty-panel p {
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto 1.1rem;
}

.dashboard-section-tutor {
  margin-top: 0.5rem;
  padding: 2rem 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(254, 240, 138, 0.45), transparent 45%),
    radial-gradient(circle at 100% 20%, rgba(187, 247, 208, 0.55), transparent 40%),
    linear-gradient(180deg, #f0fdf4, #ecfccb);
  border: 2px solid rgba(34, 197, 94, 0.2);
}

/* Match the tutor card’s outer width (full container edge, no extra inset) */
.dashboard-section-cta {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  padding: 0;
}

.dashboard-section-cta .cta-strip {
  margin: 0;
}

.tutor-section-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.tutor-section-copy h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
  color: var(--primary-dark);
}

.tutor-section-copy p {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
}

.tutor-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.course-sub-tag {
  display: inline-block;
  margin-bottom: 0.45rem;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.filter-label {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.filter-chip {
  padding: 1rem 2rem;
  min-height: 56px;
  border: 3px solid var(--border);
  background: white;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.25);
}

.filter-chip:active {
  transform: translateY(1px) scale(0.92);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
  transition-duration: 0.08s;
}

.filter-chip.active {
  background: var(--gradient);
  border-color: transparent;
  color: white;
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.4);
}

.filter-chip.active:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 14px 32px rgba(34, 197, 94, 0.45);
}

.filter-chip.chip-pop {
  animation: chipPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-chip.active.chip-pop {
  animation: chipPopActive 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipPop {
  0% { transform: scale(1); }
  20% { transform: scale(0.88); }
  45% { transform: scale(1.18); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

@keyframes chipPopActive {
  0% { transform: scale(1.06); }
  20% { transform: scale(0.9); }
  45% { transform: scale(1.22); }
  70% { transform: scale(1.02); }
  100% { transform: scale(1.06); }
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.video-card, .course-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 2px solid transparent;
}

.video-card:hover, .course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.video-card.hidden, .course-card.hidden { display: none; }

.video-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb iframe,
.video-thumb video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: cover;
}

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.play-btn:hover { transform: scale(1.1); }

.video-thumb.playing .play-btn {
  display: none;
}

.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--primary-dark);
}

.course-card .course-img {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.course-card:nth-child(1) .course-img { background: linear-gradient(135deg, #fef3c7, #fbbf24); }
.course-card:nth-child(2) .course-img { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); }
.course-card:nth-child(3) .course-img { background: linear-gradient(135deg, #bbf7d0, #22c55e); }
.course-card:nth-child(4) .course-img { background: linear-gradient(135deg, #fecdd3, #f43f5e); }

.course-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.course-card-link .card-body h3 {
  color: var(--text);
}

.course-assigned-tag {
  background: #dcfce7;
  color: #166534;
}

.course-browse-tag {
  background: #fef9c3;
  color: #92400e;
}

.course-main {
  padding: 2rem 0 3rem;
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

.course-hero-media img,
.course-hero-media .course-hero-fallback {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.course-hero-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #bbf7d0, #22c55e);
}

.course-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.course-access-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
}

.course-access-note-open {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.course-access-note-locked {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.course-content-list {
  display: grid;
  gap: 0.85rem;
}

.course-content-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.course-content-item:hover {
  transform: translateY(-2px);
  border-color: #86efac;
  box-shadow: var(--shadow);
}

.course-content-item.is-locked {
  opacity: 0.92;
  cursor: not-allowed;
}

.course-content-item.is-locked:hover {
  transform: none;
  border-color: #fde68a;
}

.course-content-item.has-video-thumb {
  align-items: stretch;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
}

.course-content-thumb {
  width: 128px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.course-content-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: white;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
  background: rgba(15, 23, 42, 0.18);
}

.course-content-item:not(.is-locked):hover .course-content-play {
  background: rgba(15, 23, 42, 0.28);
}

.course-content-item.is-locked .course-content-play {
  font-size: 1.1rem;
  background: rgba(15, 23, 42, 0.35);
}

.course-content-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.course-content-copy {
  flex: 1;
  min-width: 0;
}

.course-content-copy strong {
  display: block;
  margin-bottom: 0.15rem;
}

.course-content-status {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

.course-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.course-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.course-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.course-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.course-viewer-body {
  min-height: 320px;
  background: #000;
}

.course-viewer-video,
.course-viewer-frame {
  width: 100%;
  height: min(70vh, 540px);
  border: 0;
  display: block;
}

.course-viewer-fallback {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: white;
}

.course-viewer-secure {
  background: #f8fafc;
  max-height: min(78vh, 720px);
  overflow: auto;
  user-select: none;
  -webkit-user-select: none;
}

.course-viewer-viewonly-note {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #166534;
  background: #ecfccb;
  border-bottom: 1px solid #d9f99d;
  text-align: center;
}

.course-viewer-viewonly-note-bar {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  background: #f8fafc;
  color: #475569;
}

.course-viewer-pdf-pages {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  justify-items: center;
}

.course-viewer-pdf-page {
  width: min(100%, 900px);
  height: auto;
  background: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-radius: 4px;
}

.course-viewer-image {
  display: block;
  width: min(100%, 900px);
  height: auto;
  margin: 1rem auto;
  pointer-events: none;
}

@media (max-width: 768px) {
  .course-hero {
    grid-template-columns: 1fr;
  }

  .course-content-item.has-video-thumb {
    flex-wrap: wrap;
  }

  .course-content-thumb {
    width: 100%;
    max-width: 220px;
  }

  .course-content-status {
    width: 100%;
    padding-left: 0;
  }
}

/* CTA strip */
.cta-strip {
  background: var(--gradient);
  border-radius: 24px;
  padding: 2.5rem;
  margin: 2rem 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: white;
}

.cta-strip h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.cta-strip p { opacity: 0.9; font-size: 0.95rem; }

.cta-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  background: white;
  color: var(--primary-dark);
}

.cta-buttons .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 74, 110, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.modal-success {
  text-align: center;
  padding: 2rem 0;
}

.modal-success .icon { font-size: 3rem; margin-bottom: 1rem; }
.modal-success h4 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.5rem; }
.modal-success p { color: var(--text-muted); }

.empty-state {
  display: none;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state.show { display: block; }
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }

.live-badge {
  background: #ffe8e8;
  border-radius: 999px;
  color: #c0392b;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.35rem;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
}

.ended-badge {
  background: #eef2f7;
  border-radius: 999px;
  color: #5a6a7a;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.35rem;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
}

.live-class-card-ended {
  opacity: 0.85;
}

.live-class-card-ended .ended-tag {
  color: #5a6a7a;
  font-weight: 600;
}

#liveClassesSection.live-classes-active {
  background: linear-gradient(180deg, #fff8f0 0%, transparent 100%);
  border: 2px solid #ffb347;
  border-radius: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.5rem 1.25rem 1.75rem;
}

#liveClassesSection.live-classes-active .section-header h2 {
  color: #c0392b;
}

#liveClassesHint {
  color: #c0392b;
  font-weight: 600;
}

.live-class-card .live-join-btn {
  display: inline-block;
  margin-top: 0.85rem;
  width: 100%;
  text-align: center;
}

.live-class-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.live-class-page .nav {
  margin-bottom: 0;
  flex-shrink: 0;
}

.live-class-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 1280px;
  width: 100%;
  padding: 0 1rem 1rem;
}

.live-class-header {
  flex-shrink: 0;
  margin: 0.75rem 0 0.5rem;
}

.live-class-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 0.25rem;
}

.live-class-header .subtitle {
  margin: 0;
  font-size: 0.95rem;
}

.live-class-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.live-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-tool-btn:hover {
  border-color: var(--primary);
  background: var(--accent-light);
}

.live-tool-btn.active {
  border-color: var(--primary);
  background: var(--accent-light);
  color: var(--primary-dark);
}

.live-tool-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.live-tool-btn-end {
  border-color: #cbd5e1;
  margin-left: auto;
}

.live-tool-btn-end:hover {
  border-color: #64748b;
  background: #f8fafc;
}

.live-tool-btn-end:disabled {
  opacity: 0.6;
}

.live-tool-icon {
  font-size: 1rem;
  line-height: 1;
}

.live-class-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-class-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(240px, 30%) minmax(0, 1fr);
  gap: 0.85rem;
  min-height: min(620px, 68vh);
  width: 100%;
}

.live-class-cameras {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
}

.live-class-activity {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  border: 2px solid #bbf7d0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  overflow: hidden;
}

.live-activity-idle {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  padding: 1.5rem;
  text-align: center;
}

.live-activity-idle-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #14532d;
}

.live-activity-whiteboard,
.live-activity-worksheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.live-activity-whiteboard[hidden],
.live-activity-worksheet[hidden],
.live-activity-idle[hidden] {
  display: none !important;
}

.live-activity-whiteboard iframe,
.live-activity-worksheet iframe {
  flex: 1;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}

.live-class-timer-compact {
  margin: 0;
  padding: 0.45rem 0.75rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.live-class-timer-compact .live-class-timer-value {
  font-size: 1.15rem;
}

.present-worksheet-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  max-height: min(50vh, 420px);
  overflow: auto;
}

.present-worksheet-item {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.present-worksheet-item:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.live-class-stage {
  flex: 1;
  display: flex;
  min-height: min(520px, 52vh);
  width: 100%;
  position: relative;
}

@media (max-width: 900px) {
  .live-class-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .live-class-cameras {
    min-height: 240px;
    max-height: 320px;
  }

  .live-activity-whiteboard iframe,
  .live-activity-worksheet iframe {
    min-height: 360px;
  }
}

.live-class-timer {
  flex-shrink: 0;
  margin: 0.65rem 0 0.35rem;
  padding: 0.7rem 1rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f0fdf4);
  display: grid;
  gap: 0.2rem;
}

.live-class-timer-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.live-class-timer-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.live-class-timer-value {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  color: #14532d;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.live-class-timer-meta {
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
}

.live-class-timer-warning {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #9a3412;
}

.live-class-timer.is-warning {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  animation: live-timer-pulse 1.4s ease-in-out infinite;
}

.live-class-timer.is-warning .live-class-timer-value {
  color: #c2410c;
}

.live-class-timer.is-ended {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
  animation: none;
}

.live-class-timer.is-ended .live-class-timer-value {
  color: #b91c1c;
}

@keyframes live-timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
  50% { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.22); }
}

.live-class-stage.is-maximized {
  position: fixed;
  inset: 0;
  z-index: 250;
  min-height: 100dvh;
  max-height: 100dvh;
  width: 100vw;
  border-radius: 0;
}

.live-class-stage:fullscreen {
  min-height: 100dvh;
  width: 100%;
  background: #0f172a;
  border-radius: 0;
}

.live-class-stage:fullscreen .daily-container,
.live-class-stage.is-maximized .daily-container {
  border-radius: 0;
  min-height: 100%;
  height: 100%;
}

.live-stage-maximize-exit {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.live-stage-maximize-exit:hover {
  background: rgba(15, 23, 42, 0.9);
}

body.live-class-video-maximized {
  overflow: hidden;
}

.whiteboard-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid #bbf7d0;
}

.whiteboard-panel[hidden] {
  display: none !important;
}

.whiteboard-stage-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  flex-shrink: 0;
}

.whiteboard-stage-bar .subtitle {
  flex: 1;
  margin: 0;
  font-size: 0.85rem;
}

.whiteboard-panel iframe {
  width: 100%;
  height: min(2400px, 120vh);
  min-height: 560px;
  border: 0;
}

.daily-container {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}

.daily-container iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 16px;
}

.live-class-main .login-error {
  flex-shrink: 0;
  margin-top: 0.75rem;
}

body.worksheet-live-embed .nav,
body.worksheet-live-embed .worksheet-sky,
body.worksheet-live-embed .worksheet-ground,
body.worksheet-live-embed .worksheet-complete {
  display: none !important;
}

body.worksheet-live-embed {
  background: #fff;
}

body.worksheet-live-embed .worksheet-main {
  padding: 0.5rem 0.75rem 1rem;
  max-width: none;
}

body.worksheet-live-embed .worksheet-hero {
  margin-bottom: 0.5rem;
}

body.worksheet-live-embed .worksheet-hero-art {
  display: none;
}

.live-class-provider-note {
  flex-shrink: 0;
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.live-class-provider-note a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.live-class-provider-note a:hover {
  color: var(--primary-dark);
}

.worksheet-activity-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem 0.75rem;
}

.worksheet-activity-checks label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.worksheet-json-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.worksheet-page {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(134, 239, 172, 0.45), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(253, 224, 71, 0.28), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(167, 243, 208, 0.35), transparent 60%),
    linear-gradient(180deg, #dff6ff 0%, #e8f9e4 42%, #c8efc4 100%);
}

.worksheet-sky {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.worksheet-sun {
  position: absolute;
  top: 4.5rem;
  right: 6%;
  font-size: 2.6rem;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.55));
  animation: worksheetSunPulse 4s ease-in-out infinite;
}

.worksheet-cloud {
  position: absolute;
  width: 3.6rem;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow:
    -1.1rem 0.2rem 0 -0.15rem rgba(255, 255, 255, 0.88),
    1.05rem 0.15rem 0 -0.1rem rgba(255, 255, 255, 0.88);
}

.worksheet-cloud-a {
  top: 5.5rem;
  left: 8%;
  animation: worksheetCloudDrift 22s ease-in-out infinite;
}

.worksheet-cloud-b {
  top: 7rem;
  left: 35%;
  transform: scale(0.75);
  opacity: 0.85;
  animation: worksheetCloudDrift 28s ease-in-out infinite reverse;
}

.worksheet-leaf {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0.85;
  animation: worksheetLeafFall 14s linear infinite;
}

.worksheet-leaf-a { left: 12%; top: -5%; animation-duration: 16s; }
.worksheet-leaf-b { left: 55%; top: -8%; animation-duration: 19s; animation-delay: -6s; font-size: 1.15rem; }
.worksheet-leaf-c { left: 78%; top: -3%; animation-duration: 13s; animation-delay: -3s; }

.worksheet-butterfly {
  position: absolute;
  top: 28%;
  left: 4%;
  font-size: 1.35rem;
  animation: worksheetButterfly 18s ease-in-out infinite;
}

.worksheet-ground {
  pointer-events: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem;
  z-index: 0;
  background: linear-gradient(180deg, transparent, rgba(74, 222, 128, 0.22));
}

.worksheet-ground-flower {
  position: absolute;
  bottom: 0.4rem;
  font-size: 1.35rem;
  animation: worksheetBloom 3.5s ease-in-out infinite;
}

.worksheet-ground-flower-a { left: 8%; animation-delay: 0s; }
.worksheet-ground-flower-b { left: 48%; animation-delay: 0.6s; }
.worksheet-ground-flower-c { right: 10%; animation-delay: 1.1s; }

.worksheet-page > .nav,
.worksheet-page > .worksheet-main {
  position: relative;
  z-index: 1;
}

.worksheet-main {
  max-width: 840px;
  padding-bottom: 4rem;
}

.worksheet-hero {
  margin: 1rem 0 1.25rem;
  text-align: center;
}

.worksheet-hero-art {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 0.35rem;
  font-size: 1.85rem;
}

.worksheet-hero-bloom { animation: worksheetSway 3.2s ease-in-out infinite; }
.worksheet-hero-sprout { animation: worksheetSway 2.8s ease-in-out infinite 0.4s; }
.worksheet-hero-pot { animation: worksheetSway 3.6s ease-in-out infinite 0.8s; }

.worksheet-hero h1 {
  font-family: var(--font-display);
  margin: 0.35rem 0;
  color: var(--primary-dark);
}

.worksheet-progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.worksheet-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(22, 101, 52, 0.2);
  transition: transform 0.25s ease, background 0.25s ease, width 0.25s ease;
}

.worksheet-dot.is-done {
  background: var(--primary);
}

.worksheet-dot.is-active {
  width: 1.35rem;
  background: var(--primary-dark);
  transform: scale(1.08);
}

.worksheet-stage {
  min-height: 280px;
  border: 2px solid rgba(34, 197, 94, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 253, 244, 0.92)),
    radial-gradient(circle at 100% 0%, rgba(254, 240, 138, 0.25), transparent 40%) !important;
  box-shadow: 0 12px 28px rgba(21, 128, 61, 0.08);
  overflow: hidden;
}

.worksheet-stage-enter {
  animation: worksheetStageIn 0.45s ease both;
}

.worksheet-type-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ecfdf5, #dcfce7);
  border: 1px solid #86efac;
  font-size: 0.8rem;
  font-weight: 700;
  color: #166534;
}

.worksheet-type-icon {
  font-size: 1rem;
  line-height: 1;
}

.worksheet-prompt {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
  color: #14532d;
}

.worksheet-hint {
  margin: 0 0 0.85rem;
  color: #3f6212;
  font-size: 0.95rem;
}

.worksheet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  justify-content: center;
}

.worksheet-feedback {
  margin-top: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  text-align: center;
}

.worksheet-feedback-pop {
  animation: worksheetFeedbackPop 0.45s ease;
}

.worksheet-feedback.is-ok {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #86efac;
  color: #166534;
}

.worksheet-feedback.is-bad {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 2px solid #fdba74;
  color: #9a3412;
}

[data-check-item].is-wrong,
.worksheet-activity-body.is-wrong {
  outline: 2px solid #f97316;
  outline-offset: 2px;
  border-radius: 12px;
  background: rgba(255, 237, 213, 0.45);
  animation: worksheetWrongShake 0.4s ease;
}

[data-check-item].is-correct-mark,
.worksheet-activity-body.is-correct-mark {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
  border-radius: 12px;
  background: rgba(220, 252, 231, 0.45);
}

.worksheet-garden-track {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(220, 252, 231, 0.85));
  border: 1px solid #86efac;
}

.worksheet-garden-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 0.55rem;
}

.worksheet-garden-points {
  color: #b45309;
}

.worksheet-garden-pots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.worksheet-garden-pot {
  width: 2.1rem;
  height: 2.4rem;
  border-radius: 10px;
  background: #fefce8;
  border: 1px solid #fde68a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.worksheet-garden-pot.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.worksheet-garden-soil {
  width: 100%;
  height: 0.45rem;
  background: #a16207;
}

.worksheet-garden-plant {
  position: absolute;
  bottom: 0.35rem;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.35;
  transform: scale(0.7);
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.worksheet-garden-pot.is-grown .worksheet-garden-plant {
  opacity: 1;
  transform: scale(1.15) translateY(-2px);
  animation: worksheetPlantGrow 0.7s ease;
}

.worksheet-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  overflow: hidden;
}

.worksheet-confetti,
.worksheet-cracker {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: worksheetConfettiFall 1.45s ease-out forwards;
}

.worksheet-cracker {
  width: auto;
  height: auto;
  background: transparent !important;
  font-size: 1.25rem;
}

.worksheet-plant-pop {
  position: fixed;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -20%) scale(0.85);
  z-index: 1210;
  min-width: 220px;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffbeb, #ecfccb);
  border: 2px solid #fbbf24;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.worksheet-plant-pop.is-show {
  animation: worksheetPlantPopIn 1.7s ease forwards;
}

.worksheet-plant-pop-emoji {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.worksheet-plant-pop strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #9a3412;
}

.worksheet-plant-pop span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3f6212;
}

.worksheet-complete {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.worksheet-complete[hidden] {
  display: none !important;
}

.worksheet-complete-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.4rem 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(254, 240, 138, 0.55), transparent 45%),
    linear-gradient(180deg, #ffffff, #ecfccb);
  border: 2px solid #86efac;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: worksheetCompleteIn 0.55s ease both;
}

.worksheet-complete-burst {
  font-size: 2.5rem;
  animation: worksheetSway 2.2s ease-in-out infinite;
}

.worksheet-complete-card h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: #14532d;
  margin: 0.35rem 0;
}

.worksheet-complete-points {
  font-weight: 800;
  font-size: 1.15rem;
  color: #b45309;
  margin: 0.25rem 0 0.5rem;
}

.worksheet-complete-plants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin: 0.85rem 0 1.15rem;
  min-height: 2rem;
}

.worksheet-complete-plant {
  font-size: 1.55rem;
  animation: worksheetPlantGrow 0.55s ease both;
  animation-delay: calc(var(--i, 0) * 0.08s);
}

@keyframes worksheetWrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes worksheetConfettiFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: 0.2; }
}

@keyframes worksheetPlantGrow {
  0% { transform: scale(0.2) translateY(8px); opacity: 0; }
  70% { transform: scale(1.2) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes worksheetPlantPopIn {
  0% { opacity: 0; transform: translate(-50%, -10%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -30%) scale(1.05); }
  75% { opacity: 1; transform: translate(-50%, -32%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
}

@keyframes worksheetCompleteIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.worksheet-card-pop {
  animation: worksheetCardIn 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

.worksheet-arrange {
  display: grid;
  gap: 0.85rem;
}

.worksheet-arrange-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
  padding: 0.85rem;
  border: 2px dashed #86efac;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.worksheet-arrange-slot {
  position: relative;
  min-width: calc(var(--slot-ch, 5ch) + 1.6rem);
  min-height: 3.2rem;
  padding: 0.45rem 0.5rem 0.45rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f0fdf4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.worksheet-arrange-slot.is-target,
.worksheet-arrange-slot.is-drop-hover,
.worksheet-arrange-bank.is-drop-hover {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  transform: translateY(-1px);
}

.worksheet-arrange-slot.is-filled {
  border-style: solid;
  background: linear-gradient(180deg, #ecfccb, #d9f99d);
}

.worksheet-arrange-slot-num {
  position: absolute;
  top: -0.55rem;
  left: 0.45rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.worksheet-arrange-slot-ghost {
  color: #86efac;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}

.worksheet-arrange-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 3.2rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 2px solid #bbf7d0;
  background: linear-gradient(135deg, #fff7ed, #ecfccb);
}

.worksheet-word-chip {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #14532d;
  cursor: grab;
  background: linear-gradient(160deg, #fef08a, #facc15);
  box-shadow: 0 3px 0 rgba(161, 98, 7, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.worksheet-word-chip.is-placed {
  background: linear-gradient(160deg, #86efac, #22c55e);
  color: #14532d;
  box-shadow: 0 3px 0 rgba(21, 128, 61, 0.25);
}

.worksheet-word-chip.is-selected,
.worksheet-word-chip.is-dragging {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 4px 0 rgba(21, 128, 61, 0.2);
}

.worksheet-word-chip:active {
  cursor: grabbing;
}

.worksheet-arrange-preview {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #14532d;
  min-height: 1.4em;
}

.worksheet-arrange-preview.is-empty {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
}

.worksheet-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.worksheet-order-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f0fdf4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.worksheet-order-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(21, 128, 61, 0.1);
}

.worksheet-order-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #86efac, #4ade80);
  color: #14532d;
  font-weight: 800;
  font-size: 0.85rem;
}

.worksheet-match-list {
  display: grid;
  gap: 0.75rem;
}

.worksheet-match-pair {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.3fr);
  gap: 0.65rem;
  align-items: stretch;
}

.worksheet-match-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #ecfccb);
  font-weight: 700;
  color: #14532d;
}

.worksheet-match-badge {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #22c55e;
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
}

.worksheet-match-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 2px dashed #86efac;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
}

.worksheet-match-arrow {
  color: #16a34a;
  font-weight: 800;
  font-size: 1.1rem;
}

.worksheet-quiz-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  border: 2px solid #bbf7d0;
  border-radius: 12px;
  background: white;
  margin-bottom: 0.45rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.worksheet-quiz-option:hover {
  border-color: #4ade80;
  background: #f0fdf4;
  transform: translateX(3px);
}

.worksheet-quiz-block {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 0.35rem;
  border: 2px solid #bbf7d0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.worksheet-quiz-q {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #14532d;
  padding: 0 0.25rem;
  margin-bottom: 0.5rem;
}

.worksheet-blank-input,
.worksheet-match-row select,
[data-math-index] {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid #bbf7d0;
  border-radius: 10px;
  font: inherit;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.worksheet-blank-input:focus,
.worksheet-match-row select:focus,
[data-math-index]:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.worksheet-fill {
  font-size: 1.05rem;
  line-height: 1.85;
}

.worksheet-fill-list {
  display: grid;
  gap: 0.7rem;
}

.worksheet-fill-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f7fee7);
}

.worksheet-fill-num {
  width: 1.55rem;
  height: 1.55rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #bef264;
  color: #365314;
  font-weight: 800;
  font-size: 0.8rem;
}

.worksheet-fill .worksheet-blank-input {
  display: inline-block;
  width: auto;
  min-width: 7rem;
  margin: 0 0.25rem;
  padding: 0.25rem 0.5rem;
  vertical-align: baseline;
}

.worksheet-math-q {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  color: #14532d;
}

.worksheet-math-list {
  display: grid;
  gap: 0.75rem;
}

.worksheet-math-row {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  background: white;
}

.worksheet-unscramble-list {
  display: grid;
  gap: 0.85rem;
}

.worksheet-unscramble-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border: 2px solid #bbf7d0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(254, 240, 138, 0.35), transparent 40%),
    linear-gradient(180deg, #fff, #f0fdf4);
}

.worksheet-unscramble-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.worksheet-unscramble-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #86efac, #22c55e);
  color: #14532d;
  font-weight: 800;
  font-size: 0.85rem;
}

.worksheet-unscramble-head .worksheet-hint {
  margin: 0;
  flex: 1;
}

.worksheet-letter-slots,
.worksheet-letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 3.1rem;
  align-items: center;
}

.worksheet-letter-slots {
  padding: 0.55rem 0.65rem;
  border: 2px dashed #86efac;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.worksheet-letter-bank {
  padding: 0.25rem 0;
}

.worksheet-letter-bank.is-hint {
  opacity: 0.95;
}

.worksheet-built-preview {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #14532d;
  min-height: 1.4em;
}

.worksheet-built-preview.is-empty {
  color: #94a3b8;
  letter-spacing: 0.04em;
  font-size: 1rem;
  font-weight: 600;
}

.worksheet-letter-tile,
.worksheet-letter-input {
  --tile-rot: 0deg;
  width: 2.7rem;
  height: 2.7rem;
  border: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #14532d;
  box-shadow:
    0 3px 0 rgba(21, 128, 61, 0.25),
    0 6px 12px rgba(21, 128, 61, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  animation: worksheetTilePop 0.35s ease both;
}

.worksheet-letter-tile:nth-child(3n),
.worksheet-letter-input:nth-child(3n) { --tile-rot: -3deg; }
.worksheet-letter-tile:nth-child(3n+1),
.worksheet-letter-input:nth-child(3n+1) { --tile-rot: 2deg; }
.worksheet-letter-tile:nth-child(3n+2),
.worksheet-letter-input:nth-child(3n+2) { --tile-rot: -1deg; }

.worksheet-letter-hint {
  background: linear-gradient(160deg, #fef08a, #fde047 45%, #facc15);
  transform: rotate(var(--tile-rot));
  cursor: default;
  user-select: none;
}

.worksheet-letter-hint:nth-child(4n) {
  background: linear-gradient(160deg, #bbf7d0, #86efac 45%, #4ade80);
}

.worksheet-letter-hint:nth-child(4n+1) {
  background: linear-gradient(160deg, #bae6fd, #7dd3fc 45%, #38bdf8);
}

.worksheet-letter-hint:nth-child(4n+2) {
  background: linear-gradient(160deg, #fdba74, #fb923c 45%, #f97316);
  color: #7c2d12;
}

.worksheet-letter-hint.is-used {
  opacity: 0.28;
  filter: grayscale(0.35);
  transform: rotate(var(--tile-rot)) scale(0.92);
}

.worksheet-letter-input {
  text-align: center;
  text-transform: uppercase;
  background: linear-gradient(160deg, #dcfce7, #86efac 50%, #22c55e);
  transform: rotate(0deg);
  cursor: text;
  padding: 0;
  outline: none;
  caret-color: #14532d;
}

.worksheet-letter-input:focus {
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.28),
    0 5px 0 rgba(21, 128, 61, 0.22),
    0 10px 16px rgba(21, 128, 61, 0.14);
}

@keyframes worksheetTilePop {
  from { opacity: 0; transform: scale(0.7) rotate(var(--tile-rot)); }
  to { opacity: 1; transform: scale(1) rotate(var(--tile-rot)); }
}

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

@keyframes worksheetCloudDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2.5rem); }
}

@keyframes worksheetLeafFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

@keyframes worksheetButterfly {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(4rem, -2rem) rotate(10deg); }
  50% { transform: translate(9rem, 1rem) rotate(-6deg); }
  75% { transform: translate(3rem, 2.5rem) rotate(12deg); }
}

@keyframes worksheetBloom {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes worksheetSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

@keyframes worksheetStageIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes worksheetCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes worksheetFeedbackPop {
  0% { transform: scale(0.94); opacity: 0.4; }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 700px) {
  .worksheet-match-pair {
    grid-template-columns: 1fr;
  }

  .worksheet-letter-tile,
  .worksheet-letter-input {
    width: 2.45rem;
    height: 2.45rem;
    font-size: 1.2rem;
  }

  .worksheet-sun,
  .worksheet-butterfly {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .worksheet-sun,
  .worksheet-cloud,
  .worksheet-leaf,
  .worksheet-butterfly,
  .worksheet-ground-flower,
  .worksheet-hero-bloom,
  .worksheet-hero-sprout,
  .worksheet-hero-pot,
  .worksheet-stage-enter,
  .worksheet-card-pop,
  .worksheet-feedback-pop,
  .worksheet-letter-tile {
    animation: none !important;
  }
}

/* About page */
.about-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.about-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.about-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 3rem;
}

.about-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  text-align: center;
  border: 2px solid var(--border);
}

.about-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.about-card h3 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.about-mission {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.about-mission h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.about-mission p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Teacher portal */
.teacher-login-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.teacher-login-link a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.teacher-login-link a:hover {
  text-decoration: underline;
}

.teacher-login-hero {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 50%, #4ade80 100%);
}

.teacher-main {
  padding: 2rem 1.5rem 3rem;
  max-width: 1200px;
}

.teacher-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.teacher-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0.5rem 0;
}

.teacher-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.modal-content-wide {
  width: min(760px, calc(100% - 2rem));
  max-height: min(85vh, 820px);
  overflow: auto;
}

.teacher-courses-panel {
  overflow: visible;
}

.teacher-courses-header {
  align-items: flex-start !important;
}

.teacher-courses-header .subtitle {
  margin: 0.35rem 0 0;
  max-width: 40rem;
}

.teacher-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.teacher-course-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  color: inherit;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.teacher-course-card:hover,
.teacher-course-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  outline: none;
}

.teacher-course-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #bbf7d0, #22c55e);
  overflow: hidden;
}

.teacher-course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teacher-course-card-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
}

.teacher-course-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1rem 1rem;
  min-width: 0;
}

.teacher-course-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teacher-course-card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.teacher-course-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.teacher-course-card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.teacher-course-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.teacher-course-item-list,
.teacher-unlock-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.teacher-course-item-list li,
.teacher-unlock-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.teacher-unlock-list li.is-locked {
  background: #fff7ed;
  border-color: #fed7aa;
}

.teacher-unlock-list li.is-unlocked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.teacher-content-manage {
  display: grid;
  gap: 1rem;
}

.teacher-student-course {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  background: #f8fafc;
}

.teacher-student-course-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.teacher-student-course-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-enrollment-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.teacher-panel {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.teacher-panel .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.teacher-panel .section-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.admin-assign-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-assign-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-assign-form select,
#scheduleForm select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: white;
}

.students-table .subtitle {
  font-size: 0.8rem;
  margin: 0;
}

/* Admin portal */
.admin-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  flex: 1;
  padding-bottom: 2rem;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.admin-sidebar-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.admin-nav-btn:hover,
.admin-nav-btn.active {
  background: var(--accent-light);
  color: var(--primary-dark);
}

.admin-badge {
  margin-left: auto;
  background: #dc2626;
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.admin-sidebar-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-main {
  min-width: 0;
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-hero-compact {
  margin-bottom: 1rem;
}

.admin-hero-compact h1 {
  font-size: 1.5rem;
}

.admin-filter,
.admin-inline-select {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: white;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fafafa;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.admin-card-bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.admin-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.admin-message-cell {
  max-width: 280px;
  font-size: 0.88rem;
}

.admin-teacher-cell {
  width: 108px;
  max-width: 108px;
}

.admin-teacher-select {
  display: block;
  width: 100%;
  max-width: 108px;
  min-width: 0;
  padding: 0.35rem 1.4rem 0.35rem 0.4rem;
  font-size: 0.78rem;
  line-height: 1.2;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  background-color: white;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-check-cell {
  text-align: center;
  white-space: nowrap;
}

.admin-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-check-label input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.admin-row-completed {
  opacity: 0.72;
  background: #f0fdf4;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-nav-btn {
    width: auto;
    flex: 1 1 auto;
  }
}

.upload-preview {
  display: block;
  max-width: 220px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.upload-status {
  margin-top: 0.35rem;
}

#courseImageUrl[readonly] {
  margin-top: 0.5rem;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
}

.course-img-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.admin-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-upload-row input[type="file"] {
  max-width: 100%;
}

.admin-content-list {
  display: grid;
  gap: 0.75rem;
}

.admin-content-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.admin-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-top: 1.75rem;
}

.admin-filter-row {
  margin-bottom: 1rem;
}

.course-enroll-choices {
  display: grid;
  gap: 0.55rem;
  max-height: 260px;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
}

.course-enroll-choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--border);
  cursor: pointer;
}

.course-enroll-choice.is-enrolled {
  opacity: 0.72;
  cursor: not-allowed;
}

.course-enroll-choice input {
  flex-shrink: 0;
}

.course-enroll-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.admin-content-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fafafa;
}

.admin-content-thumb-preview {
  width: 160px;
  aspect-ratio: 16 / 9;
  margin: 0.65rem 0;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.admin-content-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.storage-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
}

.storage-badge.local {
  background: #fef3c7;
  color: #92400e;
}

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

.students-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.students-table th,
.students-table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.students-table th {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty-cell {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem !important;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.25rem;
}

.cal-day {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s ease;
  position: relative;
  min-height: 44px;
}

.cal-day:hover {
  border-color: var(--border);
  background: var(--accent-light);
}

.cal-day.selected {
  border-color: var(--primary);
  background: var(--accent-light);
}

.cal-day.has-event .cal-day-num {
  color: var(--primary-dark);
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-day-empty {
  visibility: hidden;
  pointer-events: none;
}

.cal-events-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.cal-events-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cal-event-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.cal-event-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cal-event-item .btn {
  align-self: flex-start;
  margin-top: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.live-join-btn {
  margin-top: 0.75rem;
  width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 2.5rem 2rem; min-height: 280px; }
  .login-hero h1 { font-size: 2rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-video-wrap,
  .vision-card-playful {
    min-height: 300px;
  }
  .vision-garden-scene { min-height: 148px; }
  .vision-monkey { font-size: 1.65rem; }
  .vision-tiger-face { width: 3.75rem; height: 3.75rem; }
  .vision-tiger-bubble { font-size: 0.76rem; }
  .cta-strip { flex-direction: column; text-align: center; }

  .dashboard-section-tutor {
    padding: 1.5rem 1rem;
  }

  .tutor-section-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .cta-buttons { justify-content: center; }
  .teacher-grid { grid-template-columns: 1fr; }
  .teacher-hero { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .live-class-main {
    padding: 0 0.75rem 0.75rem;
  }
  .live-class-header h1 {
    font-size: 1.2rem;
  }
  .daily-container {
    border-radius: 12px;
    min-height: 280px;
  }
  .live-class-toolbar {
    gap: 0.4rem;
  }
  .live-tool-btn span:not(.live-tool-icon) {
    display: none;
  }
  .live-tool-btn {
    padding: 0.55rem 0.75rem;
  }
}

/* Essay Garden */
.dashboard-section-essay {
  margin-top: 0.5rem;
}

.essay-garden-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.9fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.essay-garden-side,
.essay-garden-main,
.essay-best-block,
.essay-best-list,
.essay-best-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.essay-wotd {
  background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 55%, #bbf7d0 100%);
  border-radius: 18px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.essay-wotd-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.essay-wotd strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
}

.essay-write-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem 1.2rem 1.25rem;
  margin-bottom: 1.25rem;
}

.essay-write-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.essay-write-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.essay-use-word {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

#essayWordCount.is-ready {
  color: var(--primary-dark);
}

.essay-success,
.essay-reward-banner {
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
}

.essay-success {
  background: #ecfccb;
  color: #3f6212;
  border: 1px solid #bef264;
}

.essay-reward-banner {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.essay-streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
}

.essay-streak-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.essay-streak-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin: 0.2rem 0 0.65rem;
}

.essay-streak-bar {
  height: 0.55rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.essay-streak-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.essay-credits {
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0.35rem 0;
}

.essay-reward-highlight {
  margin-top: 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 55%, #fdba74 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.essay-reward-highlight-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #92400e;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}

.essay-reward-highlight p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #78350f;
  line-height: 1.35;
}

.essay-reward-highlight strong {
  color: #9a3412;
}

.essay-mine h3,
.essay-best-block h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.65rem;
}

.essay-my-list,
.essay-best-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.essay-history-card,
.essay-best-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
}

.essay-best-card {
  position: relative;
  padding: 1rem 1.15rem 1.1rem;
  overflow: hidden;
}

.essay-best-ribbon {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  width: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(120, 53, 15, 0.22));
}

.essay-best-ribbon-star {
  width: 2rem;
  height: 2rem;
  display: block;
  z-index: 2;
}

.essay-best-ribbon-banner {
  position: relative;
  margin-top: -0.4rem;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.essay-best-ribbon-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.05rem;
  padding: 0 0.3rem;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
  color: #fff7ed;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid #991b1b;
  border-right: 1px solid #991b1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.essay-best-ribbon-tail {
  width: 0.45rem;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  position: relative;
}

.essay-best-ribbon-tail::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 0.35rem;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.essay-best-ribbon-tail-left {
  border-top-left-radius: 2px;
}

.essay-best-ribbon-tail-right {
  border-top-right-radius: 2px;
}

.essay-history-top,
.essay-best-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.essay-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.essay-status-pill.reviewed {
  background: #dcfce7;
  color: #166534;
}

.essay-status-pill.pending {
  background: #ffedd5;
  color: #9a3412;
}

.essay-feedback {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--text);
}

.essay-best-sub {
  margin: -0.25rem 0 0.75rem;
}

.essay-best-author {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0 3.1rem 0.45rem 0;
}

.essay-best-author-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.essay-best-author strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.essay-best-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 3.1rem 0.55rem 0;
  color: var(--text);
}

.essay-best-body {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 0.98rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: none;
  line-height: 1.55;
}

.essay-best-block {
  background: transparent;
  width: 100%;
}

.admin-essay-review {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.admin-essay-body-preview {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

@media (max-width: 900px) {
  .essay-garden-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav { padding: 1rem 1rem 1rem 1.35rem; gap: 0.5rem; }
  .logo-text { display: none; }
  .nav-river { height: 3rem; margin: 0 0.65rem; }
  .nav-rower { width: 3.7rem; height: 2.55rem; }
  .nav-fish { width: 1.45rem; height: 0.85rem; }
  .nav-sun { width: 1.25rem; height: 1.25rem; top: 0.12rem; right: 0.55rem; }
}
