:root {
  --bg: #000000;
  --panel: rgba(17, 17, 17, 0.98);
  --panel-strong: rgba(24, 24, 24, 0.99);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f1ece4;
  --muted: #b8b8b8;
  --metadata: color-mix(in srgb, var(--muted) 68%, var(--panel-strong));
  --accent: #eee7dd;
  --accent-strong: #fff8ed;
  --accent-soft: rgba(255, 255, 255, 0.06);
  --control-bg: rgba(18, 18, 18, 0.98);
  --control-hover-bg: #232323;
  --control-hover-border: rgba(255, 255, 255, 0.16);
  --shadow: none;
  --transition-ui: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  font-synthesis: none;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body.notes-page {
  margin: 0;
  color: var(--text);
  background: var(--panel-strong);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.notes-practice-boot .practice-viewer {
  visibility: hidden;
}

html.notes-lesson-boot [data-notes-lesson-body] {
  visibility: hidden;
}

:is(html, body).notes-page--sepia {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f8fafc;
  --panel-strong: #f1f4f7;
  --border: rgba(17, 17, 17, 0.12);
  --text: #111827;
  --muted: #53606d;
  --accent: #1f2937;
  --accent-strong: #0f172a;
  --accent-soft: rgba(17, 17, 17, 0.04);
  --control-bg: #f3f6f8;
  --control-hover-bg: #e7edf2;
  --control-hover-border: rgba(17, 17, 17, 0.18);
  --shadow: none;
}

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

.shell {
  width: min(1280px, calc(100% - 1rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.75rem 1rem;
  border-radius: 0;
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: var(--shadow);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.notes-header {
  padding: 1.5rem 0 1rem;
}

.notes-header__inner {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem 1.25rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.notes-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem;
}

.notes-quick-actions--floating {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.55rem;
  width: fit-content;
  max-width: calc(100vw - 2rem);
}

.notes-action-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--notes-button-border, var(--border));
  border-radius: 0;
  background: var(--notes-button-bg, var(--control-bg));
  color: var(--notes-button-fg, var(--accent-strong));
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-ui);
}

.notes-action-chip:hover,
.notes-action-chip:focus-visible {
  background: var(--notes-button-hover-bg, var(--control-hover-bg));
  border-color: var(--notes-button-hover-border, var(--control-hover-border));
  color: var(--notes-button-hover-fg, var(--notes-button-fg, var(--accent-strong)));
  transform: var(--notes-button-hover-transform, translateY(-1px));
}

.notes-action-chip:focus-visible {
  outline: 2px solid var(--notes-button-outline, var(--accent-strong));
  outline-offset: 2px;
}

.notes-action-chip--search {
  gap: 0.5rem;
  --notes-button-bg: #d7ebcd;
  --notes-button-border: #b2c99f;
  --notes-button-fg: #20331b;
  --notes-button-hover-bg: #e4f2dd;
  --notes-button-hover-border: #c3d7b3;
  --notes-button-hover-fg: #20331b;
}

@supports (background-color: color-mix(in srgb, white, black)) {
  .notes-action-chip--search {
    --notes-button-hover-bg: color-mix(in srgb, var(--notes-button-bg) 70%, white);
    --notes-button-hover-border: color-mix(in srgb, var(--notes-button-border) 70%, white);
  }
}

.notes-action-chip--practice {
  --notes-button-bg: #d9f1d1;
  --notes-button-border: #aecd9f;
  --notes-button-fg: #1f3718;
  --notes-button-hover-bg: #e5f7df;
  --notes-button-hover-border: #bfd9b1;
  --notes-button-hover-fg: #1f3718;
}

@supports (background-color: color-mix(in srgb, white, black)) {
  .notes-action-chip--practice {
    --notes-button-hover-bg: color-mix(in srgb, var(--notes-button-bg) 70%, white);
    --notes-button-hover-border: color-mix(in srgb, var(--notes-button-border) 70%, white);
  }
}

.notes-theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.notes-theme-toggle:hover,
.notes-theme-toggle:focus-visible {
  background: transparent;
  border-color: transparent;
  color: var(--accent-strong);
  transform: none;
  text-decoration: underline;
}

:is(html, body).notes-page--sepia .notes-theme-toggle {
  color: var(--metadata);
}

.notes-action-chip--back {
  --notes-button-bg: #c7b8d9;
  --notes-button-border: #9c89b8;
  --notes-button-fg: #2b2138;
  --notes-button-hover-bg: #d7cbe5;
  --notes-button-hover-border: #ab99c4;
  --notes-button-hover-fg: #241b31;
  --notes-button-outline: #d7cbe5;
}

.notes-quick-actions--floating .notes-action-chip {
  box-shadow: none;
  backdrop-filter: none;
}

.search-panel__field input:focus-visible,
.search-result:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.subjects-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--panel-strong);
}

.subjects-panel[hidden] {
  display: none;
}

.subjects-panel__content {
  width: min(1180px, 100%);
  min-height: 100%;
  margin: 0 auto;
}

.subjects-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.subjects-panel__head h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.subjects-panel__groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.subjects-panel__group h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  line-height: 1.2;
}

