/* The render hook sets this attribute only on a signed-in student's classroom. */
body[data-thanks-student] {
  --academy-page: #f7f6ef;
  --academy-white: #fffef9;
  --academy-line: #d9ddce;
  --academy-ink: #253d43;
  --academy-muted: #536056;
  --academy-blue: #355849;
  --academy-blue-soft: #e7eddf;
  --academy-shadow: 0 4px 18px rgb(59 61 39 / 5%);
  --ink: var(--academy-ink);
  --page: var(--academy-page);
  --card: var(--academy-white);
  --line: var(--academy-line);
  --muted: var(--academy-muted);
  --blue: var(--academy-blue);
  --teal: var(--academy-blue);
  --teal-soft: var(--academy-blue-soft);
  --autumn-rust: #854422;
  --autumn-border: #dcd5c4;
  --autumn-sage: #e7eddf;
  --autumn-paper: #f6efe0;
  --autumn-heading: "Songti SC", STSong, "Noto Serif CJK SC", Georgia, serif;
  --autumn-photo: linear-gradient(90deg, #f6efe0 0%, #f6efe0 35%, #f6efe0f5 46%, #f6efe08a 61%, #f6efe000 78%), url('./desk.webp');
  --autumn-photo-y: 67%;
  background: var(--page);
  color: var(--ink);
  accent-color: var(--teal);
}

body[data-thanks-student] #app .appbar {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 1px 8px rgb(48 57 40 / 4%);
}
body[data-thanks-student] #app .appbar :is(.brand, .profile, .nav > button, .nav > a) {color: var(--ink)}
body[data-thanks-student] #app .appbar .brand > svg {color: var(--autumn-rust)}
body[data-thanks-student] #app .appbar .nav > :is(button, a) {
  background: transparent;
  border-color: transparent;
  border-radius: 9px;
}
body[data-thanks-student] #app .appbar .nav > :is(:hover, .active, [aria-current="page"], [aria-expanded="true"]) {
  background: var(--autumn-sage);
  color: var(--teal);
}
body[data-thanks-student] #app .appbar .nav > [aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}
body[data-thanks-student] #app .appbar :is(.avatar, .profile .icon) {
  background: var(--autumn-sage);
  color: var(--teal);
}
body[data-thanks-student] #app .appbar .profile small {color: var(--muted)}
body[data-thanks-student] #xw-language-picker {
  color: var(--muted);
  background: #eeeee3;
  border-color: var(--line);
}
body[data-thanks-student] #xw-language-picker select {
  color: var(--ink);
  border-color: #a9b3a0;
  background: var(--card);
}
body[data-thanks-student] #app :is(.appbar, .main) :focus-visible,
body[data-thanks-student] :is(#xw-language-picker, .cxw-dialog, .student-profile-modal) :focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Use the native page headers, including headings mounted later by course and editor modules. */
body[data-thanks-student] #app .main > :is(.head, .academy-work-toolbar, .course-classroom-head, .l1-catalog-head),
body[data-thanks-student] #app :is(#l1Classroom > .l1-classroom-head, .main > #codingSpace > .code-heading, #programAssignment .program-homework > h1) {
  min-height: 124px;
  padding: 23px clamp(18px, 3vw, 34px);
  border: 1px solid var(--autumn-border);
  border-radius: 17px;
  background-color: var(--autumn-paper);
  background-image: var(--autumn-photo);
  background-size: cover;
  background-position: center, 70% var(--autumn-photo-y);
  background-repeat: no-repeat;
  box-shadow: none;
  color: var(--ink);
}
body[data-thanks-student="progress"] {--autumn-photo-y: 78%}
body[data-thanks-student="courses"] {--autumn-photo-y: 44%}
body[data-thanks-student="circle"] {--autumn-photo-y: 54%}
body[data-thanks-student="coding"] {--autumn-photo-y: 48%}
body[data-thanks-student] #app .main > .head {
  align-items: center;
  display: flex;
}
body[data-thanks-student] #app .main > .head::after {content: none}
body[data-thanks-student] #app .main > .head > div:first-child {max-width: min(68%, 55ch)}
body[data-thanks-student] #app .main :is(.head, .academy-work-toolbar, .course-classroom-head, .l1-catalog-head, .l1-classroom-head, .code-heading) h1,
body[data-thanks-student] #app #programAssignment .program-homework > h1 {
  color: var(--ink);
  font: 700 clamp(24px, 2.5vw, 34px)/1.28 var(--autumn-heading);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
