@font-face {
  font-family: Virgil;
  src: url('./vendor/Virgil.woff2') format('woff2');
  font-display: swap;
}
:root {
  --ink: #293f32;
  --muted: #768276;
  --green: #476f45;
  --line: #e1e8dd;
  --paper: #fff;
  --hand: Virgil, 'Segoe Print', 'KaiTi', cursive;
  --body: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 16px/1.6 var(--body);
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
a {
  color: var(--green);
  text-decoration: none;
}
button:hover,
a:hover {
  color: #233f22;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #6e965c;
  outline-offset: 5px;
}
button:disabled {
  cursor: not-allowed;
}
button[aria-disabled='true'] {
  cursor: not-allowed;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  top: -80px;
  background: white;
  padding: 10px;
  z-index: 10;
}
.skip:focus {
  top: 0;
}
.topbar {
  height: 88px;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}
.brand {
  font-family: var(--hand);
  font-size: 26px;
  color: #2d4231;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand-dot {
  color: #8ca875;
  margin-left: -13px;
}
.sprout {
  display: inline-block;
  width: 28px;
  height: 30px;
  position: relative;
  border-bottom: 1px solid transparent;
}
.sprout:after {
  content: '';
  position: absolute;
  width: 2px;
  height: 24px;
  background: #6b8650;
  left: 14px;
  top: 8px;
  transform: rotate(12deg);
}
.sprout i {
  position: absolute;
  width: 13px;
  height: 19px;
  border: 1.5px solid #739658;
  background: #dbecc6;
  border-radius: 0 90% 0 90%;
  transform: rotate(-25deg);
  left: 1px;
  top: 5px;
}
.sprout i + i {
  left: 14px;
  top: 0;
  transform: rotate(78deg);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.quiet-button {
  font-size: 14px;
  color: #647260;
}
.quiet-button > span:first-child {
  font-size: 21px;
}
.language {
  display: flex;
  padding: 4px;
  background: #f3f6ef;
  border: 1px solid #e8ecdf;
  border-radius: 10px;
  gap: 2px;
}
.language button {
  font-size: 13px;
  border-radius: 6px;
  min-width: 34px;
  height: 28px;
}
.language button[aria-pressed='true'] {
  background: white;
  box-shadow: 0 1px 4px #2e422115;
  color: #385733;
}
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  font-size: 24px;
  color: #7e8b78;
}
.icon-button:hover {
  background: #edf3e7;
}
.panel-icon {
  width: 18px;
  height: 16px;
  border: 1.5px solid #778970;
  border-radius: 3px;
  position: relative;
}
.panel-icon:after {
  content: '';
  height: 100%;
  position: absolute;
  right: 5px;
  top: 0;
  border-left: 1.5px solid #778970;
}
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 28%);
  min-height: calc(100vh - 88px);
}
main {
  padding: 28px 46px 0;
  min-width: 0;
  outline: none;
}
.breadcrumb {
  font-size: 13px;
  min-height: 24px;
  color: #899282;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: #7a8972;
}
.breadcrumb a:first-child {
  display: inline-flex;
  align-items: center;
}
.book-icon {
  display: inline-block;
  width: 18px;
  height: 15px;
  flex-shrink: 0;
  border: 1.3px solid currentColor;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}
