:root {
  --bg: #0a1f3d;
  --bg-soft: #16305a;
  --card: #12294f;
  --card-strong: #1b3a63;
  --ink: #f4f6fb;
  --muted: #a9b8d6;
  --line: #2c4a7c;
  --brand: #00a86b;
  --brand-dark: #00795a;
  --accent: #14b886;
  --accent-warm: #f59e0b;
  --accent-mint: #0d9488;
  --accent-peach: #fb923c;
  --jade: #00a86b;
  --jade-dark: #00795a;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.3);

  --fun-1: #3b82f6;
  --fun-2: #a855f7;
  --fun-3: #f59e0b;
  --fun-4: #ec4899;
  --fun-5: #22c55e;
  --fun-6: #06b6d4;
  --bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  font-size: 18px;
  background: var(--bg);
}

.auth-body {
  min-height: 100vh;
}

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

.page-shell {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

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

.hero-copy,
.hero-panel,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 168, 107, 0.16), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.08), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.06), transparent 50%),
    var(--card);
}

.hero-copy,
.hero-panel {
  border-radius: 0;
  padding: 1.75rem;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-topbar-title {
  display: grid;
  gap: 0.2rem;
}

.hero-topbar-title .eyebrow {
  margin-bottom: 0;
}

.hero-topbar-title strong {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hero-top-row .hero-account-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.65rem 0.9rem;
}

.hero-top-row .hero-account-copy {
  gap: 0.65rem;
}

.hero-topbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#hero-copy-content {
  display: grid;
  gap: 0;
}

#hero-copy-content.hidden {
  display: none;
}

.hero-copy--compact {
  padding-bottom: 1rem;
}

.hamburger-button {
  min-width: 120px;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.98;
  margin-bottom: 0.8rem;
}

.hero-text,
.quiz-meta,
#results-summary {
  color: var(--ink);
  font-size: 1.08rem;
}

.section-heading p,
.summary-row span,
.profile-note,
.score-pill span {
  color: var(--ink);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.hero-badge {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: 1px solid transparent;
  color: #ffffff;
  font-weight: 800;
  box-shadow: none;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1rem;
  background: var(--card);
  color: var(--ink);
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.hero-panel.is-open {
  transform: translateX(0);
}

.hero-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 13, 28, 0.58);
  z-index: 24;
}

#hero-panel-content.hidden,
#parent-dashboard-content.hidden {
  display: none;
}

.hero-account-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.18);
}

.hero-account-copy {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hero-account-text {
  display: grid;
  gap: 0.18rem;
}

.hero-account-text span,
.hero-account-text small {
  color: var(--ink);
}

.hero-account-text span {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-account-text strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.hero-account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid rgba(0, 168, 107, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.hero-account-avatar--placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand-dark);
}

.header-avatar-upload-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-dark);
  cursor: pointer;
  text-decoration: underline;
  width: fit-content;
}

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

.hero-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  position: relative;
  z-index: 8;
}

.hero-account-button {
  text-decoration: none;
}

.hero-child-select {
  min-width: 9.5rem;
  appearance: auto;
}

.hero-panel-heading h3 {
  font-size: 1.55rem;
  margin-top: 0.15rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.hero-stat-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(255, 210, 122, 0.12));
  border: 1px solid rgba(0, 168, 107, 0.24);
  display: grid;
  gap: 0.3rem;
}

.hero-stat-card span,
.hero-chart-heading span,
.hero-chart-heading small {
  color: var(--ink);
}

.hero-stat-card span {
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.9;
}

.hero-stat-card strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.hero-chart-wrap {
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.18);
}

.hero-chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.hero-chart-heading span {
  font-weight: 800;
}

.hero-chart-heading small {
  font-size: 0.86rem;
  opacity: 0.84;
}

.hero-activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
  min-height: 200px;
}

.hero-activity-day {
  display: grid;
  gap: 0.5rem;
  align-items: end;
  justify-items: center;
}

.hero-activity-meta {
  min-height: 36px;
  text-align: center;
  display: grid;
  gap: 0.12rem;
}

