:root {
  color-scheme: light;
  --navy-950: #071a3d;
  --navy-900: #0b2456;
  --navy-800: #123777;
  --blue-700: #174fc5;
  --blue-600: #2864e8;
  --blue-500: #3c78ff;
  --blue-100: #e8f0ff;
  --blue-50: #f3f7ff;
  --ink: #10213f;
  --muted: #65728a;
  --surface: #ffffff;
  --canvas: #f5f8fd;
  --line: #dbe4f2;
  --danger: #c63838;
  --danger-soft: #fff0f0;
  --success: #117a55;
  --success-soft: #e8f8f1;
  --warning: #a65c00;
  --warning-soft: #fff5df;
  --shadow: 0 18px 50px rgb(20 51 108 / 10%);
  --shadow-soft: 0 8px 24px rgb(20 51 108 / 8%);
}

* { box-sizing: border-box; }
* { min-width: 0; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.035em; }
.hidden { display: none !important; }
.secondary-text { color: var(--muted); font-size: 0.88rem; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 440px);
  gap: clamp(36px, 8vw, 120px);
  align-items: center;
  min-height: 100vh;
  padding: 48px max(24px, calc((100vw - 1180px) / 2));
  background:
    radial-gradient(circle at 14% 18%, rgb(67 127 255 / 32%), transparent 28%),
    linear-gradient(135deg, var(--navy-950), var(--navy-800) 54%, var(--blue-600));
}
.login-brand { color: #fff; }
.login-brand h1 { margin: 24px 0 0; font-size: clamp(3rem, 7vw, 6.5rem); }
.brand-mark, .wordmark-icon {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #cfe0ff);
  color: var(--blue-700);
  font-weight: 900;
  box-shadow: 0 12px 30px rgb(0 0 0 / 16%);
}
.brand-mark { width: 72px; height: 72px; font-size: 2rem; }
.login-card { border: 1px solid rgb(255 255 255 / 65%); border-radius: 28px; background: rgb(255 255 255 / 97%); box-shadow: 0 28px 80px rgb(3 16 49 / 28%); padding: 40px; }
.login-card h2 { margin-bottom: 8px; font-size: 2rem; }
.muted { margin-bottom: 28px; color: var(--muted); }
.auth-switch { margin: -8px 0 18px; color: var(--muted); font-size: .82rem; text-align: right; }
.auth-switch-button { border: 0; background: transparent; cursor: pointer; color: var(--blue-700); font-weight: 800; padding: 2px 0; }
.auth-switch-button:hover { text-decoration: underline; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 0.92rem; font-weight: 800; }
.field-hint { margin: -2px 0 0; color: var(--muted); font-size: 0.82rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid #bdc9dc;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgb(40 100 232 / 14%); }
input:disabled, select:disabled, textarea:disabled { background: #edf1f7; cursor: wait; }
.form-message, .dialog-message { min-height: 1.55em; margin: 10px 0 0; color: var(--danger); font-size: 0.9rem; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 17px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.62; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 8px 18px rgb(40 100 232 / 20%); }
.button-primary:hover { background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); }
.button-ghost { border-color: var(--line); background: #fff; color: var(--blue-700); }
.button-ghost:hover { background: var(--blue-50); border-color: #bfd0ef; }
.button-danger { background: var(--danger); color: #fff; }
.button-danger-quiet { background: var(--danger-soft); color: var(--danger); }
.button-block { width: 100%; min-height: 48px; }
.button-small { min-height: 34px; border-radius: 9px; font-size: 0.84rem; padding: 6px 11px; }

.app-shell { min-height: 100vh; background: var(--canvas); }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 30px;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid rgb(219 228 242 / 88%);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 6px 22px rgb(18 55 119 / 5%);
  padding: 0 max(22px, calc((100vw - 1320px) / 2));
  backdrop-filter: blur(14px);
}
.wordmark { display: flex; align-items: center; gap: 12px; border: 0; background: none; cursor: pointer; font-weight: 900; padding: 0; }
.wordmark-icon { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, var(--blue-500), var(--navy-800)); color: #fff; box-shadow: none; }
.topnav { display: flex; align-self: stretch; gap: 6px; }
.topnav button { position: relative; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 800; padding: 0 16px; }
.topnav button::after { position: absolute; right: 16px; bottom: 0; left: 16px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue-600); content: ""; opacity: 0; }
.topnav button:hover, .topnav button.active { color: var(--blue-700); }
.topnav button.active::after { opacity: 1; }
.account-menu { display: flex; align-items: center; gap: 10px; }
.account-name { font-weight: 800; }
.role-badge, .status-badge { display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; font-size: 0.78rem; font-weight: 800; padding: 4px 10px; }
.role-badge { background: var(--blue-100); color: var(--blue-700); }
.icon-button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--muted); font-weight: 700; padding: 7px 12px; }
.icon-button:hover { background: var(--blue-50); color: var(--blue-700); }

.page-content { max-width: 1320px; min-height: calc(100vh - 76px); margin: 0 auto; outline: none; padding: 50px 26px 80px; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(1.9rem, 3.5vw, 2.7rem); }
.back-button { display: block; margin: 0 0 10px; border: 0; background: none; color: var(--blue-700); cursor: pointer; font-weight: 800; padding: 0; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-soft); padding: 26px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; }

