:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #162e29;
  background: #f7f7f2;
  --surface: #fffefa;
  --ink: #162e29;
  --muted: #51645e;
  --line: #d8e1d8;
  --accent: #184e3b;
  --pale: #eef4f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
#notesPanel { margin-bottom: 18px; }
#noteForm, #teacherForm { max-width: 640px; }
#notesPanel .checkbox { display: flex; align-items: center; }
#notesPanel .checkbox input { width: auto; min-height: auto; }
#noteList li { margin-block: 8px; }
#noteList button { margin-inline-start: 8px; }
#teacherReply { white-space: pre-wrap; margin-top: 8px; }
.studio-nav, .studio-views, .studio-head-actions, .array-controls, .tutor-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.studio-nav { margin-block: 12px 20px; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.studio-views { margin-bottom: 14px; }
.studio-views [aria-pressed="true"], #eraseBoard[aria-pressed="true"] { background: var(--accent); color: #fff; }
.studio-progress { display: grid; gap: 3px; font-size: .82rem; font-weight: 750; min-inline-size: 108px; }
.studio-progress meter { width: 100%; }
.studio-tutor { background: #f5f8f5; border: 1px solid var(--line); border-radius: 16px; padding: 16px; position: sticky; top: 12px; }
.tutor-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px; }
.tutor-heading h3, .tutor-heading p { margin: 0; }
.tutor-toggle { display: flex; align-items: center; gap: 5px; font-size: .8rem; }
.tutor-toggle input { width: auto; min-height: auto; }
.tutor-chat { display: flex; flex-direction: column; gap: 10px; max-height: 340px; min-height: 130px; overflow-y: auto; margin: 12px 0; }
.chat-bubble { align-self: flex-start; background: var(--surface); border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); max-width: 94%; overflow-wrap: anywhere; }
.chat-bubble[data-role="student"] { align-self: flex-end; background: #e3efe7; }
.chat-bubble p, .material-reply { white-space: pre-wrap; margin: 4px 0; }
.tutor-chips button { font-size: .83rem; padding: 7px 9px; min-height: 36px; }
.array-lab, .working-bar, .material-file, .dropzone { background: var(--pale); border: 1px solid var(--line); padding: 14px; border-radius: 12px; margin-block: 14px; }
.array-controls { justify-content: space-between; }
.array-controls label { flex: 1 1 120px; }
.array-controls input { padding: 0; }
.array-board { display: grid; place-items: center; min-height: 150px; padding: 12px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.array-board .counter-array { grid-template-columns: repeat(var(--columns), minmax(12px, 27px)); gap: 7px; }
.array-equation { font: 700 1.5rem Georgia, serif; margin-bottom: 0; }
.visual-grid { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 3px; margin-block: 12px; }
.visual-grid span { display: grid; place-items: center; min-height: 30px; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: .75rem; }
.visual-grid span.visual-active, .visual-fill { background: var(--accent); color: white; }
.visual-grid[data-kind="graph"] { display: block; }
.visual-fill { height: 10px; border-radius: 4px; }
#skillReviewList li { margin-block: 8px; }
#skillReviewList button { margin-inline-start: 8px; }
#scratchCanvas { width: 100%; height: auto; display: block; background: white; border: 1px solid var(--line); border-radius: 12px; touch-action: none; margin-block: 12px; }
#penColor { padding: 4px; width: 48px; }
#phonePair img { display: block; margin-block: 8px; }
.working-steps { padding-inline-start: 20px; }
.working-step { border-inline-start: 3px solid #bb7c30; padding-inline-start: 8px; margin-bottom: 6px; }
.working-step[data-status="correct"] { border-color: #3c855e; }
.materials-hub ul, #worksheetFiles { padding: 0; list-style: none; }
.material-file input { margin-bottom: 8px; }
.dropzone[data-drag="true"] { outline: 2px dashed var(--accent); }
@media (max-width: 820px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } .studio-tutor { position: static; } }
.voice-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block: 12px; }
#voiceStatus { margin: 0; }
.narration-unspoken { color: transparent; user-select: none; }
.screen-reader-text { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }
.teaching-steps { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; list-style: none; margin: 6px 0 15px; }
.teaching-steps li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 100px; font-weight: 650; font-size: .82rem; }
.teaching-steps [aria-current="step"] { background: var(--accent); color: white; border-color: var(--accent); }
.teacher-stage { background: #eef3e9; border-radius: 14px; padding: clamp(20px, 4vw, 38px); margin-bottom: 16px; }
.teacher-label { color: var(--accent); font-size: .82rem; font-weight: 750; }
.teacher-label { display: flex; align-items: center; gap: 10px; }
.tutor-avatar { display: inline-grid; place-items: center; position: relative; width: 42px; height: 42px;
  border-radius: 46%; background: #184e3b; color: #fff; box-shadow: 0 0 0 3px #d2e6da; }
.tutor-avatar::before { content: ''; position: absolute; top: 13px; left: 12px; width: 4px; height: 4px;
  border-radius: 50%; background: currentColor; box-shadow: 14px 0 currentColor; }
.tutor-avatar span { width: 12px; height: 5px; margin-top: 12px; border-radius: 50%; background: currentColor; }
#lesson[data-speaking="true"] .tutor-avatar span { animation: tutor-talk 350ms alternate infinite; }
@keyframes tutor-talk { 0% { transform: scaleY(.4); } 75% { transform: scaleY(1.8); } }
@media (prefers-reduced-motion: reduce) { #lesson .tutor-avatar span { animation: none !important; } }
#placeLab { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#placeNumber { max-width: 180px; }
.teacher-stage h3 { font: 500 clamp(1.55rem, 3vw, 2.35rem) Georgia, serif; margin: 8px 0 14px; }
#teachingText { white-space: pre-wrap; font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 68ch; }
#teachingPreview { margin-top: 14px; }
#planWeeks li { margin-block: 14px; }
#planWeeks p { margin-block: 4px; }
#familySummary li, #previewOutline li { margin-block: 8px; }
.teaching-picture { display: grid; gap: 12px; margin: 18px 0; padding: 16px; max-width: 630px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.teaching-picture figcaption { font-weight: 740; }
.picture-bar-row { display: grid; grid-template-columns: minmax(65px, 1fr) 3fr 3ch; gap: 10px; align-items: center; }
.picture-bar-track { background: #edf0e8; border-radius: 4px; overflow: hidden; }
.picture-bar-fill { display: block; height: 18px; background: #287c67; }
.picture-bar-value { font-variant-numeric: tabular-nums; }
.counter-array { display: grid; grid-template-columns: repeat(var(--columns), minmax(5px, 15px)); gap: 5px; }
.counter-array span { display: block; aspect-ratio: 1; width: 100%; border-radius: 50%; background: #287c67; }
.picture-steps { display: grid; gap: 8px; margin: 0; padding-inline-start: 20px; }
.picture-steps li { padding: 8px 10px; background: var(--pale); border-radius: 6px; }
.place-block-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.place-block-column { display: grid; gap: 8px; padding: 8px; background: var(--pale); border-radius: 8px; font-size: .82rem; }
.place-blocks { display: flex; align-items: center; flex-wrap: wrap; min-height: 22px; gap: 3px; }
.place-blocks span { display: block; border: 1px solid var(--accent); background-color: #d2e6da; }
.place-block-0 { width: 20px; height: 20px; background-image: repeating-linear-gradient(0deg, transparent 0 1px, #8ab0a0 1px 2px), repeating-linear-gradient(90deg, transparent 0 1px, #8ab0a0 1px 2px); }
.place-block-1 { width: 4px; height: 20px; background-image: repeating-linear-gradient(0deg, transparent 0 1px, #8ab0a0 1px 2px); }
.place-block-2 { width: 6px; height: 6px; }
#sourceExcerpt { margin: 0; padding-inline-start: 14px; border-inline-start: 3px solid var(--accent); }
body { margin: 0; }
main, .site-header { width: min(100% - 40px, 1180px); margin-inline: auto; }
.site-header {
  min-height: 76px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); gap: 16px;
}
a { color: var(--accent); }
.wordmark { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; text-decoration: none; font-weight: 750; }
.wordmark span {
  display: grid; place-items: center; width: 36px; height: 36px; background: var(--accent);
  color: white; border-radius: 10px; font-size: 1.35rem;
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.05; }
h1 { font-size: clamp(2.85rem, 7vw, 5.75rem); letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.65rem, 3vw, 2.28rem); letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p { line-height: 1.55; }
.label { font-size: .75rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.hint { color: var(--muted); font-size: .9rem; }
.gate { display: grid; grid-template-columns: 1.15fr 1fr; align-items: start; gap: clamp(26px, 8vw, 105px); padding-block: 11vh; }
.gate-copy { display: grid; gap: 20px; padding-top: 26px; }
.gate-copy p:last-child { color: var(--muted); max-width: 38ch; font-size: 1.13rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: clamp(17px, 3vw, 27px); }
.gate .panel { display: grid; gap: 20px; }
form { display: grid; gap: 13px; align-items: start; }
label { display: grid; gap: 6px; font-size: .875rem; font-weight: 660; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  display: block; width: 100%; padding: 10px 12px; border: 1px solid #b8c8be; border-radius: 8px;
  background: #fff; color: var(--ink); min-height: 44px;
}
textarea { resize: vertical; }
button {
  padding: 10px 15px; border-radius: 8px; border: 1px solid transparent; font-weight: 680;
  min-height: 42px; cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #173f33; }
.secondary, .quiet { background: var(--pale); color: var(--ink); }
.quiet { background: transparent; border-color: var(--line); }
.secondary:hover, .quiet:hover { background: #d9e7d9; }
:focus-visible { outline: 3px solid #226e5a; outline-offset: 3px; }
details > summary { cursor: pointer; font-weight: 660; }
details[open] summary { margin-bottom: 12px; }
.gate details { border-top: 1px solid var(--line); padding-top: 14px; }
.message { color: #8f341e; white-space: pre-line; font-size: .93rem; }
.message:empty { display: none; }
.workspace-head {
  display: flex; justify-content: space-between; align-items: end; gap: 20px;
  padding-block: 34px 25px;
}
.workspace-head h1 { font-size: clamp(2.55rem, 6vw, 4.5rem); }
.workspace-head .label { margin-bottom: 8px; }
.course-select { width: min(100%, 300px); }
.dashboard-layout { display: grid; grid-template-columns: minmax(290px, .92fr) minmax(0, 1.55fr); gap: 18px; }
.timeline, .performance { display: grid; align-content: start; gap: 14px; }
.weeks { display: grid; }
.week-button {
  display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 8px; align-items: center; border-radius: 0;
  text-align: left; padding: 8px 5px; color: var(--ink); background: transparent; border-bottom: 1px solid var(--line);
}
.week-button:hover { background: var(--pale); }
.week-button[aria-current="true"] { background: var(--pale); border-radius: 7px; padding-inline: 8px; }
.week-number { font-size: .75rem; color: var(--accent); }
.week-button small { text-align: right; font-size: .72rem; color: var(--muted); }
.section-head, .button-row { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 12px; }
.section-head .label { align-self: center; }
.topic-row { padding-block: 13px; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.topic-title, .metric { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.metric { font-size: .85rem; color: var(--muted); }
.band { color: #285848; background: var(--pale); font-size: .74rem; padding: 3px 7px; border-radius: 5px; }
.band[data-band="reteach"] { background: #faebdc; color: #803d24; }
.meter { width: 100%; height: 6px; accent-color: var(--accent); }
.performance ul { padding-left: 20px; color: var(--muted); }
.lesson { display: grid; gap: 14px; margin-top: 18px; }
.lesson .section-head .label { margin-bottom: 6px; }
.question, #explanationText, #teachingText { white-space: pre-wrap; overflow-wrap: anywhere; }
.question { font-size: 1.25rem; margin-block: 8px 14px; }
#answerForm { max-width: 680px; }
#answerForm button, #hintForm button { justify-self: start; }
#hintPanel { margin-top: 16px; }
#hintPanel p { margin-top: 8px; }
#hintForm { max-width: 680px; }
.feedback-box, .completion { display: grid; gap: 10px; background: var(--pale); border-radius: 12px; padding: 16px; }
.feedback-box button { justify-self: start; }
.feedback-box[data-score="0"], .feedback-box[data-score="0.5"] { background: #faebdc; }
footer { display: flex; flex-wrap: wrap; gap: 9px 18px; font-size: .85rem; padding-block: 20px; color: var(--muted); }
@media (max-width: 760px) {
  .gate, .dashboard-layout { grid-template-columns: 1fr; }
  .gate { padding-block: 32px; }
  .gate-copy { padding-top: 0; }
  .workspace-head { display: grid; align-items: start; padding-block: 24px 16px; }
}