.subjects-panel__list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subjects-panel__list .notes-inline-link {
  color: var(--metadata);
  font-weight: 500;
}

.subjects-panel__list .notes-inline-link[aria-current="page"] {
  color: var(--accent-strong);
  text-decoration: underline;
}

.subjects-panel__list .notes-inline-link:focus-visible,
.subjects-panel__list .notes-inline-link:hover {
  color: var(--accent-strong);
}

body.subjects-panel-open {
  overflow: hidden;
}

.section-label,
.notes-header__eyebrow {
  margin: 0 0 0.02rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--metadata);
  font-weight: 400;
}

.notes-header__title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.notes-header__brand-link {
  color: #c7b8d9;
  text-decoration: underline;
}

.notes-header__brand-link:hover,
.notes-header__brand-link:focus-visible {
  text-decoration: underline;
}

.notes-header__credit {
  color: var(--metadata);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: none;
}

.notes-header h1,
.notes-viewer h1,
.notes-viewer h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.notes-header h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
}

.notes-header__brand {
  display: grid;
  gap: 0.02rem;
  flex: 1 1 320px;
  min-width: 0;
}

.notes-intro {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(10px);
  overflow: auto;
}

.search-panel[hidden] {
  display: none;
}

.search-panel__card {
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  overflow: hidden;
}

.search-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-panel__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.1;
}

.search-panel__field {
  display: block;
}

.search-panel__field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.9rem 1rem;
  font: inherit;
}

.search-panel__field input::placeholder {
  color: var(--muted);
}

.search-panel__status {
  margin: 0.8rem 0 0;
  color: var(--muted);
  min-height: 1.5rem;
}

.search-results {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.55rem;
  max-height: calc(100vh - 14rem);
  overflow: auto;
  padding-right: 0.1rem;
}

.search-result {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.9rem 1rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-ui);
}

.search-result__item {
  display: block;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-strong);
  transform: translateX(2px);
}

.search-result.is-active,
.search-result[aria-current="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-strong);
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  transform: translateX(2px);
}

.search-result__title {
  display: block;
  margin: 0;
}

.search-result__title {
  margin-top: 0.18rem;
  font-weight: 700;
}

.search-result__subject {
  display: block;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-result__snippet {
  display: -webkit-box;
  color: var(--muted);
  line-height: 1.55;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin-top: 0.45rem;
}

.search-result mark,
.notes-search-match {
  background: rgba(255, 255, 255, 0.14);
  color: var(--accent-strong);
  border-radius: 0;
  padding: 0 0.18rem;
}

:is(html, body).notes-page--sepia .search-panel__field input {
  background: #ffffff;
}

:is(html, body).notes-page--sepia .practice-level--level-1 {
  --practice-level-accent: #84f0b8;
  --practice-level-border: rgba(132, 240, 184, 0.34);
}

:is(html, body).notes-page--sepia .practice-level--level-2 {
  --practice-level-accent: #8fb2ff;
  --practice-level-border: rgba(143, 178, 255, 0.34);
}

:is(html, body).notes-page--sepia .practice-level--level-3 {
  --practice-level-accent: #ffd27a;
  --practice-level-border: rgba(255, 210, 122, 0.34);
}

:is(html, body).notes-page--sepia .practice-level--level-4 {
  --practice-level-accent: #ff9ca8;
  --practice-level-border: rgba(255, 156, 168, 0.34);
}

:is(html, body).notes-page--sepia .search-result,
:is(html, body).notes-page--sepia .guide-tree__button,
:is(html, body).notes-page--sepia .practice-level,
:is(html, body).notes-page--sepia .practice-problem,
:is(html, body).notes-page--sepia .practice-problem__study-input {
  background: rgba(17, 17, 17, 0.03);
}

:is(html, body).notes-page--sepia .search-result:hover,
:is(html, body).notes-page--sepia .search-result:focus-visible,
:is(html, body).notes-page--sepia .guide-tree__button:hover,
:is(html, body).notes-page--sepia .guide-tree__button:focus-visible {
  background: rgba(17, 17, 17, 0.06);
}

:is(html, body).notes-page--sepia .search-result {
  background: rgba(17, 17, 17, 0.045);
  border-color: rgba(17, 17, 17, 0.2);
}

:is(html, body).notes-page--sepia .search-result:hover,
:is(html, body).notes-page--sepia .search-result:focus-visible {
  background: rgba(17, 17, 17, 0.09);
  border-color: var(--accent-strong);
}

:is(html, body).notes-page--sepia .search-result.is-active,
:is(html, body).notes-page--sepia .search-result[aria-current="true"],
:is(html, body).notes-page--sepia .guide-tree__button.is-ancestor,
:is(html, body).notes-page--sepia .guide-tree__button.is-active {
  background: rgba(17, 17, 17, 0.08);
}

:is(html, body).notes-page--sepia .search-result mark,
:is(html, body).notes-page--sepia .notes-search-match {
  background: rgba(17, 17, 17, 0.12);
  color: #000000;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 75ch) minmax(0, 290px);
  gap: 1rem;
  align-items: start;
  justify-content: center;
}

.notes-layout__balance {
  min-width: 0;
}

.practice-layout {
  display: block;
}

.landing-hero,
.landing-support {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.25rem, 4vw, 3rem);
}

