:root {
  --font-heading: "Baloo 2";
  --font-body: "Quicksand";
  --ink: #2f3152;
  --muted: #71748f;
  --paper: #fffdf8;
  --lavender: #a992f4;
  --lavender-soft: #eee8ff;
  --blue: #72b8ec;
  --blue-soft: #e6f5ff;
  --peach: #ff9d82;
  --peach-soft: #fff0e8;
  --yellow: #ffd66b;
  --mint: #85d9bd;
  --line: #e8e4dc;
  --shadow: 0 14px 35px rgba(67, 63, 103, 0.09);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body), sans-serif;
  font-weight: 550;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.paper-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(#dbd7d0 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 64%);
}

.topbar {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  margin: 16px auto 0;
  max-width: 1180px;
  padding: 10px 0;
  position: relative;
  width: calc(100% - 40px);
  z-index: 10;
}

.brand {
  align-items: center;
  display: flex;
  gap: 11px;
}

.brand-mark {
  align-items: center;
  background: var(--lavender);
  border: 3px solid var(--ink);
  border-radius: 14px 14px 18px 12px;
  box-shadow: 3px 3px 0 var(--ink);
  color: white;
  display: flex;
  font-family: var(--font-heading), sans-serif;
  font-size: 24px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  transform: rotate(-4deg);
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-heading), sans-serif;
  font-size: 19px;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  gap: 34px;
  justify-content: center;
}

.nav-links a {
  color: #5e6078;
  font-size: 13px;
  font-weight: 700;
  position: relative;
}

.nav-links a::after {
  background: var(--yellow);
  bottom: -7px;
  content: "";
  height: 3px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) rotate(-1deg) scaleX(0);
  transition: transform 180ms ease;
  width: 110%;
}

.nav-links a:hover::after {
  transform: translateX(-50%) rotate(-1deg) scaleX(1);
}

.streak-pill {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(54, 51, 83, 0.07);
  display: flex;
  font-size: 11px;
  gap: 6px;
  padding: 9px 14px;
}

.streak-pill b {
  color: #735ed5;
}

.nav-account,
.auth-slot {
  align-items: center;
  display: flex;
  gap: 10px;
}

.nav-account {
  justify-content: flex-end;
  min-width: 0;
}

.nav-account > a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.login-button,
.logout-link {
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  padding: 8px 13px;
}

.login-button {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
}

.logout-link {
  border-color: var(--line);
  padding: 6px 9px;
}

.user-chip {
  background: #eef6ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  max-width: 150px;
  overflow: hidden;
  padding: 8px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: 1.06fr 0.94fr;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 610px;
  padding: 70px 0 95px;
  position: relative;
  width: calc(100% - 40px);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.hand-label {
  background: var(--yellow);
  border-radius: 7px;
  color: #625331;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 7px 12px;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

.hero h1 {
  font-family: var(--font-heading), sans-serif;
  font-size: clamp(50px, 7vw, 82px);
  letter-spacing: -0.045em;
  line-height: 0.94;
  margin: 24px 0;
}

.hero h1 span {
  color: #8068df;
  display: inline-block;
  position: relative;
}

.hero h1 span::after {
  background: var(--mint);
  bottom: -6px;
  content: "";
  height: 8px;
  left: 2%;
  opacity: 0.6;
  position: absolute;
  transform: rotate(-2deg);
  width: 96%;
  z-index: -1;
}

.hero-copy > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  max-width: 560px;
}

.hero-actions {
  align-items: center;
  display: flex;
  gap: 24px;
  margin-top: 31px;
}

.primary-btn,
.submit-btn {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 16px;
  box-shadow: 5px 6px 0 #dcd6ff;
  color: white;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 20px;
  justify-content: center;
  padding: 15px 21px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.primary-btn:hover,
.submit-btn:hover:not(:disabled) {
  box-shadow: 3px 4px 0 #dcd6ff;
  transform: translate(2px, 2px);
}

.text-link {
  border-bottom: 2px dashed #aaa1d4;
  color: #5c5679;
  font-size: 12px;
  font-weight: 800;
  padding-bottom: 4px;
}

.trust-row {
  color: #77798d;
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  gap: 16px;
  margin-top: 28px;
}

.hero-art {
  height: 420px;
  position: relative;
}

.mascot-wrap {
  height: 320px;
  left: 50%;
  position: absolute;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 390px;
}

.cloud {
  background: #f7f4ff;
  border: 5px solid var(--ink);
  border-radius: 110px 110px 90px 90px;
  box-shadow: 10px 13px 0 #d8cdfd;
  height: 170px;
  left: 48px;
  position: absolute;
  top: 93px;
  transform: rotate(-1deg);
  width: 300px;
}

.cloud::before,
.cloud::after {
  background: #f7f4ff;
  border: 5px solid var(--ink);
  border-bottom: 0;
  content: "";
  position: absolute;
  z-index: -1;
}

.cloud::before {
  border-radius: 90px 90px 0 0;
  height: 115px;
  left: 29px;
  top: -73px;
  transform: rotate(-10deg);
  width: 120px;
}

.cloud::after {
  border-radius: 90px 90px 0 0;
  height: 138px;
  right: 33px;
  top: -94px;
  transform: rotate(12deg);
  width: 142px;
}

.cloud-eye {
  background: var(--ink);
  border-radius: 50%;
  height: 13px;
  position: absolute;
  top: 65px;
  width: 10px;
}

.cloud-eye.left {
  left: 100px;
}

.cloud-eye.right {
  right: 100px;
}

.cloud-mouth {
  font-family: sans-serif;
  font-size: 28px;
  left: 50%;
  position: absolute;
  top: 72px;
  transform: translateX(-50%);
}

.cloud-cheek {
  background: #ffb0aa;
  border-radius: 50%;
  height: 12px;
  opacity: 0.8;
  position: absolute;
  top: 88px;
  width: 24px;
}

.cloud-cheek.left {
  left: 70px;
}

.cloud-cheek.right {
  right: 70px;
}

.cluster-badge {
  align-items: center;
  background: var(--blue);
  border: 4px solid var(--ink);
  clip-path: polygon(25% 7%, 75% 7%, 98% 50%, 75% 93%, 25% 93%, 2% 50%);
  color: white;
  display: flex;
  font-family: var(--font-heading), sans-serif;
  font-size: 35px;
  font-weight: 800;
  height: 92px;
  justify-content: center;
  position: absolute;
  right: -2px;
  top: 55px;
  transform: rotate(8deg);
  width: 96px;
  z-index: 4;
}

.spark {
  color: #e4a735;
  font-size: 34px;
  position: absolute;
}

.spark-one {
  left: 9px;
  top: 40px;
  transform: rotate(-13deg);
}

.spark-two {
  bottom: 28px;
  right: 0;
}

.speech-card,
.mini-note {
  background: white;
  border: 2px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(47, 49, 82, 0.14);
  position: absolute;
  z-index: 5;
}

.speech-card {
  border-radius: 18px 18px 18px 4px;
  bottom: -3px;
  left: 50%;
  padding: 13px 20px;
  text-align: center;
  transform: translateX(-50%) rotate(-2deg);
  width: 236px;
}

.speech-card span {
  display: block;
  font-size: 11px;
}

.speech-card .jp {
  color: #745fcd;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
}

.mini-note {
  border-radius: 12px;
  font-size: 9px;
  line-height: 1.4;
  padding: 10px 14px;
  text-align: center;
}

.mini-note b {
  font-size: 12px;
}

.note-one {
  background: #fff4c9;
  left: -18px;
  top: 220px;
  transform: rotate(-8deg);
}

.note-two {
  background: #e5fff4;
  right: -12px;
  top: 265px;
  transform: rotate(6deg);
}

.doodle-arrow {
  color: var(--ink);
  font-size: 56px;
  left: 5px;
  position: absolute;
  top: 130px;
  transform: rotate(20deg);
}

.subjects-section,
.method-section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 90px 0;
  position: relative;
  width: calc(100% - 40px);
}

.subjects-section::before {
  background: #f4f0ff;
  border-radius: 50%;
  content: "";
  filter: blur(1px);
  height: 460px;
  left: 50%;
  opacity: 0.55;
  position: absolute;
  top: 65%;
  transform: translate(-50%, -50%);
  width: 1200px;
  z-index: -1;
}

.section-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 38px;
}