.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 320px)); justify-content: start; gap: 18px; align-items: stretch; }
.class-card { display: flex; min-height: 250px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(160deg, #fff 48%, #f1f6ff); box-shadow: var(--shadow-soft); padding: 22px; transition: transform 180ms ease, box-shadow 180ms ease; }
.class-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.interactive-class-card { cursor: pointer; }
.interactive-class-card:focus-visible { outline: 3px solid rgb(40 100 232 / 30%); outline-offset: 3px; }
.class-card-heading { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.class-card h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.45rem; }
.class-stats { display: grid; gap: 14px; margin: 20px 0 18px; }
.class-stats div { display: grid; gap: 3px; }
.class-stats dt, .summary-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.class-stats dd { margin: 0; font-weight: 800; }
.submission-progress { margin-top: auto; margin-bottom: 18px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 0.87rem; }
.progress-track { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; appearance: none; background: #dfe8f7; }
.progress-track::-webkit-progress-bar { border-radius: 999px; background: #dfe8f7; }
.progress-track::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--navy-800)); }
.progress-track::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--navy-800)); }

.class-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toolbar-tool { position: relative; }
.class-tool-button { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; color: var(--blue-700); font-weight: 800; padding: 8px 13px; }
.class-tool-button:hover, .class-tool-button[aria-expanded="true"] { border-color: #b7c9e9; background: var(--blue-50); }
.class-tool-button:focus-visible { outline: 3px solid rgb(40 100 232 / 22%); outline-offset: 2px; }
.class-tool-icon { display: inline-grid; width: 18px; place-items: center; line-height: 1; }
.class-tool-popover { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; max-height: min(620px, calc(100vh - 150px)); overflow: auto; border: 1px solid #c9d7eb; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgb(7 26 61 / 22%); text-align: left; padding: 20px; }
.class-tool-popover[hidden] { display: none; }
.class-tool-popover:focus { outline: none; }
.settings-popover { width: min(440px, calc(100vw - 32px)); }
.member-popover { width: min(760px, calc(100vw - 32px)); }
.compact-settings-panel { width: min(440px, calc(100vw - 32px)); }
.compact-settings-fields { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 12px; align-items: end; }
.compact-settings-fields .field { margin-bottom: 10px; }
.dialog-compact-fields { grid-template-columns: minmax(0, 1fr) 118px; }
.form-panel .form-actions { margin-top: 8px; }
.form-actions, .row-actions, .file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.member-bulk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.member-selection-form { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.member-selection-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.member-selection-heading h3 { margin: 0; font-size: 1rem; }
.select-all-control { display: inline-flex; flex: none; align-items: center; gap: 6px; cursor: pointer; color: var(--blue-700); font-size: .82rem; font-weight: 800; }
.select-all-control input, .member-option-row > input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--blue-600); }
.member-selection-list { display: grid; max-height: 285px; overflow-y: auto; overscroll-behavior: contain; border-block: 1px solid var(--line); }
.member-option-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 54px; border-top: 1px solid var(--line); padding: 8px 2px; }
.member-option-row:first-child { border-top: 0; }
.member-check-label { display: grid; cursor: pointer; }
.member-selection-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-top: 12px; }
.member-selection-actions .button { min-height: 36px; padding: 6px 11px; }
.compact-empty { margin: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 18px 2px 4px; }
.assignments-panel { margin-top: 0; }
.assignment-list { display: grid; gap: 10px; }
.assignment-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 10px; }
.assignment-main { display: grid; gap: 4px; min-height: 62px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; padding: 9px 12px; }
.assignment-main:hover { background: var(--blue-50); }
.assignment-main span { color: var(--muted); font-size: 0.86rem; }
.assignment-main strong, .assignment-preview, .submitted-text, .feedback-comment { overflow-wrap: anywhere; }