body[data-thanks-student] #app .main :is(.head, .l1-catalog-head, .l1-classroom-head, .course-classroom-head, .code-heading) .eyebrow {
  color: var(--autumn-rust);
  font-weight: 700;
  letter-spacing: .06em;
}
body[data-thanks-student] #app .main :is(.head p:not(.eyebrow), .l1-catalog-head p:not(.eyebrow), .course-files-hint, .course-card-footer, .l1-course-summary) {color: var(--muted)}
body[data-thanks-student] #app .main :is(.course-classroom-head, .l1-classroom-head, .l1-catalog-head) {margin-top: 12px}
body[data-thanks-student] #app .main :is(.course-lesson-actions, .l1-classroom-actions, .academy-work-toolbar > div:last-child, .code-heading .code-owner) {
  padding: 7px 10px;
  background: #fffaf0f2;
  border-radius: 10px;
  color: var(--muted);
}
body[data-thanks-student] #app .main :is(.academy-work-toolbar, #l1Classroom > .l1-classroom-head, .course-classroom-head, .main > #codingSpace > .code-heading, #programAssignment .program-homework > h1) {min-height: 94px}
body[data-thanks-student] #app #programAssignment .program-homework > h1 {display: flex; align-items: center; margin-top: 0}
body[data-thanks-student] #app :is(.course-classroom-head, .l1-classroom-head) > div:first-child {min-width: 0}

/* Cards, controls and teaching text use warm paper. Feedback colors and code surfaces stay local to their components. */
body[data-thanks-student] #app .main :is(.panel, .assignment, .question-card, .course-level-card, .lesson-card, .course-outline, .l1-lesson-card, .course-files-panel, .course-document-viewer, .l2-task-files, .l2-original-resources, .wrong),
body[data-thanks-student] #app #reviewArchive :is(.learning-closure, .closure-card),
body[data-thanks-student="coding"] #app .main > #codingSpace {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--academy-shadow);
}
body[data-thanks-student] #app .main :is(.assignment, .course-level-card, .lesson-card, .l1-lesson-card, .lesson-list, .code-heading, .course-files-panel > header, .l2-workspace-heading, .l2-task-files) :is(h2, h3),
body[data-thanks-student] #app #reviewArchive .closure-card h3 {color: var(--ink)}
body[data-thanks-student] #app .main :is(.assignment, .course-level-card, .lesson-card, .l1-lesson-card, .l2-workspace-heading, .l2-task-files) > p,
body[data-thanks-student] #app #reviewArchive .closure-card p {color: var(--muted)}
body[data-thanks-student] #app .secondary,
body[data-thanks-student] .student-profile-modal .secondary {
  color: var(--teal);
  background: var(--card);
  border-color: #bfc8b7;
}
body[data-thanks-student] #app .secondary:hover:not(:disabled),
body[data-thanks-student] #app :is(.academy-arrow, .text-button):hover {
  border-color: #9fae97;
  background: var(--autumn-sage);
  color: var(--teal);
}
body[data-thanks-student] #app .primary,
body[data-thanks-student] :is(.student-profile-modal .primary, .cxw-send) {
  background: var(--teal);
  border-color: transparent;
  color: #fffef9;
  box-shadow: none;
}
body[data-thanks-student] #app .primary:hover:not(:disabled),
body[data-thanks-student] .cxw-send:hover:not(:disabled) {background: #284638}
body[data-thanks-student] #app :is(.field, .text-button) {color: var(--teal)}
body[data-thanks-student] #app .main .tag:not(.warn):not(.good),
body[data-thanks-student] #app .main :is(.course-level-label, .lesson-number, .academy-topic, .academy-question-label > span) {
  color: var(--teal);
  background: var(--autumn-sage);
}
body[data-thanks-student] #app .main .tag.warn {color: #845019; background: #f8eacb}
body[data-thanks-student] #app .main .tag.good {color: #285f42; background: #e1eddd}
body[data-thanks-student] #app .assignments > .muted {
  background: var(--card);
  color: var(--muted);
  border-color: #bec7b6;
}
body[data-thanks-student] #app .academy-focus :is(.academy-question-help p, .academy-question-nav p, .academy-question-label, .academy-question-help summary) {color: var(--muted)}
body[data-thanks-student] #app .academy-focus .academy-progress {background: var(--autumn-sage)}
body[data-thanks-student] #app .academy-focus .academy-progress > span {background: var(--teal)}
body[data-thanks-student] #app .academy-focus .academy-code {color: #374e45; background: #f2f0e6; border-color: var(--line)}
body[data-thanks-student] #app .main .option:not(.answer):not(.selected) {color: var(--ink); background: var(--card); border-color: var(--line)}
body[data-thanks-student] #app .main .option:not(:disabled):hover,
body[data-thanks-student] #app .main .option.selected:not(.answer) {background: var(--autumn-sage); border-color: #7b9279}
body[data-thanks-student] #app .academy-focus .option.selected .academy-radio {border-color: var(--teal)}
body[data-thanks-student] #app .academy-focus .option.selected .academy-radio::after {background: var(--teal)}
body[data-thanks-student] #app .academy-focus .number.answered:not(.active) {color: var(--teal); background: var(--autumn-sage)}
body[data-thanks-student] #app .academy-focus .number.active {background: var(--teal); color: white; box-shadow: none}
body[data-thanks-student] #app .academy-focus .number.active:is(.correct, .wrong) {outline: 2px solid currentColor; outline-offset: 2px}
body[data-thanks-student] #app .academy-focus .number.active.correct {color: #286341; background: #e1eddd}
body[data-thanks-student] #app .academy-focus .number.active.wrong {color: #943c39; background: #fbe7df}
body[data-thanks-student] #app .main :is([data-question-language][aria-pressed="true"], .program-tabs [aria-current="step"]) {
  color: var(--teal); background: var(--autumn-sage); border-color: #728a73;
}
body[data-thanks-student] #app .program-tabs [aria-current="step"] {outline-color: var(--teal)}