.hero-activity-time,
.hero-activity-achievement,
.hero-activity-label {
  color: var(--ink);
}

.hero-activity-time {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.92;
}

.hero-activity-achievement {
  font-size: 0.72rem;
  opacity: 0.8;
}

.hero-activity-bar-wrap {
  width: 100%;
  height: 112px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: end;
  padding: 0.35rem;
}

.hero-activity-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.95), rgba(79, 70, 229, 0.95));
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.26);
}

.hero-activity-bar.is-empty {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.hero-activity-label {
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0.9;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.content {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

#parent-dashboard-section {
  order: -10;
}

.card {
  border-radius: 22px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.content > .card {
  padding: 1rem 1.1rem;
}

#hero-panel:has(#hero-panel-content.hidden),
#account-tools-section:has(#profile-panel-content.hidden) {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}

.hero,
.content > .card,
.sidebar.card {
  margin: 0;
}

.auth-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 40px 0;
}

.auth-card {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.auth-copy h1,
.auth-panel-copy h2 {
  margin: 0;
}

.auth-form {
  width: 100%;
}

.auth-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.8rem;
}

.auth-input-grid label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 700;
}

.auth-input-grid label.hidden,
#auth-grade-label.hidden,
#auth-email-label.hidden {
  display: none !important;
}

.auth-input-grid label:first-child {
  grid-column: 1 / -1;
}

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

.auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-message {
  margin-top: 12px;
  min-height: 24px;
  color: var(--ink);
}

#level-section {
  position: relative;
  z-index: 6;
}

.section-heading {
  margin-bottom: 0.55rem;
}

.section-heading--collapsible {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.section-heading--collapsible > div:first-child {
  flex: 1 1 160px;
  min-width: 0;
}

#grade-panel-content {
  overflow: hidden;
}

#profile-panel-content {
  overflow: hidden;
}

#grade-panel-content.hidden {
  display: none;
}

#profile-panel-content.hidden {
  display: none;
}

#topic-search-panel-content.hidden {
  display: none;
}

.section-heading h2 {
  margin-bottom: 0.3rem;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

.section-heading p {
  margin: 0;
}

.compact-heading {
  margin-bottom: 0.35rem;
}

.compact-heading p {
  display: none;
}

.grade-buttons,
.level-grid,
.options-list,
.results-breakdown {
  display: grid;
  gap: 0.8rem;
}

.profile-panel {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--line);
}

.profile-current {
  margin-bottom: 1rem;
}

.profile-form {
  display: grid;
  gap: 0.55rem;
}

.field-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.profile-form input,
.profile-form select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
}

.profile-form input::placeholder {
  color: #5f6674;
}

.profile-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.parent-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.parent-panel-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.18);
}

.parent-panel-card h3 {
  font-size: 1.25rem;
}

.parent-add-child {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.child-photo-preview-wrap {
  min-height: 76px;
}

.child-photo-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(0, 168, 107, 0.2);
}

.avatar-section {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.18);
}

.avatar-current-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.current-avatar-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(0, 168, 107, 0.24);
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.current-avatar-preview--placeholder {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}

.avatar-current-copy {
  display: grid;
  gap: 0.2rem;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.avatar-upload-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.avatar-library-panel {
  display: grid;
  gap: 0.8rem;
}

.avatar-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
}

.avatar-library-item {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(0, 168, 107, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.avatar-library-item:hover,
.avatar-library-item:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(59, 168, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.avatar-library-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.avatar-library-item span {
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.parent-kids-dashboard {
  display: grid;
  gap: 0.8rem;
}

.parent-dashboard-learner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.parent-dashboard-learner-card {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}

.parent-dashboard-learner-card.is-active {
  border-color: rgba(99, 102, 241, 0.48);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.parent-dashboard-learner-photo,
.parent-dashboard-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(0, 168, 107, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.parent-dashboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.parent-dashboard-learner-photo--placeholder,
.parent-dashboard-avatar--placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
}

.parent-dashboard-overview {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.parent-dashboard-goals-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.parent-dashboard-summary-card,
.parent-dashboard-chart-card,
.parent-dashboard-table-card {
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.18);
}

.parent-dashboard-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.parent-dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.parent-dashboard-metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 107, 0.12);
}

.parent-dashboard-metric span,
.parent-dashboard-analysis-cell,
.parent-dashboard-analysis-head {
  color: var(--ink);
}

.parent-dashboard-metric strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.parent-dashboard-goal-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.goal-editor-summary {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 107, 0.14);
}

.goal-editor-summary strong,
.goal-editor-summary span {
  color: var(--ink);
}

.goal-editor-summary strong {
  font-size: 1rem;
}

.goal-editor-summary span {
  opacity: 0.9;
}

.parent-dashboard-goal-form input,
.parent-dashboard-goal-form select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
  font-weight: 700;
}

.parent-dashboard-goal-form button {
  margin-top: 0.3rem;
}

.goal-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.2rem;
  color: var(--ink);
  font-weight: 700;
}

