.expanded-lesson-index,
.unit-glossary,
.study-calendar,
.local-tutor,
.writing-tools,
.confidence-calibration,
.diagnostic-gap-profile,
.pending-review-queue {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.expanded-lesson-index > summary,
.unit-glossary > summary,
.pending-review-queue > summary,
.pending-review-item > summary {
  min-height: 2.75rem;
  padding-block: 0.55rem;
  cursor: pointer;
  font-weight: 700;
}

.expanded-lesson-index[open] > summary,
.unit-glossary[open] > summary,
.pending-review-queue[open] > summary {
  margin-bottom: 0.5rem;
}

.expanded-lesson-layout { align-items: start; }
.expanded-unit { min-width: 0; }
.expanded-unit h3,
.micro-lesson-content h4 { line-height: 1.3; }
.micro-lesson-nav { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.8rem 0; }
.micro-lesson-tab { min-height: 2.75rem; }
.micro-lesson-tab.is-selected,
.lesson-pick.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.micro-lesson-content { min-width: 0; line-height: 1.65; }
.micro-lesson-content p { max-width: 78ch; }
.unit-glossary { margin: 1rem 0; }
.glossary-list { display: grid; grid-template-columns: minmax(8rem, 0.35fr) minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; }
.glossary-list dt { font-weight: 700; }
.glossary-list dd { margin: 0; overflow-wrap: anywhere; }
.learning-visual { min-width: 0; margin: 1rem 0; padding: 0.85rem; border: 1px solid var(--line); border-radius: 0.7rem; background: #f7f7f1; }
.learning-visual figcaption { margin-bottom: 0.55rem; font-weight: 700; }
.visual-steps { padding-left: 1.35rem; }
.visual-steps li { margin: 0.35rem 0; }

.digital-resources,
.digital-resource { min-width: 0; max-width: 100%; }
.digital-resource-image { display: block; max-width: 100%; height: auto; }

.study-calendar { margin-top: 1rem; }
.study-week-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: 0.5rem; }
.study-week-day { min-width: 0; padding: 0.6rem; border: 1px solid var(--line); border-radius: 0.6rem; background: #fff; }
.study-week-day h4 { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.study-week-day p { margin: 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.study-week-evidence { margin: 0.35rem 0 0; padding-top: 0.65rem; border-top: 1px solid var(--line); }
.calendar-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 0.75rem; }
.calendar-day { min-width: 0; padding: 0.85rem; border-left: 4px solid var(--accent); border-radius: 0.6rem; background: #f6f7f1; }
.calendar-day h4 { margin: 0 0 0.35rem; }
.calendar-day > p { margin: 0.3rem 0 0.7rem; color: var(--muted); }
.calendar-task-list { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.calendar-task { display: grid; gap: 0.35rem; min-width: 0; padding: 0.65rem; border: 1px solid var(--line); border-radius: 0.55rem; background: #fff; }
.calendar-task .button { justify-self: start; }
.progress-next-plan { display: grid; gap: 0.5rem; margin-top: 1rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.7rem; background: #f7f7f1; }
.progress-next-plan h4 { margin: 0; }
.progress-next-plan .course-actions { justify-content: space-between; margin: 0; padding-top: 0.45rem; border-top: 1px solid var(--line); }

.structured-item { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.7rem; background: #fff; }
.structured-item legend { padding: 0 0.35rem; font-weight: 700; }
.structured-item-prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
.structured-options { display: grid; gap: 0.45rem; }
.structured-options .check-option { min-width: 0; }
.structured-matching,
.structured-order { display: grid; gap: 0.6rem; }
.structured-table-scroll { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.structured-table-scroll-hint { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.9rem; }
.structured-answer-table th,
.structured-answer-table td { min-width: 7rem; padding: 0.5rem; vertical-align: top; }
.structured-answer-table input { width: 100%; min-width: 5rem; min-height: 2.6rem; }
.structured-chart-preview { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.55rem; background: #f7f7f1; }
.structured-chart-preview h5 { margin: 0 0 0.4rem; }
.structured-chart-status,
.structured-chart-summary { margin: 0.35rem 0; overflow-wrap: anywhere; }
.structured-chart-svg { display: block; width: 100%; max-width: 100%; height: auto; color: var(--ink); font: 12px/1.2 sans-serif; }
.structured-chart-svg .chart-grid-line { stroke: var(--line); stroke-width: 1; }
.structured-chart-svg .chart-axis-line { stroke: currentColor; stroke-width: 1.5; }
.structured-chart-svg .chart-data-bar { fill: #aacbbb; stroke: var(--accent-strong); stroke-width: 2; }
.structured-chart-svg .chart-tick-label { fill: currentColor; font-size: 12px; }
.structured-chart-svg .chart-axis-label { fill: currentColor; font-size: 14px; font-weight: 650; }
.structured-pie-chart-svg { display: block; box-sizing: border-box; width: 100%; max-width: 22rem; height: auto; margin: 0 auto; }
.structured-pie-chart-remainder { fill: #edf0ec; stroke: var(--control-border); stroke-width: 2; }
.structured-pie-chart-sector { stroke: #fff; stroke-width: 2; }
.structured-pie-chart-legend { display: grid; gap: 0.35rem; min-width: 0; margin: 0.6rem 0 0; padding: 0; list-style: none; }
.structured-pie-chart-legend-item { display: grid; grid-template-columns: 0.8rem minmax(0, 1fr); gap: 0.45rem; align-items: start; min-width: 0; overflow-wrap: anywhere; }
.structured-pie-chart-swatch { width: 0.75rem; height: 0.75rem; margin-top: 0.2rem; border: 1px solid var(--control-border); border-radius: 50%; }
.structured-pie-chart-swatch-0 { background-color: #547f69; }
.structured-pie-chart-swatch-1 { background-color: #d2a33e; }
.structured-pie-chart-swatch-2 { background-color: #477b9d; }
.structured-pie-chart-swatch-3 { background-color: #a45b4e; }
.structured-pie-chart-swatch-4 { background-color: #80669b; }
.structured-pie-chart-swatch-5 { background-color: #548d89; }
.structured-response-status { padding: 0.6rem 0.75rem; border-left: 3px solid var(--warning); background: var(--warning-bg); color: var(--warning); font-weight: 650; }
.structured-feedback { display: grid; gap: 0.55rem; margin-top: 0.75rem; }
.structured-feedback-list { display: grid; gap: 0.65rem; padding-left: 1.35rem; }
.structured-feedback-item { padding-left: 0.2rem; }
.structured-feedback-item.is-correct::marker { color: var(--success); }
.structured-feedback-item.is-incorrect::marker { color: var(--danger); }
.structured-feedback-item.is-pending::marker { color: var(--warning); }
.reference-example { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--accent); background: #f6f7f1; }

.writing-tools { gap: 0.45rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.65rem; background: #f7f7f1; }
.writing-word-count { margin: 0; font-weight: 700; }
.writing-checklist { display: grid; gap: 0.2rem; margin: 0; padding-left: 1.25rem; }
.writing-checklist .checklist-met { color: var(--success); }
.writing-checklist li:not(.checklist-met) { color: var(--muted); }
.local-tutor-result { min-height: 3rem; padding: 0.8rem; border-left: 3px solid var(--accent); background: #f7f7f1; white-space: pre-wrap; overflow-wrap: anywhere; }
.tutor-citation { color: var(--muted); font-size: 0.92rem; }
.practice-progressive-hints,
.practice-guide-routes { display: grid; gap: 0.55rem; min-width: 0; margin-top: 0.85rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 0.65rem; background: #f7f7f1; }
.practice-progressive-hints h5,
.practice-guide-routes h4,
.practice-hint-list { margin: 0; }
.practice-hint-list { padding-left: 1.3rem; }
.practice-hint-list li { margin: 0.35rem 0; overflow-wrap: anywhere; }
.practice-guide-routes .button { justify-self: start; max-width: 100%; white-space: normal; text-align: left; }
.practice-guide-route-status { margin: 0; }
.active-practice-guide-return { display: grid; gap: 0.5rem; margin: 0.75rem 0; }
.active-practice-guide-return p { margin: 0; }
.diagnostic-gap-profile { margin-top: 1rem; }
.diagnostic-gap-profile .topic-evidence { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.pending-review-queue { margin-top: 1rem; }
.pending-review-item { min-width: 0; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.65rem; background: #fff; }
.pending-review-item[open] > summary { margin-bottom: 0.75rem; }
.confidence-calibration { margin-top: 1rem; }
.confidence-calibration ul { display: grid; gap: 0.35rem; margin: 0; padding-left: 1.25rem; }

@media (max-width: 700px) {
  .glossary-list { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .glossary-list dd { margin-bottom: 0.55rem; }
  .micro-lesson-nav { display: flex; }
  .micro-lesson-tab { flex: 1 1 16rem; width: auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: start; }
  .structured-answer-table th,
  .structured-answer-table td { min-width: 6rem; }
  .structured-chart-svg .chart-tick-label,
  .structured-chart-svg .chart-axis-label { font-size: 24px; }
}