.notes-landing-page .notes-header__inner,
.notes-landing-page .landing-hero,
.notes-landing-page .landing-support,
.notes-landing-page .landing-subject-card {
  border: 0;
}

.landing-hero__intro {
  max-width: 52rem;
}

.landing-hero h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.98;
  text-wrap: balance;
}

.landing-hero__lead {
  max-width: 52ch;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.5;
}

.landing-router {
  display: grid;
  gap: 0.85rem;
}

.landing-router h2,
.landing-support h2,
.landing-philosophy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.landing-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.landing-subject-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 14rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.landing-subject-card:hover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

.landing-subject-card:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.landing-subject-card__number,
.landing-subject-card__link {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.landing-subject-card__title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
}

.landing-subject-card__description {
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.5;
}

.landing-subject-card__link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: auto;
}

.landing-subject-card__link span {
  font-size: 1.25rem;
  letter-spacing: 0;
}

.landing-support {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 1.5rem;
}

.landing-support__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.landing-philosophy {
  display: grid;
  gap: 0.9rem;
  max-width: 70rem;
  margin: clamp(1rem, 4vw, 3rem) auto;
  padding: clamp(1rem, 4vw, 2rem) 0;
  border-top: 1px solid var(--border);
}

.notes-landing-page .landing-philosophy {
  border-top: 0;
}

.landing-philosophy__copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  color: var(--muted);
  line-height: 1.6;
}

.landing-philosophy__copy p {
  margin: 0;
}

.text-underline-muted {
  color: var(--metadata);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.text-underline-muted:hover,
.text-underline-muted:focus-visible {
  color: var(--muted);
  text-decoration-color: var(--muted);
}

.panel.concept-dag-tree-panel {
  display: grid;
  padding: 1rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.concept-dag-tree-panel + [data-notes-lesson-body] > :first-child {
  margin-top: 1.2em;
}

.concept-dag-tree-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.concept-dag-tree {
  overflow-x: auto;
}

.concept-dag-tree__lines {
  display: grid;
  min-width: max-content;
  --concept-dag-unit: 4rem;
  font-size: 1.0rem;
  line-height: 1.5rem;
}

.concept-dag-tree__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  position: relative;
  width: max-content;
  white-space: nowrap;
}

.concept-dag-tree__connector {
  display: flex;
  flex: 0 0 auto;
  height: 1.5rem;
  color: var(--metadata);
}

.concept-dag-tree__connector-cell {
  position: relative;
  display: inline-block;
  flex: 0 0 var(--concept-dag-unit);
  width: var(--concept-dag-unit);
  height: 1.5rem;
}

.concept-dag-tree__connector-cell--vertical::after,
.concept-dag-tree__connector-cell--corner::after,
.concept-dag-tree__connector-cell--junction::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0.5rem;
  width: 1px;
  height: 100%;
  background: currentColor;
}

.concept-dag-tree__connector-cell--corner::before,
.concept-dag-tree__connector-cell--junction::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.5rem;
  height: 1px;
  background: currentColor;
}

.concept-dag-tree__connector-cell--corner::before {
  /* Connect this cell's center to the next cell's center. */
  width: calc(var(--concept-dag-unit) + 0.5rem);
}

.concept-dag-tree__connector-cell--junction::before {
  width: calc(var(--concept-dag-unit) + 0.5rem);
}

.concept-dag-tree__connector--tail .concept-dag-tree__connector-cell--corner::after,
.concept-dag-tree__connector--tail .concept-dag-tree__connector-cell--junction::after {
  /* Overlap the midpoint stroke by one pixel so the T-shaped joins cannot rasterize
     as a one-pixel gap at fractional CSS coordinates. */
  height: calc(50% + 1px);
}

.concept-dag-tree__connector--tail .concept-dag-tree__connector-cell--junction:last-child::before {
  width: calc(var(--concept-dag-unit) + 0.5rem);
}

.concept-dag-tree__nodes {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  background: var(--panel-strong);
}

.concept-dag-tree__node {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--metadata);
  font: inherit;
  line-height: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.concept-dag-tree__separator {
  color: var(--metadata);
  white-space: pre;
}

.concept-dag-tree__node:hover,
.concept-dag-tree__node:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.concept-dag-tree__node:focus-visible {
  outline: 1px solid var(--accent-strong);
  outline-offset: 1px;
}

.concept-dag-tree__node.is-selected {
  color: var(--metadata);
  font-weight: 700;
}

.concept-dag-tree__empty {
  margin: 0;
  color: var(--metadata);
}


.notes-structures {
  display: grid;
  gap: 0.65rem;
  flex: 1 1 100%;
  min-width: 0;
  position: relative;
}

