@font-face {
  font-family: 'Sarabun';
  src: url('./fonts/Sarabun-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Sarabun';
  src: url('./fonts/Sarabun-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Sarabun';
  src: url('./fonts/Sarabun-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Sarabun';
  src: url('./fonts/Sarabun-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  font-family: 'Sarabun', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #0f172a;
  background: #f8fafc;
  font-synthesis: none;

  /* Brand Tokens (DESIGN.md: กรมท่า #0F2557 และแสด #EA580C) */
  --brand-primary: #0F2557;
  --brand-primary-dark: #001038;
  --brand-primary-hover: #143270;
  --brand-accent: #EA580C;
  --brand-accent-text: #9A3412;
  --brand-accent-light: #FFEDD5;
  --brand-surface: #F8FAFC;
  --brand-surface-card: #FFFFFF;
  --brand-surface-low: #F1F5F9;
  --brand-border: #E2E8F0;
  --brand-border-strong: #CBD5E1;
  --brand-text: #0F172A;
  --brand-text-muted: #64748B;

  /* Status Tokens (Strictly separated from Brand Colors) */
  --status-unsubmitted-bg: #F1F5F9;
  --status-unsubmitted-text: #475569;
  --status-unsubmitted-border: #CBD5E1;

  --status-pending-bg: #FEF3C7;
  --status-pending-text: #92400E;
  --status-pending-border: #FDE68A;

  --status-graded-bg: #D1FAE5;
  --status-graded-text: #065F46;
  --status-graded-border: #A7F3D0;

  /* Legacy aliases for backward compatibility */
  --text: var(--brand-text);
  --muted: var(--brand-text-muted);
  --blue: var(--brand-primary);
  --border: var(--brand-border);
  --surface: var(--brand-surface-card);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--brand-primary); }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}
main:focus { outline: none; }
button { border: 0; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.5; font-weight: 700; color: var(--brand-primary); }
h2 { font-size: 21px; line-height: 1.5; font-weight: 700; color: var(--brand-primary); }
h3 { font-size: 17px; line-height: 1.5; }
svg { display: block; }
small { font-size: 14px; }
.muted { color: var(--brand-text-muted); }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 16px; padding: 12px 18px; background: var(--brand-primary); color: white; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.demo-strip { padding: 6px 20px; background: #fff6dc; color: #715624; font-size: 14px; text-align: center; border-bottom: 1px solid #ecdfbd; }
html:has(body[data-route="teacher"]) { scrollbar-gutter: stable; }
body[data-route="teacher"] { background: var(--brand-surface); color: var(--brand-text); }
.site-header { background: var(--brand-primary); color: #ffffff; border-bottom: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12); }
.header-inner { max-width: 1440px; margin: auto; padding: 8px 24px; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-brand-group { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 52px; padding: 4px 6px; border-radius: 8px; color: #ffffff; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 1px; }
.brand strong { display: block; font-size: 18px; line-height: 1.35; font-weight: 700; color: #ffffff; overflow-wrap: anywhere; }
.brand-home-cue { display: inline-flex; align-items: center; gap: 5px; color: #dae2fd; font-size: 14px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.brand-home-icon { flex: none; }
.brand-home-label { text-decoration: underline; text-decoration-color: rgba(218, 226, 253, .55); text-underline-offset: 3px; }
.brand:hover, .brand[aria-current="page"] { background: rgba(255, 255, 255, .1); }
.brand:hover .brand-home-label { text-decoration-color: currentColor; }
.brand:focus-visible { background: rgba(255, 255, 255, .14); outline: 2px solid #ffffff; outline-offset: -2px; }
.brand:active { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
.brand small { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .brand { transition: background-color 140ms ease, box-shadow 140ms ease; }
  .brand-home-label { transition: text-decoration-color 140ms ease; }
  main.home-arrival { animation: home-arrival 160ms ease-out; }
  @keyframes home-arrival { from { opacity: .65; } to { opacity: 1; } }
}
.header-classroom-badge { padding: 2px 8px; border-radius: 4px; background: var(--brand-accent-light); color: var(--brand-accent-text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.header-demo-pill { padding: 2px 10px; border-radius: 9999px; background: rgba(218, 226, 253, 0.18); border: 1px solid rgba(218, 226, 253, 0.3); color: #dae2fd; font-size: 12px; font-weight: 500; white-space: nowrap; }
.header-divider { width: 1px; height: 20px; background: rgba(198, 198, 205, 0.25); flex-shrink: 0; }
.header-course-context { font-size: 13px; color: #b3c5ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
.nav-mode-label { font-size: 13px; color: #bec6e0; margin-right: 2px; }
.nav-button { min-height: 36px; padding: 6px 14px; border-radius: 6px; background: transparent; color: #dce9ff; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, color .15s; }
.nav-button:hover { background: rgba(220, 233, 255, 0.14); color: #ffffff; }
.nav-button.active { background: var(--brand-accent-light); color: var(--brand-accent-text); }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.nav-badge.has-pending, .nav-button.active .nav-badge { background: #ffffff; color: var(--brand-accent-text); }
.nav-auth-badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, 0.16); color: #dce9ff; line-height: 1.2; }
.nav-auth-badge.has-pending { background: #ba1a1a; color: #ffffff; }
.teacher-only-flex { display: none; }
body[data-route="teacher"] .teacher-only-flex { display: inline-flex; }
.teacher-profile-chip { align-items: center; gap: 8px; color: #ffffff; font-size: 13px; font-weight: 500; }
.teacher-profile-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-primary-dark); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.3); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.teacher-profile-text { display: flex; flex-direction: column; line-height: 1.25; }
.teacher-profile-name { font-weight: 600; color: #ffffff; }
.teacher-profile-role { font-size: 11px; color: #b3c5ff; }
main { min-height: calc(100vh - 220px); }
.page { max-width: 1440px; padding: 24px 24px 48px; margin: 0 auto; }
.page-heading { margin-bottom: 26px; }
.page-heading p { margin-top: 7px; color: var(--brand-text-muted); }
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
.login-intro { padding-top: 12px; }
.login-intro h1 { margin: 8px 0 14px; font-size: 30px; }
.term-label { color: var(--muted); font-size: 14px; }
.intro-text { max-width: 510px; color: #46566a; line-height: 1.9; }
.section-label { font-size: 17px; margin: 30px 0 12px; }
.subject-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.subject-list li { padding: 13px 0; display: grid; grid-template-columns: 1fr auto; gap: 16px; border-bottom: 1px solid var(--border); font-size: 15px; }
.subject-list span { color: var(--muted); white-space: nowrap; }
.subject-note { color: var(--muted); margin-top: 11px; font-size: 14px; }
.login-box, .panel { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 28px; }
.login-box h2 { margin-bottom: 8px; }
.login-box > p { color: var(--muted); font-size: 16px; }
.primary-button {
  background: var(--brand-primary);
  color: #ffffff;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.primary-button:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}
.primary-button:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
  box-shadow: none;
}
.secondary-button {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--brand-border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .15s, border-color .15s;
}
.secondary-button:hover {
  background: var(--brand-surface-low);
  border-color: #94a3b8;
}
.text-button { min-height: 40px; background: transparent; color: var(--brand-primary); padding: 8px 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.full-width { width: 100%; }
.login-main-button { margin-top: 24px; }
.google-icon { width: 21px; height: 21px; background: white; border-radius: 50%; padding: 2px; flex-shrink: 0; }
.login-box .login-note { font-size: 14px; color: #617084; margin-top: 10px; }
.login-divider { margin: 24px 0 20px; border: 0; border-top: 1px solid var(--border); }
.simple-steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 16px; }
.simple-steps li { display: flex; gap: 11px; align-items: start; font-size: 15px; }
.step-no { width: 25px; height: 25px; border-radius: 50%; background: #edf2f8; color: #375879; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.simple-steps strong { display: block; font-weight: 600; }
.simple-steps p { color: var(--muted); margin-top: 2px; }
.login-preview-link { margin-top: 20px; width: 100%; text-align: center; }
.page-callout { margin-top: 28px; padding: 16px 18px; border-left: 3px solid #7393b8; background: #edf2f7; color: #435973; font-size: 14px; }
.site-footer { max-width: 1440px; margin: auto; padding: 20px 24px; color: #617084; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 18px; font-size: 14px; }
.topline { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 24px; }
.back-button { border: 0; background: transparent; padding: 3px 0; color: var(--brand-primary); font-size: 14px; min-height: 36px; }
.session { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px 16px; font-size: 14px; color: var(--muted); }
.session span { overflow-wrap: anywhere; }
.session button { font-size: 14px; min-height: 36px; }
.access-page { max-width: 760px; }
.access-panel { padding: 30px; }
.access-panel > .muted { margin-top: 10px; }
.progress { display: flex; gap: 0; list-style: none; margin: 0 0 28px; padding: 0; }
.progress li { flex: 1; padding: 10px 6px; font-size: 14px; color: #657287; border-bottom: 3px solid #dce3eb; text-align: center; }
.progress li.current { border-color: var(--brand-accent); color: var(--brand-accent-text); font-weight: 600; }
.progress li.done { color: #37674e; border-color: #87a794; }
.field { margin-top: 20px; }
.field label { font-weight: 600; display: block; margin-bottom: 6px; color: var(--brand-text); font-size: 15px; }
.field input { width: 100%; border: 1px solid var(--brand-border-strong); background: white; padding: 10px 14px; border-radius: 8px; font-size: 15px; color: var(--brand-text); min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.field textarea { width: 100%; border: 1px solid var(--brand-border-strong); background: white; padding: 10px 14px; border-radius: 8px; font-size: 15px; color: var(--brand-text); line-height: 1.6; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(15, 37, 87, 0.15); outline: none; }
.field input[aria-invalid='true'], .field textarea[aria-invalid='true'] { border-color: #b6463d; box-shadow: 0 0 0 3px rgba(182, 70, 61, 0.15); }
.field-help { color: var(--muted); font-size: 14px; margin-top: 7px; }
.due-date-summary { color: #1e3b60; font-size: 14px; font-weight: 600; margin-top: 7px; line-height: 1.5; }
.due-date-summary.is-invalid { color: #b6463d; font-weight: 700; }
input[type="datetime-local"] { max-width: 100%; min-width: 0; }
.sample-hint { background: #f2f5f8; border: 1px solid #e0e6ed; border-radius: 5px; padding: 12px 14px; margin-top: 15px; font-size: 14px; display: grid; gap: 10px; }
.sample-row, .sample-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sample-extra { padding-top: 8px; border-top: 1px dashed #d3dce6; color: var(--muted); font-size: 14px; }
.sample-chip { background: white; color: var(--brand-primary); border: 1px solid #9ab4d6; border-radius: 4px; font-size: 14px; font-weight: 600; padding: 5px 10px; min-height: 34px; }
.sample-chip:hover { background: #eaf2fc; border-color: var(--brand-primary); }
.sample-chip.subtle { color: #495a6e; border-color: #c5d0dc; font-weight: 500; }
.sample-chip.subtle:hover { background: #e8eef5; border-color: #8fa1b5; }
.previous-code-note { margin-top: 12px; padding: 10px 14px; background: #fff6f4; border-left: 3px solid #c96c63; color: #7a2e27; font-size: 14px; border-radius: 0 4px 4px 0; }
.form-error { min-height: 24px; font-size: 14px; color: #a82e29; margin: 9px 0 12px; }
.form-actions, .action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.access-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.status-label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 9999px; white-space: nowrap; line-height: 1.4; background: var(--status-unsubmitted-bg); color: var(--status-unsubmitted-text); border: 1px solid var(--status-unsubmitted-border); }
.status-label.pending-work, .status-label.is-pending { background: var(--status-pending-bg); color: var(--status-pending-text); border-color: var(--status-pending-border); }
.status-label.approved, .status-label.is-graded { background: var(--status-graded-bg); color: var(--status-graded-text); border-color: var(--status-graded-border); }
.status-label.neutral-status { background: var(--status-unsubmitted-bg); color: var(--status-unsubmitted-text); border-color: var(--status-unsubmitted-border); }
.status-label.rejected { color: #a23d35; background: #fff0ed; border-color: #ffdad6; }
.details { margin: 23px 0; border-top: 1px solid var(--border); }
.details div { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.workspace-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 23px; }
.workspace-heading p { color: var(--muted); margin-top: 7px; }
.workspace-heading .status-label { white-space: nowrap; margin-top: 7px; }
.workspace-note { border-left: 3px solid #b6c4d5; padding: 11px 16px; background: #eaf0f6; color: #4f647d; font-size: 14px; margin-bottom: 25px; }
/* หน้านักเรียน: งานก่อน ข้อมูลบัญชีทีหลัง (สอดคล้องกับ DESIGN.md) */
.student-task-header {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  border-left: 6px solid var(--brand-accent);
}
.student-task-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 6px 0 8px; }
.student-task-title-row h1 { font-size: 24px; line-height: 1.35; font-weight: 700; color: var(--brand-primary); margin: 0; }
.student-task-title-row .status-label { margin: 0; }
.student-task-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin: 4px 0 0; font-size: 14px; color: var(--brand-text-muted); }
.student-task-meta strong { color: var(--brand-primary); font-weight: 700; }
.student-task-header .workspace-note { margin: 12px 0 0; padding: 6px 12px; }
.assignment-card .assignment-instructions { background: none; border: 0; padding: 0; font-size: 17px; color: var(--text); }
.result-card h2, .assignment-card h2, .submission-panel h2 { font-size: 19px; margin-bottom: 8px; }
.result-card.is-graded { border-left: 4px solid #2f7a52; }
.result-card.is-waiting { border-left: 4px solid #d29b2b; }
.result-score { margin-bottom: 10px; }
.result-score .score-highlight { font-size: 20px; padding: 4px 12px; }
.result-score .score-waiting { font-size: 16px; padding: 4px 12px; }
.submitted-summary { padding-top: 18px; padding-bottom: 18px; }
.submitted-summary summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.submitted-summary-title { font-size: 17px; font-weight: 700; color: var(--text); }
.submitted-summary[open] summary { margin-bottom: 4px; }
.summary-line { display: flex; gap: 30px; border-bottom: 1px solid var(--border); margin-bottom: 26px; padding-bottom: 19px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.summary-line strong { font-size: 21px; color: var(--text); margin-left: 7px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 26px; align-items: start; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-top h2 { font-size: 20px; }
.section-top small { color: var(--muted); }
.section-description { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.request-table, .roster-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.request-table th, .roster-table th { font-size: 14px; text-align: left; font-weight: 600; color: #566579; border-bottom: 1px solid #cdd7e3; background: #f8fafc; padding: 11px 12px; }
.request-table td { padding: 16px 12px; vertical-align: top; border-bottom: 1px solid var(--border); }
.request-table:not(.auth-request-table) th:first-child, .request-table:not(.auth-request-table) td:first-child { padding-left: 0; background: transparent; }
.request-table:not(.auth-request-table) td:last-child, .request-table:not(.auth-request-table) th:last-child { padding-right: 0; width: 180px; }
.request-person strong { display: block; font-size: 15px; }
.request-person small { display: block; color: var(--muted); margin-top: 4px; }
.request-email { overflow-wrap: anywhere; margin-top: 5px; color: #354f70; font-size: 14px; }
.request-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 136px; }
.request-actions button { min-height: 44px; font-size: 14px; padding: 9px 12px; }
.request-actions .reject-button { border-color: #cfa9a3; color: #823329; background: #fffbfa; }
.request-actions .reject-button:hover { background: #fff0ed; border-color: #b57369; }
.roster-panel { padding: 22px; }
.roster-panel h2 { font-size: 18px; margin-bottom: 7px; }
.roster-panel > p { color: var(--muted); font-size: 14px; }
.roster-list { list-style: none; padding: 0; margin: 15px 0 0; }
.roster-list li { padding: 13px 0; border-bottom: 1px solid var(--border); }
.roster-list li:last-child { border-bottom: 0; }
.roster-list strong { font-size: 14px; font-weight: 600; display: block; }
.roster-list small { display: block; color: var(--muted); }
.roster-list .roster-email { color: #354f70; overflow-wrap: anywhere; margin-top: 2px; }
.roster-status { color: #52647a; font-size: 14px; }
.roster-status.approved { color: #286045; }
.roster-status.pending { color: #856222; }
.empty-state { border-top: 1px solid var(--border); padding: 28px 0; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: 14px; }
.demo-tools { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding-top: 22px; margin-top: 27px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.student-overview { background: white; border: 1px solid var(--border); border-radius: 8px; }
.student-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; }
.student-tabs span { padding: 15px 4px; border-bottom: 3px solid var(--blue); color: var(--blue); font-size: 15px; font-weight: 600; }
.course-row { padding: 26px; display: flex; gap: 18px; align-items: start; }
.course-code { display: grid; place-items: center; width: 54px; height: 54px; flex-shrink: 0; background: #edf2f7; color: #365d89; font-size: 21px; border-radius: 6px; }
.course-row h2 { font-size: 20px; }
.course-row p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.course-availability { padding: 14px 26px; border-top: 1px solid var(--border); background: #fafbfd; color: var(--muted); font-size: 14px; }
.student-account p { font-size: 14px; color: var(--muted); margin-top: 10px; }
.student-account .details { margin: 17px 0 12px; }
.student-account .details div { grid-template-columns: 1fr; gap: 3px; font-size: 14px; }
.student-account h2 { font-size: 18px; }
.student-account button { margin-top: 12px; }
.help-page { max-width: 840px; }
.help-section { margin-top: 26px; }
.help-section h2 { font-size: 19px; }
.help-section ol { padding-left: 25px; color: #46576c; }
.help-section li { padding: 5px 0; }
.help-section p { margin-top: 10px; color: var(--muted); }
dialog { border: 1px solid #ccd5e0; padding: 26px; border-radius: 9px; width: calc(100% - 32px); max-width: 510px; color: var(--text); background: white; box-shadow: 0 18px 65px #20365133; max-height: calc(100dvh - 40px); overflow-y: auto; }
dialog::backdrop { background: #172b456b; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; gap: 15px; }
.dialog-top h2 { font-size: 22px; }
.icon-button { width: 40px; height: 40px; border-radius: 5px; color: #46576b; background: #f1f4f8; font-size: 23px; }
dialog > .muted { font-size: 14px; }
.account-options { display: grid; gap: 9px; margin-top: 21px; }
.account-option { width: 100%; display: flex; gap: 12px; align-items: center; border: 1px solid #d5dee8; background: white; border-radius: 5px; padding: 15px; text-align: left; color: var(--text); }
.account-option:hover { background: #f0f5fc; border-color: #769bc8; }
.account-avatar { width: 38px; height: 38px; background: #eaf0f7; color: #3c5c84; display: grid; place-items: center; font-size: 14px; border-radius: 50%; flex-shrink: 0; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong { display: block; font-size: 15px; }
.account-copy small { display: block; color: var(--muted); overflow-wrap: anywhere; margin-top: 3px; }
.account-arrow { color: #54759e; }
.dialog-footnote { color: var(--muted); font-size: 14px; margin-top: 18px; }
.dialog-summary { margin-top: 14px; padding: 12px 14px; background: #fff6f4; border-left: 3px solid #c96c63; color: #7a2e27; font-size: 14px; border-radius: 0 4px 4px 0; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.course-eyebrow { font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 4px; }
.status-label { white-space: nowrap; }
.status-label.pending-work { color: #9a5b00; background: #fef3c7; border: 1px solid #fde68a; }
.status-label.approved { color: #146c38; background: #dcfce7; border: 1px solid #bbf7d0; }
.status-label.neutral-status { color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; }

/* Stitch Teacher Grading Workstation */
.teacher-shell { width: 100%; background: var(--brand-surface); color: var(--brand-text); padding-bottom: 24px; }
.assignment-strip { background: #ffffff; border-bottom: 1px solid var(--brand-border); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.assignment-strip-inner { max-width: 1440px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.assignment-strip-title-group { min-width: 0; flex: 1; }
.assignment-strip-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assignment-type-badge { padding: 3px 8px; border-radius: 6px; background: var(--brand-accent-light); color: var(--brand-accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.assignment-course-tag { font-size: 13px; color: var(--brand-text-muted); }
.assignment-strip-top h1 { font-size: 22px; line-height: 1.35; font-weight: 700; color: var(--brand-primary); margin: 0; }
.assignment-strip-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--brand-text-muted); }
.meta-item-strong { color: var(--brand-primary); font-weight: 600; }
.meta-item-strong strong { font-weight: 700; color: var(--brand-primary); }
.meta-dot { color: #cbd5e1; }
.course-sub-tag { color: var(--brand-text-muted); }
.assignment-strip-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.strip-action-btn { min-height: 38px; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, border-color .15s, color .15s; }
.strip-action-btn.secondary-button { background: #ffffff; color: var(--brand-primary); border: 1px solid var(--brand-border-strong); }
.strip-action-btn.secondary-button:hover, .strip-action-btn.secondary-button.is-active { background: var(--brand-surface-low); border-color: #94a3b8; }
.strip-action-btn.primary-button { background: var(--brand-primary); color: #ffffff; border: 1px solid var(--brand-primary); }
.strip-action-btn.primary-button:hover, .strip-action-btn.primary-button.is-active { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }

.enrollment-banner { background: #dce9ff; border-bottom: 1px solid #c7d9f8; }
.enrollment-banner-inner { max-width: 1440px; margin: 0 auto; padding: 6px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.enrollment-banner-text { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #0b1c30; }
.banner-count { color: var(--brand-accent-text); font-weight: 700; }
.banner-sub { color: #45464d; font-size: 14px; }
.banner-open-btn { min-height: 30px; padding: 4px 12px; border-radius: 6px; background: var(--brand-primary); color: #ffffff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; transition: background-color .15s; }
.banner-open-btn:hover { background: var(--brand-primary-hover); }

.teacher-workspace-container { max-width: 1440px; margin: 0 auto; padding: 12px 24px 0; }

.teacher-filter-bar-card { background: #ffffff; border: 1px solid var(--brand-border); border-radius: 12px; padding: 8px 14px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-pill { min-height: 38px; padding: 6px 14px; border-radius: 8px; border: 1px solid transparent; background: var(--brand-surface-low); color: var(--brand-text); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: background-color .15s, color .15s; }
.filter-pill:hover { background: #e2e8f0; }
.filter-pill .pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.filter-pill.active-chip { background: var(--brand-accent-light); color: var(--brand-accent-text); border-color: var(--brand-accent); }
.filter-pill.active-chip .pill-count { background: #ffffff; color: var(--brand-accent-text); }

.search-and-counter { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; min-width: 240px; flex-wrap: wrap; }
.search-box-wrap { position: relative; flex: 1; max-width: 320px; min-width: 180px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #64748b; pointer-events: none; }
#teacher-student-search { width: 100%; height: 38px; padding: 4px 30px 4px 32px; border-radius: 8px; border: 1px solid var(--brand-border-strong); background: #ffffff; color: var(--brand-text); font-size: 15px; }
#teacher-student-search:focus { background: #ffffff; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(15, 37, 87, 0.15); outline: none; }
.clear-search-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: transparent; color: #475569; font-size: 16px; display: grid; place-items: center; padding: 0; }
.filter-status-line { flex: 0 1 16rem; margin: 0; font-size: 14px; font-weight: 500; color: #45464d; text-align: end; }

.mobile-pane-switcher { display: none; margin-bottom: 10px; background: #e5eeff; padding: 4px; border-radius: 8px; gap: 4px; }
.mobile-pane-btn { flex: 1; min-height: 36px; padding: 6px 10px; border-radius: 6px; background: transparent; color: #0b1c30; font-size: 14px; font-weight: 600; }
.mobile-pane-btn.is-active { background: var(--brand-accent-light); color: var(--brand-accent-text); }
.mobile-back-list-btn { display: none; min-height: 32px; padding: 4px 10px; border-radius: 6px; background: #ffffff; border: 1px solid #cbd5e1; color: #0b1c30; font-size: 14px; font-weight: 600; }

/* Master-Detail 2 Columns */
.master-detail-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.roster-master-column { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.roster-column-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.roster-column-title { font-size: 14px; font-weight: 700; color: #45464d; margin: 0; }
.roster-sort-label { font-size: 14px; font-weight: 600; color: var(--brand-primary); }

.student-card-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; scrollbar-gutter: stable; padding-right: 4px; }
.student-roster-card { flex-shrink: 0; position: relative; background: #ffffff; border: 1px solid var(--brand-border); border-radius: 10px; padding: 11px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, background-color .15s, box-shadow .15s; overflow: hidden; }
.student-roster-card:hover { border-color: #cbd5e1; background: #f8fafc; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.student-roster-card.is-selected { background: #f1f5f9; border-color: #cbd5e1; box-shadow: 0 1px 4px rgba(15, 37, 87, 0.08); }
.student-roster-card.is-selected::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--brand-accent); }

.card-top-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-student-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.roll-badge { width: 28px; height: 28px; border-radius: 6px; background: #eff4ff; color: var(--brand-primary); border: 1px solid #cbd5e1; font-size: 14px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.roll-badge.is-selected { background: var(--brand-primary); color: #ffffff; border-color: var(--brand-primary); }
.student-name-main { font-size: 17px; font-weight: 700; color: #0b1c30; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-roster-card .status-label { margin: 0; font-size: 14px; padding: 2px 9px; border-radius: 999px; }

.card-bottom-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: #45464d; }
.student-code-sub { font-size: 14px; color: #45464d; white-space: nowrap; }
.student-code-sub strong { color: #0b1c30; font-weight: 600; }
.card-score-text { font-size: 14px; color: #475569; white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-num { font-size: 16px; font-weight: 700; color: #146c38; }
.score-waiting-tag { font-size: 14px; font-weight: 600; color: #9a5b00; }
.roster-list-footnote { padding: 8px 12px; border-radius: 8px; background: #ffffff; border: 1px solid #e2e8f0; text-align: center; font-size: 14px; color: #45464d; }

/* Right Column Grading Workspace */
.grading-workspace { min-width: 0; }
.workspace-card, .workspace-empty-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); }
.workspace-empty-card, .unsubmitted-workspace-body { padding: 32px 24px; text-align: center; }
.grading-detail-header { background: #eff4ff; border-bottom: 1px solid #cbd5e1; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.detail-student-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title-row h2 { font-size: 20px; font-weight: 700; color: var(--brand-primary); margin: 0; }
.meta-chip { padding: 2px 8px; border-radius: 5px; background: #ffffff; color: #0b1c30; font-size: 14px; font-weight: 600; border: 1px solid #cbd5e1; white-space: nowrap; }
.detail-title-row .status-label { margin: 0; font-size: 14px; padding: 2px 10px; border-radius: 999px; }
.detail-sub-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: #334155; }
.timing-badge { padding: 1px 8px; border-radius: 4px; background: #ffffff; color: var(--brand-primary); font-size: 13px; font-weight: 700; }
.timing-badge.late { color: #ba1a1a; background: #ffdad6; }
.detail-nav-group { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-step-btn { min-height: 32px; padding: 4px 10px; border-radius: 6px; background: #ffffff; color: #0b1c30; border: 1px solid #cbd5e1; font-size: 14px; font-weight: 600; }
.nav-step-btn:hover:not(:disabled) { background: #eff6ff; border-color: #93c5fd; color: var(--brand-primary); }
.nav-step-btn:disabled { opacity: 0.55; background: #e5eeff; color: #64748b; }

.workspace-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.evidence-section { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.evidence-label { font-size: 15px; font-weight: 700; color: #0b1c30; }
.evidence-answer-box { padding: 8px 12px; border-radius: 8px; background: #eff4ff; border: 1px solid #dbeafe; color: #0b1c30; font-size: 17px; line-height: 1.5; }
.evidence-attachments-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.attachment-box { padding: 8px 12px; border-radius: 8px; background: #eff4ff; border: 1px solid #dbeafe; display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; min-height: 50px; }
.attachment-box.empty-attachment { background: #f8fafc; border-color: #e2e8f0; }
.attachment-info { display: flex; align-items: center; gap: 10px; min-width: 180px; flex: 1 1 200px; }
.attachment-icon { width: 34px; height: 34px; border-radius: 7px; background: #dce1ff; color: #001551; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.attachment-icon.file-icon { background: #ffdad6; color: #93000a; }
.attachment-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.attachment-text strong { font-size: 15px; font-weight: 600; color: #0b1c30; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-text a { font-size: 14px; color: var(--brand-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-open-btn { min-height: 32px; padding: 4px 10px; border-radius: 6px; background: #ffffff; border: 1px solid #cbd5e1; color: #0b1c30; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.attachment-open-btn:hover { background: #e5eeff; border-color: #93c5fd; }
.sim-file-note { padding: 2px 8px; border-radius: 5px; background: #dce9ff; color: #334155; font-size: 14px; font-weight: 500; flex-shrink: 0; }

/* Scoring and Feedback Form Card */
.grading-form-card { padding: 12px 14px; border-radius: 10px; background: #eff4ff; border: 1px solid #cbd5e1; display: flex; flex-direction: column; gap: 8px; }
.grading-form-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.grading-form-top h3 { font-size: 17px; font-weight: 700; color: #0b1c30; margin: 0; }
.save-state-pill { padding: 3px 10px; border-radius: 999px; background: #d3e4fe; color: #1e293b; font-size: 14px; font-weight: 600; }
.save-state-pill.is-saved { background: #dcfce7; color: #146c38; border: 1px solid #bbf7d0; }
.save-state-pill.is-dirty { background: #fef3c7; color: #9a5b00; border: 1px solid #fde68a; }

.grading-form-columns { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.score-column, .feedback-column { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-label-bold { font-size: 15px; font-weight: 700; color: #0b1c30; }
.req-mark { color: #ba1a1a; }
.score-input-row { display: flex; align-items: center; gap: 8px; }
#grade-score { width: 96px; height: 42px; text-align: center; font-size: 18px; font-weight: 700; color: var(--brand-text); background: #ffffff; border: 1.5px solid var(--brand-border-strong); border-radius: 8px; padding: 4px 8px; transition: border-color .15s, box-shadow .15s; }
#grade-score:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(15, 37, 87, 0.15); outline: none; background: #ffffff; }
.score-unit-label { font-size: 16px; font-weight: 600; color: #334155; }
.score-hint-text { font-size: 14px; color: #475569; margin: 0; }
.compact-chips { margin-top: 2px; gap: 6px; }
.feedback-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.optional-hint { font-size: 14px; color: #475569; }
#grade-feedback { width: 100%; border: 1px solid var(--brand-border-strong); border-radius: 8px; background: #ffffff; padding: 8px 12px; font-size: 15px; line-height: 1.5; color: var(--brand-text); resize: vertical; transition: border-color .15s, box-shadow .15s; }
#grade-feedback:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(15, 37, 87, 0.15); outline: none; }
#grade-form .form-error { min-height: 0; margin: 2px 0; font-weight: 600; }
.grading-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid #dbeafe; }
.save-status-indicator { font-size: 14px; color: #45464d; font-weight: 500; }
.saved-confirm-text { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: var(--status-graded-bg); color: var(--status-graded-text); font-weight: 700; }
.saved-confirm-check { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .just-saved .saved-confirm-text { animation: grade-saved 650ms ease-out; }
  .just-saved .saved-confirm-check { animation: grade-check 480ms ease-out; }
  @keyframes grade-saved {
    0%, 25% { box-shadow: 0 0 0 3px var(--status-graded-border); }
    100% { box-shadow: 0 0 0 5px transparent; }
  }
  @keyframes grade-check {
    0% { transform: scale(.65); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
  }
}
.unsaved-draft-text { color: #9a5b00; font-weight: 700; }
.save-grade-btn { min-inline-size: 132px; min-height: 42px; padding: 8px 22px; border-radius: 8px; font-size: 15px; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); transition: background-color .15s, border-color .15s; }

.save-grade-btn:disabled { background: var(--status-graded-text); border-color: var(--status-graded-text); color: #ffffff; box-shadow: none; cursor: default; }

/* Enrollment Modal */
.enrollment-modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.enrollment-modal-backdrop[hidden] { display: none !important; }
.enrollment-modal-card { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 12px; max-width: 540px; width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18); }
.enrollment-modal-header { padding: 14px 18px; background: #e5eeff; border-bottom: 1px solid #cbd5e1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.enrollment-modal-header h2 { font-size: 18px; font-weight: 700; color: #0b1c30; }
.enrollment-modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.enrollment-request-list { display: flex; flex-direction: column; gap: 10px; }
.enrollment-request-card { padding: 12px 14px; border-radius: 9px; background: #eff4ff; border: 1px solid #cbd5e1; display: flex; flex-direction: column; gap: 10px; }
.enrollment-request-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.enrollment-request-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.enrollment-modal-footer { padding: 10px 18px; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; }
.compact-empty { padding: 14px 0; }
.classroom-grid { grid-template-columns: minmax(0, 1fr) 290px; }
.classroom-main { display: grid; gap: 22px; min-width: 0; }
.assignment-card { display: grid; gap: 16px; }
.assignment-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.trial-badge { display: inline-block; font-size: 14px; font-weight: 600; color: #2b5a8e; background: #eaf2fc; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }
.assignment-instructions { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px 16px; font-size: 15px; color: #2d3c4e; }
.assignment-meta { margin: 4px 0 0; }
.score-highlight { display: inline-block; background: #eaf4ed; border: 1px solid #c5decb; border-radius: 5px; padding: 3px 10px; font-size: 16px; color: #1f5138; }
.score-sub { font-size: 14px; color: #3c6952; margin-left: 4px; }
.feedback-box { background: #f4faf6; border: 1px solid #c5decb; border-radius: 6px; padding: 12px 15px; font-size: 14px; color: #254032; }
.score-waiting { display: inline-block; background: #fff9eb; border: 1px solid #ecd9a8; border-radius: 5px; padding: 3px 10px; font-size: 14px; color: #6e5017; }
.previous-grade-note { padding: 10px 14px; background: #fff9eb; border-left: 3px solid #dec587; font-size: 14px; color: #6e5017; border-radius: 0 4px 4px 0; }
.submitted-summary { border-top: 1px solid var(--border); padding-top: 14px; }
.submitted-summary h3 { font-size: 16px; margin-bottom: 8px; }
.compact-details { margin: 10px 0 0; }
.compact-details div { padding: 9px 0; font-size: 15px; }
.mock-file-tag { display: inline-block; background: #eef3f8; border: 1px solid #cbd6e2; padding: 2px 8px; border-radius: 4px; font-size: 14px; font-weight: 600; color: #314a68; }
.small-note { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.submission-panel h2 { margin-bottom: 6px; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.active-chip { background: #eaf2fc; border-color: var(--blue); color: #194782; }
.mock-file-field { min-width: 0; }
.file-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 154px; padding: 22px 16px; background: #f8f9ff; border: 2px dashed var(--brand-border-strong); border-radius: 10px; color: var(--brand-primary); text-align: center; transition: border-color .15s, background-color .15s; }
.file-dropzone:hover, .file-dropzone.is-dragover { border-color: var(--brand-primary); background: #edf2ff; }
.file-dropzone strong { font-size: 16px; line-height: 1.5; }
.file-drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #e3e9ff; }
.file-drop-hint { color: #475569; font-size: 14px; }
.file-demo-note { margin-top: 7px; font-size: 14px; color: #9A3412; }
.file-samples { margin-top: 10px; font-size: 14px; color: var(--muted); }
.file-samples summary { cursor: pointer; }
.submission-actions { flex-direction: column; align-items: stretch; }
.submission-send-button { width: 100%; min-height: 46px; }
.submission-actions > .text-button { align-self: center; }
.sim-tag { display: inline-block; font-size: 14px; font-weight: 600; color: #6e5017; background: #fef0d5; border: 1px solid #e5c98f; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.selected-mock-file { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-surface-low); color: var(--brand-text); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.selected-mock-file > span { min-width: 0; overflow-wrap: anywhere; }
.selected-mock-file strong, .selected-mock-file small { display: block; }
.selected-mock-file strong { font-size: 15px; }
.selected-mock-file small { color: var(--muted); font-size: 14px; }
.selected-mock-file .text-button { flex: none; }
.assignment-manage-panel { margin-bottom: 22px; }
.create-assignment-box { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #cbd6e2; }
.warning-inline { margin-top: 12px; padding: 10px 14px; background: #fff6f4; border-left: 3px solid #c96c63; color: #7a2e27; font-size: 14px; border-radius: 0 4px 4px 0; }
.grade-inputs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grading-panel { margin-bottom: 22px; border: 2px solid #3568a8; background: #fcfdff; }
.stale-warning { margin: 12px 0; padding: 12px 14px; background: #fff4f2; border: 1px solid #deb0a8; border-radius: 6px; color: #7d281e; font-size: 14px; display: grid; gap: 8px; }
.grading-table-panel { margin-bottom: 24px; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.filter-status-line { font-size: 15px; color: var(--muted); margin-top: 4px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
/* (Old filter-pill styling removed in favor of Stitch shared tokens above) */
.table-scroll { width: 100%; overflow-x: auto; }
.gradebook-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.gradebook-table th { font-size: 14px; text-align: left; font-weight: 600; color: #4d5d71; border-bottom: 1px solid #cdd7e3; background: #f8fafc; padding: 12px 14px; white-space: nowrap; }
.gradebook-table td { padding: 14px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.gradebook-table tr.active-grade-row { background: #eef5fc; }
.gradebook-table .col-roll { width: 68px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.gradebook-table .col-status { width: 120px; white-space: nowrap; }
.gradebook-table .col-score { width: 130px; }
.gradebook-table .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gradebook-table .col-action { width: 160px; white-space: nowrap; }
.gradebook-table .status-label { margin-bottom: 0; font-size: 14px; padding: 4px 10px; }
.student-name-main { font-size: 17px; font-weight: 600; color: var(--text); display: inline; margin-right: 8px; }
.student-code-sub { font-size: 14px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.score-num { font-size: 18px; font-weight: 700; color: #1f5138; }
.score-waiting-tag { font-size: 15px; font-weight: 600; color: #805610; }
.table-action-button { min-height: 40px; padding: 7px 14px; font-size: 15px; }
.filter-empty-state { padding: 24px 4px 8px; }
.teacher-requests-panel { margin-bottom: 24px; }
.roster-details { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.roster-details summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--blue); }
.compact-roster-list { max-height: 320px; overflow-y: auto; padding-right: 4px; }
.toast { position: fixed; z-index: 50; bottom: 22px; left: 50%; transform: translate(-50%,15px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px); width: max-content; background: #243b55; color: white; border-radius: 6px; padding: 13px 20px; font-size: 14px; box-shadow: 0 4px 16px #142c4422; transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.storage-warning { background: #fff0d2; color: #6f4b18; font-size: 14px; padding: 12px 24px; text-align: center; }
.noscript { padding: 20px; color: #8e392b; }
@media (max-width: 1000px) {
  .login-layout { grid-template-columns: minmax(0,1fr) 365px; gap: 30px; }
  .workspace-grid, .classroom-grid { grid-template-columns: minmax(0,1fr) 260px; gap: 20px; }
  .login-intro h1 { font-size: 30px; }
  .panel, .login-box { padding: 24px; }
  .header-course-context { display: none; }
  .master-detail-grid { grid-template-columns: 280px minmax(0, 1fr); gap: 12px; }
  .grading-form-columns { grid-template-columns: 1fr; gap: 10px; }
  .evidence-attachments-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 780px) {
  .header-inner { padding: 8px 14px; gap: 6px 10px; flex-wrap: wrap; }
  .header-demo-pill, .header-divider, .header-course-context, .teacher-only-flex { display: none !important; }
  .brand strong { font-size: 16px; }
  .brand-mark { width: 46px; height: 46px; }
  .header-actions { width: 100%; min-width: 0; max-width: 100%; justify-content: flex-start; gap: 6px; }
  .header-actions .help-nav, .header-actions .nav-mode-label { display: none; }
  .nav-button { font-size: 14px; padding: 5px 8px; min-height: 32px; max-width: 100%; flex-wrap: wrap; }
  .page { padding: 22px 16px 32px; }
  .assignment-strip-inner { padding: 10px 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .assignment-strip-actions { width: 100%; }
  .strip-action-btn { flex: 1; justify-content: center; }
  .enrollment-banner-inner, .teacher-workspace-container { padding-left: 14px; padding-right: 14px; }
  .assignment-strip-top h1 { font-size: 18px; }
  .mobile-pane-switcher { display: flex; }
  .mobile-back-list-btn { display: inline-flex; align-items: center; }
  .master-detail-grid { grid-template-columns: 1fr; }
  .student-card-list { max-height: none; }
  .teacher-shell[data-mobile-pane="detail"] .roster-master-column { display: none; }
  .teacher-shell[data-mobile-pane="list"] .grading-workspace { display: none; }
  h1 { font-size: 26px; }
  .login-layout { grid-template-columns: 1fr; gap: 26px; }
  .login-intro { padding: 0; }
  .login-intro h1 { font-size: 29px; margin: 6px 0 12px; }
  .subject-section { display: none; }
  .login-box { max-width: 520px; width: 100%; }
  .login-intro .page-callout { display: none; }
  .intro-text { font-size: 16px; }
  .demo-strip { padding: 6px 14px; font-size: 14px; }
  .site-footer { padding: 16px; flex-direction: column; gap: 3px; font-size: 14px; }
  .workspace-grid, .classroom-grid { grid-template-columns: 1fr; }
  .grade-inputs-grid { grid-template-columns: 1fr; gap: 0; }
  .workspace-heading { flex-wrap: wrap; gap: 12px; }
  .workspace-heading .status-label { margin: 0; }
  .workspace-heading p { font-size: 14px; }
  .summary-line { gap: 12px 22px; font-size: 14px; }
  .topline { gap: 10px; }
  .session { max-width: 68%; gap: 0 12px; }
  .access-page { padding-top: 20px; }
  .access-panel { padding: 24px; }
  .access-panel h1 { font-size: 25px; }
  .progress { margin-bottom: 24px; }
  .progress li { font-size: 14px; }
  .details div { grid-template-columns: 115px minmax(0,1fr); gap: 10px; font-size: 14px; }
  .student-account .details div { grid-template-columns: 1fr; }
  .demo-tools { align-items: start; flex-direction: column; gap: 9px; }
  .roster-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .roster-list li { border: 0; padding: 5px 0; }
  .roster-list strong { font-size: 14px; }
  .course-row { padding: 22px; }
  .course-availability { padding: 15px 22px; }
}
@media (max-width: 460px) {
  .brand { gap: 7px; }
  .brand strong { font-size: 14px; }
  .header-actions { gap: 5px; }
  .nav-button { padding: 4px 7px; font-size: 14px; gap: 4px; }
  .nav-badge, .nav-auth-badge { font-size: 13px; padding: 1px 6px; }
  .page { padding-left: 12px; padding-right: 12px; }
  .header-inner { padding: 8px 12px; gap: 6px 8px; }
  .assignment-strip-inner, .enrollment-banner-inner, .teacher-workspace-container { padding-left: 10px; padding-right: 10px; }
  .search-and-counter { min-width: 100%; justify-content: space-between; }
  .search-box-wrap { max-width: 100%; min-width: 100%; }
  .filter-status-line { flex-basis: 100%; text-align: start; }
  .grading-detail-header, .workspace-body, .grading-form-card { padding: 12px; }
  .panel, .login-box, .access-panel { padding: 18px 14px; }
  .roster-list { grid-template-columns: 1fr; gap: 0; }
  .roster-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .roster-list strong { font-size: 14px; }
  .details div { grid-template-columns: 1fr; gap: 4px; }
  .login-intro h1 { font-size: 26px; }
  .login-preview-link { font-size: 14px; }
  .course-code { width: 42px; height: 42px; font-size: 18px; }
  .course-row { gap: 13px; }
  .toast { width: calc(100% - 24px); }
}
/* ==========================================================================
   Google Auth & Classroom Access Views (Zero-Inline-Style CSP Compliant)
   ========================================================================== */
.auth-page-main { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
.auth-nav-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: #1e293b; border-radius: 6px; }
.auth-nav-avatar { width: 24px; height: 24px; background: #3b82f6; color: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.auth-nav-email { color: #f8fafc; font-size: 14px; font-weight: 600; }
.auth-nav-role { margin: 0; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.auth-nav-logout-form { display: inline; margin: 0; }
.auth-login-top { margin-bottom: 16px; }
.auth-login-title { font-size: 26px; margin: 0; }
.auth-login-subtitle { font-size: 16px; color: #475569; margin-bottom: 20px; }
.auth-login-callout { margin: 0 0 24px; }
.auth-callout-text { margin: 6px 0 0; }
.auth-google-btn-wrap { text-align: center; padding: 20px 0; }
.auth-google-btn { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; padding: 12px 28px; }
.auth-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid #e2e8f0; padding-bottom: 16px; margin-bottom: 20px; }
.auth-role-badge { margin-bottom: 8px; }
.auth-view-title { font-size: 24px; margin: 0; }
.auth-view-subtext { margin: 4px 0 0; color: #64748b; font-size: 14px; }
.auth-view-subtext-student { margin: 6px 0 0; color: #64748b; font-size: 14px; }
.auth-message-callout { margin-bottom: 20px; border-color: #16a34a; background: #f0fdf4; color: #166534; }
.auth-error-inline { margin-bottom: 20px; }
.auth-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.auth-stat-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; text-align: center; }
.offering-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
a.offering-card { display: block; color: inherit; text-decoration: none; }
a.offering-card .auth-stat-val { font-size: 17px; line-height: 1.4; }
a.offering-card:hover { border-color: var(--brand-primary); background: #ffffff; }
a.offering-card:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.auth-stat-card-approved { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px; text-align: center; }
.auth-stat-card-pending { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px; text-align: center; }
.auth-stat-label { color: #64748b; font-size: 13px; display: block; }
.auth-stat-label-approved { color: #166534; font-size: 13px; display: block; }
.auth-stat-label-pending { color: #92400e; font-size: 13px; display: block; }
.auth-stat-val { font-size: 22px; color: #0f172a; }
.auth-stat-val-approved { font-size: 22px; color: #15803d; }
.auth-stat-val-pending { font-size: 22px; color: #b45309; }
.auth-section-box { margin-bottom: 32px; }
.auth-section-top { margin-bottom: 12px; }
.auth-section-h2 { font-size: 19px; margin: 0; }
.auth-table-wrap { overflow-x: auto; }
.auth-request-table { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; width: 100%; border-collapse: collapse; }
.auth-th { padding: 10px 14px; text-align: left; }
.auth-th-right { padding: 10px 14px; text-align: right; }
.auth-th-center { padding: 10px 14px; text-align: center; }
.auth-td { padding: 12px 14px; }
.auth-td-bold { padding: 12px 14px; font-weight: 600; }
.auth-td-email { padding: 12px 14px; color: #1e40af; }
.auth-td-actions { padding: 12px 14px; text-align: right; white-space: nowrap; }
.auth-action-form { display: inline; margin-right: 6px; }
.auth-action-form-last { display: inline; }
.auth-btn-action { min-height: 34px; padding: 4px 14px; font-size: 14px; }
.auth-btn-reject { min-height: 34px; padding: 4px 12px; font-size: 14px; color: #b91c1c; }
.auth-empty-box { padding: 24px; border: 1px dashed #cbd5e1; border-radius: 8px; text-align: center; }
.auth-empty-text { margin: 0; color: #64748b; }
.auth-roster-scroll { overflow-x: auto; max-height: 480px; border: 1px solid #e2e8f0; border-radius: 8px; }
.auth-roster-table { background: #fff; margin: 0; width: 100%; border-collapse: collapse; }
.auth-roster-thead-row { position: sticky; top: 0; background: #f8fafc; z-index: 2; }
/* Keep a returned-to student row visible below the sticky table header. */
.classroom-student-row { scroll-margin-top: 64px; }
.classroom-student-row:target { background: #eff6ff; }
#assignment-overview .auth-roster-scroll { scroll-padding-top: 50px; }
#assignment-overview tbody tr:target { background: #eaf2ff; }
.auth-th-rollno { padding: 10px 14px; width: 70px; text-align: left; }
.auth-th-id { padding: 10px 14px; width: 90px; text-align: left; }
.auth-th-status { padding: 10px 14px; width: 140px; text-align: center; }
.auth-td-roster { padding: 10px 14px; }
.auth-td-roster-bold { padding: 10px 14px; font-weight: 600; }
.auth-td-roster-muted { padding: 10px 14px; color: #334155; }
.auth-td-roster-center { padding: 10px 14px; text-align: center; }
.auth-status-unlinked { margin: 0; background: #f1f5f9; color: #64748b; }
.auth-status-pending { margin: 0; }
.auth-status-approved { margin: 0; }
.auth-muted-dash { color: #94a3b8; }
.auth-student-header { border-bottom: 1px solid #e2e8f0; padding-bottom: 16px; margin-bottom: 20px; }
.auth-student-role-badge { background: #f1f5f9; color: #475569; margin-bottom: 8px; }
.auth-student-pending-badge { background: #fef3c7; color: #92400e; margin-bottom: 8px; }
.auth-student-rejected-badge { margin-bottom: 8px; }
.auth-student-info-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.auth-info-title { font-size: 18px; margin: 0 0 12px; color: #0f172a; }
.auth-details-list { margin: 0; border: 0; }
.auth-details-item { padding: 8px 0; }
.auth-details-label { color: #64748b; }
.auth-student-approved-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 20px; margin-bottom: 24px; }
.auth-approved-title { font-size: 18px; margin: 0 0 12px; color: #166534; }
.auth-student-approved-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.auth-grid-label { color: #166534; font-size: 13px; display: block; }
.auth-grid-val-name { font-size: 17px; color: #0f172a; }
.auth-grid-val-email { font-size: 15px; color: #1e40af; font-weight: 600; }
.auth-callout-approved { border-color: #3b82f6; background: #eff6ff; color: #1e3a8a; }
.auth-callout-rejected { border-color: #ef4444; background: #fef2f2; color: #991b1b; margin-bottom: 24px; }
.auth-link-form { max-width: 480px; }
.auth-input-id { font-size: 18px; letter-spacing: 1px; }
.auth-form-submit-btn { padding: 10px 24px; }
.auth-form-actions-top { margin-top: 20px; }
.auth-section-divider { margin-top: 24px; border-top: 1px solid #e2e8f0; padding-top: 16px; }
.auth-info-footer { margin-top: 24px; padding: 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.auth-footer-title { font-size: 16px; margin: 0 0 8px; color: #334155; }
.auth-footer-text { margin: 0; font-size: 14px; color: #64748b; line-height: 1.6; }
.auth-return-link-wrap { margin-top: 16px; }

/* ==========================================================================
   Classroom Assignment, Submission, and Grading Styles (Zero-Inline-Style CSP)
   ========================================================================== */
.classroom-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 22px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.classroom-header-badge { margin-bottom: 10px; }
.classroom-title { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 8px; line-height: 1.4; }
.classroom-meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; color: #475569; font-size: 14px; }
.classroom-meta-item strong { color: #0f172a; }
.classroom-instructions { background: #f8fafc; border-left: 4px solid #3b82f6; padding: 14px 16px; margin-bottom: 20px; font-size: 15px; color: #334155; line-height: 1.6; border-radius: 0 8px 8px 0; }
.classroom-result-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px; padding: 20px; margin-bottom: 24px; }
.classroom-result-title { font-size: 18px; font-weight: 700; color: #166534; margin: 0 0 12px; }
.classroom-score-box { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 18px; background: #ffffff; border: 1px solid #bbf7d0; border-radius: 8px; margin-bottom: 12px; }
.classroom-score-val { font-size: 32px; font-weight: 700; color: #15803d; line-height: 1; }
.classroom-score-max { font-size: 16px; color: #64748b; }
.classroom-feedback-box { background: #ffffff; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px 16px; margin-top: 8px; }
.classroom-feedback-label { font-size: 13px; font-weight: 600; color: #166534; display: block; margin-bottom: 4px; }
.classroom-feedback-text { font-size: 15px; color: #1e293b; margin: 0; line-height: 1.6; }
.classroom-submission-view { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.classroom-submission-title { font-size: 14px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.classroom-submission-text { background: transparent; border: 0; border-left: 3px solid #94a3b8; border-radius: 0; padding: 4px 0 4px 12px; font-size: 15px; color: #1e293b; white-space: pre-wrap; word-break: break-word; margin: 0; line-height: 1.6; }
.classroom-submission-link-wrap { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px 12px; word-break: break-all; }
.classroom-submission-link { font-size: 15px; color: #1d4ed8; font-weight: 500; text-decoration: underline; }
.classroom-form { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
.classroom-textarea { width: 100%; min-height: 110px; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 15px; line-height: 1.6; font-family: inherit; }
.classroom-textarea:focus { outline: 3px solid #3378cc; outline-offset: 2px; }
.classroom-input { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 15px; font-family: inherit; }
.classroom-input:focus { outline: 3px solid #3378cc; outline-offset: 2px; }
.classroom-input-score { width: 140px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 18px; font-weight: 600; }
.classroom-grade-pane { background: #f8fafc; border: 2px solid #2563eb; border-radius: 10px; padding: 24px; margin-top: 28px; scroll-margin-top: 20px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); }
.classroom-grade-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.classroom-grade-student-title { font-size: 20px; margin: 0; color: #0f172a; }
.classroom-grade-sub { font-size: 14px; color: #64748b; margin-top: 4px; }
.classroom-status-waiting { margin: 0; background: #fef3c7; color: #92400e; font-weight: 600; }
.classroom-score-display-cell { font-weight: 600; color: #15803d; }
.classroom-score-zero-cell { font-weight: 600; color: #b91c1c; }
.classroom-score-pending-cell { color: #b45309; }


@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Teacher assignment management */
.manage-details { margin: 8px 0 16px; }
.manage-details summary { cursor: pointer; padding: 8px 0; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.manage-action-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.manage-confirm { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }

/* Gradebook: header row and student columns stay put so scores are copied to the right person */
.gb-room-link { display: inline-flex; min-height: 32px; padding: 4px 12px; margin: 2px 4px 2px 0; }
.gb-summary { margin-top: 16px; }
.gb-warn { color: var(--status-pending-text); }
.gb-scroll { max-height: 70vh; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; margin-top: 8px; }
.gb-scroll:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.gb-table { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 100%; }
.gb-table th, .gb-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; border-right: 1px solid #eef2f6; background: #ffffff; text-align: center; }
.gb-table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; vertical-align: bottom; font-weight: 600; color: #334155; }
.gb-table .gb-sticky { position: sticky; z-index: 1; text-align: left; }
.gb-table thead .gb-sticky { z-index: 3; }
.gb-table .gb-roll { left: 0; width: 52px; min-width: 52px; }
.gb-table .gb-name { left: 52px; min-width: 190px; border-right: 2px solid #cbd5e1; font-weight: 500; }
.gb-col { min-width: 96px; max-width: 160px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.gb-col a { color: inherit; }
.gb-max, .gb-id { display: block; font-size: 12px; font-weight: 400; color: #64748b; }
.gb-uncounted { color: #94a3b8; }
.gb-table tbody tr:nth-child(even) > * { background: #f8fafc; }
.gb-table tbody tr:hover > * { background: #eef4ff; }
.gb-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.gb-graded { color: #0f172a; font-weight: 600; }
.gb-zero { color: #b91c1c; }
.gb-table .gb-pending { color: var(--status-pending-text); background: var(--status-pending-bg); font-size: 13px; }
.gb-table .gb-missing { color: var(--status-unsubmitted-text); font-size: 13px; }
.gb-total { border-left: 2px solid #cbd5e1; }
@media print {
  .site-header, .demo-strip, .gb-picker, .auth-header-row nav { display: none; }
  .gb-scroll { max-height: none; overflow: visible; border: 0; }
  .gb-table .gb-sticky, .gb-table thead th { position: static; }
}
@media (max-width: 640px) {
  .gb-table .gb-roll { width: 40px; min-width: 40px; }
  .gb-table .gb-name { left: 40px; min-width: 120px; max-width: 120px; white-space: normal; }
  .gb-col { min-width: 80px; }
}

/* Student to-do and assignment rows */
.student-task-list { list-style: none; margin: 0; padding: 0; }
.student-task { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid #e2e8f0; }
.student-task:first-child { border-top: 0; }
.student-task-title { font-weight: 600; flex: 1 1 220px; }
.student-task-meta { color: #64748b; font-size: 14px; flex: 1 1 160px; }
.student-task-status { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.student-todo { border-color: var(--status-pending-border); }

/* Teacher: pending count on room cards, roster filter, spacing before assignment settings */
.roster-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.roster-filter a { min-height: 36px; padding: 6px 14px; }
#assignment-manage { margin-top: 28px; }
@media (max-width: 640px) {
  .auth-stats-grid:not(.offering-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Status bar: graded / waiting / not handed in, same order and colours everywhere; numbers always beside it. */
.status-bar { margin: 14px 0 6px; }
.status-bar svg { display: block; width: 100%; height: 14px; border-radius: 7px; background: var(--status-unsubmitted-bg); }
.status-bar-compact { margin: 8px 0 0; }
td .status-bar-compact { min-width: 160px; }
.status-bar-compact svg { height: 8px; border-radius: 4px; }
.sb-graded { fill: #059669; background: #059669; }
.sb-pending { fill: #F59E0B; background: #F59E0B; }
.sb-missing { fill: #CBD5E1; background: #CBD5E1; }
.status-bar-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; color: var(--status-unsubmitted-text); font-size: .95rem; }
.status-bar-compact .status-bar-legend { gap: 2px 10px; margin-top: 4px; font-size: .82rem; }
.status-bar-legend strong { color: var(--brand-text, #0F172A); }
.sb-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: baseline; }

/* Real upload box (Worker): the native input is stretched invisibly over the dashed box. */
.field .upload-zone { position: relative; display: flex; margin-bottom: 0; color: var(--brand-primary); cursor: pointer; overflow-wrap: anywhere; }
.upload-zone .upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-zone:focus-within { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.field .upload-zone.has-file { border-style: solid; border-color: #059669; background: #ecfdf5; color: #065F46; }
.upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.upload-list li, .submission-files li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.upload-list li { padding: 8px 10px; border: 1px solid var(--brand-border); border-radius: 8px; background: #fff; }
.upload-list .text-button { margin-left: auto; min-width: 44px; min-height: 44px; }
.upload-preview { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex: none; }
.submission-files { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.submission-files .submission-image-link { flex-basis: 100%; }
.keep-files { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--brand-border); border-radius: 8px; }
.keep-files legend { padding: 0 4px; font-weight: 600; font-size: 15px; }
/* A submitted picture is shown in place; the link opens it full size. */
.submission-image-link { display: block; margin: 6px 0 4px; }
.submission-image { display: block; max-width: 100%; max-height: 480px; border: 1px solid var(--brand-border); border-radius: 8px; object-fit: contain; background: #fff; }
