/* Student reading and navigation. Scoped so staff workflows retain their layout. */
.app:has(.student-nav) .top { padding-top: 24px; padding-bottom: 12px; }
.app:has(.student-nav) .brand-full { font-size: 17px; letter-spacing: -0.3px; }
.app:has(.student-nav) .nav { gap: 8px; padding-bottom: 20px; }
.student-nav a, .student-nav .nav-more > summary { font-size: 15px; }
.app:has(.student-nav) .main { padding-bottom: 48px; }
.app:has(.student-nav) .panel { box-shadow: none; }

/* A lesson reads like one well typeset page, rather than a stack of dashboard cards. */
.main > [data-focused-course] { padding: 24px 32px 40px; border-radius: 18px; }
.lesson-breadcrumb { display: flex; align-items: center; gap: 20px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.lesson-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.lesson-breadcrumb .lesson-help { margin-left: auto; color: var(--muted); }
.lesson-breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
[data-focused-course] > [data-course-source]:empty,
[data-focused-course] > [data-course-repair]:empty { display: none; }
.course-loading { color: var(--muted); padding: 32px 0; }
.math-node-course .course-head { margin-bottom: 28px; }
.math-node-course .course-head h1 { color: var(--ink); font-size: 30px; letter-spacing: -0.5px; line-height: 1.4; }
.math-node-course .course-objective { margin-top: 12px; color: var(--ink-soft); line-height: 1.8; }
.math-node-course .course-practice-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; font-size: 15px; font-weight: 600; text-decoration: none; }
.math-node-course .course-layout > .course-toc { background: var(--surface); }
.math-node-course .course-section, .math-node-course .course-body > details.math-reading { padding: 28px 0 16px; }
.math-node-course .course-section-title h2 { font-size: 20px; font-weight: 600; }
.math-node-course .course-example { margin-top: 20px; }
.math-node-course .course-example li { padding-left: 4px; margin: 12px 0; }
.math-node-course .course-example-end { margin-top: 20px; padding: 14px 18px; background: var(--primary-soft); border-radius: 10px; font-weight: 500; }
.math-node-course .course-prereq { margin: 8px 0 20px; background: var(--bg); border-color: var(--line); }
.math-node-course .course-prereq > summary { color: var(--muted); font-size: 14px; font-weight: 500; }
.math-node-course .course-prereq[open] > summary { color: var(--ink); }
.math-node-course .course-prereq p { font-size: 15px; }
.math-node-course .math-task { padding: 24px; border-radius: 14px; }
.math-node-course .math-task h2 { font-size: 18px; }
.math-node-course .math-choices { gap: 10px; margin: 20px 0; }
.math-node-course .math-choices button { padding: 14px 18px; }
.math-node-course .math-progress li { border: 0; background: var(--bg); padding: 6px 12px; }
.math-node-course .math-progress li[aria-current="step"] { background: var(--primary-soft); }
.lesson-extra-foundations { max-width: 680px; margin: 24px auto 0; color: var(--muted); }
.lesson-extra-foundations > summary { min-height: 44px; cursor: pointer; }
.main:has([data-focused-course]) + .site-foot { display: none; }

