:root {
  --navy: #132b3a;
  --navy-2: #1b3a4b;
  --teal: #278f86;
  --teal-soft: #dff3ef;
  --mango: #ffc45e;
  --mango-soft: #fff1cb;
  --coral: #e96857;
  --cream: #f7f3e9;
  --paper: #fffefa;
  --white: #ffffff;
  --ink-muted: #65757c;
  --line: #dbe2df;
  --line-dark: rgba(19, 43, 58, 0.14);
  --shadow-sm: 0 1px 2px rgba(19, 43, 58, 0.05), 0 8px 24px rgba(19, 43, 58, 0.05);
  --shadow-md: 0 2px 4px rgba(19, 43, 58, 0.05), 0 18px 48px rgba(19, 43, 58, 0.08);
  --font-sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-math: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-sans);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 7% 10%, rgba(255, 196, 94, 0.13), transparent 23rem),
    radial-gradient(circle at 92% 8%, rgba(39, 143, 134, 0.11), transparent 25rem),
    var(--cream);
  color: var(--navy);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(39, 143, 134, 0.28);
  outline-offset: 2px;
}

sup {
  position: relative;
  top: -0.42em;
  font-size: 0.62em;
  line-height: 0;
}

.study-app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid var(--line-dark);
  background: rgba(255, 254, 250, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  box-shadow: 0 4px 0 var(--mango);
  color: var(--white);
  font-family: var(--font-math);
  font-size: 21px;
  font-weight: 700;
}

.brand-name,
.brand-subtitle,
.chapter-crumb,
.overall-copy strong,
.overall-copy span,
.rail-heading span,
.rail-heading small,
.level-label strong,
.level-label small,
.rail-note p,
.session-bar h1,
.session-bar p,
.level-score small,
.instruction,
.condition,
.paper-prompt,
.builder-heading h2,
.support-row span,
.hint-card p,
.feedback-copy h3,
.feedback-copy p,
.law-name,
.mastery-card p,
.session-card p {
  margin: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.chapter-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-muted);
  font-size: 12px;
}

.chapter-crumb strong {
  color: var(--navy);
}

.overall-progress {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--progress), #e5ebe8 0);
}

.progress-ring::after {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: inherit;
  background: var(--paper);
  content: "";
}

.progress-ring span {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 900;
}

.overall-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overall-copy strong {
  font-size: 11px;
}

.overall-copy span {
  color: var(--ink-muted);
  font-size: 10px;
}

.study-layout {
  display: grid;
  grid-template-columns: 232px minmax(500px, 760px) 268px;
  gap: 24px;
  width: min(100%, 1370px);
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 44px) 54px;
  align-items: start;
}

.level-rail,
.study-sidebar {
  position: sticky;
  top: 100px;
}

.level-rail {
  padding: 18px 14px 15px;
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.78);
  box-shadow: var(--shadow-sm);
}

.rail-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 6px 13px;
  border-bottom: 1px solid var(--line);
}

.rail-heading span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-heading small {
  color: var(--ink-muted);
  font-size: 11px;
}

.level-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 0;
}

.level-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}

.level-button:hover {
  background: rgba(39, 143, 134, 0.08);
}

.level-button.active {
  background: var(--teal-soft);
}

.level-button:active {
  transform: translateY(1px);
}

.level-number {
  --level-colour: var(--teal);
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--level-colour) 35%, white);
  border-radius: 10px;
  background: color-mix(in srgb, var(--level-colour) 10%, white);
  color: var(--level-colour);
  font-size: 11px;
  font-weight: 900;
}

.level-button.active .level-number {
  border-color: var(--level-colour);
  background: var(--level-colour);
  color: white;
}

.level-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.level-label strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-label small {
  color: var(--ink-muted);
  font-size: 10px;
}

.rail-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 11px;
  background: var(--mango-soft);
  color: var(--navy);
}

.rail-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #bb7412;
}

.rail-note p {
  font-size: 10px;
  line-height: 1.45;
}

.rail-note strong {
  display: block;
  margin-bottom: 1px;
}

