:root {
  color-scheme: dark;
  --page: #020a16;
  --page-deep: #010711;
  --sidebar: #020a16;
  --surface: #061522;
  --surface-raised: #0a1d2c;
  --surface-soft: #04111e;
  --border: #172f45;
  --border-strong: #28516b;
  --text: #edf3f2;
  --text-soft: #c6d2d2;
  --muted: #82969c;
  --teal: #1fc8bd;
  --teal-soft: #63d8d1;
  --green: #62dc84;
  --green-deep: #153f34;
  --amber: #f1b338;
  --coral: #ff625c;
  --magenta: #dd77d3;
  --radius-small: 8px;
  --radius: 12px;
  --radius-large: 16px;
  --sidebar-width: 180px;
  --rail-width: 286px;
  --ui-font: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --display-font: Georgia, "Times New Roman", serif;
  --math-font: "STIX Two Math", "Cambria Math", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(125deg, rgba(20, 73, 106, 0.08), transparent 34%),
    var(--page);
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal-soft);
  outline-offset: 3px;
}

#main-content:focus,
.dictionary-popover:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  transform: translateY(-160%);
  border: 1px solid var(--teal-soft);
  border-radius: var(--radius-small);
  background: var(--page-deep);
  color: var(--text);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.side-navigation {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 21px 12px 16px;
  border-right: 1px solid rgba(43, 91, 105, 0.4);
  background: rgba(2, 10, 22, 0.98);
}

.navigation-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.brand {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  filter: saturate(0.45) brightness(1.22);
}

.brand strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-transform: uppercase;
}

.primary-navigation,
.secondary-navigation {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.secondary-navigation {
  margin-top: auto;
}

.navigation-item {
  display: grid;
  min-height: 44px;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #b8c7ca;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.navigation-item:hover:not(.is-disabled) {
  background: rgba(16, 61, 72, 0.38);
  color: var(--text);
}

.navigation-item.is-current {
  background: linear-gradient(90deg, rgba(14, 107, 109, 0.68), rgba(9, 65, 74, 0.55));
  color: var(--teal-soft);
}

.navigation-item.is-disabled {
  color: #3d5158;
}

.navigation-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: currentColor;
  line-height: 1;
  transition: filter 140ms ease, transform 140ms ease;
}

.navigation-icon svg {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navigation-item:hover:not(.is-disabled) .navigation-icon {
  transform: translateX(1px);
}

.navigation-item.is-current .navigation-icon {
  filter: drop-shadow(0 0 5px rgba(69, 231, 207, 0.52));
}

.workspace {
  min-width: 0;
}

.top-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-height: 126px;
  grid-template-columns: minmax(420px, 1fr) auto;
  gap: 28px;
  padding: 19px 28px 16px;
  border-bottom: 1px solid rgba(40, 83, 96, 0.32);
  background: rgba(2, 10, 22, 0.92);
  backdrop-filter: blur(18px);
}

.top-bar-main {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.atlas-heading {
  display: flex;
  align-items: center;
  gap: 24px;
}

.back-button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(3, 14, 27, 0.76);
  color: var(--text-soft);
  cursor: pointer;
}

.back-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.atlas-title {
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.atlas-search {
  display: grid;
  width: min(100%, 620px);
  min-height: 39px;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(5, 19, 33, 0.86);
  color: var(--muted);
}

.atlas-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
}

.atlas-search input::placeholder {
  color: #789097;
  opacity: 1;
}

.atlas-search input:disabled {
  cursor: default;
}

.search-icon {
  font-size: 22px;
  line-height: 1;
}

.search-shortcut {
  color: #697f86;
  font-size: 12px;
}

.learner-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 84px 84px;
  align-items: start;
  gap: 10px;
}

.level-card {
  display: flex;
  min-width: 190px;
  align-items: flex-start;
  gap: 10px;
  padding: 3px 5px;
}

.level-badge {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: rgba(10, 97, 91, 0.16);
  color: var(--teal-soft);
  font-size: 13px;
  font-weight: 700;
}

.level-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  color: var(--muted);
  font-size: 11px;
}

