: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: #f5f5f5;
  --muted: #b8b8b8;
  --accent: #f5f5f5;
  --accent-strong: #ffffff;
  --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: 0 18px 42px rgba(0, 0, 0, 0.42);
  --radius-lg: 0px;
  --radius-md: 0px;
  --radius-sm: 0px;
  --transition-ui: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  --pomodoro-track: rgba(255, 255, 255, 0.08);
  --pomodoro-focus: #f5f5f5;
  --pomodoro-short: #88d8b0;
  --pomodoro-long: #9ab7ff;
  --pomodoro-flash: #ffffff;
  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(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.notes-page--sepia,
body.notes-page--sepia {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #faf9f6;
  --panel-strong: #f2f0eb;
  --border: rgba(17, 17, 17, 0.12);
  --text: #101010;
  --muted: #4f4f4f;
  --accent: #101010;
  --accent-strong: #000000;
  --accent-soft: rgba(17, 17, 17, 0.04);
  --control-bg: #f4f2ed;
  --control-hover-bg: #e9e6e0;
  --control-hover-border: rgba(17, 17, 17, 0.18);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
  --pomodoro-track: rgba(17, 17, 17, 0.08);
  --pomodoro-focus: #101010;
  --pomodoro-short: #2f7a52;
  --pomodoro-long: #385bb3;
  --pomodoro-flash: #101010;
}

.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: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notes-header__inner> :not(.notes-header__art) {
  position: relative;
  z-index: 1;
}

.notes-header__art {
  position: absolute;
  right: 1rem;
  bottom: 0rem;
  width: clamp(6.5rem, 16vw, 9rem);
  height: auto;
  max-width: min(100%, 5rem);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.notes-header__timer {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  justify-self: end;
  align-self: start;
  min-width: min(100%, 18.5rem);
}

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

.notes-pomodoro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}

.notes-pomodoro__preset {
  appearance: none;
  display: grid;
  gap: 0.14rem;
  align-content: start;
  justify-items: center;
  min-width: 0;
  padding: 0.72rem 0.65rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: var(--transition-ui);
}

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

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

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

.notes-pomodoro__minutes {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.notes-pomodoro__label {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.22;
  text-align: center;
  text-transform: uppercase;
}

.notes-pomodoro__preset.is-active .notes-pomodoro__label,
.notes-pomodoro__preset:hover .notes-pomodoro__label,
.notes-pomodoro__preset:focus-visible .notes-pomodoro__label {
  color: inherit;
}

.notes-pomodoro-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 16px;
  pointer-events: none;
  background: var(--pomodoro-track);
}

.notes-pomodoro-bar__fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--pomodoro-progress, 0));
  background: linear-gradient(90deg, var(--pomodoro-fill, var(--accent-strong)), var(--pomodoro-fill, var(--accent-strong)));
  transition: transform 0.18s linear;
  will-change: transform;
}

.notes-pomodoro-bar[data-mode="focus"] {
  --pomodoro-fill: var(--pomodoro-focus);
}

.notes-pomodoro-bar[data-mode="short"] {
  --pomodoro-fill: var(--pomodoro-short);
}

.notes-pomodoro-bar[data-mode="long"] {
  --pomodoro-fill: var(--pomodoro-long);
}

.notes-pomodoro-bar.is-running .notes-pomodoro-bar__fill {
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}

html.notes-page--sepia .notes-pomodoro-bar.is-running .notes-pomodoro-bar__fill,
body.notes-page--sepia .notes-pomodoro-bar.is-running .notes-pomodoro-bar__fill {
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
}

.notes-pomodoro-bar.is-complete .notes-pomodoro-bar__fill {
  animation: notes-pomodoro-complete-flash 1.1s ease-in-out 0s 2;
}

@keyframes notes-pomodoro-complete-flash {

  0%,
  100% {
    filter: brightness(1);
    opacity: 1;
  }

  35% {
    filter: brightness(1.9);
    opacity: 0.35;
  }

  70% {
    filter: brightness(1.15);
    opacity: 1;
  }
}