.goal-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.parent-dashboard-goal-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0 1rem;
}

.subject-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.25rem 0 1rem;
}

.subject-progress-card,
.subject-progress-chart-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 168, 107, 0.16);
}

.subject-progress-card--math {
  border-color: rgba(46, 204, 113, 0.28);
  box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.08);
}

.subject-progress-card--english {
  border-color: rgba(96, 165, 250, 0.28);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.subject-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.subject-progress-head span,
.subject-progress-head strong,
.subject-progress-card small,
.subject-progress-chart-card h4,
.subject-progress-chart-card small {
  color: var(--ink);
}

.subject-progress-head span {
  font-weight: 700;
}

.subject-progress-head strong {
  font-size: 1rem;
}

.subject-progress-card small {
  display: block;
  opacity: 0.92;
}

.subject-progress-chart-card {
  margin-bottom: 0.95rem;
}

.subject-progress-chart {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.subject-progress-chart-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.subject-progress-chart-label {
  display: grid;
  gap: 0.2rem;
}

.subject-progress-chart-label strong,
.subject-progress-chart-label small,
.subject-progress-chart-line span,
.subject-progress-chart-line strong {
  color: var(--ink);
}

.subject-progress-chart-bars {
  display: grid;
  gap: 0.55rem;
}

.subject-progress-chart-line {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.subject-progress-chart-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.subject-progress-chart-fill {
  height: 100%;
  border-radius: inherit;
}

.subject-progress-chart-row--math .subject-progress-chart-fill--time {
  background: linear-gradient(90deg, #1fb66b, #53d58d);
}

.subject-progress-chart-row--math .subject-progress-chart-fill--levels {
  background: linear-gradient(90deg, #167c4a, #28b96c);
}

.subject-progress-chart-row--english .subject-progress-chart-fill--time {
  background: linear-gradient(90deg, #3b82f6, #69b1ff);
}

.subject-progress-chart-row--english .subject-progress-chart-fill--levels {
  background: linear-gradient(90deg, #2458d3, #4b8dff);
}

.goal-progress-block {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.goal-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.goal-progress-head span,
.goal-progress-head strong {
  color: var(--ink);
}

.goal-progress-head span {
  font-weight: 700;
}

.goal-progress-head strong {
  font-size: 0.96rem;
}

.goal-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(0, 168, 107, 0.14);
}

.goal-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e 0%, #38bdf8 100%);
  transition: width 180ms ease;
}

@media (max-width: 880px) {
  .subject-progress-grid {
    grid-template-columns: 1fr;
  }

  .subject-progress-chart-row {
    grid-template-columns: 1fr;
  }
}

.parent-dashboard-analysis-table {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(100px, 1fr));
  gap: 0;
  border: 1px solid rgba(0, 168, 107, 0.18);
  border-radius: 18px;
  overflow: hidden;
}

.parent-dashboard-analysis-head,
.parent-dashboard-analysis-cell {
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(0, 168, 107, 0.12);
}

.parent-dashboard-analysis-head {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.parent-dashboard-analysis-cell--weak {
  color: #ffb4a8;
  font-weight: 700;
  background: rgba(255, 108, 84, 0.1);
}

.parent-kid-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 168, 107, 0.16);
}

.parent-kid-card.is-active {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.parent-kid-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.parent-kid-head small {
  display: block;
  margin-top: 0.15rem;
  color: rgba(244, 246, 251, 0.82);
}

.parent-kid-avatar {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 168, 107, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.parent-kid-avatar--placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
}

.parent-kid-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.8rem;
}

.parent-kid-meta span,
.parent-kid-card small {
  color: var(--ink);
}

.profile-note {
  margin: 0.7rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

.grade-buttons {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.level-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  position: relative;
  z-index: 2;
}

.level-grid[aria-busy="true"] {
  opacity: 0.72;
}

.level-grid[aria-busy="true"] .level-card {
  cursor: progress;
}

.level-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 8;
}

.grade-button,
.level-card,
.option-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 160ms var(--bounce-ease), box-shadow 160ms ease, background 160ms ease;
}

.grade-button:active,
.level-card:active,
.option-button:not(:disabled):active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.94);
}

.grade-button,
.level-card,
.secondary-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  color: var(--ink);
  border: 1px solid var(--line);
}