.section-heading h2 {
  font-family: var(--font-heading), sans-serif;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 15px 0 0;
}

.section-heading > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  max-width: 320px;
  text-align: right;
}

.subject-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}

.subject-card {
  background: white;
  border: 2px solid transparent;
  border-radius: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  min-height: 332px;
  padding: 24px;
  position: relative;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.subject-card:hover,
.subject-card.active {
  box-shadow: 0 18px 42px rgba(67, 63, 103, 0.15);
  transform: translateY(-6px) rotate(-0.4deg);
}

.subject-card.active {
  border-color: var(--ink);
}

.subject-card.lavender {
  background: linear-gradient(145deg, white 55%, #f0ebff);
}

.subject-card.blue {
  background: linear-gradient(145deg, white 55%, #e9f7ff);
}

.subject-card.peach {
  background: linear-gradient(145deg, white 55%, #fff0e9);
}

.card-top,
.card-bottom,
.listen-top,
.card-heading-row,
.submit-row,
.sidebar-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.subject-number {
  color: #adaebc;
  font-family: var(--font-heading), sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.subject-emoji {
  align-items: center;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 4px 0 var(--ink);
  display: flex;
  font-size: 25px;
  height: 52px;
  justify-content: center;
  transform: rotate(4deg);
  width: 52px;
}

.jp-label {
  color: #8d7fc6;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-top: 18px;
}

.subject-card h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 25px;
  margin: 4px 0 9px;
}

.subject-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  min-height: 54px;
}

.progress-line {
  background: rgba(47, 49, 82, 0.09);
  border-radius: 999px;
  height: 7px;
  margin: 23px 0 11px;
  overflow: hidden;
}

.progress-line span {
  background: var(--lavender);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 240ms ease;
}

.blue .progress-line span {
  background: var(--blue);
}

.peach .progress-line span {
  background: var(--peach);
}

.card-bottom {
  color: var(--muted);
  font-size: 9px;
}

.card-bottom b {
  color: var(--ink);
  font-size: 10px;
}

.practice-shell {
  background: #f5f2ec;
  border-bottom: 1px solid #e5e0d8;
  border-top: 1px solid #e5e0d8;
  display: grid;
  grid-template-columns: 280px minmax(0, 880px);
  justify-content: center;
  min-height: 800px;
  position: relative;
}

.lesson-sidebar {
  background: #fdfbf6;
  border-left: 1px solid #e4dfd6;
  border-right: 1px solid #e4dfd6;
  padding: 32px 18px;
}

.sidebar-title {
  justify-content: flex-start;
  gap: 12px;
  padding: 0 8px 21px;
}

.sidebar-title > span {
  font-size: 28px;
}

.sidebar-title small,
.sidebar-title h3 {
  display: block;
  margin: 0;
}

.sidebar-title small {
  color: #8b7ac5;
  font-size: 9px;
}

.sidebar-title h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 16px;
}

.lesson-list {
  display: grid;
  gap: 7px;
}

.lesson-list button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 30px 1fr 12px;
  padding: 11px 10px;
  text-align: left;
  transition: background 150ms ease;
}

.lesson-list button:hover {
  background: #f0ecff;
}

.lesson-list button.selected {
  background: var(--ink);
  color: white;
}

.lesson-list button.completed:not(.selected) {
  background: #eefaf5;
}

.lesson-list button.completed:not(.selected) .lesson-index {
  background: var(--mint);
  border-color: #62bea1;
  color: #174f40;
}

.lesson-list button.completed:not(.selected) small {
  color: #31826d;
  font-weight: 800;
}

.lesson-list button.completed.selected .lesson-index {
  background: var(--mint);
  border-color: var(--mint);
  color: #174f40;
}

.lesson-index {
  align-items: center;
  background: white;
  border: 1px solid #ddd8cf;
  border-radius: 9px;
  color: var(--ink);
  display: flex;
  font-size: 10px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.lesson-list b,
.lesson-list small {
  display: block;
}

.lesson-list b {
  font-size: 10px;
  margin-bottom: 2px;
}

.lesson-list small {
  color: #9696a4;
  font-size: 8px;
}

.selected small {
  color: #c9c6db;
}

.chevron {
  font-size: 18px;
}

.sidebar-tip {
  align-items: flex-start;
  background: #fff5c9;
  border: 1px dashed #d7bf61;
  border-radius: 13px;
  display: flex;
  font-size: 9px;
  gap: 8px;
  line-height: 1.5;
  margin: 26px 8px 0;
  padding: 12px;
  transform: rotate(-1deg);
}

.sidebar-tip p {
  margin: 0;
}

.practice-main {
  background: white;
  border-right: 1px solid #e4dfd6;
  padding: 38px 38px 62px;
}

.practice-header {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 27px;
}

.breadcrumb {
  color: #9394a5;
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.practice-header h2 {
  font-family: var(--font-heading), sans-serif;
  font-size: 31px;
  line-height: 1;
  margin: 0;
}

.practice-header p {
  color: var(--muted);
  font-size: 10px;
  margin: 6px 0 0;
}

.level-tabs {
  background: #f2efe9;
  border-radius: 13px;
  display: flex;
  gap: 3px;
  padding: 4px;
}

.level-tabs button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #777888;
  cursor: pointer;
  display: flex;
  font-size: 8px;
  font-weight: 800;
  gap: 5px;
  padding: 8px 9px;
}

.level-tabs button span {
  align-items: center;
  border: 1px solid #c8c5bf;
  border-radius: 50%;
  display: flex;
  height: 16px;
  justify-content: center;
  width: 16px;
}

.level-tabs button.active {
  background: white;
  box-shadow: 0 3px 10px rgba(47, 49, 82, 0.08);
  color: var(--ink);
}

.level-tabs button.active span {
  background: var(--lavender);
  border-color: var(--lavender);
  color: white;
}

.level-tabs button.completed:not(.active) {
  color: #31826d;
}

.level-tabs button.completed:not(.active) span {
  background: var(--mint);
  border-color: var(--mint);
  color: #174f40;
}

.level-tabs button.completed:not(.active) span::after {
  content: "✓";
}

.level-tabs button.completed:not(.active) span {
  font-size: 0;
}

.level-tabs button.completed.active::after {
  color: #31826d;
  content: "✓";
  font-size: 9px;
}

.listen-card {
  background: linear-gradient(135deg, #f4f0ff, #eaf7ff);
  border: 1px solid #dcd5f4;
  border-radius: 21px;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 21px;
  position: relative;
}

.listen-card::after {
  color: rgba(128, 104, 223, 0.08);
  content: "あ";
  font-family: var(--font-heading), sans-serif;
  font-size: 130px;
  position: absolute;
  right: 30px;
  top: -44px;
}

.listen-top {
  justify-content: flex-start;
  gap: 13px;
  position: relative;
  z-index: 2;
}

.headphones {
  align-items: center;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 15px;
  box-shadow: 3px 4px 0 var(--ink);
  display: flex;
  font-size: 24px;
  height: 49px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 49px;
}

.tiny-label {
  color: #7a6db2;
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.listen-top h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 18px;
  margin: 2px 0;
}

.listen-top p {
  color: #77788f;
  font-size: 8px;
  margin: 0;
}

.play-counter {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 8px;
  margin-left: auto;
  padding: 7px 10px;
}

.audio-control {
  align-items: center;
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(71, 63, 113, 0.08);
  display: flex;
  gap: 14px;
  margin-top: 18px;
  padding: 11px 15px;
  position: relative;
  z-index: 2;
}

.play-btn {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  font-size: 11px;
  height: 38px;
  justify-content: center;
  padding-left: 3px;
  width: 38px;
}

.play-btn:disabled {
  background: var(--mint);
  cursor: default;
  padding-left: 0;
}

.fake-wave {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 2px;
  height: 40px;
  overflow: hidden;
}

.fake-wave i {
  background: #b9a9ec;
  border-radius: 2px;
  display: block;
  min-width: 2px;
  opacity: 0.72;
  width: 3px;
}

.audio-control > span {
  color: #77788f;
  font-size: 8px;
  font-weight: 800;
}

.keyword-hints {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 8px;
  gap: 7px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
}

.keyword-hints > span {
  color: #77788f;
}

.keyword-hints b {
  background: #fff7d9;
  border-radius: 6px;
  color: #675c38;
  padding: 5px 8px;
}

.exercise-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}

.dictation-card,
.quiz-card,
.transcript-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 7px 19px rgba(47, 49, 82, 0.04);
  padding: 19px;
}

.card-heading-row {
  align-items: flex-start;
  margin-bottom: 14px;
}

.card-heading-row > div {
  align-items: center;
  display: flex;
  gap: 8px;
}

.card-heading-row h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 15px;
  margin: 0;
}