.level-copy small {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.level-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-progress {
  width: 100%;
  height: 4px;
  margin: 4px 0 2px;
  overflow: hidden;
  border-radius: 99px;
  background: #17343e;
}

.level-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--teal-soft));
  transition: width 180ms ease;
}

.metric-card {
  display: grid;
  min-height: 70px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 9px 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(4, 16, 29, 0.58);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.metric-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.metric-symbol {
  font-size: 13px;
}

.streak-symbol {
  color: var(--coral);
}

.xp-symbol {
  color: var(--teal-soft);
}

main {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

.state-panel {
  display: grid;
  min-height: 58vh;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.state-panel h1 {
  margin: 19px 0 5px;
  font-family: var(--display-font);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
}

.state-panel p {
  max-width: 540px;
  color: var(--muted);
}

.state-panel-error {
  padding: 24px;
  border: 1px solid rgba(255, 98, 92, 0.32);
  border-radius: var(--radius-large);
  background: rgba(72, 22, 25, 0.16);
}

.loading-mark {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--teal-soft);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: #7f9298;
  font-size: 12px;
}

.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
  gap: 28px;
  align-items: start;
}

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

.room-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.room-heading-copy {
  display: contents;
}

.eyebrow,
.card-label {
  margin: 0;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.3;
}

.room-introduction h1 {
  grid-column: 1 / -1;
  max-width: 760px;
  margin: 7px 0 12px;
  font-family: var(--display-font);
  font-size: clamp(32px, 2.65vw, 38px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.room-introduction h1 .term-link {
  color: var(--teal-soft);
  font-style: italic;
  text-decoration-thickness: 0.045em;
  text-underline-offset: 0.14em;
}

.room-lede {
  grid-column: 1;
  max-width: 690px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.term-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #67cce3;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(103, 204, 227, 0.72);
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.1em;
  text-decoration-skip-ink: auto;
  cursor: pointer;
}

.term-link:hover {
  color: #a2e5f4;
  text-decoration-color: currentColor;
}

.term-link:focus-visible {
  outline: none;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(99, 216, 209, 0.55);
}

.learning-status {
  grid-column: 1;
  margin: 14px 0 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}

.room-actions {
  grid-column: 2;
  grid-row: 3 / 5;
  display: grid;
  justify-items: end;
  gap: 10px;
  padding-bottom: 3px;
}

.action-buttons,
.answer-row {
  display: flex;
  gap: 8px;
}

.button {
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(4, 17, 30, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  border-color: #2e6976;
  background: var(--surface-raised);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-primary {
  border-color: #1a8f8b;
  background: linear-gradient(135deg, #0a686d, #168b84);
  color: #effffd;
}

.button-primary:hover:not(:disabled) {
  border-color: var(--teal-soft);
  background: linear-gradient(135deg, #0c797b, #1a9b91);
}

.button-secondary.is-active {
  border-color: rgba(98, 220, 132, 0.58);
  background: rgba(35, 128, 91, 0.38);
  color: #adf3bd;
}

.next-button {
  min-width: 174px;
}

.difficulty-section {
  margin-top: 8px;
}

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

.section-heading-row h2,
.practice-section h2,
.rail-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

.difficulty-layers {
  display: grid;
  gap: 8px;
}

.difficulty-card {
  --level: var(--green);
  --level-faint: rgba(98, 220, 132, 0.1);
  overflow: clip;
  border: 1px solid var(--border);
  border-left: 3px solid var(--level);
  border-radius: var(--radius);
  background: rgba(5, 18, 31, 0.78);
}

.difficulty-card.level-medium {
  --level: var(--amber);
  --level-faint: rgba(241, 179, 56, 0.1);
}

.difficulty-card.level-hard {
  --level: var(--coral);
  --level-faint: rgba(255, 98, 92, 0.1);
}

.difficulty-card[open] {
  border-color: color-mix(in srgb, var(--level) 30%, var(--border));
  border-left-color: var(--level);
  background: rgba(6, 21, 35, 0.9);
}

.difficulty-summary {
  display: grid;
  min-height: 91px;
  grid-template-columns: 54px minmax(0, 1fr) auto 55px 20px;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  list-style: none;
  cursor: pointer;
}

.difficulty-summary::-webkit-details-marker,
.concept-summary::-webkit-details-marker,
.compact-disclosure > summary::-webkit-details-marker,
.why-disclosure > summary::-webkit-details-marker {
  display: none;
}

.difficulty-summary:hover {
  background: rgba(21, 52, 62, 0.32);
}

.difficulty-card[open] > .difficulty-summary {
  background: var(--level-faint);
}

.difficulty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--level) 68%, transparent);
  border-radius: 50%;
  background: var(--level-faint);
  color: var(--level);
  font-family: var(--math-font);
  font-size: 19px;
  line-height: 1;
}

.difficulty-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.difficulty-level {
  color: var(--level);
  font-size: 17px;
  font-weight: 600;
}

.difficulty-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.difficulty-subtitle {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-meta {
  display: grid;
  min-width: 78px;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.difficulty-meta strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

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

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #08212b;
}

.progress-ring > span {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.summary-chevron {
  color: var(--text-soft);
  font-size: 24px;
  line-height: 1;
  text-align: center;
  transition: transform 150ms ease;
}

.difficulty-card[open] .summary-chevron {
  transform: rotate(90deg);
}

.layer-body {
  display: grid;
  gap: 28px;
  min-width: 0;
  padding: 25px 25px 30px;
  border-top: 1px solid var(--border);
}

.prompt-card,
.practice-workspace,
.answer-banner,
.lesson-check-card,
.watch-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(6, 20, 34, 0.76);
}

.prompt-card {
  padding: 22px 24px;
}

.layer-body > .prompt-card {
  max-width: 74ch;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.prompt-card .question-text,
.practice-prompt {
  margin: 7px 0 18px;
  color: var(--text);
  font-size: clamp(19px, 2.15vw, 23px);
  font-weight: 500;
  line-height: 1.48;
}

.goal-text,
.answer-format {
  margin: 7px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.layer-body .goal-text,
.meaning-disclosure {
  max-width: 70ch;
}

.meaning-disclosure {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.meaning-disclosure > p {
  line-height: 1.65;
}

.walkthrough {
  min-width: 0;
}

.solution-heading {
  margin: 0 0 15px;
  color: var(--text);
  font-family: var(--display-font);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.solution-heading::after {
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.walkthrough-step {
  display: block;
  min-width: 0;
  overflow: clip;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(42, 82, 94, 0.42);
  background: transparent;
  transition: border-color 140ms ease, background 140ms ease;
}

.walkthrough-step[open] {
  border-left-color: var(--teal-soft);
  background: rgba(8, 35, 44, 0.24);
}

.walkthrough-step:last-child {
  border-bottom: 0;
}

.step-summary {
  display: grid;
  min-height: 70px;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 13px;
  padding: 14px 13px 14px 8px;
  list-style: none;
  cursor: pointer;
}

.step-summary::-webkit-details-marker {
  display: none;
}

.step-summary:hover {
  background: rgba(21, 52, 62, 0.24);
}

.step-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #315666;
  border-radius: 50%;
  background: rgba(4, 18, 31, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.walkthrough-step[open] .step-marker {
  border-color: var(--teal-soft);
  background: rgba(31, 200, 189, 0.1);
  color: var(--text);
}

.walkthrough-step[data-understood="true"] .step-marker {
  border-color: rgba(98, 220, 132, 0.72);
  background: rgba(34, 119, 83, 0.2);
  color: #adf3bd;
}

.step-title {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.step-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.walkthrough-step[data-understood="true"] .step-status {
  color: #9ce9ae;
}

.step-chevron {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transition: transform 140ms ease;
}

.walkthrough-step[open] .step-chevron {
  transform: rotate(90deg);
}

.step-content {
  display: grid;
  gap: 15px;
  padding: 3px 18px 23px 59px;
}

.understood-button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #2a5660;
  border-radius: 7px;
  background: rgba(4, 18, 31, 0.8);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.understood-button:hover {
  color: var(--text);
}

.understood-button.is-understood {
  border-color: rgba(98, 220, 132, 0.62);
  background: rgba(34, 119, 83, 0.25);
  color: #a3eeb5;
}

.step-actions {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  margin-top: 2px;
}

.step-action,
.why-body {
  max-width: 70ch;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.72;
}

.step-working {
  width: min(100%, 680px);
  max-width: 100%;
  margin: 8px auto 4px;
  padding: 13px 15px;
  overflow-wrap: anywhere;
  border-block: 1px solid rgba(31, 200, 189, 0.2);
  background: transparent;
  color: var(--text);
  font-family: var(--math-font);
  font-size: clamp(20px, 2.6vw, 29px);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.why-disclosure,
.compact-disclosure {
  color: var(--text-soft);
}

.why-disclosure > summary,
.compact-disclosure > summary {
  width: fit-content;
  list-style: none;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}

.why-disclosure > summary::before,
.compact-disclosure > summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: currentColor;
}

.why-disclosure[open] > summary::before,
.compact-disclosure[open] > summary::before {
  content: "−";
}

.why-body {
  margin: 13px 0 0;
  padding-left: 18px;
  border-left: 2px solid rgba(98, 220, 132, 0.52);
}

.answer-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  border-color: rgba(98, 220, 132, 0.32);
  background: rgba(22, 78, 59, 0.25);
}

.answer-check {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--green);
}

.answer-banner > div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.answer-banner strong {
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.answer-value {
  color: #8ce9a4;
  font-family: var(--math-font);
  font-size: 24px;
  font-weight: 600;
}

.lesson-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.watch-card,
.lesson-check-card {
  padding: 17px 18px;
}

.watch-card .card-label {
  color: var(--coral);
}

.lesson-check-card .card-label {
  color: var(--teal-soft);
}

.watch-card p:last-child,
.lesson-check-card p:last-child {
  margin-bottom: 0;
  color: var(--text-soft);
  white-space: pre-line;
}

.practice-section {
  margin-top: 32px;
  padding: 19px 20px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(6, 26, 35, 0.58);
}

.practice-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.practice-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.practice-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.practice-mark {
  color: var(--teal);
  font-size: 22px;
}

.practice-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid rgba(40, 78, 90, 0.45);
  color: var(--muted);
  font-size: 10px;
}

.practice-workspace {
  margin-top: 18px;
  padding: 18px;
}

.practice-prompt-card {
  margin-bottom: 16px;
}

.answer-format-label {
  margin-top: 18px;
}

.compact-disclosure {
  margin: 13px 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 31, 41, 0.58);
}

.compact-disclosure > p,
.compact-disclosure > ol {
  margin: 12px 0 2px;
}

.compact-disclosure li + li {
  margin-top: 7px;
}

#answer-form {
  margin-top: 18px;
}

#answer-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-weight: 600;
}

.answer-row input {
  min-width: 0;
  flex: 1;
  min-height: 43px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: #03151e;
  color: var(--text);
}

.answer-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 200, 189, 0.12);
}

.answer-feedback {
  min-height: 24px;
  margin-top: 12px;
  color: #ff958f;
  font-weight: 500;
}

.answer-feedback.is-correct {
  color: var(--green);
}

.worked-feedback {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid rgba(98, 220, 132, 0.3);
  border-radius: 9px;
  background: rgba(27, 88, 65, 0.18);
}

.worked-feedback h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.worked-answer {
  color: var(--green);
  font-family: var(--math-font);
  font-size: 20px;
}

.inline-status {
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.support-rail {
  position: sticky;
  top: 148px;
  display: grid;
  gap: 14px;
}

.rail-panel {
  padding: 19px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 18, 31, 0.74);
}

.rail-panel h2 {
  font-size: 16px;
}

.concept-introduction {
  margin: 10px 0 14px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.concept-list {
  border-top: 1px solid rgba(44, 82, 93, 0.45);
}

.concept-card {
  --concept-colour: var(--teal-soft);
  border-bottom: 1px solid rgba(44, 82, 93, 0.45);
}

.concept-card:nth-child(2) {
  --concept-colour: var(--magenta);
}

.concept-card:nth-child(3) {
  --concept-colour: var(--amber);
}

.concept-summary {
  position: relative;
  display: grid;
  min-height: 74px;
  grid-template-columns: 35px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  list-style: none;
  cursor: pointer;
}

.concept-summary::before {
  content: attr(data-icon);
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--concept-colour) 75%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--concept-colour) 12%, transparent);
  color: var(--concept-colour);
  font-family: var(--math-font);
  font-size: 14px;
}

.concept-summary::after {
  content: "+";
  color: var(--text-soft);
  font-size: 19px;
  font-weight: 300;
}

.concept-card[open] .concept-summary::after {
  content: "−";
}

.concept-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.concept-summary strong {
  color: var(--concept-colour);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.concept-summary span {
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
}

.concept-body {
  min-width: 0;
  padding: 4px 10px 18px 44px;
  color: var(--text-soft);
  font-size: 11px;
  overflow-wrap: break-word;
}

.concept-body > p {
  line-height: 1.6;
}

.concept-example {
  margin: 11px 0;
  padding: 10px 11px;
  border-left: 2px solid var(--concept-colour);
  background: rgba(3, 14, 26, 0.72);
  color: var(--text);
  font-family: var(--math-font);
  line-height: 1.55;
}

.concept-detail {
  margin-top: 13px;
}

.concept-detail h3 {
  margin: 0 0 5px;
  color: var(--concept-colour);
  font-size: 10px;
  letter-spacing: 0.045em;
}

.concept-detail p {
  margin: 0;
  line-height: 1.6;
}

.progress-panel {
  display: grid;
  gap: 13px;
}

.overall-progress {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  place-self: center;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), #143843 0);
}

.overall-progress::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--surface);
}

.overall-progress span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
}