.grade-button {
  --btn-color: var(--brand);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(223, 237, 255, 0.92));
  color: var(--btn-color);
  border: 2px solid var(--btn-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#grade-buttons .grade-button:nth-child(6n+1) { --btn-color: var(--fun-1); }
#grade-buttons .grade-button:nth-child(6n+2) { --btn-color: var(--fun-2); }
#grade-buttons .grade-button:nth-child(6n+3) { --btn-color: var(--fun-3); }
#grade-buttons .grade-button:nth-child(6n+4) { --btn-color: var(--fun-4); }
#grade-buttons .grade-button:nth-child(6n+5) { --btn-color: var(--fun-5); }
#grade-buttons .grade-button:nth-child(6n+6) { --btn-color: var(--fun-6); }

.grade-button,
.level-card {
  padding: 0.95rem 1rem;
  font-weight: 800;
  font-size: 1.12rem;
}

.level-card {
  display: grid;
  gap: 0.22rem;
  text-align: left;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.level-card strong {
  display: block;
}

.level-card span {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(244, 246, 251, 0.9);
}

.collapse-button {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  flex: 0 0 auto;
  align-self: flex-start;
}

.topic-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.topic-search-panel {
  margin-top: 1rem;
  padding: 0.9rem 1.05rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 168, 107, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--line);
}

.hero-search-panel {
  margin-top: 1.1rem;
}

.hero-search-panel--inline {
  margin-top: 0;
  flex: 1 1 380px;
  min-width: 280px;
}

.topic-search-head {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.topic-search-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.18rem;
  flex: 0 0 auto;
}

.topic-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
  position: relative;
  z-index: 8;
}

.topic-search-toolbar .topic-search-input {
  flex: 1 1 220px;
  min-width: 0;
}

.topic-search-toolbar button {
  flex: 0 0 auto;
}

.topic-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.topic-search-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1e293b;
  font-size: 1.02rem;
  font-weight: 700;
  outline: none;
}

.topic-search-input::placeholder {
  color: rgba(30, 41, 59, 0.45);
}

.topic-search-results {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.topic-search-empty {
  color: rgba(244, 246, 251, 0.82);
  font-size: 0.9rem;
  line-height: 1.35;
}

.topic-search-result {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.16);
}

.topic-search-result strong,
.topic-search-result span,
.topic-search-result small {
  color: var(--ink);
}

.topic-search-result span {
  font-size: 0.94rem;
  color: rgba(244, 246, 251, 0.78);
}

.topic-search-result small {
  font-size: 0.95rem;
  line-height: 1.45;
}

.topic-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.topic-search-action {
  min-width: 0;
}

.topic-select-wrap {
  margin-top: 0.25rem;
}

.topic-select {
  width: 100%;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(124, 118, 220, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(229, 240, 255, 0.94) 100%);
  color: #3730a3;
  font-size: 1.08rem;
  font-weight: 700;
  outline: none;
}

.topic-select option {
  color: #111111;
  background: #ffffff;
}