.step-badge {
  align-items: center;
  background: var(--lavender-soft);
  border-radius: 8px;
  color: #705bc6;
  display: flex;
  font-size: 8px;
  height: 25px;
  justify-content: center;
  transform: rotate(-4deg);
  width: 27px;
}

.step-badge.yellow {
  background: #fff3c1;
  color: #94771f;
}

.points {
  background: #f1efeb;
  border-radius: 999px;
  color: #77788f;
  font-size: 7px;
  padding: 5px 8px;
}

.dictation-card textarea {
  background: #fbfaf7;
  border: 1px dashed #ccc6ba;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.9;
  min-height: 180px;
  outline: none;
  padding: 14px;
  resize: vertical;
  transition: border 150ms ease, box-shadow 150ms ease;
  width: 100%;
}

.japanese-input-tools {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: -2px 0 10px;
}

.ime-label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.ime-modes {
  background: #f2efe9;
  border-radius: 9px;
  display: flex;
  gap: 2px;
  padding: 3px;
}

.ime-modes button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #777888;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  padding: 6px 8px;
}

.ime-modes button.active {
  background: white;
  box-shadow: 0 2px 7px rgba(47, 49, 82, 0.1);
  color: #6556c8;
}

.ime-help {
  align-items: flex-start;
  color: #8b8998;
  display: flex;
  font-size: 7px;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.5;
  margin-top: 8px;
}

