:root {
  --navy: #0b1f3a;
  --navy-2: #17365d;
  --blue: #2468a2;
  --sky: #dcecf6;
  --yellow: #f4cf3a;
  --red: #c43c3c;
  --green: #28785d;
  --ink: #132238;
  --muted: #607086;
  --line: #d9e2ec;
  --paper: #ffffff;
  --bg: #f3f7fb;
  --shadow: 0 18px 46px rgba(11, 31, 58, 0.11);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(36, 104, 162, .35);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0 4vw;
  color: white;
  background: rgba(11, 31, 58, .97);
  box-shadow: 0 8px 24px rgba(3, 18, 35, .18);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  color: white;
  font-size: 1.32rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand strong { color: var(--yellow); }
.brand-ball {
  width: 34px;
  height: 34px;
  border: 3px solid #ffe671;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset 0 0 0 2px rgba(11,31,58,.16);
}
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #dce7f5;
  font-size: .91rem;
  font-weight: 650;
  text-decoration: none;
}
.main-nav a:hover, .main-nav a.active { color: white; background: rgba(255,255,255,.11); }
.mobile-menu { display: none; }

main { width: min(1180px, 92vw); margin: 0 auto; padding: 34px 0 64px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; color: var(--navy); line-height: 1.13; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.45rem); }
h2 { font-size: clamp(1.4rem, 2.3vw, 2rem); }
h3 { font-size: 1.12rem; }
.lead { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 1.05rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr); gap: 22px; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 26px rgba(11,31,58,.06);
}
.primary-session {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  padding: clamp(25px, 4vw, 44px);
  color: white;
  background: linear-gradient(120deg, var(--navy) 0%, #143f69 67%, #1c5983 100%);
}
.primary-session::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -88px;
  width: 310px;
  height: 310px;
  border: 32px solid rgba(244, 207, 58, .18);
  border-radius: 50%;
}
.primary-session h1 { max-width: 620px; color: white; }
.primary-session p { max-width: 600px; color: #dbe8f3; }
.primary-session .eyebrow { color: #ffe273; }
.session-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: var(--navy); background: var(--yellow); box-shadow: 0 8px 20px rgba(244,207,58,.23); }
.btn-secondary { color: white; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.btn-blue { color: white; background: var(--blue); }
.btn-outline { color: var(--navy); border-color: var(--line); background: white; }
.btn-quiet { min-height: 40px; padding: 0 13px; color: var(--blue); border-color: var(--line); background: white; font-size: .91rem; }

.score-card { display: grid; place-items: center; padding: 27px 24px; text-align: center; }
.progress-ring {
  --pct: 0;
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) calc(var(--pct) * 1%), #e7edf3 0);
}
.progress-ring::before { content: ""; position: absolute; width: 116px; height: 116px; border-radius: 50%; background: white; }
.progress-ring span { position: relative; font-size: 1.75rem; font-weight: 850; color: var(--navy); }
.score-card h3 { margin-top: 16px; }
.score-card p { margin: 4px 0 0; color: var(--muted); }

.section-block { margin-top: 28px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-title p { margin: 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-card {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease;
}
.category-card:hover { transform: translateY(-3px); border-color: #a9c6db; box-shadow: var(--shadow); }
.category-icon { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 18px; border-radius: 13px; color: var(--navy); background: var(--sky); font-weight: 850; }
.category-card p { margin: 8px 0 0; color: var(--muted); font-size: .91rem; }
.category-card .count { margin-top: auto; padding-top: 15px; color: var(--blue); font-size: .8rem; font-weight: 800; text-transform: uppercase; }

.lesson-progress-summary { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #c9d7e4; border-radius: 14px; background: white; }
.lesson-progress-summary > div:first-child { display: grid; }
.lesson-progress-summary strong { color: var(--navy); font-size: 1.15rem; }
.lesson-progress-summary > div:first-child span { color: var(--muted); font-size: .82rem; }
.lesson-progress-percent { color: var(--blue); font-weight: 850; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: white;
  cursor: pointer;
  font-weight: 700;
}
.chip.active { color: white; border-color: var(--navy); background: var(--navy); }
.chip span { margin-left: 5px; opacity: .72; font-size: .78rem; }

.lesson-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 20px; }
.lesson-list { padding: 9px; align-self: start; }
.lesson-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.lesson-link-copy { min-width: 0; }
.lesson-link strong { display: block; }
.lesson-link span { color: var(--muted); font-size: .83rem; }
.lesson-link.active { background: var(--sky); }
.lesson-status { display: grid; flex: none; width: 25px; height: 25px; place-items: center; border: 1px solid #c9d7e4; border-radius: 50%; color: #8292a5 !important; background: white; font-weight: 900; }
.lesson-link.completed .lesson-status { color: white !important; border-color: #26815d; background: #26815d; }
.lesson-panel { overflow: hidden; }
.lesson-copy { padding: 27px; }
.situation-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0 18px; }
.tag { padding: 5px 9px; border-radius: 7px; color: var(--navy); background: #edf2f7; font-size: .8rem; font-weight: 750; }
.why { margin: 20px 0 0; padding-left: 15px; border-left: 4px solid var(--yellow); }
.why strong { display: block; color: var(--navy); }
.lesson-check { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; padding: 17px; box-shadow: none; background: #f6f9fc; }
.lesson-check > div { display: flex; align-items: center; gap: 12px; }
.lesson-check p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.lesson-check-icon { display: grid; flex: none; width: 39px; height: 39px; place-items: center; border-radius: 50%; color: var(--navy); background: var(--yellow); font-weight: 900; }
.lesson-quiz-box { margin-top: 24px; padding: 22px; border: 2px solid #c9d7e4; border-radius: 14px; background: #f8fbfd; }
.lesson-quiz-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.lesson-quiz-top > span { padding: 6px 9px; border-radius: 999px; color: var(--navy); background: var(--sky); font-size: .78rem; font-weight: 800; }
.lesson-mini-progress { height: 7px; margin: 13px 0 20px; overflow: hidden; border-radius: 999px; background: #dfe7ef; }
.lesson-mini-progress span { display: block; height: 100%; background: var(--yellow); }
.lesson-quiz-prompt { margin-bottom: 14px; }
.lesson-quiz-options { display: grid; gap: 9px; }
.lesson-quiz-options button { padding: 13px 14px; border: 2px solid var(--line); border-radius: 10px; color: var(--navy); background: white; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.lesson-quiz-options button:hover:not(:disabled) { border-color: var(--navy); background: var(--sky); }
.lesson-quiz-options button.correct { border-color: #26815d; background: #e8f7f0; }
.lesson-quiz-options button.incorrect { border-color: #ba4545; background: #fff0f0; }
.lesson-quiz-feedback { margin: 14px 0; padding: 13px; border-radius: 10px; }
.lesson-quiz-feedback.correct { color: #165b40; background: #e8f7f0; }
.lesson-quiz-feedback.incorrect { color: #812f2f; background: #fff0f0; }
.lesson-quiz-cancel { display: block; margin-top: 12px; }
.lesson-quiz-result { display: flex; gap: 16px; margin-top: 24px; padding: 22px; border-radius: 14px; }
.lesson-quiz-result.passed { background: #e8f7f0; }
.lesson-quiz-result.retry { background: #fff6df; }
.quiz-result-mark { display: grid; flex: none; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: 1.4rem; font-weight: 900; }
.lesson-quiz-result p { margin: 5px 0 12px; }
.assignment-table { width: 100%; margin-top: 20px; border-collapse: collapse; }
.assignment-table th, .assignment-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.assignment-table th { color: white; background: var(--navy); font-size: .82rem; }
.assignment-table td:first-child { width: 110px; font-weight: 800; color: var(--navy); }
.field-wrap { padding: 18px; border-top: 1px solid var(--line); background: #edf5eb; }
.field-diagram { display: block; width: min(520px, 100%); margin: 0 auto; }
.field-note { margin: 7px 0 0; color: #52645b; text-align: center; font-size: .82rem; }

.study-shell { max-width: 820px; margin: 0 auto; }
.assessment-home-card { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 17px 20px; color: var(--text); text-decoration: none; }
.assessment-home-card strong, .assessment-home-card small { display: block; }
.assessment-home-card small { margin-top: 3px; color: var(--muted); }
.assessment-home-icon { display: grid; flex: none; width: 43px; height: 43px; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: .82rem; font-weight: 900; }
.welcome-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(4, 18, 35, .72); backdrop-filter: blur(5px); }
.welcome-modal { position: relative; width: min(560px, 100%); padding: clamp(28px, 5vw, 43px); box-shadow: 0 28px 90px rgba(0,0,0,.32); }
.welcome-close { position: absolute; top: 13px; right: 15px; display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; color: var(--navy); background: #edf2f7; cursor: pointer; font-size: 1.65rem; line-height: 1; }
.welcome-close:hover { background: #dce6ef; }
.welcome-iq { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 20px; border-radius: 50%; color: var(--navy); background: var(--yellow); font-size: 1.35rem; font-weight: 950; }
.welcome-modal > p:not(.eyebrow) { color: var(--muted); }
.welcome-points { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.welcome-points span { padding: 6px 9px; border-radius: 999px; color: var(--navy); background: var(--sky); font-size: .78rem; font-weight: 750; }
.assessment-intro { display: grid; grid-template-columns: 120px 1fr; gap: 28px; max-width: 860px; margin: 0 auto; padding: 38px; align-items: center; }
.assessment-mark { display: grid; width: 112px; height: 112px; place-items: center; border-radius: 50%; color: var(--navy); background: var(--yellow); font-size: 2.4rem; font-weight: 950; }
.assessment-promises { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.assessment-promises span { padding: 7px 10px; border-radius: 999px; color: var(--navy); background: var(--sky); font-size: .82rem; font-weight: 750; }
.assessment-shell { max-width: 820px; margin: 0 auto; padding-top: 18px; }
.assessment-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-weight: 750; }
.assessment-brand { color: var(--navy); }
.assessment-progress { height: 8px; margin-bottom: 18px; overflow: hidden; border-radius: 999px; background: #dfe7ef; }
.assessment-progress span { display: block; height: 100%; border-radius: inherit; background: var(--yellow); transition: width .25s ease; }
.assessment-question { padding: 38px; }
.assessment-question h1 { max-width: 690px; margin-bottom: 26px; }
.assessment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.assessment-options button { min-height: 72px; padding: 16px; border: 2px solid var(--line); border-radius: 13px; color: var(--navy); background: white; font-size: 1rem; font-weight: 800; text-align: left; cursor: pointer; }
.assessment-options button:hover, .assessment-options button:focus-visible { border-color: var(--navy); background: var(--sky); }
.assessment-help { color: var(--muted); font-size: .9rem; }
.assessment-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.text-button { padding: 8px 0; border: 0; color: var(--navy); background: transparent; font-weight: 750; cursor: pointer; }
.text-button:disabled { color: #aab4bf; cursor: default; }
.result-hero { display: flex; justify-content: space-between; gap: 30px; padding: 28px; border-top: 6px solid var(--yellow); }
.result-hero > div:first-child { max-width: 650px; }
.result-strength { flex: none; width: 210px; padding: 18px; border-radius: 12px; background: var(--sky); }
.result-strength span, .result-strength strong { display: block; }
.result-strength span { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.result-strength strong { margin-top: 6px; color: var(--navy); }
.recommendation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recommendation-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recommendation-card { min-height: 115px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; color: var(--navy); background: white; text-align: left; cursor: pointer; box-shadow: var(--shadow-soft); }
.recommendation-card:hover { transform: translateY(-2px); border-color: #91a8bf; }
.recommendation-card span, .recommendation-card strong { display: block; }
.recommendation-card span { margin-bottom: 8px; color: #7b6500; font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.flash-focus { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 26px; padding: 22px; }
.flash-focus > div { display: flex; align-items: center; gap: 13px; }
.flash-focus .category-icon { margin: 0; }
.assessment-actions { margin-top: 24px; text-align: center; }
.assessment-actions p { color: var(--muted); font-size: .86rem; }
.train-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.drill-list { padding: 8px; position: sticky; top: 82px; max-height: calc(100vh - 102px); overflow-y: auto; }
.drill-link { width: 100%; display: flex; gap: 12px; align-items: center; padding: 14px 12px; border: 0; border-radius: 11px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.drill-link:hover, .drill-link.active { background: var(--sky); }
.drill-link strong, .drill-link small { display: block; }
.drill-link small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.drill-number { color: #8a6d00; font-size: .76rem; font-weight: 850; }
.drill-panel { padding: 28px; }
.drill-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.train-badge { flex: none; padding: 7px 11px; border-radius: 999px; color: #5f4d00; background: #fff3b8; font-size: .82rem; font-weight: 800; }
.drill-facts { display: grid; grid-template-columns: .7fr 1.3fr; gap: 10px; margin: 22px 0; }
.drill-facts div { padding: 14px; border-radius: 11px; background: #f5f8fb; }
.drill-facts span, .drill-callout span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.drill-facts strong { color: var(--navy); }
.drill-goal { padding: 16px 18px; border-left: 5px solid var(--yellow); background: #fffbea; border-radius: 0 10px 10px 0; }
.drill-goal strong, .difficulty-grid strong { display: block; margin-bottom: 4px; color: var(--navy); }
.drill-section { margin-top: 24px; }
.drill-section ol, .drill-detail-grid ul { padding-left: 22px; }
.drill-section li, .drill-detail-grid li { margin: 8px 0; }
.drill-callout { margin: 22px 0; padding: 16px 18px; border-radius: 11px; color: white; background: var(--navy); }
.drill-callout span { color: #bdd0e5; }
.drill-detail-grid, .difficulty-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.drill-detail-grid > div, .difficulty-grid p { padding: 17px; border: 1px solid var(--line); border-radius: 12px; }
.related-drills { margin-top: 24px; }
.related-drills > div { display: flex; flex-wrap: wrap; gap: 8px; }
.related-drill-link { padding: 9px 12px; border: 1px solid #b9cadb; border-radius: 9px; color: var(--navy); background: white; font-weight: 750; cursor: pointer; }
.related-drill-link:hover { background: var(--sky); }
.mental-challenge { margin: 20px 0; padding: 22px; border-radius: 14px; color: white; background: linear-gradient(130deg, var(--navy), #245f87); }
.mental-challenge h3 { margin-bottom: 18px; color: white; }
.mental-challenge .eyebrow { color: #bdd0e5; }
.safety-note { margin: 24px 0 0; color: var(--muted); font-size: .9rem; }
.flashcard-stage { perspective: 1000px; }
.flashcard {
  position: relative;
  width: 100%;
  min-height: 380px;
  border: 0;
  border-radius: 25px;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .55s ease;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: var(--shadow);
  backface-visibility: hidden;
}
.flash-front { color: white; background: linear-gradient(145deg, var(--navy), #235681); }
.flash-back { background: white; transform: rotateY(180deg); }
.flash-label { margin-bottom: 18px; color: var(--yellow); font-size: .78rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.flash-front h2 { color: white; font-size: clamp(1.55rem, 4vw, 2.65rem); }
.flash-back h2 { font-size: clamp(1.45rem, 3.5vw, 2.3rem); }
.flash-face p { margin: 18px 0 0; }
.flash-hint { color: #cbd9e6; }
.flash-controls { display: flex; justify-content: space-between; gap: 10px; margin-top: 17px; }
.flash-count { align-self: center; color: var(--muted); font-weight: 700; }

.quiz-shell { max-width: 850px; margin: 0 auto; }
.quiz-card { padding: clamp(23px, 5vw, 42px); }
.quiz-progress { height: 9px; margin-bottom: 25px; overflow: hidden; border-radius: 999px; background: #e8eef4; }
.quiz-progress span { display: block; height: 100%; background: var(--yellow); transition: width .25s ease; }
.quiz-number { color: var(--blue); font-size: .8rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.quiz-card h2 { margin-top: 9px; }
.answers { display: grid; gap: 10px; margin-top: 23px; }
.answer {
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  text-align: left;
  font-weight: 650;
}
.answer:hover { border-color: #7eabc9; background: #f5f9fc; }
.answer.correct { border-color: #78b39f; background: #e5f4ee; }
.answer.incorrect { border-color: #d99b9b; background: #fbeaea; }
.feedback { margin-top: 19px; padding: 15px; border-radius: 12px; background: #edf4f9; }
.feedback strong { color: var(--navy); }
.quiz-footer { display: flex; justify-content: flex-end; margin-top: 19px; }
.result-score { font-size: 4rem; font-weight: 900; color: var(--navy); letter-spacing: -.06em; }

.quiz-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.quiz-path { position: relative; display: flex; min-height: 310px; flex-direction: column; padding: 27px; overflow: hidden; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
button.quiz-path { width: 100%; font: inherit; }
.quiz-path:hover { transform: translateY(-3px); border-color: #9bbbd3; box-shadow: var(--shadow); }
.quiz-path-number { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 35px; border-radius: 14px; color: var(--navy); background: var(--yellow); font-size: 1.25rem; font-weight: 900; }
.quiz-path h2 { margin-bottom: 11px; }
.quiz-path > p:not(.eyebrow) { color: var(--muted); }
.quiz-path-score { margin-top: auto; padding-top: 20px; color: var(--blue); font-weight: 800; }
.quiz-path.position-path { color: white; border-color: var(--navy); background: linear-gradient(145deg, var(--navy), #1d527d); }
.quiz-path.position-path h2, .quiz-path.position-path .eyebrow { color: white; }
.quiz-path.position-path > p:not(.eyebrow) { color: #dce8f2; }
.quiz-path.position-path .quiz-path-score { color: #ffe16b; }

.position-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.position-card { position: relative; display: grid; min-height: 190px; grid-template-columns: auto 1fr; gap: 16px; padding: 22px; border-color: var(--line); cursor: pointer; text-align: left; }
.position-card:hover { transform: translateY(-2px); border-color: #91b5cf; box-shadow: var(--shadow); }
.position-card-number, .position-number { display: grid; flex: none; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: 1.25rem; font-weight: 900; }
.position-card p { margin: 7px 0 0; color: var(--muted); }
.position-best { position: absolute; right: 19px; bottom: 17px; color: var(--blue); font-size: .83rem; font-weight: 850; }
.all-position-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 24px; }
.all-position-callout p { margin: 6px 0 0; color: var(--muted); }
.position-quiz-top { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.position-quiz-top .text-button { margin-left: auto; }
.position-result { position: relative; max-width: 760px; text-align: center; }
.position-result-number { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: white; background: var(--navy); font-size: 1.4rem; font-weight: 900; }
.position-result .lead { margin-right: auto; margin-left: auto; }
.position-result .session-actions { justify-content: center; }
.position-review { display: grid; gap: 8px; margin-top: 24px; padding: 18px; border-radius: 14px; background: #f4f7fa; text-align: left; }
.position-review h3 { margin-bottom: 4px; }
.position-review button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: white; cursor: pointer; text-align: left; font-weight: 750; }
.perfect-position { margin-top: 22px; padding: 14px; border-radius: 12px; color: #165b40; background: #e8f7f0; }

.rules-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; }
.rules-filter { padding: 18px; align-self: start; }
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}
.filter-list { display: grid; gap: 6px; margin-top: 13px; }
.filter-list button { padding: 10px 12px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; font-weight: 700; }
.filter-list button.active { color: white; background: var(--navy); }
.rules-list { display: grid; gap: 13px; }
.rule-card { padding: 23px; }
.rule-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.rule-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 7px; color: var(--blue); background: var(--sky); font-size: .76rem; font-weight: 800; }
.rule-card p { margin: 9px 0 0; color: #384a60; }
.rule-example { margin-top: 14px; padding: 13px 15px; border-radius: 11px; background: #f4f7fa; }
.rule-example strong { color: var(--navy); }
.rule-note { margin: 0 0 18px; padding: 14px 16px; border: 1px solid #e4cf7d; border-radius: 12px; background: #fff9df; color: #5c4b0e; }
.rule-quiz-banner { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 20px; padding: 21px; }
.rule-quiz-banner > div { display: flex; align-items: center; gap: 15px; }
.rule-quiz-banner .category-icon { flex: none; margin: 0; background: var(--yellow); }
.rule-quiz-banner h2, .rule-quiz-banner p { margin: 2px 0 0; }
.rule-quiz-banner p:last-child { color: var(--muted); }
.rule-quiz-shell { margin-top: 0; }
.rule-quiz-card { max-width: 760px; }
.rule-quiz-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.rule-quiz-heading h2 { margin-top: 2px; }
.rule-quiz-card.result-card .lead { margin-right: auto; margin-left: auto; }
.rule-quiz-card.result-card .session-actions { justify-content: center; }

.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.stat-card { padding: 23px; }
.stat-value { display: block; color: var(--navy); font-size: 2.3rem; font-weight: 900; letter-spacing: -.05em; }
.stat-label { color: var(--muted); font-weight: 650; }
.mastery-list { display: grid; gap: 15px; padding: 24px; }
.mastery-row { display: grid; grid-template-columns: 180px 1fr 48px; align-items: center; gap: 12px; }
.bar { height: 10px; overflow: hidden; border-radius: 999px; background: #e7edf3; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.empty { padding: 34px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-path-grid, .position-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .train-layout { grid-template-columns: 1fr; }
  .drill-list { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
  .lesson-layout, .rules-layout { grid-template-columns: 1fr; }
  .lesson-list { display: flex; overflow-x: auto; gap: 7px; }
  .lesson-link { min-width: 220px; }
  .rules-filter { position: static; }
  .filter-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .app-header { min-height: 64px; }
  .mobile-menu { display: inline-flex; min-height: 40px; align-items: center; padding: 0 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; color: white; background: transparent; }
  .main-nav { position: absolute; top: 64px; right: 3vw; left: 3vw; display: none; padding: 10px; border-radius: 14px; background: var(--navy); box-shadow: var(--shadow); }
  .main-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .primary-session { min-height: 280px; }
  .page-head { align-items: start; flex-direction: column; }
  .progress-grid { grid-template-columns: 1fr; }
  .assessment-intro { grid-template-columns: 1fr; padding: 26px; }
  .assessment-mark { width: 82px; height: 82px; font-size: 1.8rem; }
  .result-hero { display: grid; }
  .result-strength { width: auto; }
  .recommendation-grid, .recommendation-grid.two { grid-template-columns: 1fr; }
  .mastery-row { grid-template-columns: 115px 1fr 42px; }
  .flashcard { min-height: 420px; }
}

@media (max-width: 500px) {
  main { width: min(94vw, 1180px); padding-top: 24px; }
  .category-grid { grid-template-columns: 1fr; }
  .quiz-path-grid, .position-grid { grid-template-columns: 1fr; }
  .all-position-callout { align-items: stretch; flex-direction: column; }
  .drill-list, .drill-facts, .drill-detail-grid, .difficulty-grid { grid-template-columns: 1fr; }
  .drill-panel { padding: 20px; }
  .assessment-question { padding: 24px 19px; }
  .assessment-options { grid-template-columns: 1fr; }
  .flash-focus { align-items: flex-start; flex-direction: column; }
  .lesson-check { align-items: stretch; flex-direction: column; }
  .lesson-progress-summary { grid-template-columns: 1fr auto; }
  .lesson-progress-summary .bar { grid-column: 1 / -1; grid-row: 2; }
  .rule-quiz-banner { align-items: stretch; flex-direction: column; }
  .rule-quiz-banner > div { align-items: flex-start; }
  .lesson-quiz-box { padding: 18px 14px; }
  .category-card { min-height: 145px; }
  .filter-list { grid-template-columns: 1fr 1fr; }
  .assignment-table { display: block; overflow-x: auto; white-space: normal; }
  .flash-controls { flex-wrap: wrap; }
  .flash-count { order: -1; width: 100%; text-align: center; }
}

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