body[data-thanks-student] #app #reviewArchive :is(.learning-closure > p:first-child, .closure-detail),
body[data-thanks-student] #app .main :is(.course-outline-head, .course-files-panel > header, .course-document-viewer > header, .code-pane-head, .l2-task-file, .l1-goals) {
  color: var(--teal);
  background: #f0f1e6;
  border-color: var(--line);
}
body[data-thanks-student] #app :is(#circleForm textarea, .comment-form input, .course-file-search input, .course-lesson-select select, .l1-classroom-actions select, .l2-project-controls select) {
  background: var(--card); border-color: #c6cebe; color: var(--ink);
}
body[data-thanks-student] #app #circleForm .field,
body[data-thanks-student] #app .main :is(.course-file-download, .l2-original-resources > summary) {color: var(--teal)}
body[data-thanks-student] #app .circle-post .avatar,
body[data-thanks-student] #app .main :is(.l1-section-index, .code-modes, .course-file-row:hover) {background: var(--autumn-sage); color: var(--teal)}
body[data-thanks-student] #app .circle-post .comments,
body[data-thanks-student] #app .main :is(.l1-tabs, .code-toolbar, .code-editor-area, .code-result-area) {border-color: var(--line)}
body[data-thanks-student] #app .main :is(.l1-tabs button.active, .course-file-button.active, .l2-task-file.active, .code-modes button.selected) {
  color: #fffef9; background: var(--teal); border-color: var(--teal);
}
body[data-thanks-student] #app .main .l1-tabs button:not(.active):hover {color: var(--teal); background: var(--autumn-sage)}
body[data-thanks-student] #app #codingSpace :is(.code-pane-head, .code-editor-actions svg, .code-icon) {color: var(--teal)}
body[data-thanks-student] #app #codingSpace .code-pane-head {background: #f0f1e6; border-color: var(--line)}
body[data-thanks-student] #app #codingSpace .code-icon {background: var(--card); border-color: var(--line)}
body[data-thanks-student] #app #codingSpace .code-run svg {color: inherit}
body[data-thanks-student] #app .main :is(.code-owner, .code-live, .code-tools, .course-lesson-select, .l1-classroom-actions label, .l2-project-controls label) {color: var(--muted)}