.category-current-card {
  margin-top: 0.55rem;
  padding: 0.8rem 1rem;
  border-radius: 22px;
  text-align: left;
  position: relative;
  z-index: 3;
  background:
    radial-gradient(circle at top right, rgba(255, 210, 122, 0.28), transparent 24%),
    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(224, 238, 255, 0.94) 100%);
  border: 1px solid rgba(124, 118, 220, 0.3);
  box-shadow: 0 16px 32px rgba(8, 25, 53, 0.12);
}

.topics-empty-state {
  margin-top: 0.55rem;
  padding: 1.4rem 1.2rem;
  border-radius: 22px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(59, 130, 246, 0.1), rgba(245, 158, 11, 0.1));
  border: 2px dashed rgba(124, 58, 237, 0.35);
}

.topics-empty-state.hidden {
  display: none;
}

.category-current-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.5rem;
  color: #3730a3;
}

.category-current-card p {
  margin: 0;
  color: #234a86;
  font-size: 1.04rem;
  line-height: 1.55;
}

.category-current-card small {
  display: block;
  margin-top: 0.45rem;
  color: #3730a3;
  font-size: 0.98rem;
  font-weight: 800;
}

.pat-tab-section {
  margin-top: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--line);
}

.pat-tab-heading h3 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 1.18rem;
}

.pat-tab-heading p {
  margin: 0;
  color: rgba(244, 246, 251, 0.82);
  font-size: 0.98rem;
  line-height: 1.45;
}

.pat-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.pat-tab-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1e293b;
  border-radius: 16px;
  padding: 0.82rem 1rem;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pat-tab-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 35, 53, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
}

.pat-tab-button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #ffffff;
}

.probability-example-section {
  margin-top: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--line);
}

.probability-example-content {
  display: grid;
  gap: 0.95rem;
  margin-top: 0.95rem;
}

.probability-example-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.probability-example-card h4 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.06rem;
}

.probability-example-card p {
  margin: 0.35rem 0;
  color: rgba(244, 246, 251, 0.9);
  line-height: 1.55;
}

.probability-example-card .mastery-followup {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.probability-example-card strong {
  color: var(--ink);
}

.probability-example-card .probability-diagram,
.probability-example-card .probability-table {
  margin-top: 0.8rem;
}

.grade-button:hover,
.level-card:hover,
.option-button:not(:disabled):hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(13, 35, 53, 0.14);
}

.grade-button.active,
.level-card.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  border-color: transparent;
}

.grade-button.active {
  background: var(--btn-color);
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.05);
}

.level-card.pending {
  background: #b8332a;
  border-color: #d85a51;
  color: #ffffff;
}

.level-card.pending strong,
.level-card.pending span {
  color: #ffffff;
}

.level-card.completed {
  background: linear-gradient(180deg, rgba(29, 140, 97, 0.2), rgba(17, 82, 57, 0.68));
  border-color: rgba(29, 140, 97, 0.42);
  color: #ffffff;
}

.level-card.completed strong,
.level-card.completed span {
  color: #ffffff;
}

.level-card.pending.active {
  background: #cf3c31;
}

.level-card.completed.active {
  background: linear-gradient(135deg, rgba(39, 171, 116, 0.95), rgba(19, 99, 66, 0.98));
}

.summary-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 16px;
  background: #1b3a63;
  border: 1px solid transparent;
  color: #ffffff;
}

.summary-panel h3,
.summary-panel .summary-row span,
.summary-panel .history-empty {
  color: #ffffff;
}

.summary-panel .summary-row {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0, 168, 107, 0.14);
  font-size: 1rem;
}

.summary-row:last-child {
  border-bottom: 0;
}

#course-time-label,
#daily-time-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(99, 102, 241, 0.9));
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.history-empty {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.history-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.history-item {
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 0.25rem;
}

.history-item strong,
.history-item span,
.history-item small {
  color: var(--ink);
}

.quiz-card {
  background:
    radial-gradient(circle at top right, rgba(255, 210, 122, 0.12), transparent 18%),
    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.12), transparent 24%),
    var(--card-strong);
}

.quiz-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.score-pill {
  min-width: 120px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  text-align: center;
}

.score-pill span {
  display: block;
  font-size: 0.92rem;
}

