/* Student work surface: readable tasks first, account utilities on demand. */
:root { --student-ink: #332d22; --student-muted: #70634f; --student-accent: #3e593b; }
.student-account-tools { position: relative; min-width: 0; }
.student-account-tools > summary {
  display: list-item; cursor: pointer; min-height: 44px; padding: 11px 14px;
  border: 1px solid currentColor; border-radius: 10px; font-size: .875rem;
  font-weight: 700; line-height: 1.5; white-space: nowrap; list-style-position: inside;
}
.student-account-tools-body {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: min(340px, calc(100vw - 40px)); max-height: min(620px, 72dvh);
  overflow-y: auto; overscroll-behavior: contain; padding: 14px;
  border: 1px solid #d8c7ab; border-radius: 14px; background: #fffdf8; color: #2c2416;
  box-shadow: 0 12px 32px #21180f26;
}
.header-actions .student-account-tools-body .btn-prev,
.header-actions .student-account-tools-body .btn-next {
  display: block; width: 100%; margin: 0 0 8px; min-height: 44px;
  color: #2c2416 !important; background: #f5ede0 !important; border: 1px solid #d8c7ab;
  white-space: normal !important; line-height: 1.5;
}
.student-account-tools-body [hidden] { display: none !important; }
.header-actions .student-secondary-nav {
  display: grid !important; grid-template-columns: 1fr; gap: 4px; padding: 12px 0 0 !important;
  margin: 12px 0 0; border-top: 1px solid #d8c7ab; background: transparent; overflow: visible;
}
.header-actions .student-secondary-nav a {
  display: block; min-height: 44px; padding: 10px 12px !important; border: 0;
  border-radius: 8px; background: #f5ede0 !important; color: #332d22 !important;
  font-size: .875rem !important; white-space: normal; text-align: left;
}
.header-actions .student-secondary-nav a[aria-current="page"] { background: #e4ebdf !important; font-weight: 800; }
.student-account-tools-body #studentProfileBadge { margin-bottom: 10px; color: #2c2416; background: #f5ede0; }
.student-account-tools-body .student-app-install { margin: 12px 0 0; font-size: .875rem; }
.student-account-tools summary:focus-visible,
#homeworkStudentGuide summary:focus-visible,
#evaluationAppealPanel summary:focus-visible {
  outline: 3px solid #8b6914; outline-offset: 3px;
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .feature-site-nav {
  display: flex; flex-wrap: nowrap; gap: 6px; padding: 10px 18px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .feature-site-nav a {
  flex: 0 0 auto; min-height: 44px; padding: 9px 12px; font-size: .8125rem; border-radius: 9px;
  background: #211a12; color: #fffaf0; border-color: #827058;
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .feature-site-nav a[aria-current="page"] { background: #77580f; border-color: #c9a84c; }
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-header {
  display: flex; align-items: center; padding: 20px 18px; gap: 14px; margin-bottom: 16px;
  background: #f4efe5; color: var(--student-ink); border-bottom: 1px solid #dfd5c4;
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-header h1 {
  font-size: 1.5rem; line-height: 1.3; color: var(--student-ink);
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-brand-name {
  font-size: .8125rem; line-height: 1.6; margin-bottom: 4px; color: var(--student-muted);
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-brand-tag {
  display: none;
}
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .header-actions {
  display: flex; align-items: center; flex-wrap: wrap; width: auto; gap: 8px;
}
.student-task-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px; gap: 4px;
  margin-bottom: 20px; border-radius: 12px; background: #f1ede4;
}
.student-task-nav a { min-width: 0; min-height: 44px; padding: 9px 4px; font-size: .875rem; border-radius: 8px; }
.student-task-nav a:first-child { background: transparent; color: #493c29; }
.student-task-nav a[aria-current="location"] { background: var(--student-accent); color: #fff; }
.student-task-nav a, .student-account-tools summary, .student-secondary-nav a, .filter-chip { touch-action: manipulation; }
#listTitle, #readingNotePanel, #studentInfoPanel { scroll-margin-top: 20px; }
.student-list-heading .step-title { margin-bottom: 4px; font-size: 1.5rem; }
.student-list-heading .step-desc { margin: 0; font-size: .875rem; line-height: 1.65; color: #6f604b; }
.list-top .filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.list-top .filter-chip { min-height: 44px; min-width: 0; padding: 9px 14px; font-size: .875rem; line-height: 1.5; }
.student-completion-card { padding: 14px 16px; border-radius: 12px; margin: 12px 0; }
.student-completion-head small { font-size: .8125rem; line-height: 1.6; }
.student-completion-rate strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.student-completion-bar { height: 6px; margin-top: 10px; }
#listStatus:empty { display: none; }
.homework-group .group-title { font-size: 1rem; color: #6f604b; margin: 22px 0 12px; }
.homework-card { border-radius: 12px; box-shadow: none; }
.homework-card:hover { transform: none; }
.homework-card:focus-visible { outline: 3px solid #8b6914; outline-offset: 3px; }
.student-homework-due-group { margin: 12px 0; border-radius: 12px; }
.student-homework-due-group > summary { min-height: 52px; line-height: 1.55; }
.student-homework-due-group > summary small { font-variant-numeric: tabular-nums; }
.student-week-heading { font-size: 1rem; line-height: 1.55; }
.student-week-progress { display: block; margin-top: 4px; font-size: .8125rem; font-weight: 500; color: var(--student-muted); line-height: 1.7; overflow-wrap: anywhere; }
.student-week-status { display: inline-block; }
.student-homework-due-group > summary { align-items: flex-start; }
.student-homework-due-group > summary::before { margin-top: 2px; }
.student-homework-due-group[open] > summary { background: #f1ede4; }
.student-homework-due-group-list .homework-card { margin: 0; background: #fffdf9; }
.student-task-nav a:active, .filter-chip:active { background: #d9e3d5; color: #263824; }
@media (hover: hover) and (pointer: fine) {
  .student-homework-due-group > summary:hover { background: #efe8db; }
  .student-task-nav a:not([aria-current]):hover { background: #e4e9de; text-decoration: none; }
  .header-actions .student-secondary-nav a:hover { background: #e4ebdf !important; }
}
.homework-section[data-state="detail"] .detail-body,
.homework-section[data-state="detail"] .submission-preview .detail-note { line-height: 1.85; overflow-wrap: anywhere; }
.foundation-evaluation-card {
  border: 1px solid #c9d9d1; border-top: 4px solid #3e6654;
  background: #fbfdfa; border-radius: 12px; padding: 20px;
}
.foundation-evaluation-card > .submission-preview-title { color: #274a3b; font-size: 1.25rem; }
.foundation-evaluation-card p, .foundation-evaluation-card li { max-inline-size: 82ch; font-size: 1rem; }
.foundation-evaluation-error { margin: 16px 0; padding: 16px; border: 1px solid #e2e6de; background: #fff; border-radius: 10px; }
.foundation-evaluation-error h5 { margin: 0 0 10px; font-size: 1rem; line-height: 1.6; }
.foundation-evaluation-error p { line-height: 1.85; margin: 8px 0; overflow-wrap: anywhere; }
#homeworkStudentGuide { margin: 18px 0; }
.lecture-review-notice {
  display: block; width: 100%; margin: 12px 0 20px; padding: 14px 16px; min-height: 48px;
  border: 1px solid #c9a84c; border-left: 4px solid #8b6914; border-radius: 12px;
  background: #fff8e6; color: #4d3a12; font: inherit; font-weight: 700; line-height: 1.7;
  text-align: left; cursor: pointer; touch-action: manipulation;
}
.lecture-review-notice[hidden] { display: none; }
.lecture-review-notice:focus-visible { outline: 3px solid #8b6914; outline-offset: 3px; }
.lecture-review-modal { max-width: 560px; }
.lecture-review-name { font-weight: 800; color: #3f2d14; font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.lecture-review-rating { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.lecture-review-stars { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.lecture-review-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lecture-review-stars label {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  font-size: 1.9rem; color: #d9cdb8; cursor: pointer; border-radius: 8px; touch-action: manipulation;
}
.lecture-review-stars label.is-filled { color: #e0a800; }
.lecture-review-stars input:focus-visible + label { outline: 3px solid #8b6914; outline-offset: 1px; }
.lecture-review-stars .form-help { margin-left: 8px; }
#lectureReviewForm textarea { font-size: 16px; line-height: 1.7; }
#homeworkStudentGuide > .field-help { line-height: 1.7; font-size: .875rem; }
#homeworkStudentGuide details > summary { min-height: 48px; }
#homeworkStudentGuide details li { line-height: 1.85; }
#evaluationAppealPanel { margin: 20px 0; border: 1px solid #d8c7ab; border-radius: 12px; padding: 8px 18px 14px; background: #fcfaf6; }
#evaluationAppealPanel label { display: block; margin: 16px 0 6px; font-weight: 700; }
#evaluationAppealPanel .form-input { width: 100%; font-size: 1rem; line-height: 1.7; }
#evaluationAppealPanel button { margin-top: 12px; min-height: 44px; }
#evaluationAppealPanel .page-status:empty { display: none; }
@media (min-width: 960px) {
  .foundation-evaluation-card, #evaluationAppealPanel { max-width: 960px; margin-inline: auto; }
}
@media (max-width: 640px) {
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) { padding-top: max(8px, env(safe-area-inset-top)); }
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-header { flex-wrap: wrap; padding: 16px; gap: 12px; }
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-header h1 { font-size: 1.25rem; }
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .homework-brand { width: 100%; text-align: left; }
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .header-actions { width: 100%; justify-content: flex-end; }
  body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .header-actions #studentNameBadge { width: auto; margin-right: auto; max-width: 50%; overflow-wrap: anywhere; }
  .student-account-tools > summary { font-size: .8125rem; }
  .student-task-nav { margin-bottom: 16px; }
  .student-task-nav a { font-size: .8125rem; padding-inline: 2px; }
  .list-top .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding: 3px; }
  .list-top .filter-chip { flex: 1 0 auto; padding: 9px 10px; font-size: .8125rem; }
  .student-list-heading .step-title { font-size: 1.3rem; }
  .student-homework-due-group > summary { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 10px; padding: 14px; }
  .student-homework-due-group > summary > small { grid-column: 2; width: auto; margin: 2px 0 0; font-size: .75rem; font-weight: 500; }
  .foundation-evaluation-card { padding: 16px; }
  .foundation-evaluation-error { padding: 12px; }
  .homework-section[data-state="detail"] textarea,
  .homework-section[data-state="detail"] select,
  .homework-section[data-state="detail"] input:not([type="checkbox"]):not([type="radio"]) { font-size: 16px; }
  .homework-section[data-state="detail"] .detail-top { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .student-account-tools *, #evaluationAppealPanel *, .foundation-evaluation-card * { scroll-behavior: auto; transition: none; animation: none; }
}
