:root{
  --paper:#f6f6f0;
  --white:#fff;
  --ink:#203635;
  --muted:#627270;
  --line:#dce2da;
  --teal:#1e6460;
  --deep:#153b3b;
  --lime:#d5eea6;
  --coral:#c36748;
  --soft:#eef1e8;
  --code:#142e31;
  --radius:16px
}
*{
  box-sizing:border-box
}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:15px;
  line-height:1.65
}
button,input,textarea,select{
  font:inherit
}
button,a,input,textarea,select{
  -webkit-tap-highlight-color:transparent
}
button{
  cursor:pointer
}
a{
  color:var(--teal)
}
button:disabled{
  opacity:.5;
  cursor:not-allowed
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{
  outline:3px solid #82a540;
  outline-offset:4px
}
button{
  touch-action:manipulation
}
p{
  margin:0 0 1em
}
h1,h2,h3,h4{
  line-height:1.2;
  margin:0 0 .6em;
  font-weight:600
}
h1,h2{
  font-family:Georgia,"Times New Roman",serif
}
h1{
  font-size:clamp(35px,3.7vw,56px);
  letter-spacing:-1.6px
}
h2{
  font-size:29px;
  letter-spacing:-.6px
}
h3{
  font-size:18px
}
h4{
  font-size:15px
}
small{
  font-size:12px
}
svg{
  max-width:100%
}
[hidden]{
  display:none!important
}
.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
}
.skip-link{
  position:fixed;
  opacity:0;
  pointer-events:none;
  top:-60px;
  left:20px;
  z-index:100;
  background:var(--white);
  padding:8px 16px
}
.skip-link:focus{
  top:10px;
  opacity:1;
  pointer-events:auto
}
.eyebrow{
  font-size:10px;
  font-weight:700;
  letter-spacing:1.9px;
  color:var(--teal);
  margin-bottom:18px
}
.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:242px;
  background:#edf0e8;
  border-right:1px solid var(--line);
  padding:34px 20px 22px;
  display:flex;
  flex-direction:column;
  z-index:10;
  overflow-y:auto
}
.brand{
  display:flex;
  align-items:center;
  gap:13px;
  text-decoration:none;
  color:var(--ink);
  font-size:17px;
  line-height:1.35;
  letter-spacing:-.3px
}
.brand strong{
  font-weight:700
}
.sidebar-book{
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
  margin:26px 4px 40px
}
.sidebar-book span{
  font-size:10px
}
.navigation-label{
  margin-left:12px;
  font-size:9px;
  letter-spacing:1.4px;
  color:var(--muted)
}
#lab-nav{
  display:grid;
  gap:10px
}
#lab-nav a{
  display:flex;
  align-items:flex-start;
  gap:12px;
  text-decoration:none;
  border-radius:12px;
  padding:15px 12px;
  color:#4e6460;
  font-size:13px;
  line-height:1.45;
  border:1px solid transparent;
  transition:background .2s
}
#lab-nav a:hover{
  background:#e2e8da
}
#lab-nav a[aria-current=page]{
  background:var(--deep);
  color:white;
  box-shadow:0 5px 16px #143a3b12
}
.nav-number{
  font-size:11px;
  opacity:.7;
  padding-top:2px;
  font-variant-numeric:tabular-nums
}
#lab-nav small{
  display:block;
  font-size:10px;
  opacity:.65;
  margin-top:7px
}
.nav-arrow{
  margin-left:auto;
  font-size:17px;
  opacity:.7
}
.sidebar-bottom{
  margin-top:auto;
  padding:32px 8px 0
}
.sidebar-bottom p{
  font-size:11px;
  line-height:1.7
}
.sidebar-bottom .eyebrow{
  font-size:9px;
  margin-bottom:10px
}
.quiet-button{
  display:block;
  border:0;
  background:transparent;
  text-align:left;
  font-size:11px;
  font-weight:600;
  padding:6px 0;
  color:var(--teal);
  cursor:pointer
}
.about-button{
  border:0;
  border-top:1px solid #d3dacf;
  background:none;
  margin-top:18px;
  padding:16px 0 0;
  font-size:11px;
  color:var(--muted);
  width:100%;
  text-align:left
}
.page{
  margin-left:242px
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:73px;
  padding:0 48px;
  border-bottom:1px solid var(--line);
  font-size:10px;
  letter-spacing:1.4px
}
.local-badge{
  letter-spacing:0;
  font-size:11px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:7px
}
.local-badge i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#70834c
}
main{
  max-width:1430px;
  margin:auto;
  padding:42px 48px 20px
}
.hero{
  display:grid;
  grid-template-columns:1.5fr 1fr;
  gap:36px;
  align-items:center;
  margin-bottom:36px;
  min-height:245px
}
.hero .eyebrow{
  margin-bottom:16px
}
.hero-description{
  max-width:560px;
  color:var(--muted);
  font-size:14px;
  line-height:1.8
}
.hero-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:23px
}
.hero-meta span{
  border:1px solid #d5ddd1;
  border-radius:30px;
  padding:4px 10px;
  font-size:10px;
  color:#5e6d62
}
.hero-art{
  border-radius:20px;
  overflow:hidden;
  aspect-ratio:1.5;
  max-height:235px;
  background:var(--deep);
  position:relative
}
.hero-art svg{
  width:100%;
  height:100%;
  display:block
}
.lesson-tabs{
  display:flex;
  border-bottom:1px solid #cdd7cb;
  gap:30px;
  margin-bottom:30px
}
.lesson-tabs button{
  border:0;
  border-bottom:3px solid transparent;
  background:transparent;
  padding:15px 0 13px;
  font-size:13px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:9px
}
.lesson-tabs button span{
  font-size:10px;
  opacity:.7
}
.lesson-tabs button[aria-selected=true]{
  color:var(--ink);
  border-bottom-color:var(--teal);
  font-weight:700
}
.card{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden
}
.card-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:23px 25px;
  border-bottom:1px solid var(--line)
}
.card-heading h3{
  margin:0
}
.card-heading .eyebrow{
  margin-bottom:7px;
  font-size:9px
}
.card-index{
  font-family:Georgia,serif;
  font-style:italic;
  color:#a1aaa0
}
.theory-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr;
  gap:24px
}
.theory-body{
  padding:28px
}
.theory-body p{
  font-size:14px;
  color:#506360
}
.theory-body h3{
  margin-top:26px
}
.theory-body h3:first-child{
  margin-top:0
}
.formula-box{
  padding:18px 16px;
  background:var(--soft);
  border-radius:10px;
  margin:20px 0;
  overflow-x:auto;
  font-size:16px
}
.formula-box p{
  margin:0
}
.definition-list{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px 12px;
  font-size:12px;
  margin:20px 0
}
.definition-list dt{
  font-weight:600
}
.definition-list dd{
  margin:0;
  color:var(--muted)
}
.case-card{
  background:#e9eddf;
  border-color:#dce2d0
}
.case-card .theory-body{
  padding:28px
}
.case-card h2{
  font-size:30px
}
.case-card .eyebrow{
  font-size:9px
}
.numbered-list{
  padding-left:19px;
  color:#506360;
  font-size:13px
}
.numbered-list li{
  padding:6px 0 6px 5px
}
.note-block{
  border-left:3px solid #a9bf79;
  padding:3px 0 3px 16px;
  margin:24px 0;
  font-size:13px;
  color:#526553
}
.button{
  border-radius:9px;
  padding:11px 18px;
  font-size:12px;
  font-weight:600;
  border:1px solid transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  gap:6px
}
.primary{
  background:var(--deep);
  color:#fff
}
.primary:hover{
  background:#24534e
}
.secondary{
  background:#f7f8f3;
  border-color:var(--line);
  color:var(--ink)
}
.secondary:hover{
  background:#edf1e4
}
.full{
  width:100%
}
.text-button{
  background:none;
  border:0;
  color:var(--teal);
  font-size:11px;
  padding:8px 5px
}
.experiment-intro{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin:8px 0 23px
}
.experiment-intro h2{
  font-size:26px;
  margin-bottom:6px
}
.experiment-intro p{
  font-size:12px;
  color:var(--muted);
  margin:0
}
.small-tag{
  display:inline-flex;
  border:1px solid #d9e0d4;
  border-radius:5px;
  padding:4px 7px;
  letter-spacing:.9px;
  font-size:9px;
  white-space:nowrap;
  color:#63735b
}
.prediction-strip{
  display:flex;
  align-items:center;
  gap:16px;
  background:#edf0e4;
  padding:16px 22px;
  border-radius:12px;
  margin-bottom:24px
}
.prediction-mark{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border:1px solid #a5b888;
  border-radius:50%;
  font-family:Georgia,serif;
  font-style:italic;
  flex-shrink:0
}
.prediction-strip label{
  width:100%;
  font-size:11px;
  font-weight:600
}
.prediction-strip input{
  display:block;
  border:0;
  background:transparent;
  border-bottom:1px solid #ccd6c2;
  width:100%;
  padding:6px 0 3px;
  border-radius:0;
  font-size:12px;
  color:var(--ink)
}
.workspace{
  display:grid;
  grid-template-columns:minmax(230px,.8fr) minmax(330px,1.35fr);
  gap:24px;
  margin-bottom:24px;
  align-items:start
}
.control-card{
  padding-bottom:23px
}
.control-card .card-heading{
  padding:20px
}
#controls{
  padding:18px 20px 6px
}
.control-card>.button,.control-card>.control-note{
  width:calc(100% - 40px);
  margin-left:20px
}
.control-note{
  font-size:10px;
  color:var(--muted);
  margin-top:10px;
  margin-bottom:0;
  line-height:1.6
}
.control-label{
  font-size:11px;
  font-weight:600;
  display:block;
  margin-bottom:7px
}
.control-select{
  width:100%;
  background:#f6f8f2;
  border:1px solid var(--line);
  border-radius:7px;
  padding:8px 10px;
  font-size:11px;
  color:var(--ink);
  margin-bottom:20px
}
.matrix-controls{
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  margin:0 0 18px
}
.matrix-input{
  border-left:2px solid var(--teal);
  border-right:2px solid var(--teal);
  padding:5px 7px;
  display:grid;
  grid-template-columns:repeat(2,45px);
  gap:5px
}
.matrix-input input,.data-table input{
  min-width:0;
  width:100%;
  border:1px solid var(--line);
  background:#fafbf7;
  border-radius:5px;
  padding:6px 3px;
  text-align:center;
  font-size:12px;
  color:var(--ink);
  font-variant-numeric:tabular-nums
}
.matrix-input.gauss-input{
  grid-template-columns:repeat(4,minmax(30px,1fr));
  gap:5px;
  max-width:290px
}
.matrix-input.gauss-input input:nth-child(4n){
  border-left:2px solid var(--coral);
  border-radius:0 4px 4px 0
}
.field-row{
  margin-bottom:16px
}
.field-row input[type=range]{
  width:100%;
  accent-color:var(--teal)
}
.range-label{
  display:flex;
  justify-content:space-between;
  font-size:11px;
  gap:12px
}
.range-label output{
  font-weight:600
}
.input-help{
  font-size:11px;
  color:var(--muted);
  margin-top:12px;
  line-height:1.7
}
.data-table{
  border-collapse:collapse;
  width:100%;
  font-size:10px;
  margin-bottom:14px
}
.data-table th{
  font-weight:500;
  color:var(--muted);
  text-align:center;
  padding:3px 2px 8px
}
.data-table td{
  padding:2px
}
.data-table input{
  font-size:10px;
  padding:4px 2px
}
.code-card{
  background:var(--code);
  border-color:var(--code)
}
.code-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 19px;
  color:#e5eee7;
  border-bottom:1px solid #ffffff16;
  font-size:12px
}
.code-heading>span{
  display:flex;
  align-items:center;
  gap:10px
}
.code-heading .text-button{
  color:#b9d7ba
}
.file-dot{
  height:7px;
  width:7px;
  border-radius:2px;
  background:#bdde8e
}
.editor-wrap{
  display:flex;
  min-height:265px;
  position:relative;
  padding:16px 0 5px
}
#line-numbers{
  font:11px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:pre;
  flex-shrink:0;
  width:41px;
  text-align:right;
  padding-right:11px;
  color:#75918e;
  overflow:hidden;
  user-select:none;
  max-height:340px
}
#code{
  flex:1;
  width:100%;
  height:300px;
  min-height:220px;
  max-height:540px;
  resize:vertical;
  white-space:pre;
  overflow:auto;
  border:0;
  border-radius:0;
  background:transparent;
  color:#d7edcd;
  font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  tab-size:4;
  padding:0 16px 0 0;
  outline-offset:-3px
}
.editor-footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:#a4bab0;
  padding:10px 20px;
  font-size:9px;
  border-bottom:1px solid #ffffff18
}
.run-toolbar{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  padding:16px 18px 8px
}
.run-toolbar .primary{
  background:var(--lime);
  color:#203a2d
}
.run-toolbar .secondary{
  background:#294346;
  color:#c0d7d0;
  border-color:#4c6463
}
.run-toolbar .text-button{
  color:#afc6bc;
  margin-left:auto
}
.runtime-status{
  font-size:10px;
  color:#adc9b7;
  padding:0 20px 16px;
  min-height:34px
}
.runtime-status[data-error=true]{
  color:#ffd1b7
}
.result-card{
  margin-bottom:26px
}
#result{
  padding:25px
}
.empty-result{
  padding:35px 20px;
  text-align:center;
  color:#7b8c7b
}
.empty-result p{
  font-size:12px;
  max-width:420px;
  margin:14px auto 0
}
.empty-symbol{
  font-size:35px;
  letter-spacing:4px;
  font-family:Georgia,serif;
  font-style:italic
}
.metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:13px;
  margin-top:22px
}
.metric{
  padding:15px;
  background:#f4f6ef;
  border-radius:9px
}
.metric label{
  display:block;
  font-size:10px;
  color:#5e7063;
  margin-bottom:7px
}
.metric strong{
  display:block;
  font-size:22px;
  font-weight:500;
  font-variant-numeric:tabular-nums;
  line-height:1.3;
  overflow-wrap:anywhere
}
.metric small{
  font-size:10px;
  color:var(--muted)
}
.result-layout{
  display:grid;
  grid-template-columns:1.35fr 1fr;
  gap:25px;
  align-items:center
}
.chart{
  background:#fafbf7;
  border:1px solid #e3e7dc;
  border-radius:12px;
  overflow:hidden
}
.chart svg{
  display:block;
  width:100%;
  height:auto
}
.chart-legend{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  font-size:10px;
  color:var(--muted);
  margin:12px 0
}
.legend-dot{
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
  margin-right:5px
}
.result-copy{
  font-size:12px;
  color:#526763
}
.result-copy h4{
  color:var(--ink)
}
.result-copy .formula-box{
  font-size:13px;
  padding:12px 7px
}
.result-insight{
  background:#edf2e3;
  border-radius:9px;
  padding:13px 17px;
  font-size:12px;
  color:#3e5c3d;
  margin-top:20px
}
.console-details{
  border-top:1px solid var(--line);
  padding:14px 23px
}
.console-details summary,details summary{
  cursor:pointer;
  font-size:12px;
  color:var(--teal);
  font-weight:500
}
.console-details pre{
  font:11px/1.7 ui-monospace,monospace;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:220px;
  overflow:auto;
  background:#f2f5ee;
  padding:13px;
  border-radius:8px
}
details{
  margin:16px 0
}
details p{
  margin:12px 0 0;
  font-size:13px
}
.reflection{
  background:#e9eddf;
  border-radius:12px;
  padding:23px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:20px;
  align-items:end
}
.reflection label{
  font-size:12px;
  font-weight:600
}
.reflection textarea,.notebook textarea,.answer-text{
  display:block;
  width:100%;
  margin-top:10px;
  border:1px solid #cdd6c3;
  border-radius:8px;
  background:#fcfdf8;
  color:var(--ink);
  padding:12px;
  font-size:13px;
  resize:vertical
}
.reflection .text-button{
  white-space:nowrap
}
.step-controls{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:19px 0
}
.step-controls input{
  accent-color:var(--teal);
  flex:1;
  min-width:100px
}
.step-stage{
  font-size:10px;
  color:var(--teal);
  text-transform:uppercase;
  letter-spacing:1px
}
.step-matrix{
  padding:20px 10px;
  margin:15px 0;
  background:#f2f5ec;
  border-radius:12px;
  overflow-x:auto;
  text-align:center;
  min-height:155px
}
.step-explanation{
  font-size:13px;
  color:#566a61;
  min-height:48px
}
.step-operation{
  font-size:14px;
  min-height:34px;
  overflow-x:auto
}
.solution-box{
  padding:18px;
  background:#eaf0e0;
  border-radius:10px;
  margin-top:20px
}
.solution-box h4{
  margin-bottom:10px
}
.solution-box p{
  font-size:12px;
  margin:6px 0
}
.challenge-header{
  margin-bottom:25px
}
.challenge-header p{
  color:var(--muted);
  font-size:13px
}
.challenge-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:24px
}
.challenge-card{
  padding:27px
}
.challenge-card .eyebrow{
  font-size:9px
}
.challenge-card p{
  font-size:13px;
  color:#53665d
}
.question-options{
  display:grid;
  gap:9px;
  margin:20px 0
}
.question-options label{
  padding:12px;
  border:1px solid var(--line);
  border-radius:9px;
  font-size:12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  background:#fafbf7
}
.question-options input{
  accent-color:var(--teal);
  margin-top:4px
}
.feedback{
  border-radius:8px;
  padding:12px;
  font-size:12px;
  background:#edf3e3;
  margin-top:15px
}
.feedback[data-correct=false]{
  background:#fff0df;
  color:#704c2a
}
.challenge-card details{
  padding-top:14px;
  border-top:1px solid var(--line)
}
.notebook{
  padding:30px
}
.notebook-top{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:32px;
  margin-bottom:20px
}
.notebook-top p{
  font-size:13px;
  color:#54685b
}
.project-brief{
  background:#edf1e3;
  border-radius:10px;
  padding:20px;
  font-size:13px
}
.notebook-field{
  margin-bottom:22px
}
.notebook-field label{
  font-size:13px;
  font-weight:600
}
.notebook-field small{
  display:block;
  color:var(--muted);
  font-size:11px;
  margin:4px 0
}
.rubric{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  padding-top:20px;
  border-top:1px solid var(--line);
  font-size:11px
}
.rubric label{
  display:flex;
  gap:8px;
  align-items:center
}
.rubric input{
  accent-color:var(--teal)
}
.page-footer{
  border-top:1px solid var(--line);
  margin-top:48px;
  padding:20px 0;
  display:flex;
  justify-content:space-between;
  gap:20px;
  font-size:10px;
  color:#7b8978
}
#toast{
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  z-index:100;
  padding:12px 22px;
  border-radius:10px;
  background:#153b3b;
  color:white;
  font-size:12px;
  box-shadow:0 6px 28px #19362b33;
  max-width:90vw
}
dialog{
  border:1px solid var(--line);
  border-radius:18px;
  padding:36px;
  max-width:570px;
  width:calc(100% - 32px);
  color:var(--ink);
  background:var(--paper)
}
dialog::backdrop{
  background:#102c2b77;
  backdrop-filter:blur(3px)
}
dialog p{
  font-size:13px
}
.dialog-close{
  position:absolute;
  right:14px;
  top:10px;
  background:none;
  border:0;
  font-size:26px;
  color:var(--muted)
}
.error-box{
  background:#fff3e8;
  border:1px solid #efd4ba;
  padding:20px;
  border-radius:10px;
  color:#7a4f30;
  font-size:13px
}
.error-box pre{
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.formula-overflow{
  overflow-x:auto
}
mjx-container{
  max-width:100%
}
mjx-container[display=true]{
  overflow-x:auto;
  overflow-y:hidden;
  padding:3px 0
}
code{
  font:12px ui-monospace,monospace
}
ul{
  padding-left:20px
}
@media(min-width:1600px){
  main{
    padding-top:50px
  }
  .hero{
    min-height:280px
  }
  .hero-art{
    max-height:260px
  }
  #code{
    height:320px
  }
}
@media(max-width:1150px){
  .sidebar{
    width:212px;
    padding-left:14px;
    padding-right:14px
  }
  .page{
    margin-left:212px
  }
  main{
    padding:30px 28px 18px
  }
  .topbar{
    padding:0 28px
  }
  .hero{
    gap:24px
  }
  .hero-art{
    aspect-ratio:1.15
  }
  .workspace{
    grid-template-columns:minmax(210px,.8fr) minmax(280px,1.2fr);
    gap:18px
  }
  .matrix-input{
    grid-template-columns:repeat(2,36px)
  }
  .theory-grid,.challenge-grid{
    gap:18px
  }
  .card-heading,.theory-body{
    padding:22px
  }
  .result-layout{
    grid-template-columns:1fr
  }
  .result-copy{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px
  }
  .result-copy h4{
    grid-column:1/-1;
    margin:0
  }
  .result-copy .formula-box{
    margin:0
  }
  .reflection{
    grid-template-columns:1fr;
    gap:9px
  }
  .reflection .text-button{
    justify-self:start
  }
}
@media(max-width:850px){
  .sidebar{
    position:static;
    width:100%;
    padding:20px;
    border-right:0;
    border-bottom:1px solid var(--line);
    display:block
  }
  .brand{
    font-size:16px
  }
  .brand br{
    display:none
  }
  .brand strong{
    margin-left:5px
  }
  .sidebar-book,.navigation-label,.sidebar-bottom{
    display:none
  }
  #lab-nav{
    display:flex;
    gap:9px;
    margin-top:18px
  }
  #lab-nav a{
    flex:1;
    padding:10px;
    font-size:11px;
    gap:7px
  }
  #lab-nav small{
    font-size:9px;
    margin-top:4px
  }
  .nav-arrow{
    display:none
  }
  .nav-number{
    font-size:9px
  }
  .page{
    margin-left:0
  }
  .topbar{
    min-height:51px;
    padding:0 22px
  }
  main{
    padding:25px 22px 14px
  }
  .hero{
    min-height:210px;
    gap:20px
  }
  .hero-art{
    aspect-ratio:1.2
  }
  .hero h1{
    font-size:39px
  }
  .hero-description{
    font-size:12px
  }
  .hero-meta{
    margin-top:16px
  }
  .hero-meta span{
    font-size:9px
  }
  .lesson-tabs{
    gap:25px
  }
  .lesson-tabs button{
    font-size:12px
  }
  .page-footer{
    margin-top:35px
  }
  .workspace{
    grid-template-columns:minmax(215px,.8fr) minmax(290px,1.2fr)
  }
  .mobile-work-tools{
    display:flex;
    gap:10px;
    flex-wrap:wrap
  }
  .mobile-work-tools button{
    font-size:11px
  }
}
.mobile-work-tools{
  display:none
}
@media(max-width:850px){
  .mobile-work-tools{
    display:flex
  }
}
@media(max-width:620px){
  #line-numbers{
    line-height:18.15px
  }
  .hero{
    grid-template-columns:1fr;
    margin-bottom:25px;
    min-height:0
  }
  .hero-art{
    display:none
  }
  .hero h1{
    font-size:40px
  }
  .hero-description{
    max-width:100%;
    font-size:13px
  }
  .hero-meta{
    margin-top:18px
  }
  .lesson-tabs{
    gap:0;
    justify-content:space-between;
    margin-bottom:23px
  }
  .lesson-tabs button{
    font-size:12px;
    gap:6px
  }
  .lesson-tabs button span{
    font-size:9px
  }
  .workspace,.theory-grid,.challenge-grid,.notebook-top{
    grid-template-columns:1fr
  }
  .theory-body,.case-card .theory-body,.notebook,.challenge-card{
    padding:22px
  }
  .experiment-intro .small-tag{
    display:none
  }
  .experiment-intro h2{
    font-size:25px
  }
  .prediction-strip{
    padding:14px
  }
  .card-heading{
    padding:20px
  }
  .matrix-controls{
    gap:25px
  }
  .matrix-input{
    grid-template-columns:repeat(2,55px)
  }
  #code{
    font-size:11px;
    height:265px
  }
  .editor-footer{
    font-size:8px;
    gap:6px
  }
  .run-toolbar{
    gap:6px;
    padding:14px 12px 8px
  }
  .run-toolbar .button{
    padding:10px 12px;
    font-size:11px
  }
  .run-toolbar .text-button{
    font-size:10px
  }
  .metrics{
    grid-template-columns:1fr 1fr;
    gap:9px
  }
  .metric{
    padding:13px
  }
  .metric strong{
    font-size:20px
  }
  .metric label{
    font-size:9px
  }
  #result{
    padding:18px
  }
  .result-copy{
    display:block
  }
  .result-copy .formula-box{
    margin:10px 0
  }
  .reflection{
    padding:18px
  }
  .page-footer{
    font-size:9px;
    display:block
  }
  .page-footer span{
    display:block;
    margin-bottom:5px
  }
  .card-heading .small-tag{
    font-size:8px;
    letter-spacing:0
  }
  .step-controls{
    gap:8px
  }
  .step-controls .button{
    padding:8px 10px
  }
  .data-table input{
    font-size:12px
  }
  .data-table{
    max-width:350px
  }
  .control-note{
    font-size:11px
  }
  .topbar{
    font-size:9px
  }
  .local-badge{
    font-size:10px
  }
}
@media(prefers-reduced-motion:reduce){
  *{
    scroll-behavior:auto!important;
    transition:none!important
  }
}