.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);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.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__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.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[aria-pressed="true"] {
  color: var(--accent-strong);
}

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

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

html.notes-page--sepia .notes-theme-toggle[aria-pressed="true"],
body.notes-page--sepia .notes-theme-toggle[aria-pressed="true"] {
  color: var(--accent-strong);
}

.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;
}

.section-label,
.notes-header__eyebrow {
  margin: 0 0 0.02rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--muted);
  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 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;
}

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

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

.timer-panel__card {
  width: min(18rem, calc(100vw - 2rem));
  height: min(12rem, calc(100vh - 2rem));
}

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

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

.search-result:hover,
.search-result:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  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,
.search-result__snippet {
  margin: 0;
}

.search-result__title {
  font-weight: 700;
}

.search-result__subject {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 500;
}

.search-result__snippet {
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.55;
}

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

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

html.notes-page--sepia .practice-level--level-1,
body.notes-page--sepia .practice-level--level-1 {
  --practice-level-accent: #2f8a59;
  --practice-level-border: rgba(47, 138, 89, 0.28);
  --practice-level-tint: rgba(47, 138, 89, 0.06);
}

html.notes-page--sepia .practice-level--level-2,
body.notes-page--sepia .practice-level--level-2 {
  --practice-level-accent: #385bb3;
  --practice-level-border: rgba(56, 91, 179, 0.28);
  --practice-level-tint: rgba(56, 91, 179, 0.06);
}

html.notes-page--sepia .practice-level--level-3,
body.notes-page--sepia .practice-level--level-3 {
  --practice-level-accent: #9b6a00;
  --practice-level-border: rgba(155, 106, 0, 0.28);
  --practice-level-tint: rgba(155, 106, 0, 0.06);
}

html.notes-page--sepia .practice-level--level-4,
body.notes-page--sepia .practice-level--level-4 {
  --practice-level-accent: #a33d4b;
  --practice-level-border: rgba(163, 61, 75, 0.28);
  --practice-level-tint: rgba(163, 61, 75, 0.06);
}

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

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

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

html.notes-page--sepia .search-result mark,
body.notes-page--sepia .search-result mark,
html.notes-page--sepia .notes-search-match,
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, 1fr);
  gap: 1rem;
  align-items: start;
}

.learning-paths-layout {
  display: grid;
  gap: 1rem;
}

.learning-path-index-hero,
.learning-path-hero,
.learning-path-card {
  padding: 1.1rem 1.1rem 1rem;
}

.learning-path-index-hero h1,
.learning-path-hero h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.04;
}