.notes-sidebar {
  padding: 1.15rem 1.15rem 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.notes-sidebar__head {
  margin-bottom: 0.95rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.notes-sidebar__title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.guide-tree,
.guide-tree__branch {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-tree {
  display: grid;
  gap: 0.45rem;
}

.guide-tree__branch {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.guide-tree__button {
  --guide-depth: 0;
  appearance: none;
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.68rem 0.8rem 0.68rem calc(0.8rem + (var(--guide-depth) * 0.9rem));
  text-align: left;
  font: inherit;
  line-height: 1.45;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.guide-tree__button:hover,
.guide-tree__button:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--border);
  transform: translateX(2px);
}

.guide-tree__button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.guide-tree__button--folder {
  font-weight: 700;
}

.guide-tree__button--page {
  font-weight: 600;
}

.guide-tree__button.is-ancestor {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.guide-tree__button.is-active {
  color: var(--accent-strong);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.1);
}

.notes-toc {
  margin: 0 0 1rem;
  padding: 0;
  position: static;
  align-self: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.notes-toc__title {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.notes-toc__columns {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  position: relative;
}

.notes-toc__columns>.notes-toc__list {
  flex: 1 1 0;
  min-width: 0;
}

.notes-toc__columns::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 0.5px);
  width: 1px;
  background: var(--border);
}

.practice-page .viewer-head__actions {
  flex-direction: row;
  flex-wrap: wrap;
}

.practice-page .notes-viewer {
  padding-top: 1.35rem;
}

.practice-page .panel {
  box-shadow: none;
}

/* Practice pages use a neutral visual treatment regardless of subject. */
.practice-page {
  --accent: #e0e0e0;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.06);
  --control-hover-bg: #232323;
  --control-hover-border: rgba(255, 255, 255, 0.16);
}

.practice-page .practice-level--level-1,
.practice-page .practice-level--level-2,
.practice-page .practice-level--level-3,
.practice-page .practice-level--level-4 {
  --practice-level-accent: var(--accent-strong);
  --practice-level-border: var(--border);
}

:is(html, body).notes-page--sepia.practice-page {
  --accent: #222222;
  --accent-strong: #111111;
  --accent-soft: rgba(17, 17, 17, 0.04);
  --control-hover-bg: #e7edf2;
  --control-hover-border: rgba(17, 17, 17, 0.18);
}

.practice-problem__feedback {
  --notes-button-bg: var(--control-bg);
}

.notes-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.08rem;
}

.notes-section-toc {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.15rem 0;
}

.notes-section-toc__panel[hidden] {
  display: none;
}

.notes-section-toc__panel > .section-label {
  margin-bottom: 0.95rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.notes-section-toc__list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes-lesson-nav__link {
  display: block;
  color: var(--metadata);
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.notes-lesson-nav__link:hover,
.notes-lesson-nav__link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.notes-lesson-nav__link:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.notes-lesson-nav__link.is-active {
  color: var(--text);
  font-weight: 650;
  text-decoration: underline;
}

.notes-sidebar__toc > .notes-toc__list {
  gap: 0.55rem;
}

.notes-sidebar__toc .notes-lesson-nav__link {
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.notes-sidebar__toc .notes-lesson-nav__link:not(.is-active) {
  color: var(--muted);
}

.notes-toc__list .notes-toc__list {
  margin-top: 0.35rem;
  padding-left: 1rem;
  display: grid;
  gap: 0.18rem;
}

.notes-toc__link {
  text-decoration: none;
  color: var(--text);
  line-height: 1.25;
  font-weight: 600;
}

.notes-toc__link:hover,
.notes-toc__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

.notes-toc__link:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.notes-toc__list .notes-toc__list>.notes-toc__item {
  display: block;
  line-height: 1.25;
  font-size: 0.95rem;
  color: var(--muted);
  white-space: normal;
}

.notes-toc__list .notes-toc__list>.notes-toc__item>.notes-toc__link {
  font-weight: 500;
  font-style: italic;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.vector-calculus-gradient,
.vector-calculus-gradient-3d,
.vector-calculus-vector-field {
  margin: 2rem 0;
  padding: 0;
}

.vector-calculus-gradient>p:first-child,
.vector-calculus-vector-field>h3 {
  margin-top: 0;
}

.vector-calculus-gradient__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(14rem, 0.8fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.vector-calculus-gradient__board {
  width: 100%;
  min-height: 20rem;
  aspect-ratio: 1.35;
  border: 1px solid var(--border);
  background: var(--panel);
  touch-action: none;
}

.vector-calculus-gradient__values {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0;
}

.vector-calculus-gradient__values div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.vector-calculus-gradient__values dt {
  color: var(--muted);
}

.vector-calculus-gradient__values dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.vector-calculus-gradient__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.gradient-legend {
  align-self: center;
  width: 1.1rem;
  height: 0.18rem;
  margin-right: -0.55rem;
}

.gradient-legend--level {
  background: #999;
}

.gradient-legend--gradient {
  background: #444;
}

.gradient-legend--tangent {
  background: #afafaf;
}

.gradient-legend--direction {
  background: #3d3d3d;
}


.vector-calculus-vector-field__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(14rem, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}

.vector-calculus-vector-field__board {
  width: 100%;
  min-height: 22rem;
  aspect-ratio: 1.35;
  border: 1px solid var(--border);
  background: var(--panel);
  touch-action: none;
}

.vector-calculus-gradient__board .JXGtext,
.vector-calculus-gradient__board svg text,
.vector-calculus-gradient-3d__board .JXGtext,
.vector-calculus-gradient-3d__board svg text,
.vector-calculus-vector-field__board .JXGtext,
.vector-calculus-vector-field__board svg text {
  color: var(--text) !important;
  fill: var(--text) !important;
}

.vector-calculus-gradient-3d__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.vector-calculus-gradient-3d__board {
  width: 100%;
  min-height: 24rem;
  aspect-ratio: 1.35;
  border: 1px solid var(--border);
  background: var(--panel);
  touch-action: none;
}

@media (max-width: 760px) {
  .vector-calculus-gradient__layout {
    grid-template-columns: 1fr;
  }

  .vector-calculus-vector-field__layout {
    grid-template-columns: 1fr;
  }

  .vector-calculus-gradient__board {
    min-height: 16rem;
  }

  .vector-calculus-gradient-3d__board {
    min-height: 18rem;
  }

  .vector-calculus-vector-field__board {
    min-height: 18rem;
  }
}

.viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.viewer-meta {
  margin: 0;
  color: var(--metadata);
  line-height: 1.5;
}

.viewer-meta .viewer-source-jump {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}

.viewer-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.practice-note-meta-line {
  margin: 0;
  overflow-wrap: anywhere;
}

.viewer-contributors-block {
  margin-top: 0.35rem;
}

.viewer-contributors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--metadata);
  font-size: 0.94rem;
  line-height: 1.45;
}

.viewer-contributors__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
}

.viewer-contributors__count {
  color: var(--metadata);
  font-variant-numeric: tabular-nums;
}

.viewer-contributors__name {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--metadata);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.viewer-contributors__name:hover,
.viewer-contributors__name:focus-visible {
  color: var(--muted);
}

.viewer-contributors__name:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.viewer-source-jump {
  white-space: nowrap;
}

.suggest-edit-link {
  --notes-button-bg: #b9dcf7;
  --notes-button-border: #8bbfe8;
  --notes-button-fg: #0d2233;
  --notes-button-hover-bg: #d4efff;
  --notes-button-hover-border: #78acd6;
  --notes-button-hover-fg: #0d2233;
  --notes-button-outline: #0d2233;
}

.practice-problem-list {
  display: grid;
  gap: 1rem;
}

.practice-controls {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.practice-filters {
  display: grid;
  gap: 0.7rem;
}

.practice-filters__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.practice-filters__button {
  appearance: none;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--control-bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-ui);
}

.practice-filters__button:hover,
.practice-filters__button:focus-visible {
  background: var(--control-hover-bg);
  border-color: var(--control-hover-border);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.practice-filters__button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.practice-filters__button.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.practice-progress {
  display: grid;
  gap: 0.7rem;
}

.practice-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.practice-progress__summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.practice-progress__track {
  overflow: hidden;
  height: 0.92rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
}

.practice-progress__fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--practice-progress, 0));
  background: var(--accent-strong);
  transition: transform 0.18s ease;
}

.practice-level {
  position: relative;
  display: grid;
  gap: 1rem;
  overflow: hidden;
  padding: 1.1rem;
  border: 1px solid var(--practice-level-border, var(--border));
  background: var(--panel-strong);
  box-shadow: none;
}

.practice-level[hidden] {
  display: none;
}

.practice-level::before {
  display: none;
}

.practice-level--level-1 {
  --practice-level-accent: #84f0b8;
  --practice-level-border: rgba(132, 240, 184, 0.34);
}

.practice-level--level-2 {
  --practice-level-accent: #8fb2ff;
  --practice-level-border: rgba(143, 178, 255, 0.34);
}

.practice-level--level-3 {
  --practice-level-accent: #ffd27a;
  --practice-level-border: rgba(255, 210, 122, 0.34);
}

.practice-level--level-4 {
  --practice-level-accent: #ff9ca8;
  --practice-level-border: rgba(255, 156, 168, 0.34);
}

.practice-level__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--practice-level-border, var(--border));
}