.progress-facts {
  display: grid;
  gap: 5px;
  margin: 0;
}

.progress-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.progress-facts dt,
.progress-facts dd {
  margin: 0;
}

.progress-facts dd {
  color: var(--green);
}

.rail-link {
  display: flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--teal-soft);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}

.rail-link:hover {
  border-color: var(--border-strong);
  background: rgba(15, 54, 65, 0.34);
}

.compact-panel {
  padding-top: 16px;
  padding-bottom: 16px;
}

.compact-panel p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.rail-button {
  width: 100%;
  margin-top: 12px;
  background: transparent;
  cursor: pointer;
}

.dictionary-popover {
  position: fixed;
  z-index: 100;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: #08251f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
}

.dictionary-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
  background: #08251f;
  transform: rotate(45deg);
}

.dictionary-popover.opens-above::before {
  top: auto;
  bottom: -6px;
  border: 0;
  border-right: 1px solid var(--teal);
  border-bottom: 1px solid var(--teal);
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dictionary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dictionary-back {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(98, 220, 132, 0.42);
  border-radius: 7px;
  background: transparent;
  color: var(--green);
  font-size: 11px;
  cursor: pointer;
}

.dictionary-back:hover {
  border-color: rgba(98, 220, 132, 0.72);
  background: rgba(34, 119, 83, 0.2);
}

.dictionary-label {
  margin: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(98, 220, 132, 0.55);
  border-radius: 7px;
  background: transparent;
  color: var(--green);
  font-size: 19px;
  cursor: pointer;
}

.dictionary-popover h2 {
  margin: 14px 0 20px;
  font-family: var(--math-font);
  font-size: 29px;
  font-weight: 600;
}

.dictionary-popover h2:focus {
  outline: none;
}

.dictionary-popover section + section {
  margin-top: 17px;
}

.dictionary-popover h3 {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dictionary-popover p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.62;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 76px;
  }

  .side-navigation {
    align-items: center;
    padding-inline: 9px;
  }

  .brand {
    padding-inline: 4px;
  }

  .brand strong,
  .navigation-item > span:last-child {
    display: none;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

  .navigation-item {
    width: 50px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding-inline: 6px;
  }

  .top-bar {
    padding-inline: 22px;
  }

  main {
    padding-inline: 22px;
  }
}

@media (max-width: 980px) {
  .top-bar {
    position: relative;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .learner-strip {
    position: absolute;
    top: 18px;
    right: 22px;
    grid-template-columns: minmax(160px, 1fr) 72px 72px;
  }

  .top-bar-main {
    padding-right: 390px;
  }

  .atlas-search {
    width: 100%;
  }

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

  .support-rail {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .concept-shelf {
    grid-row: span 2;
  }

}

@media (max-width: 820px) {
  .learner-strip {
    position: static;
  }

  .top-bar-main {
    padding-right: 0;
  }

  .room-introduction {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .room-actions {
    grid-column: 1;
    grid-row: auto;
    justify-items: start;
  }

  .next-button {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --sidebar-width: 0px;
  }

  body {
    padding-bottom: 68px;
  }

  .app-shell {
    display: block;
  }

  .side-navigation {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 64px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    border-right: 0;
    background: rgba(2, 10, 22, 0.98);
    backdrop-filter: blur(14px);
  }

  .brand,
  .secondary-navigation,
  .primary-navigation .navigation-item:nth-child(n + 6) {
    display: none;
  }

  .primary-navigation {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin: 0;
  }

  .primary-navigation .navigation-item {
    display: grid;
    width: auto;
    min-height: 50px;
    grid-template-columns: 1fr;
    grid-template-rows: 24px auto;
    gap: 1px;
    padding: 4px 2px;
    justify-items: center;
    font-size: 9px;
  }

  .primary-navigation .navigation-item > span:last-child {
    display: block;
  }

  .navigation-icon {
    font-size: 18px;
  }

  .top-bar {
    padding: 14px 16px;
    gap: 14px;
  }

  .atlas-heading {
    gap: 14px;
  }

  .atlas-title {
    font-size: 19px;
  }

  .learner-strip {
    grid-template-columns: minmax(155px, 1fr) 66px 66px;
  }

  .metric-card {
    min-height: 62px;
  }

  main {
    padding: 20px 16px 54px;
  }

  .breadcrumbs {
    margin-bottom: 18px;
  }

  .room-introduction h1 {
    font-size: clamp(30px, 9vw, 39px);
  }

  .room-lede {
    font-size: 14px;
  }

  .difficulty-summary {
    grid-template-columns: 45px minmax(0, 1fr) 48px 18px;
    gap: 10px;
    padding-inline: 12px;
  }

  .difficulty-icon {
    width: 41px;
    height: 41px;
  }

  .difficulty-meta {
    display: none;
  }

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

  .layer-body {
    padding: 22px 17px 27px;
  }

  .step-summary {
    grid-template-columns: 35px minmax(0, 1fr) auto 17px;
    gap: 10px;
    padding-inline: 7px 10px;
  }

  .step-content {
    padding: 3px 13px 21px 52px;
  }

  .understood-button {
    width: fit-content;
  }

  .lesson-footer-grid,
  .support-rail {
    grid-template-columns: 1fr;
  }

  .concept-shelf {
    grid-row: auto;
  }

  .practice-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .practice-intro > .button {
    align-self: stretch;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding-inline: 13px;
  }

  .atlas-search {
    display: none;
  }

  .learner-strip {
    grid-template-columns: minmax(145px, 1fr) 62px 62px;
  }

  .level-badge {
    width: 39px;
    height: 43px;
  }

  .metric-card {
    min-height: 58px;
    padding-inline: 4px;
  }

  .metric-card strong {
    font-size: 14px;
  }

  main {
    padding-inline: 13px;
  }

  .room-actions,
  .action-buttons {
    width: 100%;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .room-actions .button,
  .next-button {
    width: 100%;
  }

  .difficulty-summary {
    min-height: 85px;
  }

  .difficulty-subtitle {
    display: none;
  }

  .difficulty-level {
    font-size: 16px;
  }

  .step-summary {
    grid-template-columns: 34px minmax(0, 1fr) 17px;
  }

  .step-status {
    grid-column: 2;
    justify-self: start;
  }

  .step-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .step-content {
    padding-left: 48px;
  }

  .answer-row {
    flex-direction: column;
  }

  .answer-row .button {
    width: 100%;
  }

  .practice-section {
    padding-inline: 15px;
  }

  .dictionary-popover {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