.learning-path-index-hero__lead,
.learning-path-hero__meta,
.learning-path-card__meta,
.learning-path-card__description,
.learning-path-card__prereqs,
.learning-path-card__status,
.learning-path-hero__goal {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.learning-path-index-hero__lead,
.learning-path-hero__goal {
  max-width: 72ch;
}

.learning-path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.learning-path-card {
  display: grid;
  gap: 0.75rem;
}

.learning-path-card__head,
.learning-path-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.learning-path-card__title {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.learning-path-card__level {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.learning-path-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.9rem;
}

.learning-path-card__prereqs strong {
  color: var(--text);
}

.learning-path-card__status {
  font-weight: 600;
}

.learning-path-hero {
  display: grid;
  gap: 1rem;
}

.learning-path-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.learning-path-hero__label {
  margin: 0 0 0.35rem;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.learning-path-hero__prereqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.learning-path-hero__prereqs li {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.36rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
}

.learning-path-hero__progress {
  display: grid;
  gap: 0.25rem;
}

.learning-path-hero__status {
  color: var(--accent-strong);
  font-weight: 700;
}

.learning-path-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.learning-path-step-item[hidden] {
  display: none;
}

.notes-structures {
  display: grid;
  gap: 0.65rem;
  flex: 1 1 100%;
}

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

.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-back-link {
  --notes-button-bg: rgba(255, 255, 255, 0.06);
}

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

.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-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;
}

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

.viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

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

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

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

.viewer-source-jump {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}

.viewer-source-jump:hover,
.viewer-source-jump:focus-visible {
  color: var(--text);
}

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

.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-filters {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.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-filters__summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.practice-progress {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.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: linear-gradient(90deg, var(--accent-strong), var(--accent));
  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: linear-gradient(180deg, var(--practice-level-tint, rgba(255, 255, 255, 0.035)) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.practice-level::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.4rem;
  background: var(--practice-level-accent, var(--accent-strong));
  opacity: 0.95;
}

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

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

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

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

.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 {
  margin-bottom: 0.1rem;
  color: var(--practice-level-accent, var(--accent-strong));
  font-weight: 700;
}

.practice-level__badge {
  display: grid;
  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 {
  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);
}

.practice-problem.is-complete {
  border-color: rgba(132, 240, 184, 0.38);
  background: linear-gradient(180deg, rgba(132, 240, 184, 0.08) 0%, rgba(255, 255, 255, 0.025) 100%);
}

html.notes-page--sepia .practice-problem.is-complete,
body.notes-page--sepia .practice-problem.is-complete {
  border-color: rgba(47, 122, 82, 0.34);
  background: linear-gradient(180deg, rgba(47, 122, 82, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.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 {
  color: var(--text);
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}

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

.practice-problem__complete-mark {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 0.98rem;
  height: 0.98rem;
  border: 1px solid currentColor;
  background: transparent;
  color: transparent;
}

.practice-problem__complete-mark::after {
  content: '';
  width: 0.3rem;
  height: 0.56rem;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translateY(-0.06rem) rotate(45deg);
}

.practice-problem__complete-toggle[aria-pressed='true'] {
  color: var(--accent-strong);
  border-color: rgba(132, 240, 184, 0.72);
  background: rgba(132, 240, 184, 0.1);
}

.practice-problem__complete-toggle[aria-pressed='true'] .practice-problem__complete-mark {
  border-color: rgba(132, 240, 184, 0.92);
  background: rgba(132, 240, 184, 0.92);
}

.practice-problem__complete-toggle[aria-pressed='true'] .practice-problem__complete-mark::after {
  border-right-color: var(--bg);
  border-bottom-color: var(--bg);
}

.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 {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.practice-problem__uses {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
}

.practice-problem__skills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.practice-problem__skill {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.practice-problem__skill:hover,
.practice-problem__skill:focus-visible {
  color: var(--text);
}

.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;
}

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

.subject-list li+li::before {
  content: "-";
  color: var(--muted);
  margin: 0 0.9rem 0 0.65rem;
  font-weight: 400;
}

.subject-list a,
.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 a:hover,
.subject-list a:focus-visible,
.subject-list button:hover,
.subject-list button:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.subject-list a.is-active,
.subject-list button[aria-selected="true"] {
  color: var(--accent-strong);
  text-decoration: underline;
}

.practice-page .practice-problem__feedback,
.practice-page .practice-problem__study-submit {
  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;
}

.practice-page .practice-problem__feedback {
  color: #ffffff;
}

.practice-page .practice-problem__study-submit {
  color: #ffffff;
}

.practice-page .practice-problem__feedback:hover,
.practice-page .practice-problem__feedback:focus-visible,
.practice-page .practice-problem__study-submit:hover,
.practice-page .practice-problem__study-submit:focus-visible {
  text-decoration: underline;
}

.practice-page .practice-problem__feedback:hover,
.practice-page .practice-problem__feedback:focus-visible {
  color: #f5f5f5;
}

.practice-page .practice-problem__study-submit:hover,
.practice-page .practice-problem__study-submit:focus-visible {
  color: #f5f5f5;
}

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

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

html.notes-page--sepia .markdown-body pre,
body.notes-page--sepia .markdown-body pre {
  background: #f2f2ee;
  color: #111111;
}

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

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

html.notes-page--sepia .practice-page .practice-problem__feedback,
body.notes-page--sepia.practice-page .practice-problem__feedback,
html.notes-page--sepia .practice-page .practice-problem__study-submit,
body.notes-page--sepia.practice-page .practice-problem__study-submit {
  color: var(--accent-strong);
}

html.notes-page--sepia .practice-page .practice-problem__feedback:hover,
body.notes-page--sepia.practice-page .practice-problem__feedback:hover,
html.notes-page--sepia .practice-page .practice-problem__feedback:focus-visible,
body.notes-page--sepia.practice-page .practice-problem__feedback:focus-visible,
html.notes-page--sepia .practice-page .practice-problem__study-submit:hover,
body.notes-page--sepia.practice-page .practice-problem__study-submit:hover,
html.notes-page--sepia .practice-page .practice-problem__study-submit:focus-visible,
body.notes-page--sepia.practice-page .practice-problem__study-submit: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%;
  padding: 1.35rem 1.35rem 1.5rem;
  overflow: hidden;
  margin: 0 0 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(--muted);
  font-size: 0.92rem;
}

.notes-footer__inner a {
  color: var(--text);
  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(--accent-strong);
}

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

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

.viewer-head {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.interactive-demo {
  margin: 1.5rem 0 1.75rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 42%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.03), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.interactive-demo__head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.interactive-demo__title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.18;
}

.interactive-demo__summary {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.interactive-demo__body {
  display: grid;
  grid-template-columns: minmax(16rem, 0.92fr) minmax(0, 1.28fr);
  gap: 1rem;
  align-items: start;
}

.interactive-demo__controls {
  display: grid;
  gap: 0.8rem;
}

.interactive-demo__control {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.interactive-demo__control-label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  justify-content: space-between;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.interactive-demo__control-label output {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.interactive-demo__control input[type="range"] {
  width: 100%;
}

.interactive-demo__control input[type="range"],
.interactive-demo__control select {
  accent-color: var(--accent-strong);
}

.interactive-demo__toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.interactive-demo__toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: var(--transition-ui);
}

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

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

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

.interactive-demo__figure {
  display: grid;
  gap: 0.75rem;
}

.interactive-demo__readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.interactive-demo__metric {
  display: grid;
  gap: 0.1rem;
  min-width: 8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.interactive-demo__metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.interactive-demo__metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.interactive-demo__svg {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 55%),
    #090909;
}

.interactive-demo__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.interactive-demo__table th,
.interactive-demo__table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.interactive-demo__table th {
  background: rgba(255, 255, 255, 0.06);
}

.interactive-demo__table tr.is-active {
  background: var(--accent-soft);
}

.interactive-demo__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.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.6em 0 0.6em;
  scroll-margin-top: 1.5rem;
}

.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 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;
}

.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 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;
}

@media (max-width: 920px) {

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

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

  .notes-header__art {
    right: -0.1rem;
    bottom: -0.1rem;
    width: clamp(5.75rem, 20vw, 7rem);
  }

  .notes-header__timer {
    width: 100%;
    min-width: 0;
    justify-items: start;
  }

  .notes-pomodoro {
    width: min(100%, 18rem);
  }

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

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

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

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

  .learning-path-card__head,
  .learning-path-hero__head {
    flex-direction: column;
  }

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

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

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

  .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;
  }

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

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

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

  .notes-header__art {
    width: clamp(4.75rem, 24vw, 6rem);
  }

  .notes-header__timer {
    gap: 0.35rem;
  }

  .notes-pomodoro {
    width: 100%;
    gap: 0.35rem;
  }

  .notes-pomodoro__preset {
    padding: 0.62rem 0.45rem 0.55rem;
  }

  .notes-pomodoro__minutes {
    font-size: 1.2rem;
  }

  .notes-header__inner,
  .notes-sidebar,
  .notes-toc,
  .notes-viewer,
  .learning-path-index-hero,
  .learning-path-hero,
  .learning-path-card,
  .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);
  }

  .timer-panel {
    padding: 0.75rem;
  }

  .timer-panel__card {
    width: calc(100vw - 1.5rem);
    height: min(10rem, calc(100vh - 1.5rem));
  }

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