.breadcrumb a:first-child:before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 8px;
  background-color: currentColor;
  -webkit-mask: url('./icons/knowledge-map.svg') center / contain no-repeat;
  mask: url('./icons/knowledge-map.svg') center / contain no-repeat;
}
.breadcrumb .current {
  color: #455c3d;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 35px 0 30px;
  gap: 15px;
}
.eyebrow {
  letter-spacing: 2.3px;
  font-size: 11px;
  font-weight: 600;
  color: #7f936f;
  margin: 0 0 15px;
}
h1 {
  font-family: var(--hand);
  font-size: clamp(30px, 3.1vw, 48px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -1px;
  margin: 0 0 15px;
  max-width: 620px;
}
h1 em {
  font-style: normal;
  white-space: nowrap;
  position: relative;
  z-index: 0;
}
h1 em:after {
  content: '';
  position: absolute;
  background: #e6f0d8;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 13px;
  z-index: -1;
  transform: rotate(-2deg);
  border-radius: 70% 30% 50% 30%;
}
.intro-copy {
  font-size: 14px;
  line-height: 1.9;
  color: #788270;
  margin: 0;
}
.garden-art {
  width: 130px;
  min-width: 130px;
  height: 145px;
  position: relative;
  margin-right: 10px;
  transform: rotate(5deg);
}
.sun {
  position: absolute;
  right: 0;
  top: 0;
  font: 43px var(--hand);
  color: #c1c6a0;
}
.art-stem {
  position: absolute;
  left: 57px;
  top: 45px;
  width: 23px;
  height: 71px;
  border-left: 2px solid #7d9965;
  border-radius: 50%;
  transform: rotate(15deg);
}
.art-leaf {
  position: absolute;
  border: 1.5px solid #87a572;
  border-radius: 0 85% 0 85%;
  background: #e7efda;
  width: 30px;
  height: 18px;
  left: 32px;
  top: 64px;
  transform: rotate(15deg);
}
.art-leaf.two {
  left: 61px;
  top: 46px;
  transform: rotate(-70deg);
  width: 33px;
}
.art-leaf.three {
  left: 58px;
  top: 85px;
  transform: rotate(-75deg);
  width: 23px;
  height: 14px;
}
.soil {
  position: absolute;
  width: 62px;
  height: 10px;
  border-top: 1.5px solid #a6b391;
  border-radius: 50%;
  left: 26px;
  top: 115px;
}
.art-caption {
  position: absolute;
  top: 128px;
  left: 8px;
  font: 15px var(--hand);
  color: #91a17d;
  white-space: nowrap;
}
.map-card {
  border: 1px solid #dfe8d6;
  border-radius: 16px;
  background: radial-gradient(ellipse at 30% 35%, #f1f7e780, transparent 70%), #fcfdf9;
  box-shadow: 0 3px 12px #354a2810;
  overflow: hidden;
}
.map-heading {
  padding: 21px 25px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.map-heading h2 {
  margin: 0;
  font: 21px var(--hand);
}
.map-tag {
  font: 14px var(--hand);
  color: #94a185;
}
#map-viewport {
  height: 340px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  cursor: grab;
  background-image: radial-gradient(#93a97a38 0.8px, transparent 0.8px);
  background-size: 19px 19px;
}
#map-viewport.dragging {
  cursor: grabbing;
}
#map-stage {
  position: absolute;
  transform-origin: 0 0;
  width: 920px;
  height: 340px;
}
#map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
#map-lines path {
  fill: none;
  stroke: #b0c19d;
  stroke-width: 1.7;
}
#map-lines path.locked-line {
  stroke-dasharray: 5 5;
  stroke: #c4cbbd;
}
.map-node {
  position: absolute;
  min-height: 55px;
  padding: 12px 16px;
  background: #fff;
  border: 1.4px solid #afc398;
  border-radius: 10px 14px 11px 13px;
  font: 20px/1.3 var(--hand);
  box-shadow: 2px 3px 0 #bacba21c;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.map-node:hover {
  background: #f1f7e7;
  box-shadow: 2px 5px 0 #b5c79f40;
}
.map-node.root {
  background: #e5efd6;
  border-color: #8eaa72;
  font-size: 21px;
}
.map-node.folder {
  background: #f0f5e8;
}
.map-node.locked {
  background: #fafbf7;
  border: 1px dashed #bdc6b2;
  color: #96a18a;
}
.map-node.leaf {
  background: #fff;
  border-color: #cbd8be;
  font-size: 17px;
}
.map-node.selected {
  box-shadow: 0 0 0 4px #aec99033;
}
.lock {
  display: inline-block;
  width: 11px;
  height: 10px;
  border: 1.4px solid currentColor;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
  margin-top: 5px;
}
.lock:before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  top: -6px;
  left: 1px;
}
.map-bottom {
  padding: 4px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.map-hint {
  font-size: 12px;
  color: #949d8c;
}
.zoom-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  border: 1px solid #e4e9de;
  border-radius: 8px;
  background: white;
  padding: 2px;
}
.zoom-controls button {
  font-size: 20px;
  width: 29px;
  height: 29px;
  line-height: 1;
}
.zoom-controls button:hover {
  background: #eff4e7;
  border-radius: 5px;
}
#zoom-level {
  font-size: 12px;
  color: #7b8a6e;
  min-width: 38px;
  text-align: center;
}
.below-map {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 27px;
  gap: 14px;
}
.handwritten {
  font: 16px var(--hand);
  color: #819370;
  margin: 0;
}
.below-map > span {
  font-size: 11px;
  color: #98a08f;
}
.formats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.formats button {
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px 14px;
  background: linear-gradient(110deg, #f8faf4, white);
}
.formats button:hover {
  border-color: #a6bc8c;
  background: #f4f8ee;
}
.format-icon {
  font: 15px var(--hand);
  color: #738966;
  border: 1px solid #cfdbbf;
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #f5f8ef;
  flex-shrink: 0;
}
.format-icon.sketch {
  font-size: 26px;
  transform: rotate(-7deg);
}
.formats strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.formats small {
  font-size: 11px;
  color: #98a08f;
}
.format-action {
  margin-left: auto;
  color: #b0bda5;
  font-size: 19px;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #a2aa9c;
  padding: 32px 0 22px;
  gap: 14px;
}
#sidebar {
  border-left: 1px solid #e2eadb;
  background: linear-gradient(100deg, #eff5e9 0, #fafcf7 20%, #fff 85%);
  padding: 35px 27px 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}
.sidebar-heading h2 {
  font: 23px var(--hand);
  margin: 0;
}
.sidebar-heading button {
  font-size: 20px;
}
.search {
  border: 1px solid #dfe7d7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffffb0;
  padding: 6px 10px;
  color: #8f9c84;
}
.search > span {
  font-size: 24px;
  line-height: 1;
}
.search input {
  background: none;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ink);
}
.search input::placeholder {
  color: #9ba591;
}
.search kbd {
  font: 12px var(--body);
  border: 1px solid #e1e6dc;
  border-radius: 3px;
  padding: 0 5px;
}
#tree {
  margin-top: 27px;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 43px;
  padding: 2px 8px;
  border-radius: 7px;
  position: relative;
  margin-bottom: 3px;
}
.tree-row.active {
  background: #e9f1dd;
  color: #3a5b2b;
}
.tree-row .tree-link {
  flex: 1;
  text-align: left;
  font-size: 14px;
  padding: 5px 0;
  min-width: 0;
}
.tree-row.locked {
  color: #9ba58f;
}
.tree-toggle {
  font-size: 16px;
  width: 18px;
  padding: 0;
  flex-shrink: 0;
}
.tree-icon {
  font-size: 16px;
  color: #94a481;
  width: 18px;
  text-align: center;
}
.tree-row.active .tree-icon {
  color: #63844b;
}
.tree-children {
  margin-left: 17px;
  border-left: 1px solid #dfe6d7;
  padding-left: 10px;
}
.tree-children .tree-children {
  margin-left: 12px;
}
.no-results {
  color: var(--muted);
  font-size: 14px;
  padding: 10px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 70px;
}
.location-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #a1ac95;
}
.sidebar-bottom > p {
  font-size: 13px;
  color: #6b7c5d;
  margin: 9px 0 28px;
}
.sidebar-note {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #92a27e;
}
.leaf-icon {
  display: inline-block;
  position: relative;
  width: 25px;
  height: 17px;
  flex-shrink: 0;
  border: 1.3px solid currentColor;
  border-radius: 1px 80% 1px 80%;
  transform: rotate(-35deg);
}
.leaf-icon:after {
  content: '';
  position: absolute;
  width: 95%;
  left: -2px;
  bottom: 4px;
  border-top: 1.2px solid currentColor;
  transform: rotate(-23deg);
  transform-origin: left center;
}
.sidebar-note > .leaf-icon {
  margin-top: 6px;
}
.sidebar-note p {
  font: 17px/1.7 var(--hand);
  margin: 0;
}
.lock-legend {
  font-size: 11px;
  color: #a0aa94;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 25px;
}
.shell.sidebar-hidden {
  grid-template-columns: 1fr;
}
.sidebar-hidden #sidebar {
  display: none;
}
.sidebar-hidden main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 35px;
  color: var(--ink);
  box-shadow: 0 20px 90px #223c2220;
}
dialog::backdrop {
  background: #263c2550;
  backdrop-filter: blur(5px);
}
.dialog-close {
  position: absolute;
  right: 16px;
  top: 12px;
}
dialog h2 {
  font: 30px var(--hand);
  margin: 12px 0;
}
dialog p {
  font-size: 14px;
  color: var(--muted);
}
.dropzone {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 25px 15px;
  border: 1px dashed #9db887;
  border-radius: 12px;
  background: #f6f9f0;
  cursor: pointer;
  margin: 24px 0;
}
.dropzone.dragover {
  background: #e5efd7;
}
.dropzone input {
  width: 100%;
  font-size: 13px;
  margin-top: 12px;
}
.upload-mark {
  font-size: 30px;
  color: #8da872;
}
.dropzone strong {
  font-size: 14px;
  font-weight: 500;
}
.dropzone small {
  font-size: 12px;
  color: var(--muted);
}
.dialog-footnote {
  font-size: 12px !important;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #314830;
  color: white;
  border-radius: 10px;
  padding: 12px 22px;
  z-index: 20;
  max-width: 90vw;
  font-size: 14px;
  box-shadow: 0 6px 24px #26391e22;
}
#note-view {
  padding: 25px 0;
  min-height: 650px;
}
.note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}
.back-button {
  font-size: 14px;
  color: #7a8e69;
  border-bottom: 1px solid #c6d4b6;
  padding: 3px 0;
}
.note-title {
  font: 36px var(--hand);
  margin: 25px 0 20px;
}
.note-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.action {
  background: #edf4e3;
  border: 1px solid #d9e5ca;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 13px;
}
.empty-state {
  padding: 65px 30px;
  text-align: center;
  border: 1px dashed #d3dfc5;
  border-radius: 13px;
  background: #fcfdf9;
  margin-top: 25px;
}
.empty-state .empty-icon {
  width: 38px;
  height: 25px;
  color: #8fa778;
}
.empty-state h3 {
  font: 25px var(--hand);
  font-weight: 400;
}
.empty-state p {
  font-size: 14px;
  color: var(--muted);
}
.course-children {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}
.course-children button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  background: #fcfdf9;
}
.note-content {
  overflow-wrap: anywhere;
  margin-top: 24px;
}
.note-content h1,
.note-content h2,
.note-content h3 {
  font-family: var(--hand);
  font-weight: 400;
}
.note-content h1 {
  font-size: 32px;
}
.note-content h2 {
  font-size: 26px;
}
.note-content img {
  max-width: 100%;
}
.note-content pre {
  overflow: auto;
  background: #f3f6ef;
  padding: 20px;
  border-radius: 9px;
}
.note-content code {
  font-family: Consolas, monospace;
  background: #f3f6ef;
}
.note-content blockquote {
  margin-left: 0;
  border-left: 3px solid #abc58c;
  padding-left: 20px;
  color: #78866c;
}
.note-content table {
  display: block;
  overflow: auto;
  border-collapse: collapse;
}
.note-content td,
.note-content th {
  border: 1px solid var(--line);
  padding: 8px 12px;
}
.pdf-viewer {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.drawing-view {
  overflow: auto;
  background: #fffce8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  max-height: 75vh;
}
.drawing-view svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 400px;
}
.note-status {
  font-size: 13px;
  color: var(--muted);
}
.error {
  color: #944b3a;
  background: #fff6f1;
  padding: 20px;
  border-radius: 10px;
}
.drawing-controls {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
}
@media (min-width: 1600px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  main {
    padding-left: 65px;
    padding-right: 65px;
  }
  #map-viewport {
    height: 430px;
  }
  .intro {
    padding-top: 45px;
    padding-bottom: 40px;
  }
}
@media (max-width: 1100px) {
  main {
    padding: 25px 27px 0;
  }
  .topbar {
    padding: 0 28px;
  }
  .garden-art {
    display: none;
  }
  #sidebar {
    padding: 30px 20px;
  }
  .formats button {
    padding: 14px 10px;
    gap: 8px;
  }
  .format-action {
    display: none;
  }
  .formats strong {
    font-size: 11px;
  }
  .map-tag {
    display: none;
  }
  .intro {
    padding: 30px 0;
  }
  .map-hint {
    font-size: 11px;
  }
  .below-map > span {
    display: none;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 72px;
    padding: 0 18px;
  }
  .brand {
    font-size: 21px;
    gap: 8px;
  }
  .top-actions {
    gap: 10px;
  }
  .quiet-button {
    display: none;
  }
  .shell {
    display: block;
    min-height: calc(100vh - 72px);
  }
  main {
    padding: 19px 20px 0;
  }
  #sidebar {
    position: fixed;
    right: 0;
    top: 72px;
    bottom: 0;
    width: min(320px, 85vw);
    z-index: 5;
    box-shadow: -10px 10px 40px #34502418;
    overflow: auto;
  }
  .intro {
    padding: 28px 0;
  }
  h1 {
    font-size: 35px;
  }
  .intro-copy {
    font-size: 13px;
  }
  #map-viewport {
    height: 320px;
  }
  .map-heading {
    padding: 18px 18px 0;
  }
  .map-bottom {
    align-items: flex-end;
  }
  .map-hint {
    max-width: 130px;
    font-size: 10px;
  }
  .formats {
    gap: 8px;
  }
  .formats button {
    padding: 12px 7px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .formats strong {
    font-size: 11px;
  }
  .formats small {
    font-size: 10px;
  }
  .below-map {
    margin: 18px 0 24px;
  }
  .handwritten {
    font-size: 14px;
  }
  .eyebrow {
    font-size: 10px;
  }
  footer {
    font-size: 10px;
  }
  .note-title {
    font-size: 30px;
  }
  .sidebar-bottom {
    padding-top: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.pdf-text {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}
.pdf-text p {
  white-space: pre-wrap;
}
.action:disabled {
  opacity: 0.4;
}
.intro-copy {
  font-size: 16px;
}
.formats strong,
.formats small,
.search input,
.tree-row .tree-link,
.quiet-button {
  font-size: 14px;
}
.formats button {
  min-width: 0;
}
.formats small {
  font-size: 12px;
}
@media (max-width: 760px) {
  .formats strong {
    font-size: 12px;
  }
  .intro-copy {
    font-size: 14px;
  }
  .map-node {
    font-size: 22px;
  }
  .map-node.leaf {
    font-size: 20px;
  }
}
@media (max-width: 480px) {
  .topbar {
    padding: 0 12px;
    gap: 7px;
  }
  .brand {
    font-size: 17px;
    gap: 5px;
  }
  .brand-dot {
    margin-left: -6px;
  }
  .sprout {
    transform: scale(0.8);
    width: 23px;
  }
  .top-actions {
    gap: 5px;
  }
  .language {
    padding: 2px;
    border-radius: 7px;
  }
  .language button {
    min-width: 24px;
    width: 24px;
    padding: 0;
    height: 25px;
    font-size: 12px;
  }
  .icon-button {
    width: 25px;
  }
  .map-bottom {
    flex-wrap: wrap;
  }
  .map-hint {
    max-width: none;
    width: 100%;
  }
  .zoom-controls {
    margin-left: auto;
  }
  .formats {
    grid-template-columns: 1fr;
  }
  .formats button {
    flex-direction: row;
    align-items: center;
    padding: 12px;
  }
  .formats strong {
    font-size: 14px;
  }
  .formats small {
    font-size: 12px;
  }
  .format-action {
    display: block;
  }
  .intro h1 {
    font-size: 31px;
  }
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .handwritten {
    font-size: 13px;
  }
}

/* A lesson can pair an editable drawing with a Markdown explanation. */
.lesson-drawing .note-content {
  margin-top: 12px;
}
.lesson-drawing .drawing-view {
  max-height: 68vh;
  scrollbar-gutter: stable;
}
.lesson-explanation {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.drawing-controls {
  flex-wrap: wrap;
}
.drawing-sections {
  max-width: 100%;
  border: 1px solid #d9e5ca;
  border-radius: 7px;
  background: #f5f8ef;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 7px 34px 7px 12px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #647a55 50%),
    linear-gradient(135deg, #647a55 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.lesson-explanation .note-content {
  max-width: 82ch;
  line-height: 1.85;
}

/* Leave enough room for long chapter titles, in both languages. */
#map-viewport { height: clamp(420px, 62vh, 650px); }
.map-scope { display: flex; align-items: center; gap: .65rem; font-size: .82rem; color: var(--muted, #76846b); }
.map-scope select { max-width: 260px; min-width: 140px; padding: .5rem .7rem; border: 1px solid #d4dfcb; border-radius: 9px; background: #fbfdf8; color: #36513c; font: inherit; }
@media (max-width: 600px) {
  .map-heading { flex-wrap: wrap; gap: .65rem; }
  .map-scope { width: 100%; }
  .map-scope select { max-width: 100%; flex: 1; }
}
.map-heading { flex-wrap: wrap; }
.map-node { white-space: normal; height: auto; min-height: 66px; }
.map-node > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.map-node.note { font-size: 19px; line-height: 1.45; padding: 18px 22px; }
.map-node .lock { flex-shrink: 0; }
.primary-action { background: #dfeccf; border: 1px solid #b7cc9e; font-weight: 600; }

/* Math keeps its own typeface; prose and hand-drawn notes keep theirs. */
.note-content .math-inline { color: #294c38; }
.note-content .katex { font-size: 1.08em; }
.note-content .math-block {
  margin: 24px 0 30px;
  padding: 22px 24px;
  border: 1px solid #e0e9d7;
  border-left: 3px solid #a9c18e;
  border-radius: 4px 12px 12px 4px;
  background: linear-gradient(110deg, #f2f7eb, #fdfefa 75%);
  overflow-x: auto;
  color: #234b36;
  break-inside: avoid;
}
.note-content .math-block .katex-display { margin: 0; text-align: center; }
.note-content .math-block .katex { font-size: 1.14em; }
.note-content h2 { margin-top: 2.8em; line-height: 1.4; }
.lesson-explanation .note-content > h2 { padding-bottom: 12px; border-bottom: 1px solid #e5ebdf; }
.note-content .math-error { color: #9b4b31; white-space: pre-wrap; }
.note-content blockquote {
  margin: 24px 0; padding: 14px 22px;
  border-left: 3px solid #b6ca9d; background: #f6f9f1;
  border-radius: 0 10px 10px 0;
}
@media (max-width: 600px) {
  .note-content .math-block { padding: 18px 12px; }
  .note-content .math-block .katex { font-size: 1em; }
}

/* Public navigation replaces the former local-file preview action. */
.header-motion { color: #496b40; font-size: 14px; white-space: nowrap; text-decoration: none; padding: 7px 10px; border: 1px solid #dfe8d7; border-radius: 10px; background: #f7faf3; }
.header-motion:hover { background: #edf4e3; }
.header-motion:focus-visible { outline: 2px solid #537d4d; outline-offset: 3px; }
@media (max-width: 480px) { .header-motion { font-size: 12px; padding: 5px 6px; } }