/* The student contact window and profile are mounted directly on body. */
body[data-thanks-student] :is(.cxw-dialog, .cxw-chat, .cxw-composer, .student-profile-modal) {
  background: var(--card); border-color: var(--line); color: var(--ink);
}
body[data-thanks-student] .cxw-chat-heading {
  color: var(--ink);
  background: var(--autumn-photo) center / cover no-repeat var(--autumn-paper);
  border-color: var(--autumn-border);
}
body[data-thanks-student] :is(.cxw-chat-heading h2, .cxw-empty strong, .student-profile-modal h2) {color: var(--ink)}
body[data-thanks-student] :is(.cxw-chat-heading p, .cxw-empty, .cxw-message-meta, .cxw-message-meta time, .cxw-key-hint, .cxw-media-hint, .cxw-voice-hint, .cxw-counter:not(.cxw-over-limit)) {color: var(--muted)}
body[data-thanks-student] :is(.cxw-avatar, .cxw-empty-symbol, .cxw-mine .cxw-bubble, .student-profile-close) {background: var(--autumn-sage); border-color: var(--line); color: var(--teal)}
body[data-thanks-student] :is(.cxw-media-button, .cxw-history, .cxw-close, .cxw-input, .cxw-bubble) {background: var(--card); color: var(--ink); border-color: #c6cebe}
body[data-thanks-student] .cxw-log {background: var(--page)}
body[data-thanks-student] .cxw-input:focus {border-color: var(--teal); box-shadow: none}
body[data-thanks-student] .student-profile-kicker {color: var(--autumn-rust)}

@media (max-width: 800px) {
  body[data-thanks-student] #app .appbar .topbar > .nav {
    display: flex; flex-flow: row nowrap; align-items: center; justify-content: flex-start;
    width: 100%; min-width: 0; max-width: 100%; gap: 5px;
    overflow-x: auto; overscroll-behavior-x: contain;
    padding: 4px 3px 6px; scroll-padding-inline: 4px;
    scrollbar-width: thin; scrollbar-color: #acb6a1 transparent;
  }
  body[data-thanks-student] #app .appbar .topbar > .nav > :is(button, a):not([hidden]) {
    flex: 0 0 auto; min-width: 0; width: auto; max-width: none; min-height: 44px;
    padding: 7px 10px; white-space: nowrap; overflow-wrap: normal;
  }
  body[data-thanks-student] #app .appbar .topbar {grid-template-columns: minmax(0, 1fr) auto}
  body[data-thanks-student] #app .appbar .topbar .profile {max-width: 100%; flex-wrap: wrap; justify-content: flex-end}
}
@media (max-width: 650px) {
  body[data-thanks-student] {
    --autumn-photo: linear-gradient(90deg, #f6efe0 0%, #f6efe0f5 42%, #f6efe0c4 61%, #f6efe030 88%), url('./desk.webp');
  }
  body[data-thanks-student] #app .main > :is(.head, .academy-work-toolbar, .course-classroom-head, .l1-catalog-head),
  body[data-thanks-student] #app :is(#l1Classroom > .l1-classroom-head, .main > #codingSpace > .code-heading, #programAssignment .program-homework > h1) {
    min-height: 93px; padding: 15px; border-radius: 13px; background-position: center, 72% var(--autumn-photo-y);
  }
  body[data-thanks-student] #app .main > .head {flex-wrap: wrap; gap: 12px}
  body[data-thanks-student] #app .main > .head > div:first-child {max-width: min(85%, 54ch)}
  body[data-thanks-student] #app :is(.course-lesson-actions, .l1-classroom-actions) {max-width: 100%}
  body[data-thanks-student] #app .l1-catalog-head img {width: 65px; height: auto}
  body[data-thanks-student] #app .appbar .topbar .profile .secondary {padding: 5px 7px; font-size: 12px}
}
@media (max-width: 460px) {
  body[data-thanks-student] #app .appbar .topbar {grid-template-columns: auto minmax(0, 1fr); column-gap: 5px}
  body[data-thanks-student] #app .appbar .topbar .brand {gap: 4px; font-size: 14px}
  body[data-thanks-student] #app .appbar .topbar .profile {white-space: normal; gap: 4px}
  body[data-thanks-student] #app .main :is(.course-classroom-head, .l1-classroom-head) {align-items: stretch; flex-direction: column}
}