.score-pill strong {
  font-size: 1.45rem;
  color: var(--ink);
}

.progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 1rem 0 1.25rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  border-radius: inherit;
  transition: width 220ms ease;
}

.question-block {
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 210, 122, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(17, 47, 96, 0.46));
  border: 1px solid rgba(132, 178, 243, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.question-text {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 1.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.question-instruction {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  margin: 0 0 0.9rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(244, 246, 251, 0.92);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 168, 107, 0.16);
}

.question-diagram {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(0, 168, 107, 0.16);
}

.question-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.probability-diagram {
  display: grid;
  gap: 0.6rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.probability-diagram strong {
  color: var(--ink);
}

.probability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.probability-table th,
.probability-table td {
  border: 1px solid rgba(0, 168, 107, 0.22);
  padding: 0.55rem 0.65rem;
  text-align: center;
  color: var(--ink);
}

.probability-table th {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.answer-feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.answer-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 255, 0.95));
  border: 1px solid rgba(124, 118, 220, 0.22);
  box-shadow: 0 14px 34px rgba(7, 22, 44, 0.12);
}

.option-button {
  padding: 1rem;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  border: 1px solid rgba(0, 168, 107, 0.4);
  font-size: 1.06rem;
  box-shadow: 0 10px 24px rgba(18, 47, 93, 0.12);
}

.option-letter {
  flex: 0 0 auto;
  min-width: 1.6rem;
  font-weight: 800;
  color: var(--ink);
}

.option-text {
  flex: 1 1 auto;
  color: var(--ink);
}

.option-button.correct {
  background: linear-gradient(180deg, #0f9d63, #0b7a4d);
  border-color: rgba(15, 157, 99, 0.9);
  box-shadow: 0 0 0 2px rgba(15, 157, 99, 0.28), 0 14px 26px rgba(15, 157, 99, 0.22);
  animation: correct-pop 420ms var(--bounce-ease);
}

@keyframes correct-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06) rotate(-1deg); }
  100% { transform: scale(1); }
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.option-button.wrong {
  background: linear-gradient(180deg, #e11d48, #b0123a);
  border-color: rgba(225, 29, 72, 0.9);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.24), 0 14px 26px rgba(225, 29, 72, 0.2);
  animation: wrong-shake 400ms ease;
}

.writing-response {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.writing-response textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(124, 118, 220, 0.26);
  background: #ffffff;
  color: #3730a3;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
}

.writing-response textarea::placeholder {
  color: rgba(18, 56, 111, 0.55);
}

.feedback-box {
  margin-top: 0;
  padding: 1rem;
  border-radius: 18px;
  background: #334155;
  border: 1px solid rgba(0, 168, 107, 0.16);
  line-height: 1.6;
  color: #ffffff;
  font-size: 1rem;
}

.feedback-box.success {
  background: linear-gradient(180deg, #0f9d63, #0b7a4d);
  border-color: rgba(15, 157, 99, 0.6);
  box-shadow: 0 14px 30px rgba(15, 157, 99, 0.2);
}

.feedback-box.error {
  background: linear-gradient(180deg, #e11d48, #b0123a);
  border-color: rgba(225, 29, 72, 0.55);
  box-shadow: 0 14px 30px rgba(225, 29, 72, 0.2);
}

.hint-box {
  background: #ffffff;
  border-color: rgba(29, 140, 97, 0.34);
  color: #3730a3;
}

.hint-box strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #3730a3;
}

.hint-box div {
  color: #3730a3;
}

.hint-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.2rem;
}

#hint-button {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: rgba(217, 119, 6, 0.4);
  color: #ffffff;
}

.feedback-reaction {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
}

.feedback-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.feedback-title {
  font-weight: 800;
  color: var(--ink);
}

.quiz-actions,
.results-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

#next-button {
  margin-left: auto;
}

.primary-button,
.secondary-button {
  padding: 0.9rem 1.25rem;
  font-weight: 800;
  font-size: 1.02rem;
}

.primary-button {
  background: linear-gradient(135deg, var(--jade), var(--jade-dark));
  color: white;
}

