:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #66746d;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --line: #dfe5dc;
  --green: #2f6f5e;
  --green-strong: #174f42;
  --blue: #335f91;
  --amber: #bf7a22;
  --red: #a84c44;
  --violet: #6c5a8f;
  --shadow: 0 18px 45px rgba(30, 40, 34, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(47, 111, 94, 0.08), transparent 280px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  padding: 14px 0;
  background: rgba(251, 250, 245, 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 229, 220, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(47, 111, 94, 0.32);
  border-radius: 8px;
  background: #eef6f0;
  color: var(--green-strong);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 0.84rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, 38vw);
  min-width: 240px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 20px rgba(30, 40, 34, 0.05);
}

.search-box svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.view-tabs,
.level-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f5ef;
}

.view-tab,
.level-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.view-tab.is-active,
.level-chip.is-active {
  background: var(--panel);
  color: var(--green-strong);
  box-shadow: 0 2px 10px rgba(30, 40, 34, 0.08);
}

.main-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 42px;
}

.sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
  padding-right: 4px;
}

.progress-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece6;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width 180ms ease;
}

.level-filter {
  width: 100%;
  margin: 14px 0;
}

.level-chip {
  flex: 1;
  padding: 0 8px;
}

.chapter-nav {
  display: grid;
  gap: 8px;
}

.chapter-button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
}

.chapter-button:hover,
.chapter-button:focus-visible,
.chapter-button.is-active {
  border-color: rgba(47, 111, 94, 0.45);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(30, 40, 34, 0.08);
}

.chapter-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef2ed;
  color: var(--green-strong);
  font-weight: 800;
}

.chapter-button strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.24;
}

.chapter-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.77rem;
}

.done-dot {
  width: 18px;
  height: 18px;
  border: 1px solid #b7c2b9;
  border-radius: 50%;
  background: #fff;
}

