.course-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--hairline); margin: 24px 0; overflow-x: auto; }
.course-tabs button { padding: 0 0 12px; height: 36px; border-radius: 0; font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; color: var(--muted-foreground); }
.course-tabs button[aria-current] { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.course-tabs button:hover { color: var(--foreground); }
.course-input { min-width: 0; }
.course-input[type="search"] { width: min(44%, 280px); }
.course-select-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--canvas); font-size: 13px; }
.course-select-row input { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.course-setup { max-width: 680px; padding: 24px; background: var(--bui-surface); border: 1px solid var(--hairline); border-radius: var(--desktop-surface-radius); }
.course-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.course-overview-row { display: flex; align-items: center; text-align: left; gap: 12px; padding: 16px; height: auto; white-space: normal; background: var(--bui-surface); border-radius: var(--desktop-surface-radius); border: 1px solid var(--hairline); }
.course-overview-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.course-material { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--hairline); }
.course-empty { color: var(--muted-foreground); font-size: 13px; padding: 28px 0; max-width: 480px; line-height: 1.7; }
.course-notice { container: course-notice / inline-size; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; background: var(--canvas); border: 1px solid var(--hairline); border-left: 3px solid var(--primary); padding: 16px; margin: 0 0 24px; font-size: 13px; line-height: 20px; border-radius: 8px; overflow-wrap: anywhere; min-width: 0; }
.course-notice > p { flex: 1 1 360px; min-width: 0; max-width: 85ch; margin: 0; }
.course-notice [data-notice-actions] { flex: 0 0 auto; max-width: 100%; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@container course-notice (max-width: 480px) {
  .course-notice > p { flex-basis: 100%; }
  .course-notice [data-notice-actions] { margin-left: 0; }
}
.course-notice + .course-notice { margin-top: -12px; }
:is(h1, h2, h3, h4) + .course-notice { margin-top: 12px; }

.course-calendar { container: course-calendar / inline-size; width: 100%; min-width: 0; }
.course-calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.course-calendar-layout > section { min-width: 0; }
.course-calendar-layout h2 { font-size: 14px; line-height: 20px; }
.course-month { background: var(--bui-surface); border: 1px solid var(--hairline); border-radius: var(--desktop-surface-radius); padding: 20px; min-width: 0; }
.course-month-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.course-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.course-weekday { font-size: 11px; color: var(--muted-foreground); text-align: center; padding: 0 8px 8px; }
.course-day-cell { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; width: 100%; min-width: 0; height: 112px; min-height: 112px; padding: 5px 6px; border: 1px solid var(--hairline); border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: normal; text-align: left; }

.course-day-cell[data-today="true"] .course-day-number { font-weight: 700; color: var(--primary); }
.course-day-cell[data-selected="true"] { background: var(--primary-soft); border-color: var(--primary); }
.course-month-grid .course-day-number { align-self: flex-start; line-height: 20px; width: 28px; height: 28px; min-height: 28px; padding: 0; }
.course-day-events { display: grid; gap: 4px; width: 100%; min-width: 0; }
.course-month-grid .course-day-preview { display: flex; align-items: baseline; justify-content: flex-start; width: 100%; height: 20px; min-height: 20px; gap: 4px; min-width: 0; padding: 0 4px; border-left: 3px solid var(--event-color); border-radius: 3px; background: color-mix(in srgb, var(--event-color) 10%, var(--bui-surface)); color: var(--foreground); font-size: 11px; line-height: 16px; }
.course-month-grid :is(.course-day-preview, .course-day-more) { text-align: left; }
.course-day-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.course-month-grid .course-day-more { width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; justify-content: flex-start; height: 20px; min-height: 20px; padding: 0 5px; color: var(--muted-foreground); font-size: 11px; }
@container course-calendar (max-width: 480px) {
  .course-month-grid .course-day-more { gap: 0; padding-inline: 0; }
  .course-day-more-label { display: none; }
}
.course-calendar [data-kind="exam"] { --event-color: var(--ink-red); }
.course-calendar [data-kind="assignment"] { --event-color: var(--primary); }
.course-calendar [data-kind="class"] { --event-color: var(--ink-green); }
.course-calendar [data-kind="other"] { --event-color: var(--muted-foreground); }
.course-calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: var(--muted-foreground); font-size: 12px; }
.course-calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.course-calendar-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--event-color); }
.course-event { overflow-wrap: anywhere; display: flex; align-items: start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.course-event-date { font-variant-numeric: tabular-nums; display: flex; flex-direction: column; width: 84px; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.course-event-date small { color: var(--muted-foreground); font-size: 12px; line-height: 18px; font-weight: 400; margin-top: 4px; }
.course-event[data-status="cancelled"] h3 { text-decoration: line-through; }
.course-badge { display: inline-block; background: var(--canvas); border: 1px solid var(--hairline); color: var(--muted-foreground); padding: 2px 6px; border-radius: 8px; font-size: 12px; line-height: 18px; font-weight: 500; margin-left: 6px; }
.course-source-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); }
.course-source-link:hover { text-decoration: underline; }
.course-source-list { display: grid; gap: 20px; min-width: 0; }
.course-source-card { padding: 20px; overflow-wrap: anywhere; }
.course-source-heading { min-width: 0; }
.course-source-back { justify-self: start; }
.course-source-list .course-source-preview { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; height: auto; padding: 20px; text-align: left; white-space: normal; }
.course-source-preview strong { font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.course-source-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted-foreground); overflow-wrap: anywhere; }
.course-source-heading h2 { margin-top: 4px; font-size: 16px; line-height: 24px; font-weight: 600; }
.course-source-body { margin-top: 16px; max-width: 70ch; font-size: 14px; line-height: 20px; white-space: pre-wrap; }
.course-source-body p { margin: 0; }
.course-source-body p + p { margin-top: 12px; }
.course-source-card footer { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.course-source-card footer a { font-size: 12px; line-height: 20px; }
.course-source-card footer svg { width: 14px; height: 14px; }
.course-question { max-width: 780px; }
.course-composer { padding: 16px; background: var(--bui-surface); border: 1px solid var(--hairline); border-radius: 22px; }
.course-composer:focus-within { border-color: var(--ring); }
.course-composer textarea { display: block; width: 100%; resize: vertical; min-height: 80px; font-size: 14px; line-height: 1.6; background: transparent; border: 0; padding: 0 0 12px; }
.course-composer textarea:focus-visible { outline: none; }
.course-answer { padding: 20px 0; border-top: 1px solid var(--hairline); overflow-wrap: anywhere; }
.course-citation .course-source-link { align-items: flex-start; }
.course-citation { border-left: 2px solid var(--border); padding-left: 12px; }
@media (max-width: 820px) { .course-material { flex-wrap: wrap; } .course-material > div:last-child { margin-left: 34px; } }

@container course-calendar (max-width: 639px) {
  .course-month { padding: 12px; }
  .course-month-heading { flex-wrap: wrap; }
  .course-month-grid { gap: 2px; }
  .course-weekday { padding-inline: 3px; }
  .course-day-cell { padding: 5px 3px; min-height: 92px; }
  .course-month-grid .course-day-preview { padding: 2px 3px; border-left-width: 2px; }
}

/* Dashboard: raised study destinations, quiet informational lists. */
.course-tabs a { padding: 0 0 12px; font-size: 13px; line-height: 24px; white-space: nowrap; border-bottom: 2px solid transparent; color: var(--muted-foreground); }
.course-tabs a[aria-current] { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.course-tabs a:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.dashboard { container: dashboard / inline-size; min-width: 0; }
.dashboard > section, .dashboard-columns { margin-bottom: 32px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.dashboard-columns > section { min-width: 0; }
.dashboard-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; margin-bottom: 12px; }
.dashboard-section-heading h2 { font-size: 14px; line-height: 20px; font-weight: 600; }
.dashboard-meta { font-size: 12px; line-height: 18px; color: var(--muted-foreground); }
.dashboard-resume { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 16px; }
.dashboard-resume-copy { min-width: 0; }
.dashboard-resume strong { display: block; font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.dashboard-resume .dashboard-meta { margin-top: 6px; color: color-mix(in srgb, var(--foreground) 72%, var(--primary)); }
.dashboard-resume-preview { min-width: 0; }
.dashboard-resume-preview [data-library-preview] { background: var(--background); }
.dashboard-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.dashboard-courses .dashboard-course { display: flex; justify-content: start; gap: 12px; height: auto; min-height: 88px; padding: 16px; text-align: left; white-space: normal; }
.dashboard-course-copy { min-width: 0; }
.dashboard-course strong { display: block; font-size: 14px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.dashboard-course small { display: block; margin-top: 4px; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--muted-foreground); }
@container dashboard (max-width: 440px) {
  .dashboard-resume { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .dashboard-resume > button { grid-column: 1 / -1; justify-self: stretch; }
}
.dashboard .dashboard-row { display: flex; align-items: center; justify-content: start; gap: 16px; width: 100%; height: auto; min-height: 60px; padding: 12px 4px; text-align: left; white-space: normal; border-radius: 0; border-bottom: 1px solid var(--hairline); }
.dashboard .dashboard-review-action { margin-top: 12px; padding: 6px 12px; height: auto; min-height: 32px; white-space: normal; text-align: left; }
.dashboard-row > span { min-width: 0; }
.dashboard-row strong { display: block; font-size: 13px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.dashboard-row small { display: block; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--muted-foreground); margin-top: 3px; }
.dashboard-date { flex: 0 0 64px; padding: 7px 4px; text-align: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-variant-numeric: tabular-nums; }
.dashboard-date small { color: inherit; margin-top: 0; font-size: 11px; }
.dashboard-row-arrow { margin-left: auto; flex-shrink: 0; color: var(--muted-foreground); }
@container dashboard (min-width: 700px) { .dashboard-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }

/* Calendar event disclosure: shared overlay elevation, anchored to the event. */
.course-event-title-button { height: auto; padding: 0; white-space: normal; text-align: left; justify-content: flex-start; font-weight: 600; }
.course-event-popover { z-index: 70; width: min(340px, calc(100vw - 32px)); max-height: min(480px, var(--radix-popover-content-available-height)); overflow-y: auto; padding: 20px; border-radius: var(--desktop-overlay-radius); color: var(--popover-foreground); background: var(--popover); box-shadow: var(--bui-shadow-overlay); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.course-event-popover-heading { display: flex; align-items: flex-start; gap: 12px; }
.course-event-popover-heading h3 { flex: 1; font-size: 16px; line-height: 24px; font-weight: 600; padding-top: 2px; }
.course-event-popover-heading button { flex-shrink: 0; }
.course-event-popover-course { color: var(--muted-foreground); margin-top: 4px; }
.course-event-popover-date { margin-top: 16px; font-variant-numeric: tabular-nums; }
.course-event-popover-status { margin-top: 12px; font-weight: 600; }
.course-event-popover-detail { margin-top: 12px; }
.course-event-popover-evidence { margin-top: 12px; border-left: 2px solid var(--border); padding-left: 12px; color: var(--muted-foreground); white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
.course-event-popover-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Submission is separate from event type; never communicate urgency by color alone. */
:root { --assignment-warning: #946200; }
.dark { --assignment-warning: #e8b85f; }
.assignment-status { display: block; width: fit-content; max-width: 100%; margin-top: 4px; padding: 2px 6px; border-radius: var(--desktop-control-radius); background: var(--canvas); color: var(--muted-foreground); font-size: 11px; font-weight: 500; line-height: 16px; white-space: normal; overflow-wrap: anywhere; }
.assignment-status[data-urgency="soon"] { color: var(--assignment-warning); background: color-mix(in srgb, var(--assignment-warning) 12%, var(--bui-surface)); }
.assignment-status[data-urgency="urgent"] { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 10%, var(--bui-surface)); }
.assignment-status:is([data-submission="submitted"], [data-submission="graded"]) { color: var(--ink-green); background: color-mix(in srgb, var(--ink-green) 10%, var(--bui-surface)); }
.course-day-copy { display: flex; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.course-day-copy .course-day-title { display: block; flex: 1; min-width: 0; }
.course-day-time { font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.course-day-copy .assignment-status { flex-shrink: 1; min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; margin-top: 0; padding: 0 3px; font-size: 10px; line-height: 14px; white-space: nowrap; }

.course-agenda { min-width: 0; }
.course-agenda-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.course-agenda-column:only-child { grid-column: 1 / -1; }
.course-agenda-column h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.course-agenda-count { color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.course-agenda-list { max-height: 288px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.course-agenda-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; height: auto; min-height: 44px; padding: 12px; border-radius: 8px; white-space: normal; text-align: left; border-bottom: 1px solid var(--hairline); overflow-wrap: anywhere; }
.course-agenda-title { font-size: 13px; line-height: 20px; font-weight: 600; }
.course-agenda-meta { color: var(--muted-foreground); font-size: 12px; line-height: 18px; font-weight: 400; }
.course-agenda-row[data-status="cancelled"] .course-agenda-title { text-decoration: line-through; }
.course-agenda-row .assignment-status { margin-top: 0; }
.course-agenda-empty { padding: 12px 0; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.course-agenda-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.course-agenda-disclosures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.course-agenda-disclosures summary { cursor: pointer; padding: 12px 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
@container course-calendar (max-width: 639px) {
  .course-agenda-columns, .course-agenda-disclosures { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Home shortcuts share a row, with each action anchored below its content. */
.dashboard-quick-access { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 32px; }
.dashboard-quick-access > section { min-width: 0; display: flex; flex-direction: column; }
.dashboard-quick-access:has(.dashboard-schedule) .dashboard-resume { flex: 1; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
.dashboard-quick-access:has(.dashboard-schedule) .dashboard-resume > button { grid-column: 1 / -1; justify-self: start; align-self: end; }
.dashboard-schedule { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: start; gap: 16px; padding: 16px; min-width: 0; }
.dashboard-schedule-course { width: 100%; min-width: 0; }
.dashboard-schedule-course + .dashboard-schedule-course { border-top: 1px solid var(--hairline); padding-top: 16px; }
.dashboard-schedule strong { display: block; font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; margin: 4px 0 6px; }
.dashboard-schedule button { margin-top: 16px; }
@container dashboard (min-width: 700px) { .dashboard-quick-access:has(> section + section) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sync-course-terms, .sync-course-choices { margin-inline-start: 20px; min-width: 0; }
[data-material-history] > :not(summary),
.course-agenda-disclosures details > .course-agenda-list { margin-inline-start: 20px; }
[data-material-history] > ul > li > ul { margin-inline-start: 20px; }