.practice-column {
  min-width: 0;
}

.session-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
  padding: 4px 2px 0;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.session-bar h1 {
  margin-top: 5px;
  font-family: var(--font-math);
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.session-bar p {
  max-width: 560px;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.level-score {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
}

.level-score strong {
  font-size: 25px;
  line-height: 1;
}

.level-score strong span {
  color: var(--ink-muted);
  font-size: 13px;
}

.level-score small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.question-card {
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 233, 0.5);
}

.question-count {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.difficulty-pill,
.marks-pill,
.builder-safe {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.difficulty-pill {
  padding: 4px 8px;
  background: var(--teal-soft);
  color: #176d65;
}

.difficulty-pill.challenge {
  background: #f0e7f6;
  color: #6d4687;
}

.difficulty-pill.stretch {
  background: var(--mango-soft);
  color: #9a5d09;
}

.marks-pill {
  padding: 5px 9px;
  border: 1px solid var(--line-dark);
  background: white;
  color: var(--navy);
}

.question-body {
  position: relative;
  padding: clamp(24px, 4vw, 38px) clamp(20px, 4vw, 36px) 22px;
  background-image:
    linear-gradient(rgba(39, 143, 134, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 143, 134, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

.instruction {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.question-expression {
  margin: clamp(24px, 5vw, 42px) 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-family: var(--font-math);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.condition {
  margin-top: -18px;
  color: var(--ink-muted);
  font-family: var(--font-math);
  font-size: 11px;
  font-style: italic;
  text-align: center;
}

.paper-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed rgba(19, 43, 58, 0.18);
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.pencil-dot {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--mango-soft);
  color: var(--navy);
}

.answer-builder {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: #f4f8f7;
}

.builder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.builder-heading h2 {
  margin-top: 3px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.builder-safe {
  gap: 5px;
  padding: 6px 9px;
  background: var(--teal-soft);
  color: #176d65;
  white-space: nowrap;
}

.builder-display {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 12px 20px;
  border: 1px solid rgba(19, 43, 58, 0.16);
  border-radius: 13px;
  background: white;
  box-shadow: inset 0 1px 0 rgba(19, 43, 58, 0.03);
  color: var(--navy);
  font-family: var(--font-math);
  font-size: clamp(24px, 5vw, 34px);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.builder-display.correct {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(39, 143, 134, 0.12);
}

.builder-display.wrong,
.builder-display.form {
  border-color: var(--coral);
}

.answer-part {
  min-width: 90px;
  min-height: 36px;
  padding: 2px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: text;
  font-family: inherit;
  font-size: inherit;
}

.answer-part.selected {
  background: var(--mango-soft);
  box-shadow: inset 0 -2px 0 var(--mango);
}

.fraction-line {
  width: min(220px, 72%);
  height: 2px;
  margin: 3px 0;
  background: var(--navy);
}

.builder-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.keypad {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.keypad-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keypad-row button {
  display: grid;
  min-width: 34px;
  height: 33px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 1px rgba(19, 43, 58, 0.04);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: background 150ms ease, transform 150ms ease;
}

.keypad-row button:hover {
  background: var(--mango-soft);
}

.keypad-row button:active {
  transform: translateY(1px);
}

.keypad-row button.variable-key {
  border-color: rgba(39, 143, 134, 0.3);
  background: var(--teal-soft);
  color: #176d65;
  font-family: var(--font-math);
  font-size: 15px;
}

.keypad-row button.power-chip {
  min-width: 52px;
  font-family: var(--font-math);
}

.keypad-row button.active-tool {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.mini-fraction,
.math-fraction {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  line-height: 1;
}

.mini-fraction span:first-child,
.math-fraction span:first-child {
  padding: 0 5px 2px;
  border-bottom: 1px solid currentColor;
}

.mini-fraction span:last-child,
.math-fraction span:last-child {
  padding: 2px 5px 0;
}

.submit-answer {
  display: inline-flex;
  min-width: 164px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 0 4px 0 var(--mango);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.submit-answer:hover {
  background: var(--navy-2);
}

.submit-answer:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--mango);
}

.inline-message {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 700;
}

.inline-message.error {
  color: var(--coral);
}

.support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px 0;
}

.hint-button,
.feedback-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.hint-button:hover,
.feedback-actions button:hover {
  background: rgba(39, 143, 134, 0.08);
}

.support-row > span {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hint-card,
.feedback-card {
  margin-top: 12px;
  border-radius: 14px;
}

.hint-card {
  padding: 14px 16px;
  border: 1px solid #efd490;
  background: var(--mango-soft);
}

.hint-card > span {
  color: #946017;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hint-card p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
}

.feedback-card {
  display: flex;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(39, 143, 134, 0.3);
  background: #eef9f6;
}

.feedback-card.wrong,
.feedback-card.form {
  border-color: rgba(233, 104, 87, 0.3);
  background: #fff5f2;
}

.feedback-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
}

.wrong .feedback-icon,
.form .feedback-icon {
  background: var(--coral);
}

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

.feedback-copy h3 {
  margin-top: 3px;
  font-family: var(--font-math);
  font-size: 20px;
}

.feedback-copy > p {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.worked-solution {
  margin-top: 11px;
  padding: 12px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-math);
  font-size: 12px;
  line-height: 1.65;
}

.worked-solution p + p {
  margin-top: 3px;
}

.final-answer-line {
  margin-top: 7px !important;
  color: var(--teal);
}

.feedback-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.feedback-actions button.next-button {
  background: var(--navy);
  color: white;
}

.study-sidebar {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.law-card,
.mastery-card,
.session-card {
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: rgba(255, 254, 250, 0.86);
  box-shadow: var(--shadow-sm);
}

.law-card {
  overflow: hidden;
}

.law-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: var(--navy);
  color: var(--mango);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.law-name {
  padding: 16px 15px 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.law-example {
  margin: 0 15px 15px;
  padding: 14px 10px;
  border-radius: 10px;
  background: var(--teal-soft);
  font-family: var(--font-math);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.mastery-card,
.session-card {
  padding: 15px;
}

.mastery-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 850;
}

.mastery-topline strong {
  color: var(--teal);
  font-size: 15px;
}

.mastery-track {
  overflow: hidden;
  height: 5px;
  margin-top: 9px;
  border-radius: 99px;
  background: #e4eae7;
}

.mastery-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 300ms ease;
}

.pattern-dots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-top: 13px;
}

.pattern-dots span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 850;
}

.pattern-dots span.current {
  border-color: var(--mango);
  box-shadow: 0 0 0 2px var(--mango-soft);
  color: var(--navy);
}

.pattern-dots span.passed {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.mastery-card p,
.session-card p {
  margin-top: 11px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.45;
}

.session-card > span {
  display: block;
  margin-bottom: 10px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.session-card > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.session-card strong {
  font-size: 20px;
}

.session-card small {
  color: var(--ink-muted);
  font-size: 10px;
}

a.brand-lockup {
  color: inherit;
  text-decoration: none;
}

.chapter-crumb a {
  color: inherit;
  text-decoration: none;
}

.chapter-crumb a:hover {
  color: var(--teal);
}

.learning-home {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 196, 94, 0.15), transparent 28rem),
    radial-gradient(circle at 88% 15%, rgba(39, 143, 134, 0.14), transparent 27rem),
    var(--cream);
}

.home-topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line-dark);
  background: rgba(255, 254, 250, 0.88);
  backdrop-filter: blur(16px);
}

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

.profile-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

.profile-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.profile-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgba(39, 143, 134, 0.28);
  border-radius: 50%;
  background: var(--teal-soft);
  color: #176d65;
  font-family: var(--font-math);
  font-size: 16px;
  font-weight: 800;
}

.home-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 44px) 64px;
}

.home-welcome {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.home-welcome h1 {
  margin: 5px 0 0;
  font-family: var(--font-math);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.home-welcome p {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

.today-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 750;
}

.continue-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(340px, 1.22fr);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.continue-visual {
  position: relative;
  display: grid;
  min-height: 300px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--navy);
  background-size: 24px 24px;
}

.continue-visual::before,
.continue-visual::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.continue-visual::before {
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 196, 94, 0.22);
}

.continue-visual::after {
  width: 155px;
  height: 155px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.continue-visual > span {
  position: relative;
  z-index: 2;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 30px;
  background: var(--mango);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  color: var(--navy);
  font-family: var(--font-math);
  font-size: 37px;
  font-weight: 800;
}

.floating-power {
  position: absolute;
  z-index: 3;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: var(--font-math);
  font-size: 16px;
  backdrop-filter: blur(6px);
}

.power-one {
  top: 40px;
  left: 34px;
}

.power-two {
  right: 30px;
  bottom: 38px;
}

.power-three {
  top: 65px;
  right: 24px;
}

.continue-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 5vw, 54px);
}

.continue-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.continue-copy h2 {
  margin: 10px 0 0;
  font-family: var(--font-math);
  font-size: clamp(35px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.continue-copy > p {
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.home-progress-row {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
}

.home-progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 99px;
  background: #e4eae7;
}

.home-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.home-progress-row strong {
  color: var(--teal);
  font-size: 13px;
}

.continue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 10px;
}

.continue-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 25px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 0 4px 0 var(--mango);
  color: white;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.continue-button:hover {
  background: var(--navy-2);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 20px;
  margin-top: 22px;
}

.topic-library,
.focus-card,
.tutor-card {
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.84);
  box-shadow: var(--shadow-sm);
}

.topic-library {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-family: var(--font-math);
  font-size: 23px;
  letter-spacing: -0.025em;
}

.topic-count,
.coming-soon {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #176d65;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 17px;
}

.topic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

a.topic-row {
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

a.topic-row:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.topic-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal);
}

.topic-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.topic-copy strong {
  font-size: 12px;
}

.topic-copy small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-progress {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
}

.topic-arrow {
  color: var(--ink-muted);
}

.upcoming-topic {
  opacity: 0.7;
}

.upcoming-topic .topic-icon {
  background: #edf0ef;
  color: var(--ink-muted);
}

.coming-soon {
  background: #edf0ef;
  color: var(--ink-muted);
}

.home-side-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.focus-card,
.tutor-card {
  padding: 20px;
}

.focus-card {
  background: var(--navy);
  color: white;
}

.focus-card > svg {
  color: var(--mango);
}

.focus-card > span,
.tutor-card > span {
  display: block;
  margin-top: 13px;
  color: var(--mango);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.focus-card h3 {
  margin: 7px 0 0;
  font-family: var(--font-math);
  font-size: 20px;
  line-height: 1.25;
}

.focus-card p,
.tutor-card p {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.focus-card p {
  color: rgba(255, 255, 255, 0.68);
}

.tutor-card > span {
  margin-top: 0;
  color: var(--teal);
}

.tutor-card p {
  color: var(--navy);
  font-family: var(--font-math);
  font-size: 13px;
  font-style: italic;
}

::selection {
  background: var(--mango);
  color: var(--navy);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: clamp(28px, 7vw, 44px);
  border: 1px solid var(--line-dark);
  border-radius: 24px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow-md);
}

.login-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 25px;
  place-items: center;
  border-radius: 15px;
  background: var(--navy);
  box-shadow: 0 5px 0 var(--mango);
  color: white;
  font-family: var(--font-math);
  font-size: 27px;
  font-weight: 700;
}

.login-card h1 {
  margin: 8px 0 7px;
  font-family: var(--font-math);
  font-size: 35px;
  line-height: 1.05;
}

.login-card > p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.login-card label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: white;
  color: var(--navy);
  font-size: 15px;
}