.ime-help b {
  color: #6556c8;
}

.ime-help kbd {
  background: #f2efe9;
  border: 1px solid #ddd8cf;
  border-radius: 4px;
  font: inherit;
  padding: 1px 4px;
}

.ime-help > span:last-child {
  flex: 0 0 auto;
}

.dictation-card textarea:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--lavender-soft);
}

.dictation-card textarea::placeholder {
  color: #c0bdc4;
}

.textarea-foot {
  color: #9998a5;
  display: flex;
  font-size: 7px;
  justify-content: space-between;
  margin-top: 8px;
}

.quiz-card fieldset {
  border: 0;
  margin: 0 0 13px;
  padding: 0;
}

.quiz-card legend {
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 7px;
}

.answer-options {
  display: grid;
  gap: 5px;
}

.answer-options label {
  align-items: center;
  background: #fbfaf7;
  border: 1px solid #ebe7df;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  font-size: 8px;
  gap: 8px;
  padding: 7px 9px;
}

.answer-options label.chosen {
  background: #f0ecff;
  border-color: #a996e9;
}

.answer-options input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.answer-options label > span {
  align-items: center;
  background: white;
  border: 1px solid #ddd8cf;
  border-radius: 6px;
  display: flex;
  font-size: 7px;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.answer-options label.chosen > span {
  background: var(--lavender);
  border-color: var(--lavender);
  color: white;
}

.submit-row {
  background: #f9f7f2;
  border-radius: 14px;
  margin-top: 18px;
  padding: 13px 15px;
}

.submit-row b,
.submit-row span {
  display: block;
}

.submit-row b {
  font-size: 9px;
  margin-bottom: 2px;
}

.submit-row > div > span {
  color: #888894;
  font-size: 7px;
}

.submit-btn {
  box-shadow: 3px 4px 0 #dcd6ff;
  font-size: 9px;
  gap: 9px;
  padding: 10px 15px;
}

.submit-btn:disabled {
  background: #aaa8b0;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.result-card {
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 19px;
  box-shadow: 6px 7px 0 var(--ink);
  display: flex;
  gap: 24px;
  margin-top: 22px;
  padding: 18px 22px;
}

.result-card.passed {
  background: #e8fff3;
}

.result-card.retry {
  background: #fff3df;
}

.result-score {
  align-items: baseline;
  border-right: 1px dashed rgba(47, 49, 82, 0.3);
  display: flex;
  flex-wrap: wrap;
  min-width: 115px;
  padding-right: 20px;
}

.result-score > span {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  width: 100%;
}

.result-score strong {
  font-family: var(--font-heading), sans-serif;
  font-size: 47px;
  line-height: 1;
}

.result-score small {
  color: var(--muted);
  font-size: 9px;
}

.result-copy {
  flex: 1;
}

.result-copy h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 16px;
  margin: 0 0 8px;
}

.metric-row {
  display: flex;
  font-size: 8px;
  gap: 12px;
  margin-bottom: 10px;
}

.result-copy button {
  background: white;
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  padding: 7px 10px;
}

.transcript-card {
  background: #fffdf4;
  margin-top: 21px;
  position: relative;
}

.tape {
  background: rgba(255, 214, 107, 0.75);
  font-size: 7px;
  font-weight: 900;
  left: 50%;
  letter-spacing: 0.12em;
  padding: 6px 22px;
  position: absolute;
  top: -11px;
  transform: translateX(-50%) rotate(-1deg);
}

.transcript-card h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 18px;
  margin: 7px 0 13px;
}