.chapter-button.is-done .done-dot {
  border-color: var(--green);
  background: radial-gradient(circle at center, var(--green) 0 48%, #fff 52%);
}

.content-panel {
  min-width: 0;
}

.admin-page {
  padding: 24px 0 42px;
}

body.is-locked .search-box,
body.is-locked .view-tabs,
body.is-locked .sidebar {
  display: none;
}

body.is-locked .topbar {
  justify-content: center;
}

body.is-locked .brand {
  min-width: 0;
}

body.is-locked .main-grid {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

body.is-locked .content-panel {
  width: 100%;
}

.hero-panel,
.chapter-layout,
.roadmap-layout,
.resource-layout,
.lab-layout {
  display: grid;
  gap: 18px;
}

.hero-panel {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: stretch;
  margin-bottom: 18px;
}

.intro-block {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-block h1,
.chapter-header h1,
.section-block h2,
.resource-section h2,
.lab-layout h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-block h1 {
  max-width: 760px;
  font-size: 2.25rem;
}

.intro-block p,
.chapter-header p {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.02rem;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.metric {
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f4;
}

.metric strong {
  display: block;
  color: var(--green-strong);
  font-size: 1.55rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.visual-board {
  min-height: 350px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 111, 94, 0.1), rgba(191, 122, 34, 0.09)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-media {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) 132px;
  gap: 12px;
  min-height: 520px;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 1px solid rgba(223, 229, 220, 0.85);
  border-radius: 8px;
  background: #eef3ef;
}

.hero-mini-diagram {
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(223, 229, 220, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.visual-board svg,
.diagram svg {
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.chapter-header {
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  background: var(--green-strong);
  color: #fff;
}

.secondary-action {
  border-color: var(--line);
  background: #fff;
  color: var(--green-strong);
}

.chapter-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.section-stack,
.side-stack {
  display: grid;
  gap: 14px;
}

.section-block,
.side-card,
.resource-section,
.week-card,
.lab-card,
.quiz-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.section-block,
.resource-section,
.lab-card {
  padding: 22px;
}

.section-block h2 {
  margin-bottom: 10px;
  font-size: 1.34rem;
}

.section-block p {
  margin: 0 0 12px;
}

.section-block p:last-child {
  margin-bottom: 0;
}

.side-card {
  padding: 16px;
}

.side-card h3,
.quiz-card h3,
.resource-card h3,
.week-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.bullet-list,
.check-list,
.resource-list,
.plain-list {
  margin: 0;
  padding-left: 1.1rem;
}

.bullet-list li,
.check-list li,
.resource-list li,
.plain-list li {
  margin: 0.45rem 0;
}

.deep-list,
.term-list,
.video-list {
  margin: 0;
  padding: 0;
}

.deep-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.deep-list li {
  padding: 12px 12px 12px 16px;
  border-left: 4px solid rgba(47, 111, 94, 0.55);
  border-radius: 6px;
  background: #f7faf6;
}

.term-list {
  display: grid;
  gap: 10px;
}

.term-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.term-item:last-child {
  border-bottom: 0;
}

.term-item dt {
  color: var(--green-strong);
  font-weight: 900;
}

.term-item dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.video-card {
  background: #fbf7ef;
}

.video-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.video-list li {
  display: grid;
  gap: 2px;
}

.video-list a {
  color: var(--blue);
  font-weight: 900;
}

.video-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.check-list {
  list-style: none;
  padding-left: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.55rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 3px;
  background: var(--green);
}

.diagram {
  height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf6;
}

.quiz-card {
  padding: 16px;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.quiz-option.is-correct {
  border-color: rgba(47, 111, 94, 0.55);
  background: #eef7f1;
}

.quiz-option.is-wrong {
  border-color: rgba(168, 76, 68, 0.55);
  background: #fbefed;
}

.quiz-explain {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.week-card {
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 18px;
}

.week-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.week-card b {
  color: var(--green-strong);
}

.week-card p {
  margin: 0;
  color: var(--muted);
}

.resource-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.video-shelf {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(191, 122, 34, 0.28);
  border-radius: var(--radius);
  background: #fffaf1;
}

.video-shelf h3,
.video-shelf p {
  margin: 0;
}

.video-shelf p {
  color: var(--muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-tile {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(223, 229, 220, 0.95);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.video-tile strong {
  color: var(--blue);
  line-height: 1.25;
}

.video-tile span {
  color: var(--muted);
  font-size: 0.82rem;
}

.resource-filter {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.resource-filter.is-active {
  border-color: rgba(47, 111, 94, 0.45);
  color: var(--green-strong);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resource-card {
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.resource-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.resource-card a {
  color: var(--blue);
  font-weight: 800;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.resource-meta span {
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f4f5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
  gap: 18px;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.practice-card,
.reflection-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.practice-card {
  padding: 16px;
}

.practice-card h3,
.reflection-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.reflection-card {
  margin-top: 12px;
  padding: 16px;
  border-color: rgba(47, 111, 94, 0.32);
  background: #f4faf5;
}

.reflection-card p {
  margin: 0;
  color: var(--muted);
}

.neuron-lab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.control-row {
  display: grid;
  gap: 6px;
}

.control-row label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.control-row input,
.control-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
}

.nernst-result {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed rgba(47, 111, 94, 0.45);
  border-radius: var(--radius);
  background: #f4faf5;
  text-align: center;
}

.nernst-result strong {
  display: block;
  color: var(--green-strong);
  font-size: 1.9rem;
}

.atlas-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.atlas-tab {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.atlas-tab.is-active {
  border-color: rgba(47, 111, 94, 0.5);
  color: var(--green-strong);
  background: #f1f8f2;
}

.atlas-card {
  min-height: 165px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9faf7;
}

.empty-state {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.exam-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.exam-toolbar,
.exam-question,
.exam-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.exam-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.exam-toolbar h2,
.exam-toolbar p {
  margin: 0;
}

.exam-toolbar p {
  color: var(--muted);
}

.exam-result {
  display: none;
  gap: 4px;
  padding: 16px;
  background: #f4faf5;
}

.exam-result:not(:empty) {
  display: grid;
}

.exam-result strong {
  color: var(--green-strong);
  font-size: 1.25rem;
}

.exam-result span {
  color: var(--muted);
}

.exam-list {
  display: grid;
  gap: 12px;
}

.exam-question {
  padding: 18px;
}

.exam-question h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.35;
}

.exam-options {
  display: grid;
  gap: 8px;
}

.exam-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.exam-option input {
  flex: 0 0 auto;
  margin-top: 0.24rem;
}

.exam-option span {
  min-width: 0;
}

.exam-option.is-correct {
  border-color: rgba(47, 111, 94, 0.55);
  background: #eef7f1;
}

.exam-option.is-wrong {
  border-color: rgba(168, 76, 68, 0.55);
  background: #fbefed;
}

.exam-question.is-missed {
  border-color: rgba(191, 122, 34, 0.5);
}

.exam-explain {
  display: none;
  margin: 12px 0 0;
  color: var(--muted);
}

.exam-question.is-correct .exam-explain,
.exam-question.is-wrong .exam-explain,
.exam-question.is-missed .exam-explain {
  display: block;
}

.form-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.access-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(47, 111, 94, 0.32);
  border-radius: var(--radius);
  background: #f4faf5;
}

.access-card h2,
.access-card p {
  margin: 0;
}

.access-card p {
  color: var(--muted);
}

.registration-form,
.admin-panel {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.registration-form label,
.admin-login label,
.full-field {
  display: grid;
  gap: 6px;
}

.registration-form label span,
.admin-login label span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.registration-form input,
.registration-form select,
.registration-form textarea,
.admin-login input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
}

.registration-form textarea {
  min-height: 128px;
  resize: vertical;
}

.registration-form input:focus,
.registration-form select:focus,
.registration-form textarea:focus,
.admin-login input:focus {
  outline: 2px solid rgba(47, 111, 94, 0.22);
  border-color: rgba(47, 111, 94, 0.58);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
}

.consent-row input {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  margin-top: 0.28rem;
}

.consent-row span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.consent-row a {
  color: var(--blue);
  font-weight: 900;
}

.form-actions,
.admin-login {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.admin-login label {
  min-width: min(320px, 100%);
  flex: 1;
}

.form-status {
  color: var(--muted);
  font-weight: 700;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

.admin-table th {
  background: #f4f7f3;
  color: var(--green-strong);
  font-weight: 900;
}

.admin-table td {
  color: var(--muted);
}

.admin-table a {
  color: var(--blue);
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

@media (max-width: 1120px) {
  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand,
  .top-actions,
  .search-box {
    width: 100%;
    min-width: 0;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding-right: 0;
  }

  .chapter-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel,
  .chapter-body,
  .lab-grid,
  .video-shelf {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
  }

  .topbar {
    min-height: 0;
  }

  .view-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .view-tab {
    flex: 0 0 auto;
  }

  .chapter-nav,
  .roadmap-layout,
  .resource-grid,
  .video-grid,
  .practice-grid,
  .form-grid,
  .admin-summary,
  .metric-row,
  .neuron-lab {
    grid-template-columns: 1fr;
  }

  .intro-block,
  .chapter-header,
  .section-block,
  .resource-section,
  .lab-card {
    padding: 18px;
  }

  .intro-block h1 {
    font-size: 1.72rem;
  }

  .hero-media {
    min-height: 430px;
    grid-template-rows: 220px 150px;
  }

  .chapter-button {
    grid-template-columns: 38px 1fr auto;
  }

  .chapter-number {
    width: 38px;
    height: 38px;
  }

  .atlas-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exam-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