.login-card input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(39, 143, 134, 0.12);
}

.login-card button {
  min-height: 49px;
  margin-top: 3px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 0 4px 0 var(--mango);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.login-card small {
  display: block;
  margin-top: 24px;
  color: var(--ink-muted);
  font-size: 10px;
  text-align: center;
}

.login-error {
  margin: 0;
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1190px) {
  .study-layout {
    grid-template-columns: 218px minmax(0, 1fr);
    max-width: 1050px;
  }

  .study-sidebar {
    position: static;
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .chapter-crumb {
    display: none;
  }

  .study-layout {
    display: block;
    max-width: 790px;
    padding-top: 18px;
  }

  .level-rail {
    position: static;
    margin-bottom: 20px;
    padding: 12px;
  }

  .rail-heading,
  .rail-note {
    display: none;
  }

  .level-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 7px;
    overflow-x: auto;
    padding: 0 0 3px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .level-list::-webkit-scrollbar {
    display: none;
  }

  .level-button {
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 9px;
    scroll-snap-align: start;
  }

  .level-label {
    width: 100%;
  }

  .level-label strong {
    max-width: 100%;
  }

  .study-sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
  }

  .continue-card {
    grid-template-columns: 0.8fr 1.2fr;
  }

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

  .home-side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .topbar {
    position: static;
    min-height: 64px;
    padding: 11px 15px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 13px;
  }

  .overall-copy {
    display: none;
  }

  .progress-ring {
    width: 39px;
    height: 39px;
  }

  .progress-ring::after {
    width: 31px;
    height: 31px;
  }

  .study-layout {
    padding: 12px 12px 40px;
  }

  .level-rail {
    margin-bottom: 15px;
    border-radius: 13px;
  }

  .level-list {
    grid-template-columns: repeat(5, 116px);
  }

  .level-button {
    min-height: 88px;
    border: 1px solid rgba(19, 43, 58, 0.08);
    background: rgba(255, 255, 255, 0.64);
  }

  .level-label strong {
    min-height: 27px;
    line-height: 1.15;
    white-space: normal;
  }

  .session-bar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .session-bar p {
    display: none;
  }

  .level-score {
    padding-top: 4px;
  }

  .question-card {
    border-radius: 15px;
  }

  .question-meta,
  .answer-builder {
    padding-right: 14px;
    padding-left: 14px;
  }

  .question-body {
    padding: 24px 16px 18px;
  }

  .question-expression {
    margin: 29px 0;
  }

  .builder-heading {
    align-items: flex-start;
  }

  .builder-safe {
    display: none;
  }

  .builder-tools {
    grid-template-columns: 1fr;
  }

  .submit-answer {
    min-height: 45px;
  }

  .keypad-row button {
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
  }

  .study-sidebar {
    grid-template-columns: 1fr;
  }

  .law-card,
  .mastery-card,
  .session-card {
    border-radius: 13px;
  }

  .home-topbar {
    min-height: 64px;
    padding: 11px 15px;
  }

  .profile-status {
    display: none;
  }

  .home-shell {
    padding: 28px 13px 44px;
  }

  .home-welcome {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .home-welcome p {
    font-size: 12px;
  }

  .continue-card {
    grid-template-columns: 1fr;
    border-radius: 17px;
  }

  .continue-visual {
    min-height: 188px;
  }

  .continue-visual > span {
    width: 84px;
    height: 84px;
    border-radius: 23px;
    font-size: 29px;
  }

  .continue-visual::before {
    width: 155px;
    height: 155px;
  }

  .continue-visual::after {
    width: 116px;
    height: 116px;
  }

  .floating-power {
    font-size: 13px;
  }

  .power-one {
    top: 25px;
    left: 20px;
  }

  .power-two {
    right: 20px;
    bottom: 23px;
  }

  .power-three {
    top: 30px;
    right: 18px;
  }

  .continue-copy {
    padding: 26px 20px 29px;
  }

  .continue-copy h2 {
    font-size: 36px;
  }

  .topic-library,
  .focus-card,
  .tutor-card {
    border-radius: 14px;
  }

  .topic-library {
    padding: 16px;
  }

  .topic-count {
    display: none;
  }

  .topic-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .topic-progress,
  .coming-soon {
    display: none;
  }

  .topic-arrow {
    display: block;
  }

  .home-side-stack {
    grid-template-columns: 1fr;
  }
}

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