:root {
  color-scheme: dark;
  --bg: #101613;
  --panel: #19221c;
  --border: #35443a;
  --text: #e9eee6;
  --muted: #aebcae;
  --accent: #c4ed9a;
  --gold: #e3c889;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.6 system-ui,
    sans-serif;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--border);
  background: #26352b;
  color: var(--text);
  padding: 9px 15px;
  border-radius: 7px;
  cursor: pointer;
}
button:hover,
.button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
header {
  min-height: 84px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 36px;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
}
.logo {
  background: var(--accent);
  color: var(--bg);
  font-size: 25px;
  padding: 0 11px;
  border-radius: 8px;
}
.tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.layout {
  max-width: 1550px;
  margin: auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}
aside {
  border-right: 1px solid var(--border);
  padding: 34px 26px;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.13;
  letter-spacing: -1.7px;
  margin: 8px 0 16px;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin: 7px 0 14px;
}
p {
  margin: 12px 0;
}
.eyebrow {
  font: 700 11px/1.5 system-ui;
  letter-spacing: 2px;
  color: var(--accent);
}
.muted,
.small {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.lead {
  color: var(--muted);
  font-size: 19px;
}
.stats {
  display: flex;
  gap: 15px;
  margin: 28px 0 16px;
}
.stats strong {
  font-size: 27px;
  display: block;
  color: var(--gold);
}
.stats span {
  font-size: 11px;
  color: var(--muted);
}
.primary {
  background: var(--accent);
  color: #142014;
  border-color: var(--accent);
  font-weight: 700;
}
.wide {
  width: 100%;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 24px 0;
}
nav button {
  text-align: left;
  display: flex;
  gap: 13px;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  padding: 10px;
}
nav button.active {
  background: #2b3d2c;
  border-color: #789064;
}
nav button span {
  color: var(--muted);
  min-width: 22px;
}
main {
  padding: 36px 48px;
  min-width: 0;
}
.lesson-heading {
  margin-bottom: 30px;
}
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
  padding-bottom: 14px;
}
.tabs button {
  font-size: 13px;
  background: transparent;
}
.tabs button[aria-selected="true"] {
  background: #314332;
  border-color: #7b956e;
}
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 26px;
  margin: 20px 0;
}
.intro {
  background: linear-gradient(110deg, #233025, #19221c);
}
.prediction {
  border-left: 3px solid var(--gold);
  padding: 9px 18px;
  background: #202c24;
  margin: 22px 0;
}
.prediction strong {
  color: var(--gold);
  font-size: 13px;
}
.prediction p {
  margin: 5px 0;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
label {
  display: block;
  font-size: 14px;
}
select,
input[type="text"],
textarea {
  background: #111b15;
  color: var(--text);
  border: 1px solid #5d7162;
  border-radius: 6px;
  padding: 10px;
}
input[type="range"] {
  width: min(100%, 400px);
  accent-color: var(--accent);
}
textarea {
  display: block;
  width: 100%;
  margin: 10px 0 18px;
  resize: vertical;
}
.check {
  margin: 15px 0;
}
.check input {
  accent-color: var(--accent);
}
#controls {
  margin: 20px 0;
}
#visual {
  min-height: 130px;
}
.bars {
  display: grid;
  gap: 12px;
}
.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 75px;
  align-items: center;
  gap: 10px;
}
.bar-track {
  background: #0f1912;
  height: 26px;
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
}
.heatmap {
  display: grid;
  grid-template-columns: repeat(8, minmax(25px, 1fr));
  gap: 5px;
  max-width: 550px;
}
.cell {
  aspect-ratio: 1.4;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  border-radius: 4px;
  background: #0c150f;
  color: #778679;
}
.cell.on {
  background: #476d42;
  color: white;
}
.cell.selected {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.metrics {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.metric strong {
  display: block;
  font-size: 30px;
  color: var(--accent);
}
.metric span {
  font-size: 13px;
  color: var(--muted);
}
svg {
  width: 100%;
  max-height: 230px;
  display: block;
  background: #101a13;
  border-radius: 8px;
}
.question {
  font-size: 22px;
  line-height: 1.5;
  padding: 18px 0;
  color: var(--gold);
}
#feedback {
  padding: 12px 0;
  min-height: 45px;
}
.success {
  color: var(--accent);
}
.failure {
  color: #ffb3a7;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
article {
  font-size: 15px;
}
article h1 {
  font-size: 28px;
  margin-top: 24px;
}
article h2 {
  margin-top: 30px;
}
code {
  background: #0c170f;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}
pre {
  overflow: auto;
  background: #0c170f;
  padding: 14px;
  border-radius: 6px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  min-width: 500px;
  font-size: 13px;
}
td {
  padding: 10px;
  border: 1px solid var(--border);
  vertical-align: top;
}
iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  margin-top: 20px;
  border-radius: 8px;
}
footer {
  font-size: 12px;
  color: var(--muted);
  padding: 25px 0;
}
.skip {
  position: absolute;
  top: -100px;
  left: 15px;
  background: var(--bg);
  padding: 10px;
}
.skip:focus {
  top: 10px;
  z-index: 10;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  main {
    padding: 28px;
  }
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  aside {
    padding: 25px 18px;
  }
  .tag {
    display: none;
  }
  .tabs {
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  header {
    padding: 16px;
  }
  .layout {
    display: block;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  aside h2,
  aside > .muted,
  aside > .small {
    display: none;
  }
  nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 16px 0;
  }
  nav button {
    font-size: 12px;
  }
  main {
    padding: 22px 16px;
  }
  .card {
    padding: 20px;
  }
  .header-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .header-actions a {
    font-size: 12px;
  }
  .tabs button {
    padding: 8px;
    font-size: 12px;
  }
  .row input[type="text"] {
    width: 100%;
  }
}
/* Reading and context exploration */
.module-tools > p:first-child {
  font-size: 17px;
}
.full-module {
  line-height: 1.8;
}
.full-module h2 {
  margin-top: 38px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.full-module h1 {
  font-size: 28px;
}
.full-module p {
  max-width: 82ch;
}
.sandbox-details > .card {
  border: 0;
  padding: 12px 0;
  margin: 0;
  background: transparent;
}
.lab-link {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  font-size: 14px;
}
.lab-link span {
  color: var(--muted);
  font-size: 12px;
}
.lab-link:hover strong {
  text-decoration: underline;
}
#lab-navigation a {
  padding: 12px;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
}
#lab-navigation a[aria-current="page"] {
  background: #2b3d2c;
  border-color: #789064;
}
audio {
  width: 100%;
  margin: 12px 0;
}
#lecture-chapters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 10px 0;
}
#lecture-chapters button {
  font-size: 12px;
}
#lecture-chapters button[aria-current="step"] {
  border-color: var(--accent);
  background: #314332;
}
.concept-term {
  display: inline;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted #b7d991;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: help;
  text-align: inherit;
}
.concept-term:hover {
  background: #3a5135;
  color: var(--accent);
}
.selection-explain {
  position: fixed;
  z-index: 100;
  background: var(--accent);
  color: #142014;
  font-size: 13px;
  box-shadow: 0 5px 30px #0008;
}
#concept-dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid #71816c;
  border-radius: 18px;
  width: min(800px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 0;
  overflow: visible;
  box-shadow: 0 20px 100px #0009;
}
#concept-dialog::backdrop {
  background: #020704b8;
  backdrop-filter: blur(3px);
}
.concept-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
#concept-search-form {
  padding: 18px 22px;
}
#concept-search {
  flex: 1;
  min-width: 100px;
  background: #101a13;
  color: var(--text);
  border: 1px solid #5d7162;
  border-radius: 6px;
  padding: 10px;
}
#concept-scroll {
  padding: 0 26px 24px;
  max-height: calc(90dvh - 215px);
  overflow: auto;
  overscroll-behavior: contain;
}
#concept-title {
  font-size: 32px;
  margin-top: 12px;
}
#concept-body h3 {
  font-size: 15px;
  color: var(--gold);
  margin-top: 25px;
}
#concept-context {
  border-left: 2px solid var(--border);
  padding-left: 12px;
}
#concept-context:empty {
  display: none;
}
.concept-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}
.concept-footer p {
  margin: 4px 0 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#concept-related button {
  font-size: 13px;
}
#concept-body pre {
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 720px) {
  #concept-dialog {
    width: calc(100vw - 16px);
    max-height: 95dvh;
    border-radius: 12px;
  }
  .concept-toolbar {
    padding: 12px;
    flex-wrap: wrap;
  }
  .concept-toolbar .eyebrow {
    font-size: 9px;
  }
  #concept-search-form {
    padding: 12px;
  }
  #concept-scroll {
    padding: 0 16px 18px;
    max-height: calc(95dvh - 205px);
  }
  .concept-footer {
    padding: 12px;
  }
  #lecture-chapters {
    grid-template-columns: 1fr;
  }
  .lab-link {
    grid-template-columns: 55px 1fr;
  }
  .lab-link > span:last-child {
    display: none;
  }
}
#unit-navigation a {
  padding: 12px;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
}
#unit-navigation a[aria-current="page"] {
  background: #2b3d2c;
  border-color: #789064;
}
.complete-reference {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
#unit-sandbox label {
  margin-bottom: 20px;
}
#unit-sandbox label input {
  margin-top: 7px;
}
.training-graph {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.training-graph button {
  font-size: 15px;
}
.module-tools details {
  margin-top: 15px;
}
.full-module ul,
.full-module ol {
  padding-left: 25px;
}
.full-module li {
  margin: 10px 0;
}
.full-module th {
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  background: #293b2d;
  color: var(--accent);
}
blockquote {
  margin: 18px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--gold);
  background: #202c24;
}
#reader-links a,
#reader-toc a {
  padding: 8px 0;
  font-size: 13px;
  text-decoration: none;
}
#reader-toc a:hover {
  text-decoration: underline;
}
html {
  scroll-behavior: smooth;
}
#guide-body h2 {
  scroll-margin-top: 20px;
}

.concept-flow {display:flex;gap:1.5rem;list-style:none;padding:0;align-items:stretch;flex-wrap:wrap;}
.concept-flow li {position:relative;flex:1;min-width:130px;border:1px solid var(--line,#bbc7ca);border-radius:8px;padding:1rem;background:rgba(40,130,110,.08);}
.concept-flow li:not(:last-child)::after {content:'→';position:absolute;right:-1.3rem;top:40%;}
.concept-figure {margin:1.25rem 0;}
.concept-figure figcaption {font-weight:600;}
.definition-card {padding:.8rem 0;border-bottom:1px solid var(--line,#bbc7ca);}
.definition-card summary {cursor:pointer;font-weight:650;}
.tutor-panel textarea {width:100%;box-sizing:border-box;}
.tutor-panel label {display:block;margin:.7rem 0;}
@media(max-width:600px){.concept-flow {flex-direction:column;gap:1.5rem}.concept-flow li:not(:last-child)::after{content:'↓';top:auto;right:50%;bottom:-1.4rem}}
