:root {
  --ink: #2b2240;
  --muted: #6d6380;
  --paper: #fffdf8;
  --card: #ffffff;
  --line: #efe7d8;
  --ok: #2e9b57;
  --ok-bg: #e8f8ee;
  --bad: #e24b4b;
  --bad-bg: #fdeeee;
  --accent: #ff7a45;
  --accent-2: #4f8cff;
  --shadow: 0 16px 40px rgba(62, 38, 18, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Nunito", "Fredoka", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff4e5 0%, #eaf6ff 48%, #f3e9ff 100%);
  overflow-x: hidden;
}

button,
.choice {
  font-family: inherit;
}

.app {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
  position: relative;
  z-index: 1;
}

.bg-blobs .blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}

.b1 {
  width: 280px;
  height: 280px;
  background: #ffd29d;
  top: -80px;
  left: -60px;
}

.b2 {
  width: 320px;
  height: 320px;
  background: #b7e3ff;
  right: -90px;
  top: 120px;
}

.b3 {
  width: 240px;
  height: 240px;
  background: #f3c4ff;
  bottom: -70px;
  left: 30%;
}

.hero,
.panel {
  background: var(--card);
  border: 3px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 28px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.mascot {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: linear-gradient(160deg, #fff7d6, #ffe0b8);
  flex-shrink: 0;
}

.hero h1 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.hero p {
  color: var(--muted);
  margin-top: 6px;
  font-weight: 700;
}

.level-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.level-switch button {
  border: 0;
  background: #fff3e4;
  color: #c45c1a;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.level-switch button.on {
  background: linear-gradient(180deg, #ff935c, #ff6a3d);
  color: #fff;
}

.subject-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subject-switch button {
  border: 0;
  background: #eef4ff;
  color: #2c5bd6;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.subject-switch button.on {
  background: linear-gradient(180deg, #5b8dff, #2c5bd6);
  color: #fff;
}

.picture.math {
  font-size: 1rem;
}

.math-expr {
  font-family: "Fredoka", sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 8px;
  text-align: center;
}

.math-expr.mini {
  font-size: 1.15rem;
  padding: 0 4px;
}

.math-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: "Fredoka", sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
}

.math-compare.mini {
  font-size: 1.2rem;
  gap: 6px;
}

.math-compare i {
  font-style: normal;
  min-width: 42px;
  height: 48px;
  border: 3px dashed #ff8a4c;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ff8a4c;
  font-size: 1.6rem;
}

.math-compare.mini i {
  min-width: 22px;
  height: 26px;
  font-size: 0.9rem;
  border-width: 2px;
}

.math-blank {
  margin-top: 16px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
}

.geo {
  display: block;
}

.geo-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #42a5f5;
}

.geo-square {
  width: 100px;
  height: 100px;
  background: #66bb6a;
}

.geo-triangle {
  width: 0;
  height: 0;
  border-left: 58px solid transparent;
  border-right: 58px solid transparent;
  border-bottom: 100px solid #ffa726;
}

.geo-rect {
  width: 140px;
  height: 78px;
  border-radius: 10px;
  background: #ec407a;
}

.geo-oval {
  width: 132px;
  height: 78px;
  border-radius: 50%;
  background: #ab47bc;
}

.geo-diamond {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  background: #26c6da;
  transform: rotate(45deg);
}

.geo-trap {
  width: 130px;
  height: 70px;
  background: #8d6e63;
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
}

.geo-hex {
  width: 100px;
  height: 110px;
  background: #5c6bc0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.geo.mini {
  transform: scale(0.42);
  transform-origin: center;
}

.geo-diamond.mini {
  transform: rotate(45deg) scale(0.42);
}

.geo-triangle.mini {
  border-left-width: 58px;
  border-right-width: 58px;
}

.spell-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  align-items: center;
}

.spell-letter,
.blank-box {
  min-width: 38px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.spell-letter {
  background: #fff8ea;
  color: var(--ink);
}

.blank-box {
  background: #fff;
  border: 3px dashed #ff8a4c;
  color: #ff8a4c;
}

.statement {
  margin-top: 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  background: #fff8ea;
  border-radius: 16px;
  padding: 12px 16px;
}

.blank-sentence {
  margin-top: 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.blank-slot {
  display: inline-block;
  min-width: 64px;
  padding: 0 8px;
  border-bottom: 4px dashed #ff8a4c;
  color: #ff8a4c;
}

.blank-slot.correct {
  color: var(--ok);
  border-bottom-color: var(--ok);
}

.blank-slot.wrong {
  color: var(--bad);
  border-bottom-color: var(--bad);
}

.tf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tf-btn {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 24px;
  min-height: 110px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tf-btn span {
  font-family: "Nunito", sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
}

.tf-btn.yes.correct,
.choice.correct,
.order-built.correct {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.tf-btn.no.correct {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.tf-btn.wrong,
.order-built.wrong {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: var(--bad);
}

.order-built {
  min-height: 88px;
  margin-top: 16px;
  padding: 10px;
  border: 3px dashed #e0c9a8;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.order-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.order-chip {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 16px;
  min-height: 52px;
  padding: 8px 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-transform: none;
}

.order-chip.on {
  background: #eef4ff;
  border-color: var(--accent-2);
}

.spell-space {
  width: 16px;
}

.pair-seq {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.pair-seq b {
  font-family: "Fredoka", sans-serif;
  font-size: 1.55rem;
  text-transform: lowercase;
}

.match-wrap {
  background: var(--card);
  border: 3px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 20px;
}

.match-prompt {
  text-align: center;
  margin-top: 0;
}

.match-timer {
  display: inline-block;
  min-width: 3.4em;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2c5bd6;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  text-align: center;
}

.match-timer.urgent {
  background: #fdeeee;
  color: #e24b4b;
  animation: pulse 0.75s ease infinite;
}

.matching-board {
  display: grid;
  gap: 10px;
}

.match-row {
  display: grid;
  grid-template-columns: 36px 96px 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
}

.match-index {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #c45c1a;
  text-align: center;
}

.match-pic {
  position: relative;
  height: 96px;
  border-radius: 20px;
  background: #fff8ea;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.match-pic.matched {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.match-pic.wrong {
  background: var(--bad-bg);
  border-color: var(--bad);
}

.match-arrow {
  text-align: center;
  color: #c9b8a4;
  font-size: 1.35rem;
  font-weight: 800;
}

.match-drop {
  min-height: 96px;
  border: 3px dashed #e0c9a8;
  border-radius: 20px;
  background: repeating-linear-gradient(
    -12deg,
    #fffdf8,
    #fffdf8 10px,
    #fff8ee 10px,
    #fff8ee 20px
  );
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.match-drop.over,
.match-drop.awaiting,
.match-drop:hover:not(.matched) {
  border-color: var(--accent-2);
  background: #eef4ff;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.16);
}

.match-drop.matched {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-bg);
  cursor: default;
}

.match-drop.wrong {
  border-style: solid;
  border-color: var(--bad);
  background: var(--bad-bg);
  animation: shake 0.4s ease;
}

.drop-placeholder {
  color: #c2b09a;
  font-weight: 800;
  font-size: 1rem;
}

.placed-word {
  font-family: "Fredoka", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink);
}

.match-drop.matched .placed-word {
  color: var(--ok);
}

.match-drop.wrong .placed-word {
  color: var(--bad);
}

.match-visual {
  display: grid;
  place-items: center;
  min-height: 64px;
}

.match-emoji {
  font-size: 3.2rem;
  line-height: 1;
}

.match-digit {
  font-family: "Fredoka", sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #2c5bd6;
}

.match-swatch {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
}

.match-swatch.bordered {
  border: 3px solid #ddd;
}

.match-speak {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #5b8dff, #2c5bd6);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.word-bank {
  margin-top: 16px;
  padding: 14px;
  background: #fff3e4;
  border-radius: 22px;
}

.bank-label {
  display: block;
  text-align: center;
  font-weight: 800;
  color: #c45c1a;
  margin-bottom: 10px;
}

.word-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.word-chip,
.word-ghost {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 18px;
  min-width: 92px;
  min-height: 58px;
  padding: 8px 16px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: lowercase;
  color: var(--ink);
  cursor: grab;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}

.word-chip.selected {
  border-color: var(--accent-2);
  background: #eef4ff;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.22);
}

.word-chip.dragging {
  opacity: 0.35;
}

.word-chip.correct {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
  cursor: default;
}

.word-chip.wrong {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: var(--bad);
  cursor: default;
}

.word-chip.dim {
  opacity: 0.45;
  cursor: default;
}

.word-chip:disabled {
  cursor: default;
}

.word-ghost {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  margin: 0;
  transform: translate(-50%, -50%) scale(1.08);
  cursor: grabbing;
}

.shape-skirt.mini {
  width: 54px;
  height: 54px;
}

.shape-eraser.mini {
  width: 72px;
  height: 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3e4;
  color: #c45c1a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.quiz-card {
  border: 0;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quiz-card:hover,
.quiz-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  outline: none;
}

.quiz-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  margin-bottom: 12px;
}

.quiz-card h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
}

.quiz-card .en {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}

.meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ghost {
  border: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.progress-wrap {
  flex: 1;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 6px;
}

.bar {
  height: 14px;
  background: #ffe8d2;
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff8a4c, #ff5d7a);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.flash-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.flashcard {
  background: var(--card);
  border-radius: 32px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.picture-wrap {
  position: relative;
  width: min(100%, 340px);
}

.picture-wrap .picture {
  width: 100%;
}

.pic-speak {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #5b8dff, #2c5bd6);
  color: #fff;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(44, 91, 214, 0.35);
  z-index: 2;
}

.pic-speak:hover,
.pic-speak:focus-visible {
  transform: scale(1.06);
  outline: none;
}

.pic-speak.speaking,
.speak.speaking {
  animation: pulse 0.75s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.picture {
  width: min(100%, 340px);
  aspect-ratio: 1;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff8ea, #ffe9c7);
  font-size: 8rem;
  line-height: 1;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.7);
}

.picture.count {
  font-size: 2.4rem;
  padding: 18px;
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
}

.swatch {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.swatch.bordered {
  border: 4px solid #ddd;
}

.shape-skirt {
  width: 150px;
  height: 150px;
  background: #ec407a;
  clip-path: polygon(32% 8%, 68% 8%, 96% 92%, 4% 92%);
  box-shadow: 0 12px 24px rgba(236, 64, 122, 0.28);
}

.shape-eraser {
  width: 170px;
  height: 78px;
  border-radius: 14px 18px 18px 14px;
  background: linear-gradient(90deg, #ff8aa8 0 42%, #fff 42% 52%, #74d3ff 52%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.prompt {
  margin-top: 16px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.choice {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 22px;
  min-height: 92px;
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background 0.12s ease;
}

.choice:hover:not(:disabled) {
  transform: translateY(-3px);
}

.choice.correct {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.choice.wrong {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: var(--bad);
}

.choice.dim {
  opacity: 0.45;
}

.feedback {
  margin-top: 16px;
  min-height: 92px;
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.feedback strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.primary,
.speak {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  background: linear-gradient(180deg, #ff935c, #ff6a3d);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(255, 106, 61, 0.35);
}

.speak {
  background: #eef4ff;
  color: #2c5bd6;
  border-radius: 999px;
  padding: 12px 16px;
}

.hidden {
  display: none !important;
}

.result {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
}

.score-ring {
  width: 160px;
  height: 160px;
  margin: 8px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#ff7a45 calc(var(--p) * 1%), #ffe1cf 0);
}

.score-inner {
  width: 124px;
  height: 124px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 2rem;
}

.stars {
  font-size: 2rem;
  letter-spacing: 4px;
  margin: 8px 0 4px;
}

.review {
  text-align: left;
  margin-top: 18px;
}

.review h3 {
  font-family: "Fredoka", sans-serif;
  margin-bottom: 8px;
}

.review li {
  list-style: none;
  background: #fff8ef;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-speak {
  margin-left: auto;
  padding: 8px 12px;
}

.shake {
  animation: shake 0.4s ease;
}

.pop {
  animation: pop 0.35s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.92);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 820px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .flash-wrap,
  .choices {
    grid-template-columns: 1fr;
  }

  .matching-board {
    gap: 8px;
  }

  .match-row {
    grid-template-columns: 28px 76px 18px minmax(0, 1fr);
    gap: 6px;
  }

  .match-pic,
  .match-drop {
    min-height: 76px;
    height: auto;
    border-radius: 16px;
  }

  .match-emoji {
    font-size: 2.2rem;
  }

  .match-digit {
    font-size: 2rem;
  }

  .match-arrow {
    font-size: 1rem;
  }

  .placed-word {
    font-size: 1.25rem;
  }

  .drop-placeholder {
    font-size: 0.85rem;
  }

  .word-chip,
  .word-ghost {
    min-width: 76px;
    min-height: 48px;
    font-size: 1.15rem;
  }

  .match-speak {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .picture {
    font-size: 6rem;
  }

  .flashcard {
    min-height: 320px;
  }

  .site-nav {
    flex-direction: column;
  }

  .stat-bar,
  .history-row,
  .social-row {
    grid-template-columns: 1fr;
  }
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  background: #fff;
  border: 3px solid #fff;
  border-radius: 22px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.site-nav nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.brand,
.site-nav nav button {
  border: 0;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
}

.site-nav nav button.on {
  background: #fff3e4;
  color: #c45c1a;
}

.brand {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
}

.nav-cta {
  padding: 8px 14px !important;
}

.user-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar.letter {
  display: grid;
  place-items: center;
  background: #ffd29d;
  font-weight: 800;
}

.auth-card,
.account,
.dash-block {
  padding: 28px 24px;
  margin-bottom: 16px;
}

.auth-card {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--muted);
}

.form input,
.form select,
.form textarea {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.form-error,
.form-ok {
  min-height: 1.2em;
  font-weight: 800;
}

.form-error {
  color: var(--bad);
}

.form-ok {
  color: var(--ok);
}

.divider {
  text-align: center;
  margin: 16px 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.social {
  border: 0;
  border-radius: 14px;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
}

.social.google {
  background: #ea4335;
}

.social.facebook {
  background: #1877f2;
}

.switch {
  margin-top: 16px;
  font-weight: 700;
}

.link {
  border: 0;
  background: none;
  color: #2c5bd6;
  font-weight: 800;
  cursor: pointer;
}

.muted {
  color: var(--muted);
  font-weight: 700;
}

.account-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.account h2 {
  font-family: "Fredoka", sans-serif;
  margin: 22px 0 8px;
}

.danger {
  border: 0;
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.danger-row {
  margin-top: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}

.kpi small {
  color: var(--muted);
  font-weight: 800;
}

.kpi b {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 1.6rem;
  margin-top: 4px;
}

.stat-bar {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  font-weight: 800;
}

.track {
  height: 12px;
  background: #ffe8d2;
  border-radius: 999px;
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff8a4c, #ff5d7a);
}

.spark {
  width: 100%;
  height: 90px;
  margin: 8px 0 18px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  background: #fff8ef;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  font: inherit;
}

.h-icon {
  font-size: 1.4rem;
}

.h-main {
  display: grid;
}

.h-main small {
  color: var(--muted);
}

.pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.pill.great {
  background: #e8f8ee;
  color: var(--ok);
}

.pill.good {
  background: #eef4ff;
  color: #2c5bd6;
}

.pill.ok {
  background: #fff3e4;
  color: #c45c1a;
}

.pill.low {
  background: var(--bad-bg);
  color: var(--bad);
}

.eval-line,
.save-note {
  color: var(--muted);
  font-weight: 800;
  margin-top: 6px;
}

.dash-hero {
  align-items: center;
}
