/* Learning tools, touch layouts and user appearance. */
body {
  font-size: calc(16px * var(--reader-scale, 1));
  background: var(--bg);
}
body.personal-background {
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--bg) 80%, transparent),
      color-mix(in srgb, var(--bg) 86%, transparent)
    ),
    var(--user-background);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
:root[data-theme="dark"] {
  --ink: #e9edf5;
  --muted: #b5bfd1;
  --bg: #19131f;
  --paper: #292131;
  --line: #53465e;
  --navy: #25152f;
  --teal: #cca6ef;
}
[data-theme="dark"] .card,
[data-theme="dark"] .question-card,
[data-theme="dark"] .concept-card,
[data-theme="dark"] .subject-card,
[data-theme="dark"] .article,
[data-theme="dark"] .quiz-side,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .scope-card,
[data-theme="dark"] .modal,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .secondary,
[data-theme="dark"] .choice,
[data-theme="dark"] .quick-card,
[data-theme="dark"] .stat-card {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] .tag,
[data-theme="dark"] .pill,
[data-theme="dark"] .school-strip,
[data-theme="dark"] .confidence,
[data-theme="dark"] .action-guide,
[data-theme="dark"] .answer-feedback,
[data-theme="dark"] .sources-detail,
[data-theme="dark"] .connection,
[data-theme="dark"] .article-tools,
[data-theme="dark"] .unit-card {
  background: #243b4c;
  color: var(--ink);
}
.page {
  min-width: 0;
}
.page > .card {
  margin-bottom: 22px;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
input,
select,
textarea {
  max-width: 100%;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e89835;
  outline-offset: 3px;
}
.term-link {
  display: inline;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: help;
}
.term-link:hover {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}
ruby rt {
  font-size: 0.58em;
  font-weight: 400;
}
.reading {
  color: var(--teal);
  font-size: 1.05em;
}
.term-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.term-chips button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}
.quiz-navigation span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.quiz-navigation button {
  min-height: 44px;
}
.question-prompt {
  font-size: clamp(1.25rem, 2.7vw, 1.9rem);
  line-height: 1.65;
}
.question-index {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.question-index button {
  min-height: 44px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.question-index .current {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.question-index .ok {
  background: #d9f0e7;
  color: #17493b;
}
.question-index .again {
  background: #fae0e3;
  color: #7e283a;
}
.question-index .filled {
  background: #dce6fa;
  color: #244982;
}
.answer-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.answer-comparison > div {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.answer-comparison small {
  color: var(--muted);
}
.answer-comparison p {
  margin: 8px 0;
}
.review-banner {
  padding: 24px;
  border-radius: 16px;
  background: #e2f2ec;
  color: #164f40;
  border-left: 5px solid var(--teal);
  margin: 20px 0;
}
.review-banner h2 {
  font-size: 1.3rem;
}
.choice.selected {
  border: 2px solid var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, var(--paper));
}
.explanation-text {
  line-height: 1.95;
  margin: 18px 0;
}
.memory-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 0 18px;
  scrollbar-width: thin;
}
.memory-tabs button {
  flex-shrink: 0;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}
.memory-tabs button.active {
  background: var(--navy);
  color: #fff;
}
.memory-tabs small {
  margin-left: 10px;
  opacity: 0.7;
}
.memory-card {
  overflow: hidden;
}
.memory-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: 68vh;
  overscroll-behavior: contain;
}
.memory-table {
  width: 100%;
  min-width: 950px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.91rem;
}
.memory-table th,
.memory-table td {
  padding: 17px 15px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  line-height: 1.8;
  min-width: 160px;
  background: var(--paper);
}
.memory-table th {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #fff;
  z-index: 2;
  font-size: 0.83rem;
}
.memory-table th:first-child,
.memory-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 3px 0 6px #142b3410;
  font-weight: 600;
}
.memory-table th:first-child {
  z-index: 3;
}
.memory-table td:last-child {
  min-width: 130px;
}
.mask-controls {
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.reveal-cell {
  min-height: 60px;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--teal) 6%, var(--paper));
  color: var(--teal);
  font-size: 0.85rem;
}
.pathway-cards {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.pathway-cards > span {
  text-align: center;
  color: var(--teal);
}
.pathway-cards section {
  padding: 15px 20px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--teal) 8%, var(--paper));
}
.pathway-cards small {
  color: var(--muted);
}
.pathway-cards p {
  margin: 6px 0;
}
.learning-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 25px 0;
}
.learning-steps h2 {
  font-size: 1.2rem;
}
.due-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.due-week > div {
  padding: 20px 4px;
  background: color-mix(in srgb, var(--teal) 6%, var(--paper));
  text-align: center;
  border-radius: 12px;
}
.due-week strong {
  display: block;
  font-size: 1.8rem;
}
.due-week small {
  font-size: 0.75rem;
  margin-left: 4px;
}
.due-week span {
  font-size: 0.8rem;
  color: var(--muted);
}
#memory-curve svg {
  max-width: 680px;
  width: 100%;
  margin-top: 25px;
  color: var(--muted);
}
#memory-curve text {
  fill: currentColor;
  font-size: 12px;
}
.article-toc {
  display: grid;
  gap: 8px;
  padding: 22px;
  background: color-mix(in srgb, var(--teal) 5%, var(--paper));
  border-radius: 14px;
  margin: 24px 0;
}
.article-toc a {
  font-size: 0.86rem;
  color: var(--muted);
}
.article-section {
  scroll-margin-top: 20px;
}
.article-section p {
  line-height: 2.1;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.article-section.highlighted {
  border-left: 4px solid #ddb440;
  padding-left: 20px;
  background: linear-gradient(90deg, #f2c44c10, transparent);
}
.mark-section {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}
.mark-section[aria-pressed="true"] {
  color: #a27913;
}
.section-annotation {
  font-size: 0.85rem;
  margin-top: 20px;
}
.section-annotation summary {
  color: var(--muted);
  cursor: pointer;
  min-height: 35px;
}
.section-annotation textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.section-annotation small {
  color: var(--muted);
}
.personal-notes {
  margin: 24px 0;
}
.personal-notes > summary {
  cursor: pointer;
}
.personal-notes textarea {
  width: 100%;
  min-height: 100px;
  margin-top: 15px;
}
.personal-notes #annotation-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 2.5;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 16px;
  background: #fff;
}
.figure-guide {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  margin: 16px 0;
}
.figure-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.figure-labels > span {
  padding: 10px;
  background: color-mix(in srgb, var(--teal) 7%, var(--paper));
  border-radius: 8px;
  font-size: 0.85rem;
}
.figure-labels small {
  display: block;
  color: var(--muted);
}
.lab-article-link {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  gap: 10px;
  margin: 24px 0;
}
.lab-article-link span {
  font-size: 0.9rem;
  color: #a4ddce;
}
.article-figure video {
  width: 100%;
  border-radius: 12px;
}
.model-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  z-index: 2;
  pointer-events: none;
}
.model-controls > * {
  pointer-events: auto;
}
.model-controls details {
  background: #102b3ce8;
  color: #fff;
  border: 1px solid #ffffff30;
  border-radius: 9px;
  max-width: 260px;
  padding: 10px;
  font-size: 0.75rem;
  line-height: 1.6;
}
.model-controls summary {
  cursor: pointer;
  min-height: 20px;
}
.model-controls p {
  margin: 10px 0;
}
.model-controls button,
.model-candidates button {
  min-height: 42px;
  border: 1px solid #ffffff3c;
  border-radius: 9px;
  background: #14364be8;
  color: #fff;
  padding: 8px 11px;
  font-size: 0.8rem;
}
.model-controls button.active,
.model-candidates button.active {
  background: #245f66;
  border-color: #5bdbbf;
}
.model-candidates {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 2;
  max-height: 145px;
  overflow: auto;
}
.model-candidates > span {
  width: 100%;
  font-size: 0.7rem;
  color: #e4f3f3;
  background: #14364bcc;
  border-radius: 6px;
  padding: 4px 8px;
}
.body-model,
.quiz-model,
.body-preview {
  position: relative;
}
.body-preview .model-controls,
.body-preview .model-candidates {
  display: none;
}
.part-list button {
  min-height: 48px;
}
.model-toolbar {
  flex-wrap: wrap;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 20px;
}
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 10px 0;
}
.calendar-day {
  min-height: 76px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.calendar-day.today {
  border-color: var(--teal);
}
.calendar-day.selected {
  outline: 2px solid var(--teal);
  background: color-mix(in srgb, var(--teal) 9%, var(--paper));
}
.calendar-day small {
  font-size: 0.62rem;
}
.calendar-day .dot,
.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: #e08753;
}
.calendar-day.learned {
  box-shadow: inset 0 -4px #6fc8aa;
}
.calendar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.calendar-heading button {
  min-width: 44px;
  min-height: 44px;
}
.event-card {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.event-card h3 {
  margin: 6px 0;
}
.event-card p {
  white-space: pre-line;
}
.calendar-countdown {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px;
  background: var(--navy);
  color: white;
  border-radius: 20px;
  margin: 24px 0;
}
.calendar-countdown strong {
  font-size: 2.4rem;
}
.calendar-countdown small {
  font-size: 1rem;
}
.calendar-countdown p {
  margin: 5px 0;
}
.planner-form label,
.scope-builder label {
  display: block;
  margin: 14px 0;
}
.planner-form input,
.planner-form select,
.planner-form textarea,
.scope-builder input,
.scope-builder select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.planner-form textarea {
  min-height: 80px;
}
.scope-builder input[type="checkbox"] {
  width: auto;
}
.scope-selector {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.scope-selector label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.scope-selector small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}
.scope-selector input {
  min-height: 20px;
}
.scope-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.unit-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.unit-toolbar input {
  flex: 1;
  min-width: 170px;
}
.unit-toolbar select {
  width: auto;
}
.unit-card {
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.unit-card h3 {
  margin: 8px 0;
}
.unit-card .row {
  align-items: flex-start;
}
.unit-card select {
  max-width: 140px;
}
.status-learned {
  background: #e4f3eb;
  color: #225b43;
}
.status-learning {
  background: #fff0d9;
  color: #785018;
}
.syllabus-import textarea {
  width: 100%;
  min-height: 130px;
}
.syllabus-row {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 12px;
  margin: 15px 0;
  display: grid;
  gap: 10px;
}
.syllabus-row legend {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.syllabus-row select[multiple] {
  width: 100%;
  min-height: 140px;
}
.syllabus-row input,
.syllabus-row select {
  padding: 10px;
}
.syllabus-file {
  border: 2px dashed var(--line);
  padding: 22px;
  border-radius: 14px;
}
.syllabus-file input {
  max-width: 100%;
}
.syllabus-course {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.textbook-note {
  padding: 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--teal) 7%, var(--paper));
  margin: 20px 0;
}
.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.toolkit-grid h2 {
  font-size: 1.2rem;
}
.toolkit-grid p {
  color: var(--muted);
  font-size: 0.9rem;
}
.appearance {
  margin-bottom: 22px;
}
.appearance input[type="color"] {
  width: 100%;
  height: 45px;
  padding: 4px;
}
.tutorial-orbit {
  font-size: 4rem;
  font-weight: 300;
  color: var(--teal);
  width: 110px;
  height: 110px;
  margin: 20px auto;
  background: color-mix(in srgb, var(--teal) 8%, var(--paper));
  border-radius: 35%;
  display: grid;
  place-content: center;
  animation: gentle 5s ease-in-out infinite;
}
.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 24px 0;
}
.tutorial-dots span {
  height: 6px;
  width: 18px;
  background: var(--line);
  border-radius: 3px;
}
.tutorial-dots span.active {
  background: var(--teal);
}
.tutorial .text-link {
  margin-top: 18px;
}
.modal {
  max-height: 90dvh;
  overflow: auto;
}
.modal textarea {
  width: 100%;
}
.page p {
  overflow-wrap: anywhere;
}
.full {
  max-width: 100%;
}
@keyframes gentle {
  50% {
    transform: rotate(6deg);
    border-radius: 45%;
  }
}
@media (min-width: 761px) {
  .nav a[href="#more"] {
    display: none;
  }
  .nav a {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .sidebar {
    overflow-y: auto;
  }
  .scope-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
    gap: 22px;
  }
}
@media (max-width: 1000px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .learning-steps {
    gap: 10px;
  }
  .learning-steps .card {
    padding: 18px;
  }
  .memory-table {
    font-size: 0.88rem;
  }
}
@media (max-width: 760px) {
  .page {
    padding-bottom: 105px;
  }
  .sidebar .nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 5px 4px max(7px, env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .nav a:nth-child(n) {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    min-height: 52px;
    padding: 7px 0;
    font-size: 10px;
    color: var(--muted);
  }
  .nav a:nth-child(n + 7) {
    display: none;
  }
  .nav a.active {
    color: var(--teal);
    background: color-mix(in srgb, var(--teal) 7%, var(--paper));
  }
  .nav a span {
    white-space: nowrap;
  }
  .nav a svg {
    width: 20px;
    height: 20px;
  }
  .quiz-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .quiz-side {
    display: block;
  }
  .question-card {
    padding: 22px 18px;
  }
  .quiz-navigation {
    gap: 7px;
  }
  .quiz-navigation button {
    font-size: 0.8rem;
    padding: 9px 11px;
  }
  .quiz-navigation > span {
    font-size: 0.85rem;
  }
  .answer-comparison {
    grid-template-columns: 1fr;
  }
  .answer-comparison > div {
    padding: 14px;
  }
  .feedback-links {
    flex-wrap: wrap;
  }
  .question-index {
    grid-template-columns: repeat(8, 1fr);
  }
  .question-index button {
    min-height: 39px;
  }
  .learning-steps {
    grid-template-columns: 1fr;
  }
  .due-week {
    gap: 3px;
  }
  .due-week > div {
    padding: 12px 2px;
  }
  .due-week strong {
    font-size: 1.25rem;
  }
  .due-week span {
    font-size: 0.65rem;
  }
  .card.memory-card {
    padding: 18px 12px;
  }
  .memory-table th,
  .memory-table td {
    padding: 14px 12px;
    min-width: 160px;
  }
  .memory-table td:first-child,
  .memory-table th:first-child {
    min-width: 118px;
    max-width: 118px;
    overflow-wrap: anywhere;
  }
  .memory-table {
    min-width: 950px;
  }
  .mask-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mask-controls label {
    font-size: 0.74rem;
    line-height: 1.6;
  }
  .article-tools {
    position: static;
  }
  .article-section {
    margin-top: 25px;
  }
  .article-toc {
    padding: 17px;
  }
  .figure-labels {
    grid-template-columns: 1fr;
  }
  .personal-notes {
    padding: 15px;
  }
  .calendar-layout > .card {
    padding: 15px;
  }
  .calendar-day {
    min-height: 64px;
    padding: 7px 1px;
  }
  .calendar-day small {
    font-size: 0.55rem;
  }
  .calendar-grid {
    gap: 3px;
  }
  .calendar-countdown {
    padding: 20px;
    gap: 16px;
  }
  .calendar-countdown strong {
    font-size: 2rem;
  }
  .calendar-countdown h2 {
    font-size: 1.1rem;
  }
  .toolkit-grid {
    gap: 12px;
  }
  .toolkit-grid .card {
    padding: 19px 15px;
  }
  .toolkit-grid h2 {
    font-size: 1rem;
  }
  .toolkit-grid p {
    font-size: 0.8rem;
  }
  .body-model {
    height: 53dvh;
    min-height: 330px;
    max-height: 540px;
  }
  .model-controls details {
    max-width: 210px;
  }
  .model-candidates {
    max-height: 125px;
  }
  .model-controls button {
    padding: 7px 10px;
  }
  .model-toolbar button {
    min-height: 44px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 36px 22px 24px;
    max-width: calc(100vw - 20px);
  }
  .unit-card {
    padding: 16px;
  }
  .unit-card .row {
    flex-wrap: wrap;
  }
  .scope-actions > * {
    flex: 1;
    min-width: 110px;
  }
  .section-head {
    flex-wrap: wrap;
    gap: 10px;
  }
}
.event-dot {
  width: auto;
  height: auto;
  border-radius: 5px;
  padding: 2px 4px;
  background: #f7e2d2;
  color: #88451e;
  font-size: 0.6rem;
}
.calendar-day.outside {
  opacity: 0.5;
}
.calendar-countdown {
  justify-content: space-between;
  flex-wrap: wrap;
}
.calendar-countdown > strong {
  font-size: 1.6rem;
  white-space: nowrap;
}
.curriculum-unit select {
  max-width: 180px;
}
.curriculum-unit.learned {
  border-left: 4px solid #35a983;
}
.curriculum-unit.learning {
  border-left: 4px solid #eab35f;
}
.curriculum-unit .row {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.unit-chips a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  font-size: 0.8rem;
}
.syllabus-row input:not([type="checkbox"]),
.syllabus-row select {
  width: 100%;
}
.calendar-weekdays {
  margin-bottom: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .tutorial-orbit {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}

/* まなびの脈: a personal study desk, with a distinct plum navigation rail. */
.brand {
  letter-spacing: 0.025em;
  font-size: 1.08rem;
}
.brand-symbol {
  border-radius: 50%;
  background: #ffc663;
  color: #2c193d;
  font-size: 1.28rem;
}
.sidebar {
  background: #2c193d;
  border: 0;
}
.sidebar .brand {
  color: #fff;
}
.sidebar .brand small,
.sidebar-foot,
.sidebar-foot a {
  color: #d8c9e4;
}
.sidebar .nav a {
  color: #e2d8eb;
  border-radius: 9px;
}
.sidebar .nav a.active {
  background: #ffc663;
  color: #2c193d;
  box-shadow: none;
}
.sidebar .nav a:hover:not(.active) {
  background: #432850;
}
.sidebar .progress-track {
  background: #5a4169;
}
.sidebar .progress-track span {
  background: #ffc663;
}
.mobile-brand {
  font-weight: 850;
  letter-spacing: 0.08em;
  color: #4e2a69;
}
.intro-row h1 {
  letter-spacing: 0.01em;
  font-weight: 850;
  line-height: 1.45;
}
.study-desk {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper);
}
.study-desk .mission {
  border-radius: 0;
  background: #2c193d;
  border-top: 6px solid #ffc663;
}
.study-desk .mission p {
  color: #e0d6e9;
}
.study-desk .mission .eyebrow {
  color: #ffc663;
}
.study-desk .lab-preview {
  border: 0;
  border-radius: 0;
  background: var(--paper);
}
.study-desk .body-preview {
  background: var(--bg);
  border-radius: 10px;
}
.study-desk .mission-tags span {
  color: #efe7f6;
  background: #4c355d;
  border-color: #715583;
}
.study-desk .pill {
  background: #4c355d;
  color: #fff;
}
.quick-grid {
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 26px;
}
.quick-grid .quick-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 18px;
  box-shadow: none;
}
.quick-grid .quick-card + .quick-card {
  border-left: 1px solid var(--line);
}
.quick-icon.teal,
.quick-icon.blue,
.avatar,
.tag {
  background: #eee5f7;
  color: #62388a;
}
.quick-icon.orange {
  background: #fff0d6;
  color: #8a4e0e;
}
.school-strip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid #ba8b45;
  border-radius: 0 12px 12px 0;
}
.school-mark {
  background: #fff0d6;
  color: #805421;
}
.concept-card {
  border-radius: 8px;
  border-top: 3px solid #9270ae;
}
.subject-card {
  border-radius: 8px;
}
.subject-card:hover {
  border-color: #9270ae;
}
.memory-tabs button.active,
.lab-tabs button.active {
  background: #70429b;
  border-color: #70429b;
  color: #fff;
}
.memory-table th {
  background: #eee5f7;
  color: #4e2a69;
}
.memory-card .section-head {
  align-items: flex-start;
}
.memory-card .section-head > .row {
  flex-shrink: 0;
}
[data-theme="dark"] .mobile-brand {
  color: #efdbff;
}
[data-theme="dark"] .memory-table th {
  background: #493353;
  color: #f0dfff;
}
[data-theme="dark"] .term-link,
[data-theme="dark"] .text-link,
[data-theme="dark"] .eyebrow {
  color: #cca6ef;
}
@media (min-width: 901px) {
  .study-desk {
    grid-template-columns: 1.35fr 1fr;
  }
}
@media (max-width: 900px) {
  .sidebar {
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .sidebar .nav a {
    color: var(--muted);
  }
  .sidebar .nav a.active {
    background: #eee5f7;
    color: #62388a;
  }
  .memory-card .section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .study-desk .mission {
    padding: 25px;
  }
}
@media (max-width: 600px) {
  .study-desk {
    border: 0;
    gap: 16px;
    background: transparent;
    overflow: visible;
  }
  .study-desk .mission {
    border-radius: 12px;
  }
  .study-desk .lab-preview {
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .quick-grid .quick-card + .quick-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .quick-grid .quick-card {
    padding: 14px 4px;
  }
}

.sidebar .sidebar-progress strong {
  color: #ffc663;
}
.daily-ring {
  border-color: #e4d9ef;
  border-top-color: var(--teal);
}

/* Hormones: a shared map, grouped tables, and an interruptible guided tour. */
.hormone-toolbar,
.hormone-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0;
  flex-wrap: wrap;
}
.hormone-view-switch {
  display: flex;
  padding: 4px;
  background: var(--surface, #f1eef6);
  border: 1px solid var(--line, #d8d2e0);
  border-radius: 14px;
  gap: 4px;
}
.hormone-view-switch button {
  border: 0;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  min-height: 44px;
}
.hormone-view-switch button[aria-pressed="true"] {
  background: var(--teal);
  color: white;
}
.hormone-filter-row label {
  min-width: 240px;
  font-weight: 700;
  display: grid;
  gap: 6px;
}
.hormone-filter-row select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card, #fff);
  color: inherit;
  font-size: 1rem;
}
.hormone-filter-row .note {
  max-width: 520px;
  margin: 0;
}
.memory-table .hormone-group-heading th {
  position: static !important;
  width: auto !important;
  min-width: 0 !important;
  white-space: normal;
  background: var(--paper, #f1eef6);
  color: var(--ink, #271d34);
  padding: 1rem !important;
  border-top: 3px solid var(--teal);
}
.hormone-group-heading th > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.hormone-group-heading strong {
  font-size: 1.1rem;
}
.hormone-group-heading small {
  display: inline-block;
  margin-left: 1rem;
  font-size: 0.875rem;
  font-weight: 400;
}
.hormone-group-heading p {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.7;
  max-width: 780px;
}
.hormone-explorer {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(350px, 1.05fr);
  gap: 1.3rem;
  margin: 1.2rem 0 2rem;
  align-items: start;
}
.hormone-stage-wrap {
  position: sticky;
  top: 18px;
  min-width: 0;
}
.hormone-stage {
  background: radial-gradient(ellipse at 50% 45%, #382a54, #191527 80%);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #4e3d67;
  color: #fff;
  position: relative;
}
.hormone-stage-heading {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
  color: #e2d7f0;
  border-bottom: 1px solid #ffffff20;
}
.hormone-current-label {
  padding: 0.8rem 1.1rem;
  min-height: 98px;
  background: #ffffff08;
}
.hormone-current-label strong {
  display: block;
  color: #ffd892;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.hormone-current-label span {
  display: block;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #fff;
}
.hormone-model {
  position: relative;
  height: 500px;
  overflow: hidden;
  touch-action: none;
}
.hormone-model canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.hormone-model .model-controls {
  z-index: 4;
  bottom: 5px;
  top: auto;
}
.hormone-model .model-candidates {
  display: none;
}
.hormone-model .model-loading {
  font-size: 1rem;
  color: #fff;
  text-align: center;
  padding: 2rem;
}
.hormone-camera {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #ffffff20;
}
.hormone-camera button {
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid #ffffff55;
  background: #ffffff10;
  color: white;
  border-radius: 10px;
  font-size: 1rem;
}
.hormone-stage > .device-help {
  color: #d6cbe3;
  font-size: 0.85rem;
  text-align: center;
  padding: 0 1rem;
  margin: 0.2rem 0 1rem;
}
.hormone-model-note {
  margin-top: 0.7rem;
}
.anatomy-annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.anatomy-annotations svg {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  overflow: hidden;
}
.anatomy-annotations line {
  stroke: #f9d18b;
  stroke-width: 1;
  opacity: 0.7;
}
.anatomy-pin {
  position: absolute;
  pointer-events: auto;
  min-height: 32px;
  max-width: 46%;
  border: 1px solid #bba1d9;
  border-radius: 8px;
  padding: 5px 8px;
  color: #fff;
  background: #2c203bea;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: left;
  box-shadow: 0 2px 12px #0005;
  cursor: pointer;
}
.anatomy-pin:hover,
.anatomy-pin:focus-visible {
  background: #70429b;
  outline: 2px solid #ffc663;
  outline-offset: 2px;
}
.hormone-guide {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.hormone-player,
.hormone-focus {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem;
  background: var(--card, #fff);
}
.hormone-player h2 {
  font-size: 1.2rem;
  margin: 0.3rem 0;
}
.hormone-player .section-head {
  align-items: start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}
.hormone-play-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}
.hormone-play-controls label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.875rem;
}
.hormone-play-controls select {
  min-height: 44px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 5px;
  background: var(--card, #fff);
  color: inherit;
}
.hormone-tour-progress {
  width: 100%;
  height: 6px;
  accent-color: var(--teal);
  margin-top: 1.2rem;
}
.hormone-focus {
  border-left: 4px solid var(--teal);
}
.hormone-focus h3 {
  font-size: 1.45rem;
  margin: 0.4rem 0 0.7rem;
}
.hormone-focus p {
  line-height: 1.8;
}
.hormone-row-buttons {
  display: grid;
  gap: 7px;
  margin: 1rem 0;
}
.hormone-term {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  min-height: 44px;
}
.hormone-term strong {
  font-size: 1rem;
  color: var(--teal);
}
.hormone-term span {
  font-size: 0.875rem;
  line-height: 1.6;
}
.hormone-pathway {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--paper, #f4eef8);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.6;
}
.hormone-caveat {
  font-size: 0.875rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: var(--paper, #f4eef8);
  border: 1px dashed var(--line);
}
.hormone-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hormone-site-card {
  display: flex;
  align-items: start;
  gap: 9px;
  min-height: 90px;
  padding: 0.8rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card, #fff);
  color: inherit;
}
.hormone-site-card[aria-pressed="true"] {
  border: 2px solid var(--teal);
  padding: calc(0.8rem - 1px);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--teal), transparent 85%);
}
.hormone-number {
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 800;
  padding-top: 3px;
  min-width: 22px;
}
.hormone-site-card strong,
.hormone-site-card small,
.hormone-names {
  display: block;
}
.hormone-site-card strong {
  font-size: 1rem;
  line-height: 1.5;
}
.hormone-site-card small {
  font-size: 0.8rem;
  opacity: 0.75;
  margin: 0.2rem 0;
}
.hormone-names {
  font-size: 0.85rem;
  line-height: 1.65;
}
[data-theme="dark"] .hormone-player,
[data-theme="dark"] .hormone-focus,
[data-theme="dark"] .hormone-site-card {
  background: #211b2f;
}
[data-theme="dark"] .hormone-filter-row select,
[data-theme="dark"] .hormone-play-controls select {
  background: #211b2f;
}
[data-theme="dark"] .memory-table .hormone-group-heading th,
[data-theme="dark"] .hormone-pathway,
[data-theme="dark"] .hormone-caveat {
  background: #332442;
  color: #f4edf9;
}
@media (max-width: 1100px) {
  .hormone-explorer {
    grid-template-columns: minmax(300px, 0.9fr) minmax(280px, 1fr);
  }
  .hormone-index {
    grid-template-columns: 1fr;
  }
  .hormone-model {
    height: 460px;
  }
}
@media (max-width: 850px) {
  .hormone-explorer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .hormone-guide {
    display: contents;
  }
  .hormone-stage-wrap {
    position: static;
    order: 2;
    width: 100%;
  }
  .hormone-player {
    order: 1;
    width: 100%;
  }
  .hormone-focus {
    order: 3;
    width: 100%;
  }
  .hormone-guide > .section-head {
    order: 4;
    width: 100%;
  }
  .hormone-index {
    order: 5;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .hormone-guide > .note {
    order: 6;
  }
  .hormone-current-label {
    min-height: 94px;
  }
  .hormone-model {
    height: 400px;
  }
  .hormone-filter-row {
    align-items: stretch;
  }
  .hormone-filter-row label {
    flex: 1;
  }
  .hormone-group-heading th > div {
    justify-content: start;
    flex-wrap: wrap;
  }
  .hormone-toolbar {
    align-items: stretch;
  }
  .hormone-toolbar > .primary {
    flex: 1;
  }
}
@media (max-width: 480px) {
  .hormone-index {
    grid-template-columns: 1fr;
  }
  .hormone-model {
    height: 380px;
  }
  .hormone-player {
    padding: 1rem;
  }
  .hormone-view-switch {
    width: 100%;
  }
  .hormone-view-switch button {
    flex: 1;
    padding: 0.65rem 0.4rem;
    font-size: 0.95rem;
  }
  .anatomy-pin {
    font-size: 0.75rem;
    padding: 6px;
  }
  .hormone-stage-heading {
    font-size: 0.8rem;
  }
  .hormone-play-controls .primary {
    flex: 1 0 100%;
  }
  .hormone-group-heading p {
    max-width: calc(100vw - 5rem);
  }
}
.hormone-current-label small {
  display: block;
  font-size: 0.8rem;
  color: #ffe3ab;
  margin-top: 4px;
  line-height: 1.5;
}
.hormone-stage-play {
  min-width: 52px;
  background: #70429b !important;
}