.secondary-button {
  background: #e3f6ee;
  color: var(--brand-dark);
  border: 1.5px solid #a8ddc7;
  box-shadow: none;
  font-weight: 800;
}

.secondary-button:hover {
  background: #d3f0e2;
  border-color: #7fd1ac;
}

.results-breakdown {
  margin-top: 1rem;
}

.results-dashboard {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.results-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.results-metric-card,
.results-chart-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1rem 1.1rem;
}

.results-metric-card {
  display: grid;
  gap: 0.35rem;
}

.results-metric-card strong {
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1;
}

.results-metric-label {
  color: rgba(244, 246, 251, 0.76);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.results-metric-card.success {
  background: rgba(18, 113, 72, 0.28);
  border-color: rgba(34, 190, 121, 0.55);
}

.results-metric-card.error {
  background: rgba(141, 28, 28, 0.3);
  border-color: rgba(228, 82, 82, 0.55);
}

.results-metric-card.highlight {
  background: rgba(37, 87, 158, 0.35);
  border-color: rgba(92, 178, 255, 0.45);
}

.results-accuracy-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.results-accuracy-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1fb86a, #56dca5);
}

.results-chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.95rem;
}

.results-chart-heading strong,
.results-chart-heading span {
  color: var(--ink);
}

.results-chart-heading span {
  font-size: 0.92rem;
  color: rgba(244, 246, 251, 0.74);
}

.results-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.65rem;
  align-items: end;
}

.results-chart-item {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.results-chart-bar {
  display: block;
  width: 100%;
  min-height: 82px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.results-chart-item.is-correct .results-chart-bar {
  background: linear-gradient(180deg, #4ee096, #147646);
  border-color: rgba(76, 224, 150, 0.65);
}

.results-chart-item.is-wrong .results-chart-bar {
  background: linear-gradient(180deg, #ff7b7b, #951b1b);
  border-color: rgba(255, 123, 123, 0.6);
}

.results-chart-item small {
  color: var(--ink);
  font-weight: 700;
}

.result-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
}

.result-item strong {
  color: var(--ink);
}

.review-controls {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

#review-empty {
  margin-top: 0.5rem;
}

.review-controls select {
  min-width: 260px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
}

select option {
  color: #111111;
  background: #ffffff;
}

.hidden {
  display: none;
}

.parent-password-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.parent-password-modal.hidden {
  display: none;
}

.parent-password-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 13, 28, 0.65);
}

.parent-password-modal-card {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  background: var(--card-strong);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid rgba(0, 168, 107, 0.28);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.parent-password-modal-card h3 {
  font-size: 1.25rem;
}

.parent-password-modal-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

.parent-password-modal-error {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.parent-password-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

@media (max-width: 960px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

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

  .hamburger-button {
    min-width: 132px;
  }

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

  .parent-dashboard-analysis-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-select-grid {
    grid-template-columns: 1fr;
  }

  .topic-search-head {
    align-items: stretch;
  }

  .topic-search-toolbar {
    width: 100%;
  }

  .topic-search-toolbar .topic-search-input {
    flex-basis: 100%;
  }

  .topic-search-row {
    grid-template-columns: 1fr;
  }

  .pat-tab-bar {
    flex-direction: column;
  }

  .answer-feedback-layout {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: 100%;
  }

  .hero-chart-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-activity-chart {
    gap: 0.45rem;
  }

  .auth-input-grid {
    grid-template-columns: 1fr;
  }

  .hero-account-actions,
  .auth-actions {
    flex-direction: column;
  }

  .hero-account-actions > *,
  .auth-actions > * {
    width: 100%;
  }
}

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 9999;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(560deg);
    opacity: 0;
  }
}

.celebration-toast {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -12px) scale(0.9);
  background: linear-gradient(135deg, var(--brand), var(--fun-1));
  color: #ffffff;
  font-weight: 800;
  font-size: 1.3rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 168, 107, 0.35);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  animation: celebration-pop 1500ms var(--bounce-ease) forwards;
}

@keyframes celebration-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.08);
  }
  30% {
    transform: translate(-50%, 0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.95);
  }
}