.transcript-card > p {
  align-items: flex-start;
  display: flex;
  font-size: 12px;
  gap: 10px;
  line-height: 1.7;
  margin: 6px 0;
}

.transcript-card > p b {
  align-items: center;
  background: var(--lavender-soft);
  border-radius: 7px;
  display: flex;
  flex: 0 0 auto;
  font-size: 8px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.translation {
  background: white;
  border-left: 4px solid var(--mint);
  border-radius: 7px;
  display: flex;
  font-size: 9px;
  gap: 15px;
  line-height: 1.6;
  margin-top: 13px;
  padding: 10px 12px;
}

.translation b {
  flex: 0 0 auto;
}

.hand-label.mint {
  background: #cbf2e3;
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.method-item {
  padding: 25px 30px;
  position: relative;
  text-align: center;
}

.method-number {
  color: #c9c7ce;
  font-family: var(--font-heading), sans-serif;
  font-size: 11px;
  left: 17px;
  position: absolute;
  top: 8px;
}

.method-icon {
  align-items: center;
  background: #f0ebff;
  border: 2px solid var(--ink);
  border-radius: 17px;
  box-shadow: 4px 5px 0 var(--ink);
  display: flex;
  font-size: 28px;
  height: 65px;
  justify-content: center;
  margin: 0 auto 17px;
  transform: rotate(-3deg);
  width: 65px;
}

.method-item:nth-child(2) .method-icon {
  background: #fff1cb;
  transform: rotate(3deg);
}

.method-item:nth-child(3) .method-icon {
  background: #ddf7ff;
}

.method-item:nth-child(4) .method-icon {
  background: #dff8ed;
  transform: rotate(2deg);
}

.method-item h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 20px;
  margin: 0 0 5px;
}

.method-item p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.flow-arrow {
  color: #aaa3c8;
  font-size: 32px;
  position: absolute;
  right: -14px;
  top: 50px;
  transform: rotate(-7deg);
}

.feedback-section {
  align-items: center;
  background: #f2efff;
  border: 1px solid #ddd5f7;
  border-radius: 30px;
  display: grid;
  gap: 55px;
  grid-template-columns: 0.85fr 1.15fr;
  margin: 10px auto 90px;
  max-width: 1120px;
  padding: 48px;
  position: relative;
  width: calc(100% - 40px);
}

.feedback-copy h2 {
  font-family: var(--font-heading), sans-serif;
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1;
  margin: 20px 0 12px;
}

.feedback-copy p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.feedback-copy a {
  color: #6853c7;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 8px;
  text-decoration: underline;
}

.feedback-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 25px;
}

.feedback-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.feedback-form label {
  color: var(--ink);
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.feedback-form input,
.feedback-form textarea {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: block;
  font-size: 11px;
  margin-top: 7px;
  outline: none;
  padding: 12px 13px;
  resize: vertical;
  width: 100%;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--lavender-soft);
}

.feedback-honeypot {
  left: -10000px;
  position: absolute;
}

.feedback-submit {
  align-items: center;
  display: flex;
  gap: 15px;
}

.feedback-submit .primary-btn {
  border: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.feedback-submit .primary-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

.feedback-submit p {
  color: var(--muted);
  font-size: 9px;
  margin: 0;
}

.feedback-submit p.success {
  color: #31826d;
  font-weight: 800;
}

.feedback-submit p.error {
  color: #b34f46;
  font-weight: 800;
}

footer {
  align-items: center;
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 28px max(28px, calc((100vw - 1120px) / 2));
}

.footer-brand .brand-mark {
  border-color: white;
  box-shadow: 3px 3px 0 white;
}

.footer-brand small {
  color: #c3c0d2;
}

footer > p,
footer > span {
  color: #c9c6d7;
  font-size: 9px;
}

.save-notice {
  color: var(--muted);
  font-size: 11px;
  margin: 10px 0 0;
}

.save-notice a {
  color: #6556c8;
  font-weight: 800;
  text-decoration: underline;
}

.save-notice.saved {
  color: #31826d;
  font-weight: 800;
}

.leaderboard-hero {
  margin: 0 auto;
  max-width: 800px;
  padding: 70px 28px 25px;
  text-align: center;
  width: calc(100% - 40px);
}

.leaderboard-hero h1 {
  font-family: var(--font-heading), sans-serif;
  font-size: clamp(42px, 7vw, 70px);
  line-height: 1;
  margin: 14px 0;
}

.leaderboard-hero p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 610px;
}

.leaderboard-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  margin: 20px auto 80px;
  max-width: 860px;
  overflow: hidden;
  width: calc(100% - 40px);
}

.leaderboard-head,
.leaderboard-row {
  align-items: center;
  display: grid;
  grid-template-columns: 65px minmax(180px, 1fr) minmax(250px, auto);
}

.leaderboard-head {
  background: #f2efff;
  padding: 18px 25px;
}

.leaderboard-head > div:first-child {
  grid-column: 2;
}

.leaderboard-head > div:last-child {
  grid-column: 3;
  text-align: right;
}

.leaderboard-head b,
.leaderboard-head span,
.leaderboard-user b,
.leaderboard-user span {
  display: block;
}

.leaderboard-head b {
  font-family: var(--font-heading), sans-serif;
  font-size: 16px;
}

.leaderboard-head span,
.leaderboard-user span,
.leaderboard-breakdown {
  color: var(--muted);
  font-size: 10px;
}

.leaderboard-row {
  border-top: 1px dashed var(--line);
  gap: 15px;
  padding: 17px 25px;
}