.practice-level__eyebrow {
  display: grid;
  gap: 0.25rem;
}

.practice-level__head h2 {
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1.05;
}

.practice-level__head .section-label {
  display: none;
  margin-bottom: 0.1rem;
  color: var(--practice-level-accent, var(--accent-strong));
  font-weight: 700;
}

.practice-level__badge {
  display: none;
  gap: 0.12rem;
  justify-items: center;
  align-self: start;
  min-width: 5.6rem;
  padding: 0.7rem 0.8rem 0.65rem;
  border: 1px solid var(--practice-level-border, var(--border));
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.practice-level__badge-label {
  display: none;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1;
}

.practice-level__badge-value {
  color: var(--accent-strong);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
}

.practice-problem {
  padding: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.practice-problem.is-complete> :not(.practice-problem__head) {
  display: none;
}

.practice-problem.is-complete .practice-problem__head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.practice-problem__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.practice-problem__complete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.practice-problem__complete-toggle:hover,
.practice-problem__complete-toggle:focus-visible {
  border-color: var(--accent-strong);
}

.practice-problem__complete-toggle:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.practice-problem__complete-mark {
  display: none;
}

.practice-problem__complete-toggle[aria-pressed='true'] {
  border-color: #b2c99f;
  background: #d7ebcd;
  color: #20331b;
}

.practice-problem__complete-toggle[aria-pressed='true']:hover,
.practice-problem__complete-toggle[aria-pressed='true']:focus-visible {
  border-color: #c3d7b3;
  background: #e4f2dd;
  color: #20331b;
}

.practice-problem__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.practice-problem__number {
  flex: 0 0 auto;
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.practice-problem__title-text {
  min-width: 0;
}

.practice-problem__meta {
  min-width: 0;
  margin: 0.35rem 0 0;
  color: var(--metadata);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.practice-problem__meta .notes-inline-link {
  color: var(--metadata);
}

.practice-problem__meta .notes-inline-link:hover,
.practice-problem__meta .notes-inline-link:focus-visible {
  color: var(--muted);
}

.practice-problem__head-actions { display: flex; align-items: flex-start; gap: 0.55rem; flex-wrap: wrap; justify-content: flex-end; }
.worksheet-controls { margin: 1rem 0 1.25rem; padding: 0; }
.worksheet-controls__summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; list-style: none; }
.worksheet-controls__summary::-webkit-details-marker { display: none; }
.worksheet-controls__summary::after { content: '+'; color: var(--accent-strong); font-size: 1.3rem; }
.worksheet-controls[open] .worksheet-controls__summary::after { content: '−'; }
.worksheet-controls__title { display: block; margin-top: 0.2rem; font-size: 1.15rem; font-weight: 700; }
.worksheet-controls__body { padding: 0 1rem 1rem; }
.worksheet-controls__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.worksheet-controls label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.worksheet-controls input[type='text'], .worksheet-controls select { width: 100%; padding: 0.55rem; border: 1px solid var(--border); background: var(--control-bg); color: var(--text); font: inherit; }
.worksheet-controls__actions, .worksheet-selection__actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.worksheet-action-link, .practice-problem__worksheet-toggle { appearance: none; border: 0; padding: 0; background: transparent; color: var(--accent-strong); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.worksheet-action-link:hover, .worksheet-action-link:focus-visible, .practice-problem__worksheet-toggle:hover, .practice-problem__worksheet-toggle:focus-visible { color: var(--accent); }
.worksheet-action-link:focus-visible, .practice-problem__worksheet-toggle:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.worksheet-action-link:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.worksheet-controls__error { color: #a91f2d; font-weight: 700; }
.worksheet-selection { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.worksheet-selection h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.worksheet-selection__empty { margin: 0; color: var(--muted); }
.worksheet-selection__list { display: grid; gap: 0.45rem; margin: 0; padding-left: 1.5rem; }
.worksheet-selection__item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 0.55rem; border: 1px solid var(--border); background: var(--control-bg); cursor: grab; }
.worksheet-selection__item:active { cursor: grabbing; }
.worksheet-selection__label { min-width: 0; overflow-wrap: anywhere; }
.worksheet-controls .worksheet-selection__spacing { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; flex: 0 0 auto; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.worksheet-selection__spacing input { width: 4.5rem; padding: 0.35rem; border: 1px solid var(--border); background: var(--control-bg); color: var(--text); font: inherit; }
.worksheet-selection__spacing input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.worksheet-selection__actions { flex: 0 0 auto; font-size: 0.85rem; }
.worksheet-print { display: none; }

.practice-problem__skills {
  display: inline;
  margin: 0;
  padding: 0;
  list-style: none;
}

.practice-problem__skills li {
  display: inline;
}

.practice-problem__skills li + li::before {
  content: "-";
  margin: 0 0.35rem;
  color: var(--muted);
}

.practice-problem__actions {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.practice-problem__study {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.practice-problem__action-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.practice-problem__study-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 6rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.practice-problem__study-input::placeholder {
  color: var(--muted);
}

.practice-problem__study-input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.practice-problem__action-separator {
  color: var(--muted);
  user-select: none;
}

.practice-problem__prompt {
  margin-bottom: 1rem;
}

.practice-problem__solution {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.practice-problem__solution .markdown-body {
  margin-top: 0.4rem;
}

.practice-problem__solution-empty {
  margin: 0;
  color: var(--muted);
}

.subject-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  line-height: 1.7;
}

.subject-list > li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.notes-inline-link,
.subject-list button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.subject-list > li > .notes-inline-link,
.subject-list > li > button {
  color: var(--metadata);
}

.subject-section__list .notes-inline-link {
  color: var(--metadata);
}

.notes-inline-link:hover,
.notes-inline-link:focus-visible,
.subject-list button:hover,
.subject-list button:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.notes-inline-link.is-active,
.subject-list button[aria-selected="true"] {
  color: var(--metadata);
  text-decoration: underline;
}

.subject-list button[aria-expanded="true"] {
  color: var(--metadata);
  text-decoration: underline;
}

.subject-sections {
  margin-top: 0.65rem;
}

.subject-section {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.subject-section__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
  line-height: 1.7;
}

.subject-section__list > li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .notes-lesson-nav__link {
    transition: none;
  }
}

.practice-page .practice-problem__text-action {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
  color: var(--accent-strong);
}

.practice-page .practice-problem__text-action:hover,
.practice-page .practice-problem__text-action:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.practice-page .practice-problem__text-action:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

:is(html, body).notes-page--sepia .markdown-body code {
  background: rgba(17, 17, 17, 0.06);
  color: #111111;
}

:is(html, body).notes-page--sepia .markdown-body pre {
  background: #f1f4f7;
  color: #111111;
}

:is(html, body).notes-page--sepia .markdown-body blockquote {
  border-left-color: rgba(17, 17, 17, 0.22);
}

:is(html, body).notes-page--sepia .markdown-body th {
  background: rgba(17, 17, 17, 0.04);
}

:is(html, body).notes-page--sepia .practice-page .practice-problem__text-action {
  color: var(--accent-strong);
}

:is(html, body).notes-page--sepia .practice-page .practice-problem__text-action:hover,
:is(html, body).notes-page--sepia .practice-page .practice-problem__text-action:focus-visible {
  color: var(--muted);
}

.markdown-body code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.94em;
}

.notes-viewer {
  width: 100%;
  max-width: none;
  padding: 1.35rem 1.35rem 1.5rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  margin: 0 auto 2rem;
}

.notes-footer {
  margin: 1rem auto 0;
  padding: 0 0 1.5rem;
}

.notes-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--metadata);
  font-size: 0.92rem;
}

.notes-footer__inner a {
  color: var(--metadata);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.notes-footer__inner a:hover,
.notes-footer__inner a:focus-visible {
  color: var(--muted);
}

.notes-footer__inner a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.notes-footer__sep {
  color: var(--metadata);
}

.markdown-body {
  color: var(--text);
  line-height: 1.72;
  font-size: 1rem;
}

.markdown-body> :first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  line-height: 1.22;
  letter-spacing: 0;
  margin: 1.9em 0 0.75em;
  scroll-margin-top: 1.5rem;
}

.markdown-body h1,
.markdown-body h2 {
  margin-top: 2.25em;
}

.markdown-body h1 {
  font-size: 2rem;
}

.markdown-body h2 {
  font-size: 1.5rem;
}

.markdown-body h3 {
  font-size: 1.18rem;
}

.markdown-body h4 {
  font-size: 1.05rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 1rem;
}

.markdown-body a {
  color: var(--accent-strong);
}

.markdown-body a:visited {
  color: var(--accent-strong);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.35rem;
}

.markdown-body li+li {
  margin-top: 0.35rem;
}

.markdown-body code {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.14rem 0.34rem;
  border-radius: 0;
}

.markdown-body .math-block {
  margin: 1rem 0;
  overflow: visible;
}

.MathJax,
mjx-container,
.MathJax *,
mjx-container * {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.markdown-body .math-block>mjx-container {
  margin: 0 auto;
}

.markdown-body pre {
  overflow: auto;
  padding: 1rem 1.05rem;
  border-radius: 0;
  background: #090909;
  color: #f5f5f5;
}

.markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.markdown-body blockquote {
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 4px solid rgba(255, 255, 255, 0.22);
  color: var(--muted);
}

.markdown-body .callout {
  margin: 1.35rem 0;
  padding: 0;
  border: 1px solid var(--border);
  background: transparent;
  break-inside: avoid;
}

.callout__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.9rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

.callout__label {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.callout__label::before {
  content: none;
}

.callout__title {
  color: var(--text);
  font-weight: 650;
}

.callout__body {
  padding: 0.85rem 0.9rem 0.05rem;
}

.callout__body > :first-child { margin-top: 0; }
.callout__body > :last-child { margin-bottom: 0; }
.callout .callout { margin: 0.9rem 0 1rem; }

.practice-example__prompt > :first-child,
.practice-example__solution > :first-child {
  margin-top: 0;
}

.practice-example__prompt > :last-child,
.practice-example__solution > :last-child {
  margin-bottom: 0;
}

.practice-example__solution {
  margin: 0.95rem -0.9rem 0;
  border-top: 1px solid var(--border);
  padding: 0.1rem 0.9rem 0.9rem;
}

.practice-example__link {
  margin: 0.8rem 0 0;
}

.practice-example__link a:focus-visible {
  border-radius: 0;
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 0.72rem 0.85rem;
  text-align: left;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.06);
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
}

@page {
  size: A4;
}

@media print {

  body.is-printing-worksheet > * { display: none !important; }
  body.is-printing-worksheet > [data-worksheet-print-container] { display: block !important; }
  body,
  .worksheet-print { font-family: Cambria, "Times New Roman", serif; }
  .worksheet-print { color: #111; background: #fff; }
  .worksheet-print__header { margin-bottom: 1rem; }
  .worksheet-print__header h1 { margin: 0 0 0.5rem; font-size: 1.7rem; font-weight: 400; }
  .worksheet-print__fields { display: flex; justify-content: space-between; padding: 0.75rem 0 1rem; }
  .worksheet-print__kind { margin: 0 0 1rem; font-weight: 400; }
  .worksheet-print__list { padding-left: 2rem; }
  .worksheet-print__problem { break-inside: avoid; margin-bottom: 1.25rem; font-weight: 400; }
  .worksheet-print__problem::marker { font-weight: 400; }
  .worksheet-print__problem h2 { font-size: 1rem; font-weight: 400; margin: 0 0 0.45rem; break-after: avoid; }
  .worksheet-print__prompt { margin-bottom: 0.5rem; }
  .worksheet-print__workspace { min-height: calc(var(--worksheet-spacing-lines, 3) * 1.35rem); margin-top: 0.75rem; }
  .worksheet-print__answer { margin-top: 0.5rem; }
  .worksheet-reference { break-after: page; }
  .worksheet-reference, .worksheet-print__problem { color: #111; }
  .worksheet-print .math-block, .worksheet-print .MathJax { break-inside: avoid; }

  html,
  body {
    background: #ffffff;
    color: #111111;
  }

  .notes-quick-actions,
  .notes-header,
  .notes-sidebar,
  .notes-footer,
  .search-panel,
  .viewer-head__actions,
  .concept-dag-tree-panel {
    display: none !important;
  }

  .notes-layout {
    display: block;
    width: 100%;
    margin: 0;
  }

  .notes-viewer {
    border: 0;
    box-shadow: none;
    background: #ffffff;
    padding: 0;
  }

  .viewer-head { display: block; border-bottom: 0; }

  .markdown-body {
    color: #111111;
  }

  .markdown-body a {
    color: #174a78;
  }

  .markdown-body h1,
  .markdown-body h2,
  .markdown-body h3,
  .markdown-body h4 {
    break-after: avoid;
  }

  .markdown-body pre,
  .markdown-body blockquote,
  .markdown-body .callout,
  .markdown-body table,
  .markdown-body img,
  .markdown-body .math-block {
    break-inside: avoid;
  }

  .markdown-body pre {
    background: #f2f2f2;
    color: #111111;
    border: 1px solid #cccccc;
  }

  .markdown-body code {
    background: #eeeeee;
    color: #111111;
  }

  .markdown-body table {
    display: table;
    overflow: visible;
  }

  .markdown-body .callout {
    border-color: #555555;
    border-left-color: #222222;
    background: #fafafa;
    color: #111111;
  }

  .callout__heading { border-bottom-color: #999999; }
  .callout__label { color: #222222; }
  .callout__title { color: #111111; }

  .practice-example__solution {
    border-top-color: #999999;
    padding-top: 0.8rem;
  }

  .viewer-meta,
  .viewer-contributors__name {
    color: #555555;
  }
}

@media (max-width: 920px) {

  .notes-section-toc {
    display: none;
  }

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

  .viewer-head,
  .search-panel__head,
  .subjects-panel__head {
    flex-direction: column;
  }

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

  .notes-layout__balance {
    display: none;
  }

  .concept-dag-tree-panel__head {
    flex-direction: column;
  }

  .notes-footer {
    margin-top: 0.9rem;
  }

  .viewer-head__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .notes-sidebar,
  .notes-toc,
  .notes-section-toc {
    position: static;
    max-height: none;
  }

  .notes-toc__columns {
    flex-direction: column;
    gap: 1rem;
  }

  .notes-toc__columns::before {
    display: none;
  }

  .subjects-panel__groups {
    grid-template-columns: 1fr;
  }

  .notes-toc__columns>.notes-toc__list+.notes-toc__list {
    padding-top: 1rem;
    padding-left: 0;
    margin-left: 0;
    border-top: 1px solid var(--border);
  }

  .practice-problem__study {
    flex-direction: column;
  }

  .practice-problem__action-links {
    gap: 0.25rem 0.35rem;
  }

}

@media (max-width: 640px) {
  .markdown-body .callout {
    margin: 1rem 0;
  }

  .callout__heading,
  .callout__body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .practice-example__solution {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }

  .practice-example__solution {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .worksheet-selection__item { align-items: stretch; flex-wrap: wrap; }
  .worksheet-selection__label { flex: 1 1 100%; }
  .worksheet-selection__spacing { flex: 1 1 auto; }

  .shell {
    width: min(100% - 0.75rem, 1180px);
  }

  .notes-header {
    padding-top: 0.5rem;
  }

  .notes-header__inner,
  .notes-sidebar,
  .notes-toc,
  .notes-viewer,
  .notes-footer__inner,
  .search-panel__card {
    padding: 1rem;
    border-radius: 0;
  }

  .search-panel {
    padding: 0.75rem;
  }

  .search-panel__card {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
  }

  .notes-quick-actions--floating {
    max-width: calc(100vw - 1.5rem);
    right: 0.75rem;
    bottom: 0.75rem;
  }


  .landing-hero,
  .landing-support {
    padding: 1rem;
  }

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

  .landing-subject-card {
    min-height: 12rem;
  }

  .landing-support {
    align-items: start;
    grid-template-columns: 1fr;
  }
}

/* Webmeji companion: keep the draggable sprite above the page chrome. */
.webmeji-container {
  z-index: 25;
  isolation: isolate;
}

.webmeji-container img {
  max-width: none;
}

@media (max-width: 640px) {
  .webmeji-container {
    bottom: 0.25rem;
  }
}