/* Errors are a single recoverable state. Never pile bare exceptions on a page. */
.subject-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 8px 0 20px; }
.subject-directory-head h1 { margin: 0; }
.subject-directory-head .grade-switch { display: flex; margin: 0; gap: 12px; }
.grade-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.grade-nav a, .grade-nav button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.grade-nav a[aria-current="page"], .grade-nav button[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.atlas-view-tools .grade-nav { margin: 0; }
.subject-directory-head .field { margin: 0; font-size: 14px; min-width: 110px; color: var(--muted); }
[data-subject]:not([data-focused-course]) [data-chapter-tools] { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; margin: 0 0 28px; }
[data-subject]:not([data-focused-course]) [data-chapter-tools]:not(:has(select)) { grid-template-columns: minmax(0, 1fr); }
[data-chapter-tools] > label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
[data-chapter-tools] select, [data-chapter-tools] input { width: 100%; min-width: 0; min-height: 44px; margin: 0; font-size: 15px; }
.student-directory > h2 { font-size: 18px; margin: 0 0 16px; }
.student-chapter-row { border-top: 1px solid var(--line); }
.student-chapter-row summary { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 0; cursor: pointer; list-style: none; }
.student-chapter-row summary::-webkit-details-marker { display: none; }
.student-chapter-row summary::after { content: "+"; color: var(--muted); flex: none; }
.student-chapter-row details[open] > summary::after { content: "−"; }
.student-chapter-row summary strong { font-size: 17px; line-height: 1.5; font-weight: 600; flex: 1; }
.student-chapter-row .chapter-number { font-size: 14px; color: var(--muted); min-width: 32px; }
.student-chapter-row .chapter-size { font-size: 14px; color: var(--muted); flex: none; }
.student-chapter-row ul { list-style: none; margin: 0 0 20px; padding: 0; }
.student-chapter-row li a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; min-height: 56px; border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none; margin: 6px 0; line-height: 1.6; }
.student-chapter-row li a:hover { background: var(--primary-soft); }
.student-chapter-row .directory-enter { flex: none; font-size: 14px; color: var(--primary); }
.directory-pending { color: var(--muted); font-size: 14px; padding: 12px 16px; display: flex; gap: 16px; justify-content: space-between; }
.subject-extras { margin: 32px 0 0; border-top: 1px solid var(--line); }
.subject-extras > summary, .subject-catalog > summary { font-size: 15px; color: var(--muted); cursor: pointer; min-height: 56px; display: flex; align-items: center; }
.directory-empty { padding: 20px 0; color: var(--muted); }
.load-error { padding: 20px 24px; margin: 16px 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.load-error p { margin: 0; }
.load-error p + p { margin-top: 12px; }

/* The selected graph node is a small learning entry. The full graph remains intact. */
.atlas.is-student .atlas-card { background: #fff; color: #24292f; border: 1px solid #dedfdc; width: 360px; right: 24px; top: 84px; bottom: auto; max-height: calc(100% - 108px); padding: 24px; border-radius: 18px; display: block; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; box-shadow: 0 12px 44px rgba(30, 40, 50, .12); }
.atlas.is-student .atlas-card .atlas-close { position: sticky; float: right; top: 0; right: auto; z-index: 2; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: -8px -8px 0 4px; border: 0; border-radius: 10px; color: #454b53; background: #f2f3f1; font-size: 26px; line-height: 1; }
.atlas.is-student .atlas-card .atlas-close:hover { color: #20252b; background: #e6e9e6; }
.atlas.is-student .atlas-kicker { color: #59616b; font-size: 14px; line-height: 1.6; letter-spacing: 0; margin: 4px 0 16px; }
.atlas.is-student .atlas-kicker .dot { margin-right: 6px; }
.atlas.is-student .atlas-card h2 { clear: both; color: #24292f; font-size: 24px; line-height: 1.45; font-weight: 600; margin: 0 0 16px; }
.atlas.is-student .atlas-card .atlas-summary { display: block; color: #525b65; font-size: 16px; line-height: 1.75; margin: 0; overflow: visible; }
.atlas.is-student .student-node-action { padding: 24px 0; }
.atlas.is-student .student-node-action .btn { width: 100%; min-height: 48px; border-radius: 10px; font-size: 16px; color: #fff; background: #2f5d8a; }
.atlas.is-student .student-node-relations > details { border-top: 1px solid #e7e8e4; }
.atlas.is-student .student-node-relations summary { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 52px; font-size: 15px; font-weight: 500; color: #39434e; list-style: none; }
.atlas.is-student .student-node-relations summary::-webkit-details-marker { display: none; }
.atlas.is-student .student-node-relations summary span { margin-left: auto; color: #616973; font-size: 14px; }
.atlas.is-student .student-node-relations summary::after { content: "+"; color: #616973; }
.atlas.is-student .student-node-relations details[open] > summary::after { content: "−"; }
.atlas.is-student .student-node-relations h3 { color: #39434e; font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.atlas.is-student .student-node-relations .muted { color: #616973; font-size: 14px; }
.atlas.is-student .student-relation-list { margin: 0 0 16px; }
.atlas.is-student .student-relation-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eff0ed; }
.atlas.is-student .student-relation-list .atlas-jump { flex: 1; min-width: 0; min-height: 44px; display: block; padding: 4px 0; color: #2d3743; background: transparent; border: 0; border-radius: 6px; box-shadow: none; font-size: 15px; line-height: 1.6; text-align: left; }
.atlas.is-student .student-relation-list .atlas-jump small { display: block; color: #616973; font-size: 14px; margin-top: 4px; }
.atlas.is-student .student-relation-list .atlas-jump:hover { color: #2f5d8a; background: #f4f6f8; }
.atlas.is-student .student-relation-list a { flex: none; color: #2f5d8a; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: none; }
.atlas.is-student .student-earlier { margin-top: 12px; }
.atlas.is-student.is-selected .atlas-copy { opacity: 1; }
.atlas.is-student .atlas-list-context > summary { font-size: 14px; min-height: 44px; cursor: pointer; color: var(--muted); }
.atlas.is-student.is-list .atlas-view-search { display: none; }
.atlas.is-student .atlas-list-close { position: sticky; float: right; top: 0; z-index: 2; min-width: 44px; min-height: 44px; padding: 0 10px; color: var(--ink); background: var(--bg); border-radius: 10px; font-size: 16px; }
.atlas.is-student .atlas-fallback > h2 { font-size: 20px; line-height: 1.5; max-width: calc(100% - 56px); margin: 4px 0 16px; }
.atlas.is-student .atlas-fallback button[data-node-jump] { font-size: 15px; min-height: 52px; padding: 10px 12px; }
.atlas.is-student .atlas-fallback button[data-node-jump] small { font-size: 14px; color: var(--muted); }

/* Today has one clear starting point; the search stays close to it. */
.student-home { padding: 36px; }
.student-home h1 { font-size: 30px; margin: 8px 0 28px; }
.student-home h2 { font-size: 18px; margin-bottom: 18px; }
.student-home .student-today { padding-bottom: 28px; }
.student-home .task { box-shadow: none; padding: 20px; border-color: var(--line); }
.student-home [data-next-practice-list], .student-home .student-knowledge-search, .student-home .student-progress { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 12px; }
.student-home .student-knowledge-search input[type="search"] { min-height: 48px; }
.student-home .student-knowledge-search .field { max-width: 600px; }
.student-home .student-knowledge-search { border: 0; padding: 0; margin: 0; }
.student-home .home-search-bar { display: flex; align-items: center; gap: 10px; max-width: 680px; }
.student-home .home-search-bar input { min-width: 0; flex: 1; width: 100%; border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--surface); }
.student-home .home-search-bar button { flex: none; min-height: 48px; }
.student-home .home-quiet-links { display: flex; gap: 24px; margin: 12px 0 32px; font-size: 14px; }
.student-home .home-quiet-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.student-home .student-today .task { position: relative; padding-right: 48px; }
.student-home .student-today .task b { display: block; font-size: 17px; line-height: 1.6; font-weight: 600; }
.student-home .student-today .task .muted { display: block; font-size: 14px; margin-top: 8px; }
.student-home .task-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--primary); }
.student-home .student-more-practice, .student-home .student-progress { border-top: 1px solid var(--line); margin: 0; padding: 0; }
.student-home .student-more-practice > summary, .student-home .student-progress > summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; color: var(--muted); font-size: 15px; list-style: none; }
.student-home .student-more-practice > summary::after, .student-home .student-progress > summary::after { content: "+"; margin-left: auto; }
.student-home details[open] > summary::after { content: "−"; }
.student-home .student-more-practice > summary::-webkit-details-marker, .student-home .student-progress > summary::-webkit-details-marker { display: none; }

@media (max-width: 767px) {
  .app:has(.student-nav) .top { padding-top: 16px; padding-bottom: 8px; }
  .app:has(.student-nav) .brand-full { font-size: 14px; max-width: 230px; }
  .app:has(.student-nav) .nav { flex-wrap: nowrap; gap: 0; justify-content: space-between; padding-bottom: 14px; }
  .student-nav a, .student-nav .nav-more > summary { font-size: 14px; padding: 8px; }
  .main > [data-focused-course] { padding: 16px 18px 28px; border-radius: 14px; }
  .lesson-breadcrumb { gap: 12px; font-size: 14px; padding-bottom: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .lesson-breadcrumb .lesson-help { margin-left: auto; }
  .student-chapter-row .chapter-size { display: none; }
  .student-chapter-row li a { display: block; padding: 14px; }
  .student-chapter-row .directory-enter { display: block; margin-top: 8px; }
  .math-node-course .course-head h1 { font-size: 24px; line-height: 1.45; }
  .math-node-course .course-section, .math-node-course .course-body > details.math-reading { padding: 24px 0 12px; }
  .math-node-course .math-task { padding: 16px; }
  .math-node-course .math-task h2 { font-size: 17px; }
  .student-home { padding: 24px 20px; }
  .student-home h1 { font-size: 26px; }
  .student-home .grid { grid-template-columns: minmax(0, 1fr); }
  .atlas.is-student.is-selected .atlas-card,
  .atlas.is-student.has-views.is-selected.is-stage .atlas-card { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: min(70svh, 640px); padding: 20px; }
  .atlas.is-student .atlas-card h2 { font-size: 22px; }
  .atlas.is-student .atlas-views { font-size: 14px; }
  .atlas.is-student .atlas-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 16px; background: var(--bg); }
  .atlas.is-student .atlas-bar .brand { grid-column: 1; grid-row: 1; max-width: none; }
  .atlas.is-student .atlas-bar .who { grid-column: 2; grid-row: 1; font-size: 14px; }
  .atlas.is-student .atlas-bar .who span { max-width: none; }
  .atlas.is-student .atlas-bar .atlas-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; overflow: visible; }
  .atlas.is-student .atlas-nav a, .atlas.is-student .atlas-nav .nav-more > summary { font-size: 14px; padding: 6px 8px; min-height: 44px; }
  .atlas.is-student .atlas-nav .nav-more-list { top: 102px; right: 16px; }
  .atlas.is-student.has-views.is-stage .atlas-copy { top: 112px; left: 16px; max-width: calc(100% - 32px); max-height: 72px; }
}
@media (prefers-reduced-motion: no-preference) {
  .student-node-action .btn, .student-relation-list .atlas-jump { transition: background-color .15s ease; }
}
.student-chapter-heading {display:flex;align-items:baseline;gap:10px;padding:22px 0 10px;color:#66717c;}
.student-chapter-heading h3 {margin:0;font-size:16px;font-weight:650;color:#27394a;}
.student-chapter-heading>span {font-size:13px;}
.student-chapter-heading[hidden] {display:none;}