.leaderboard-rank {
  font-family: var(--font-heading), sans-serif;
  font-size: 24px;
  text-align: center;
}

.leaderboard-user b {
  font-size: 13px;
}

.leaderboard-breakdown {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.leaderboard-breakdown span {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  display: flex;
  gap: 10px;
  min-width: 112px;
  padding: 8px 11px;
}

.leaderboard-breakdown .bundle-count {
  background: var(--lavender-soft);
  border-color: #d9cffd;
}

.leaderboard-breakdown .lesson-count {
  background: var(--blue-soft);
  border-color: #cbe8fa;
}

.leaderboard-breakdown small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.leaderboard-breakdown b {
  color: var(--ink);
  font-family: var(--font-heading), sans-serif;
  font-size: 22px;
  line-height: 1;
  margin-left: auto;
}

.leaderboard-loading,
.leaderboard-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 45px 20px;
  text-align: center;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    gap: 20px;
    grid-template-columns: 1fr 0.8fr;
  }

  .hero-art {
    transform: scale(0.82);
    transform-origin: center;
  }

  .practice-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .practice-main {
    padding: 30px 24px 50px;
  }

  .practice-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .exercise-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
    margin-top: 10px;
    padding: 7px 0;
  }

  .streak-pill span:last-child {
    display: none;
  }

  .hero {
    display: flex;
    flex-direction: column;
    padding: 55px 0 70px;
    text-align: center;
  }

  .hero-copy > p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .trust-row {
    justify-content: center;
  }

  .hero-art {
    height: 350px;
    margin-top: 20px;
    width: 100%;
  }

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

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

  .section-heading > p {
    text-align: left;
  }

  .practice-shell {
    display: block;
  }

  .lesson-sidebar {
    border-left: 0;
    border-right: 0;
    padding: 24px 18px 13px;
  }

  .lesson-list {
    display: flex;
    margin: 0 -18px;
    overflow-x: auto;
    padding: 0 18px 12px;
  }

  .lesson-list button {
    flex: 0 0 190px;
  }

  .sidebar-tip {
    display: none;
  }

  .practice-main {
    border-right: 0;
    padding: 28px 18px 45px;
  }

  .level-tabs {
    overflow-x: auto;
    width: 100%;
  }

  .level-tabs button {
    flex: 1 0 auto;
  }

  .listen-top {
    flex-wrap: wrap;
  }

  .play-counter {
    margin-left: 0;
  }

  .submit-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .submit-btn {
    width: 100%;
  }

  .result-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-score {
    border-bottom: 1px dashed rgba(47, 49, 82, 0.3);
    border-right: 0;
    padding-bottom: 12px;
    padding-right: 0;
    width: 100%;
  }

  .method-flow {
    grid-template-columns: 1fr 1fr;
  }

  .feedback-section {
    gap: 30px;
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .flow-arrow {
    display: none;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
}

@media (max-width: 460px) {
  .japanese-input-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .ime-modes {
    width: 100%;
  }

  .ime-modes button {
    flex: 1;
  }

  .ime-help > span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-art {
    transform: scale(0.68);
    width: 145%;
  }

  .subjects-section,
  .method-section {
    padding: 70px 18px;
  }

  .method-flow {
    grid-template-columns: 1fr;
  }

  .feedback-section {
    border-radius: 22px;
    padding: 22px 16px;
  }

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

  .feedback-form {
    padding: 18px;
  }

  .feedback-submit {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-row {
    flex-wrap: wrap;
  }
}

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

/* Multi-page level and roadmap experience */

.level-hero {
  min-height: 590px;
}

.levels-section {
  margin: 0 auto;
  max-width: 1120px;
  padding: 90px 0 110px;
  position: relative;
  width: calc(100% - 40px);
}

.level-map {
  display: grid;
  gap: 14px;
}

.level-card {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 21px;
  box-shadow: 0 8px 24px rgba(47, 49, 82, 0.06);
  display: grid;
  gap: 22px;
  grid-template-columns: 78px 1fr auto;
  min-height: 105px;
  overflow: hidden;
  padding: 14px 22px;
  position: relative;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.level-card::after {
  background: var(--lavender-soft);
  border-radius: 50%;
  content: "";
  height: 150px;
  opacity: 0.65;
  position: absolute;
  right: -35px;
  top: -70px;
  width: 150px;
  z-index: 0;
}

.level-card.blue::after {
  background: var(--blue-soft);
}

.level-card.mint::after {
  background: #e2f8ef;
}

.level-card.peach::after {
  background: var(--peach-soft);
}

.level-card.yellow::after {
  background: #fff5cf;
}

.active-level:hover {
  box-shadow: var(--shadow);
  transform: translateX(8px) rotate(-0.15deg);
}

.locked-level {
  filter: saturate(0.65);
  opacity: 0.7;
}

.level-orb {
  align-items: center;
  background: var(--lavender-soft);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--ink);
  display: flex;
  font-family: var(--font-heading), sans-serif;
  font-size: 25px;
  font-weight: 800;
  height: 68px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 68px;
}

.blue .level-orb {
  background: var(--blue-soft);
}

.mint .level-orb {
  background: #def8ed;
}

.peach .level-orb {
  background: var(--peach-soft);
}

.yellow .level-orb {
  background: #fff4c5;
}

.level-info > span {
  color: #8472ce;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.level-info h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 22px;
  line-height: 1;
  margin: 3px 0 4px;
}

.level-info p {
  color: var(--muted);
  font-size: 10px;
  margin: 0;
}

.level-action {
  font-size: 10px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.roadmap-hero {
  align-items: center;
  display: grid;
  gap: 55px;
  grid-template-columns: 1fr 300px;
  margin: 0 auto;
  max-width: 1080px;
  padding: 80px 0 55px;
  position: relative;
  width: calc(100% - 40px);
}

.roadmap-hero h1 {
  font-family: var(--font-heading), sans-serif;
  font-size: clamp(47px, 7vw, 76px);
  letter-spacing: -0.045em;
  line-height: 0.94;
  margin: 20px 0;
}

.roadmap-hero h1 span {
  color: #8068df;
}

.roadmap-hero > div:first-child > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  max-width: 600px;
}

.roadmap-summary {
  background: #f0ebff;
  border: 2px solid var(--ink);
  border-radius: 30px;
  box-shadow: 8px 9px 0 var(--ink);
  padding: 28px;
  position: relative;
  transform: rotate(1.5deg);
}

.summary-cloud {
  font-size: 41px;
  position: absolute;
  right: 21px;
  top: 18px;
}

.roadmap-summary strong {
  display: block;
  font-family: var(--font-heading), sans-serif;
  font-size: 58px;
  line-height: 0.9;
}

.roadmap-summary small {
  color: var(--muted);
  display: block;
  font-size: 9px;
  margin-top: 6px;
}

.roadmap-summary p {
  color: var(--muted);
  font-size: 8px;
  margin: 0;
}

.roadmap-section {
  margin: 0 auto;
  max-width: 1000px;
  padding: 25px 0 110px;
  position: relative;
  width: calc(100% - 40px);
}

.roadmap-line {
  border-left: 3px dashed #d8d1ee;
  bottom: 120px;
  left: 65px;
  position: absolute;
  top: 55px;
  z-index: -1;
}

.roadmap-row {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 19px;
  display: grid;
  gap: 17px;
  grid-template-columns: 45px 53px 1fr auto;
  margin-bottom: 12px;
  min-height: 105px;
  padding: 14px 18px 14px 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.active-topic {
  box-shadow: 0 10px 26px rgba(47, 49, 82, 0.08);
}

.active-topic:hover {
  box-shadow: var(--shadow);
  transform: translateX(8px);
}

.planned-topic {
  background: rgba(255, 255, 255, 0.68);
  opacity: 0.68;
}

.roadmap-number {
  align-items: center;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  font-family: var(--font-heading), sans-serif;
  font-size: 12px;
  font-weight: 800;
  height: 39px;
  justify-content: center;
  width: 39px;
}

.active-topic .roadmap-number {
  background: var(--lavender-soft);
}

.roadmap-emoji {
  align-items: center;
  background: #f7f4ee;
  border-radius: 14px;
  display: flex;
  font-size: 24px;
  height: 49px;
  justify-content: center;
  width: 49px;
}

.roadmap-copy > span {
  color: #8f81c5;
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.roadmap-copy h2 {
  font-family: var(--font-heading), sans-serif;
  font-size: 19px;
  line-height: 1;
  margin: 3px 0;
}

.roadmap-copy p {
  color: var(--muted);
  font-size: 9px;
  margin: 0;
}

.roadmap-meta {
  min-width: 120px;
  text-align: right;
}

.roadmap-meta span,
.roadmap-meta b {
  display: block;
}

.roadmap-meta span {
  color: var(--muted);
  font-size: 8px;
  margin-bottom: 5px;
}

.roadmap-meta b {
  font-size: 9px;
}

.topic-breadcrumb {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 9px;
  gap: 8px;
}

.topic-breadcrumb b {
  color: var(--ink);
}

.topic-banner {
  align-items: center;
  background: #f0ebff;
  border: 1px solid #dfd7f7;
  border-radius: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: 74px 1fr auto;
  margin: 35px auto 30px;
  max-width: 1120px;
  padding: 22px 27px;
  position: relative;
  width: calc(100% - 40px);
}

.topic-banner.blue {
  background: var(--blue-soft);
  border-color: #cfeafa;
}

.topic-banner.peach {
  background: var(--peach-soft);
  border-color: #f7dace;
}

.topic-banner-icon {
  align-items: center;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 5px 0 var(--ink);
  display: flex;
  font-size: 31px;
  height: 65px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 65px;
}

.topic-banner > div:nth-child(2) > span {
  color: #806fbd;
  font-size: 9px;
  font-weight: 800;
}

.topic-banner h1 {
  font-family: var(--font-heading), sans-serif;
  font-size: 30px;
  line-height: 1;
  margin: 2px 0;
}

.topic-banner p {
  color: var(--muted);
  font-size: 9px;
  margin: 0;
}

.topic-mode-tabs {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.topic-mode-tabs button {
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  padding: 10px 13px;
}

.topic-mode-tabs button.active {
  background: var(--ink);
  color: white;
}

.topic-mode-tabs button span {
  align-items: center;
  background: var(--yellow);
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  font-size: 7px;
  height: 17px;
  justify-content: center;
  margin-left: 4px;
  width: 17px;
}

.topic-practice {
  border-radius: 26px 26px 0 0;
  margin: 0 auto 80px;
  max-width: 1120px;
  overflow: hidden;
  width: calc(100% - 40px);
}

.grading-note {
  align-items: flex-start;
  background: #eef8ff;
  border: 1px dashed #9dcced;
  border-radius: 13px;
  display: flex;
  font-size: 8px;
  gap: 10px;
  line-height: 1.55;
  margin-top: 18px;
  padding: 12px 14px;
}

.grading-note > span {
  font-size: 18px;
}

.grading-note b {
  display: block;
  font-size: 9px;
  margin-bottom: 2px;
}

.grading-note p {
  color: #667082;
  margin: 0;
}

.score-note {
  background: #eef8ff;
  border-radius: 8px;
  color: #697083;
  font-size: 8px;
  line-height: 1.55;
  margin-top: 10px;
  padding: 9px 11px;
}

.error-card {
  background: #fff0ed;
  border: 1px solid #f0b8af;
  border-radius: 12px;
  color: #9b493f;
  font-size: 10px;
  margin-top: 18px;
  padding: 13px;
}

.bundle-section {
  margin: 0 auto;
  max-width: 1120px;
  padding: 55px 0 110px;
  width: calc(100% - 40px);
}

.bundle-intro {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: 0 auto 40px;
  max-width: 680px;
  text-align: center;
}

.bundle-intro h2 {
  font-family: var(--font-heading), sans-serif;
  font-size: 48px;
  line-height: 1;
  margin: 18px 0 9px;
}

.bundle-intro p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.bundle-intro .primary-btn {
  margin-top: 14px;
}

.bundle-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 0.8fr 1.2fr;
}

.playlist-card,
.bundle-quiz-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 21px;
}

.playlist-heading {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px 1fr auto;
  margin-bottom: 16px;
}

.playlist-heading > span {
  align-items: center;
  background: var(--lavender-soft);
  border-radius: 12px;
  display: flex;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.playlist-heading small {
  color: #8778c2;
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.playlist-heading h3 {
  font-family: var(--font-heading), sans-serif;
  font-size: 18px;
  margin: 1px 0 0;
}

.playlist-heading > b {
  background: #eef8ff;
  border-radius: 999px;
  color: #5f7d92;
  font-size: 7px;
  padding: 6px 8px;
}

.playlist-row {
  align-items: center;
  background: #fbfaf7;
  border: 1px solid #ebe7df;
  border-radius: 11px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px 1fr 20px;
  margin-top: 7px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.playlist-row.playing {
  background: #f0ebff;
  border-color: #a997e8;
}

.playlist-row > span {
  color: #8c80bc;
  font-size: 8px;
  font-weight: 900;
}

.playlist-row b,
.playlist-row small {
  display: block;
}

.playlist-row b {
  font-size: 9px;
}

.playlist-row small {
  color: var(--muted);
  font-size: 7px;
  margin-top: 2px;
}

.playlist-row i {
  font-size: 9px;
  font-style: normal;
  text-align: center;
}

.bundle-question {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
}

.bundle-question legend {
  font-size: 9px;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 6px;
}

.bundle-submit {
  margin-top: 19px;
  width: 100%;
}

.bundle-score {
  align-items: baseline;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  margin-top: 17px;
  padding: 14px;
}

.bundle-score.passed {
  background: #e8fff3;
}

.bundle-score.retry {
  background: #fff3df;
}

.bundle-score strong {
  font-family: var(--font-heading), sans-serif;
  font-size: 40px;
  line-height: 1;
}

.bundle-score span {
  color: var(--muted);
  font-size: 9px;
}

.bundle-score p {
  font-size: 9px;
  margin: 0 0 0 14px;
}

.not-found {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 30px;
  text-align: center;
}

.not-found-cloud {
  font-size: 100px;
}

.not-found h1 {
  font-family: var(--font-heading), sans-serif;
  font-size: 50px;
  margin: 18px 0 5px;
}

.not-found p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  max-width: 500px;
}

.not-found .primary-btn {
  margin-top: 20px;
}

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

  .roadmap-summary {
    max-width: 340px;
  }

  .topic-breadcrumb {
    display: none;
  }

  .topic-banner {
    border-radius: 22px;
    grid-template-columns: 60px 1fr;
    margin: 20px auto;
  }

  .topic-mode-tabs {
    grid-column: 1 / -1;
  }

  .topic-mode-tabs button {
    flex: 1;
  }

  .topic-practice {
    border-radius: 22px 22px 0 0;
    margin-bottom: 50px;
  }

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

@media (max-width: 620px) {
  .nav-account > a {
    display: none;
  }

  .user-chip {
    max-width: 90px;
  }

  .level-card {
    gap: 13px;
    grid-template-columns: 58px 1fr;
    padding: 14px;
  }

  .level-orb {
    font-size: 20px;
    height: 52px;
    width: 52px;
  }

  .level-action {
    grid-column: 2;
  }

  .roadmap-hero {
    padding: 55px 18px 40px;
  }

  .roadmap-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .roadmap-line {
    left: 46px;
  }

  .roadmap-row {
    gap: 10px;
    grid-template-columns: 40px 1fr auto;
    padding-right: 13px;
  }

  .roadmap-emoji {
    display: none;
  }

  .roadmap-meta {
    min-width: auto;
  }

  .roadmap-meta span {
    display: none;
  }

  .topic-banner {
    padding: 18px;
  }

  .topic-banner-icon {
    font-size: 25px;
    height: 53px;
    width: 53px;
  }

  .bundle-section {
    padding: 45px 18px 80px;
  }

  .bundle-intro h2 {
    font-size: 39px;
  }

  .leaderboard-card {
    border-radius: 22px;
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard-row {
    gap: 9px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 14px;
  }

  .leaderboard-breakdown {
    grid-column: 2;
    justify-content: flex-start;
  }

  .leaderboard-breakdown span {
    min-width: 0;
    width: min(130px, 48%);
  }
}