.assignment-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; border-radius: 22px; background: linear-gradient(135deg, var(--navy-900), var(--blue-700)); box-shadow: var(--shadow); color: #fff; padding: 28px; }
.assignment-summary > div { display: grid; gap: 5px; }
.assignment-summary .summary-label { color: #bed2ff; }
.assignment-description { grid-column: 1 / -1; margin: 4px 0 0; white-space: pre-wrap; }
.submissions-panel { margin-top: 22px; }
.submission-list { display: grid; gap: 12px; }
.submission-row { display: grid; grid-template-columns: minmax(150px, .45fr) minmax(260px, 1fr) auto; gap: 18px; align-items: start; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.student-identity, .submission-state { display: grid; gap: 6px; }
.student-identity span { color: var(--muted); font-size: 0.85rem; }
.feedback-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.feedback-form textarea { min-height: 72px; }
.feedback-disclosure { min-width: 126px; }
.feedback-disclosure summary { display: flex; min-height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--blue-700); font-size: .86rem; font-weight: 800; list-style: none; padding: 7px 11px; }
.feedback-disclosure summary::-webkit-details-marker { display: none; }
.feedback-disclosure summary::before { margin-right: 6px; content: "+"; }
.feedback-disclosure[open] { grid-column: 3; width: min(420px, 42vw); }
.feedback-disclosure[open] summary { background: var(--blue-50); }
.feedback-disclosure[open] summary::before { content: "−"; }
.feedback-disclosure .feedback-form { margin-top: 10px; }
.submitted-text { max-height: 12rem; overflow: auto; margin: 10px 0; border-radius: 12px; background: var(--blue-50); white-space: pre-wrap; padding: 14px; }

.student-class-card { min-height: 245px; }
.next-assignment { display: grid; gap: 9px; margin: 20px 0 18px; }
.next-assignment .status-badge { justify-self: start; margin-top: 4px; }
.no-assignment { margin: 34px 0 auto; color: var(--muted); }
.assignment-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; border-radius: 16px; background: #eaf1fc; padding: 7px; }
.compact-tabs { flex-wrap: nowrap; margin-bottom: 0; border-radius: 13px; gap: 4px; padding: 5px; }
.compact-tabs .filter-button { min-height: 38px; flex: none; padding: 7px 14px; }
.filter-button { min-height: 44px; flex: 1 1 180px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; color: var(--muted); font-weight: 800; padding: 9px 18px; }
.filter-button.active { background: #fff; box-shadow: var(--shadow-soft); color: var(--blue-700); }
.student-assignment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.student-assignment-card { display: flex; min-height: 190px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); cursor: pointer; padding: 18px; transition: transform 160ms ease, box-shadow 160ms ease; }
.student-assignment-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.student-assignment-card:focus-visible { outline: 3px solid rgb(40 100 232 / 30%); outline-offset: 3px; }
.assignment-card-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.assignment-card-top h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.35rem; }
.assignment-preview { display: -webkit-box; overflow: hidden; margin: 16px 0; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.assignment-card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin: auto 0 8px; color: var(--muted); font-size: .88rem; }
.card-link { align-self: flex-end; color: var(--blue-700); font-size: .86rem; font-weight: 800; }
.feedback-panel { margin-top: 22px; }
.student-submission-workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; margin-top: 22px; }
.student-submission-workspace > :only-child { width: min(100%, 760px); }
.current-file { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; margin-top: 16px; border-radius: 14px; background: var(--blue-50); padding: 14px 16px; }
.submitted-file { display: grid; gap: 8px; margin-top: 10px; }
.feedback-panel.unread { border-color: #edb957; box-shadow: 0 0 0 3px rgb(237 185 87 / 18%), var(--shadow-soft); }
.feedback-comment { margin: 0 0 12px; white-space: pre-wrap; }

.status-info { background: var(--blue-100); color: var(--blue-700); }
.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-notice { background: #fff0c7; color: #875000; }
.status-neutral { background: #edf1f6; color: #59667c; }
.user-table { display: grid; }
.user-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .7fr) minmax(180px, .9fr); gap: 18px; align-items: center; min-height: 64px; border-top: 1px solid var(--line); padding: 10px 8px; }
.user-table-heading { min-height: 44px; border-top: 0; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.user-actions { justify-content: flex-end; }
.dialog-target-name { margin: -4px 0 18px; color: var(--navy-900); font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.identity-only-row { grid-template-columns: 1fr; padding-left: 12px; }

.calendar-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.calendar-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-soft); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: var(--blue-50); }
.calendar-weekdays span { color: var(--muted); font-size: .82rem; font-weight: 800; text-align: center; padding: 11px 4px; }
.calendar-day { min-width: 0; min-height: 132px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day-empty { background: #f8fafd; }
.calendar-day-heading { display: flex; justify-content: space-between; align-items: center; min-height: 28px; margin-bottom: 6px; }
.calendar-day-heading strong { color: var(--navy-800); font-size: .88rem; }
.calendar-add-day, .calendar-event-delete { display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--blue-700); font-weight: 900; }
.calendar-add-day:hover, .calendar-event-delete:hover { background: var(--blue-100); }
.calendar-event { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: start; margin-top: 5px; border-radius: 9px; background: var(--blue-100); color: var(--navy-900); padding: 4px; }
.calendar-event-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px; min-width: 0; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; padding: 3px; }
.calendar-event-editable { cursor: pointer; }
.calendar-event-editable:hover, .calendar-event-editable:focus-visible { background: rgb(255 255 255 / 66%); }
.calendar-event-time { font-size: .74rem; font-weight: 900; }
.calendar-event-copy { display: grid; min-width: 0; gap: 2px; }
.calendar-event-name { overflow-wrap: anywhere; font-size: .78rem; font-weight: 750; }
.calendar-event-scope { overflow: hidden; color: var(--blue-700); font-size: .68rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-delete { width: 20px; height: 20px; color: var(--danger); font-size: 1rem; line-height: 1; }
.calendar-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calendar-scope-fieldset { margin: 0 0 18px; border: 0; padding: 0; }
.calendar-scope-fieldset legend { margin-bottom: 8px; font-size: .92rem; font-weight: 800; }
.calendar-scope-options { display: grid; max-height: 190px; overflow-y: auto; border: 1px solid #bdc9dc; border-radius: 12px; padding: 6px; }
.calendar-scope-option { display: flex; gap: 10px; align-items: center; border-radius: 8px; cursor: pointer; padding: 8px; }
.calendar-scope-option:hover { background: var(--blue-50); }
.calendar-scope-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue-600); }

.empty-state, .loading-state { display: grid; place-items: center; min-height: 160px; border: 1px dashed #bfd0ea; border-radius: 20px; background: rgb(255 255 255 / 60%); color: var(--muted); text-align: center; padding: 24px; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: var(--blue-100); color: var(--blue-700); font-size: 1.8rem; }
.empty-state p { margin: 12px 0; }
.loading-state { min-height: 230px; align-content: center; gap: 12px; border: 0; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-dialog { width: min(92vw, 560px); max-height: 90vh; overflow: auto; border: 0; border-radius: 24px; box-shadow: 0 30px 90px rgb(6 24 62 / 30%); padding: 28px; }
.app-dialog::backdrop { background: rgb(5 20 50 / 52%); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #edf2f9; cursor: pointer; color: var(--muted); font-size: 1.6rem; line-height: 1; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(360px, calc(100vw - 44px)); }
.toast { border-radius: 13px; background: var(--navy-900); box-shadow: var(--shadow); color: #fff; font-weight: 700; padding: 14px 16px; }
.toast-error { background: var(--danger); }
.profile-list { margin: 0; }
.profile-list div { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 14px 0; }
.profile-list div:first-child { border-top: 0; }
.profile-list dd { margin: 0; font-weight: 800; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; padding: 12px 18px; }
  .topnav { grid-column: 1 / -1; grid-row: 2; min-height: 44px; order: 3; }
  .topnav button { flex: 1; }
  .account-name { display: none; }
  .page-content { padding-top: 34px; }
  .submission-row { grid-template-columns: 1fr 1fr; }
  .feedback-disclosure, .feedback-disclosure[open] { grid-column: 1 / -1; width: 100%; }
  .student-assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-submission-workspace { grid-template-columns: 1fr; }
  .calendar-day { min-height: 108px; padding: 6px; }
  .calendar-event-main { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-shell { grid-template-columns: 1fr; gap: 28px; padding: 32px 18px; }
  .login-brand { display: flex; align-items: center; gap: 16px; }
  .login-brand h1 { margin: 0; font-size: 2.2rem; }
  .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 1.4rem; }
  .login-card { padding: 28px 22px; }
  .wordmark > span:last-child, .role-badge { display: none; }
  .page-content { padding: 28px 16px 60px; }
  .page-heading { flex-wrap: wrap; align-items: flex-start; }
  .page-heading > .button { min-height: 38px; padding: 7px 11px; }
  .class-detail-actions { position: relative; width: 100%; justify-content: flex-start; }
  .toolbar-tool { position: static; }
  .class-tool-popover, .settings-popover, .member-popover, .compact-settings-panel { top: calc(100% + 10px); right: auto; left: 0; width: 100%; max-height: calc(100vh - 180px); }
  .member-bulk-grid { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: 1fr; }
  .student-assignment-grid { grid-template-columns: 1fr; }
  .class-card { min-height: 235px; }
  .panel { border-radius: 18px; padding: 20px; }
  .compact-settings-fields { grid-template-columns: minmax(0, 1fr) 96px; }
  .assignment-row, .submission-row, .feedback-form { grid-template-columns: 1fr; }
  .feedback-disclosure .feedback-form { min-width: 0; }
  .assignment-summary { grid-template-columns: 1fr; }
  .assignment-card-top, .current-file { align-items: flex-start; }
  .user-table-heading { display: none; }
  .user-row { grid-template-columns: 1fr auto; gap: 7px 14px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; padding: 14px; }
  .user-row > :nth-child(2), .user-row > :nth-child(3) { grid-column: 1; }
  .user-row > :nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
  .user-actions { max-width: 150px; justify-content: flex-end; }
  .calendar-heading-actions { width: 100%; justify-content: flex-start; }
  .calendar-heading-actions .button { flex: 1 1 auto; }
  .calendar-panel { overflow-x: auto; }
  .calendar-weekdays, .calendar-grid { min-width: 700px; }
  .calendar-form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
