:root {
  --ui-bg: #f7fafc;
  --ui-surface: #ffffff;
  --ui-soft: #edf6ff;
  --ui-soft-2: #f8fbff;
  --ui-text: #1f2937;
  --ui-muted: #718096;
  --ui-line: #dbe5f1;
  --ui-primary: #2f80d0;
  --ui-primary-strong: #1769c2;
  --ui-success: #20a464;
  --ui-warning: #d88916;
  --ui-danger: #e5484d;
  --ui-purple: #6d5bd0;
  --ui-radius: 12px;
  --ui-radius-sm: 8px;
  --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.05);
}

* {
  letter-spacing: 0;
}

html,
body {
  background: var(--ui-bg);
}

body {
  color: var(--ui-text);
  font-family: "Kanit", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

button,
.button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--ui-bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 258px;
  height: 100vh;
  min-height: 100vh;
  padding: 28px 28px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--ui-line);
  background: #ffffff;
  color: var(--ui-text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0;
  border: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ui-primary);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(47, 128, 208, 0.18);
  font-size: 20px;
  font-weight: 600;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.brand-mark::before {
  display: none;
}

.login-brand-icon {
  display: block;
  width: 104px;
  height: 104px;
  margin-bottom: 24px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(11, 99, 246, 0.22);
}

@media (max-width: 640px) {
  .login-brand-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 18px;
  }
}

.brand strong {
  display: block;
  color: var(--ui-text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 400;
}

.mobile-menu-toggle {
  display: none;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--ui-radius-sm);
  color: #68768f;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: #e9f5ff;
  color: var(--ui-primary);
  font-weight: 500;
}

.main-nav i {
  width: 20px;
  text-align: center;
  font-size: 17px;
}

.nav-dot {
  display: none;
}

.sidebar-spacer {
  flex: 1 1 auto;
}

.ai-sidebar-card,
.sidebar-account {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid #a9d5ff;
  border-radius: var(--ui-radius);
  background: #f2f8ff;
}

.ai-sidebar-card {
  text-align: center;
}

.ai-sidebar-card i {
  color: var(--ui-primary);
  font-size: 24px;
}

.ai-sidebar-card strong,
.sidebar-account strong {
  color: var(--ui-text);
  font-weight: 600;
}

.ai-sidebar-card p,
.sidebar-account small {
  margin: 0;
  color: var(--ui-muted);
  font-size: 13px;
}

.sidebar-account {
  background: #ffffff;
  border-color: var(--ui-line);
}

.sidebar-account .text-link,
.sidebar-account a {
  color: var(--ui-primary);
}

.main-panel {
  min-width: 0;
  padding: 28px 30px;
}

.topbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0;
  margin-bottom: 26px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.topbar-title h1 {
  margin: 0;
  color: var(--ui-text);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

.topbar-title p,
.topbar-title .eyebrow {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.global-search {
  position: relative;
  display: block;
  min-width: 300px;
}

.global-search[hidden] {
  display: none !important;
}

.global-search span {
  position: absolute;
  left: 15px;
  top: 50%;
  color: var(--ui-muted);
  transform: translateY(-50%);
}

.global-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 76px 10px 42px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ui-text);
  outline: 0;
}

.global-search-count {
  position: absolute;
  right: 12px;
  top: 50%;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f5ff;
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transform: translateY(-50%);
}

.global-search-count[hidden] {
  display: none;
}

.is-search-hidden {
  display: none !important;
}

.notification-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--ui-primary);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}

.topbar-create-button {
  font-size: 16px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #e2eaf4;
  color: #6b778c;
  font-weight: 600;
}

.user-chip strong {
  display: block;
  max-width: 190px;
  overflow: hidden;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  display: block;
  color: var(--ui-muted);
  font-size: 12px;
}

.content-area {
  display: grid;
  gap: 22px;
  padding: 0;
}

.flash,
.dashboard-flash {
  padding: 14px 16px;
  border: 1px solid #a9d5ff;
  border-radius: var(--ui-radius);
  background: #eef8ff;
  color: #1f5d92;
}

.flash.error,
.dashboard-flash.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

.flash.warning,
.dashboard-flash.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.panel,
.card,
.assignment-item,
.login-card {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ui-shadow);
}

.panel {
  padding: 24px;
}

.card {
  padding: 24px;
}

.section-stack {
  margin-top: 0;
}

.toolbar,
.toolbar-between,
.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-between {
  justify-content: space-between;
  align-items: flex-start;
}

.class-list-header .class-list-action {
  align-self: flex-start;
  min-width: 0;
  margin-top: 0;
  white-space: nowrap;
}

.class-list-header {
  margin-bottom: 24px;
}

.teacher-class-list-header {
  margin-bottom: 24px;
}

.api-key-panel-copy {
  display: grid;
  gap: 8px;
}

.api-key-panel-copy h2,
.api-key-panel-copy p {
  margin: 0;
}

.api-key-panel-copy p {
  line-height: 1.65;
}

.api-key-panel-header {
  padding-bottom: 18px;
}

.row-actions {
  flex-wrap: wrap;
}

.row-actions.compact-actions {
  gap: 8px;
}

.grading-settings {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background: #f8fbff;
}

.grading-settings legend {
  padding: 0 6px;
  font-weight: 600;
  color: var(--ui-text);
}

.level-thresholds {
  display: grid;
  gap: 12px;
}

.level-thresholds > .help-text {
  margin: 0;
  padding-block: 8px;
  line-height: 1.55;
}

.level-thresholds[hidden] {
  display: none;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.score-level {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.score-level.very-good {
  background: #dcfce7;
  color: #166534;
}

.score-level.good {
  background: #dbeafe;
  color: #1d4ed8;
}

.score-level.fair {
  background: #fef3c7;
  color: #92400e;
}

.score-level.fail {
  background: #ffe4e6;
  color: #be123c;
}

.score-level-detail {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--ui-muted);
}

.level-score-preview {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef6ff;
  color: #234f80;
  font-weight: 600;
}

.score-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-stat-passed {
  border-color: #bbf7d0;
}

.score-stat-failed {
  border-color: #fecdd3;
}

.score-page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.score-filters {
  display: flex;
  align-items: end;
  gap: 10px;
}

.score-filters label {
  min-width: 160px;
}

.student-score-list {
  display: grid;
  gap: 14px;
}

.student-score-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  background: #ffffff;
}

.student-score-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.student-score-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.student-score-title h3 {
  margin: 0;
}

.student-score-result {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  text-align: right;
}

.student-score-number {
  color: var(--ui-primary);
  font-size: 20px;
}

.student-score-feedback {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  line-height: 1.6;
}

.student-score-feedback p {
  margin: 6px 0 0;
}

.feedback-disclosure {
  padding: 0;
  overflow: hidden;
}

.feedback-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: var(--ui-primary);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.feedback-disclosure summary::-webkit-details-marker {
  display: none;
}

.feedback-disclosure summary:hover {
  background: #f1f5f9;
}

.feedback-chevron {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.feedback-disclosure[open] .feedback-chevron {
  transform: rotate(180deg);
}

.feedback-disclosure-content {
  padding: 0 16px 14px;
  border-top: 1px solid #e2e8f0;
}

.feedback-disclosure-content p {
  margin-top: 12px;
}

.student-score-link {
  justify-self: start;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 10px;
  color: var(--ui-text);
  font-size: 20px;
  font-weight: 600;
}

h3 {
  margin-bottom: 6px;
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 600;
}

.muted {
  color: var(--ui-muted);
}

.help-text {
  margin-top: -8px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.grid.stats.dashboard-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  gap: 14px;
}

.grid.stats.dashboard-stats.score-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-item,
.stat-card {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
}

.summary-item {
  min-height: 76px;
  padding: 14px 16px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 20px;
  position: relative;
  overflow: visible;
  box-shadow: var(--ui-shadow);
}

.stat-card::after {
  content: none;
  display: none;
}

.stat-card span,
.summary-item span {
  color: var(--ui-muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin: 0;
  color: var(--ui-primary);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
}

.summary-item strong {
  display: block;
  margin: 2px 0 0;
  color: var(--ui-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-card small {
  color: var(--ui-muted);
}

.dashboard-stats .stat-card {
  min-height: 82px;
  gap: 5px;
  padding: 14px 16px;
}

.dashboard-stats .stat-card span {
  font-size: 13px;
}

.dashboard-stats .stat-card strong {
  font-size: 26px;
}

.dashboard-stats .stat-card small {
  font-size: 12px;
  line-height: 1.35;
}

.grid.stats.classroom-stats {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.classroom-stats .stat-card {
  min-height: 72px;
  padding: 12px 14px;
}

.classroom-stats .stat-card strong {
  font-size: 24px;
}

.button,
button:not(.icon-button):not(.notification-button):not(.icon-btn):not(.mobile-menu-toggle):not(.action-icon-button),
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--ui-primary);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.button:hover,
button:not(.icon-button):not(.notification-button):not(.icon-btn):not(.mobile-menu-toggle):not(.action-icon-button):hover,
input[type="submit"]:hover {
  background: var(--ui-primary-strong);
  border-color: var(--ui-primary-strong);
}

.button:disabled,
button:disabled,
input[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button.is-loading,
button.is-loading {
  pointer-events: none;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: button-spin 0.75s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.button.secondary,
button.secondary {
  border-color: var(--ui-line);
  background: #ffffff;
  color: var(--ui-primary);
}

.button.blue {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  color: #ffffff;
}

.button.danger,
button.danger {
  border-color: var(--ui-danger);
  background: var(--ui-danger);
  color: #ffffff;
}

select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #ffffff;
  color: var(--ui-text);
  outline: 0;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: #95c9f5;
  box-shadow: 0 0 0 3px rgba(47, 128, 208, 0.14);
}

label {
  color: var(--ui-text);
  font-weight: 500;
}

.field-wide {
  flex: 1 1 320px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ui-line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #5f6f89;
  font-weight: 500;
  background: #f8fbff;
}

tr:last-child td {
  border-bottom: 0;
}

.assignment-list {
  display: grid;
  gap: 14px;
}

.class-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.class-overview-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--ui-shadow);
}

.class-overview-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.class-overview-head h3 {
  margin: 0;
}

.class-overview-head > div {
  min-width: 0;
}

.class-overview-head .class-overview-status {
  margin-top: 7px;
}

.class-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.class-overview-metrics span {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #f8fbff;
  color: var(--ui-muted);
  font-size: 13px;
}

.class-overview-metrics strong {
  display: block;
  color: var(--ui-primary);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.class-overview-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-card-action {
  justify-self: end;
}

.teacher-class-detail-card {
  display: grid;
  gap: 12px;
}

.teacher-class-detail-card .side-card-head {
  margin-bottom: 4px;
}

.teacher-class-detail-card .side-card-head h2 {
  margin-top: 2px;
  line-height: 1.25;
}

.teacher-class-detail-card .side-metrics {
  margin-top: 0;
}

.teacher-class-detail-mobile {
  display: none;
}

.teacher-class-detail-desktop {
  display: grid;
}

.teacher-class-detail-card .side-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.class-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.class-detail-stats span {
  display: grid;
  gap: 2px;
  min-height: 56px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.class-detail-stats strong {
  color: #0b63f6;
  font-size: 20px;
  font-weight: 600;
}

@media (min-width: 560px) {
  .class-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.classroom-assignment-list {
  gap: 16px;
}

.classroom-assignment-item {
  display: grid;
  gap: 14px;
  border-color: #d4e4f5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 18px 42px rgba(26, 74, 126, 0.08);
}

.classroom-assignment-item h3 {
  margin: 0 0 4px;
}

.classroom-assignment-item > details {
  padding-top: 10px;
  border-top: 1px solid var(--ui-line);
}

.classroom-assignment-item > details summary {
  color: var(--ui-primary);
  font-weight: 600;
  cursor: pointer;
}

.classroom-assignment-item .action-menu-panel .button,
.classroom-assignment-item .action-menu-panel button,
.classroom-assignment-item .action-menu-panel a {
  justify-content: center;
  text-align: center;
}

.classroom-assignment-item .action-menu {
  align-self: flex-start;
  flex: 0 0 auto;
}

.classroom-assignment-item .action-menu-panel {
  z-index: 80;
  min-width: 136px;
  border-color: #cfe1f5;
  box-shadow: 0 18px 36px rgba(29, 78, 126, 0.14);
}

.classroom-assignment-item .action-menu[open] summary {
  border-color: #8fc2f1;
  background: #eef8ff;
}

.assignment-item {
  padding: 20px;
}

.assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--ui-muted);
  font-size: 13px;
}

.assignment-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.assignment-resource-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-primary);
  font-size: 13px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.assignment-resource-links a:hover {
  border-color: var(--ui-primary);
  background: rgba(47, 128, 208, 0.08);
}

.assignment-links-editor {
  display: grid;
  gap: 9px;
}

.assignment-links-editor .field-label {
  font-weight: 500;
}

.assignment-link-rows {
  display: grid;
  gap: 8px;
}

.assignment-link-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(220px, 1.35fr) auto;
  gap: 8px;
  align-items: center;
}

.assignment-link-row input {
  min-width: 0;
}

.assignment-link-remove {
  width: 42px;
  min-width: 42px;
  padding-inline: 0;
}

.assignment-link-add {
  justify-self: start;
}

.assignment-links-editor > .help-text {
  margin: 0;
  padding-block: 8px;
  line-height: 1.55;
}

@media (max-width: 680px) {
  .assignment-link-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .assignment-link-row input:first-child {
    grid-column: 1 / -1;
  }

  .assignment-link-row input:nth-child(2) {
    grid-column: 1;
  }

  .assignment-link-remove {
    grid-column: 2;
  }
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.pill {
  background: #edf6ff;
  color: #315f91;
}

.status.open {
  background: #e8f2ff;
  color: var(--ui-primary);
}

.status.done {
  background: #ddf8e8;
  color: #12814a;
}

.status.pending {
  background: #fff2d8;
  color: #a15c00;
}

.status.missing {
  background: #ffe4e6;
  color: #be123c;
}

.pre-wrap {
  white-space: pre-wrap;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #b8c7da;
  border-radius: var(--ui-radius);
  background: #f8fbff;
  color: var(--ui-muted);
  text-align: center;
}

.text-link,
.center-link {
  color: var(--ui-primary);
  font-weight: 500;
  text-decoration: none;
}

.center-link {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.action-menu {
  position: relative;
  width: fit-content;
}

.action-menu summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #ffffff;
  color: var(--ui-primary);
  cursor: pointer;
  list-style: none;
}

.action-menu summary:hover {
  border-color: #95c9f5;
  background: #eef8ff;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 8px;
  min-width: 150px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #ffffff;
  box-shadow: var(--ui-shadow);
}

.action-menu-panel .button,
.action-menu-panel button,
.action-menu-panel a {
  width: 100%;
  justify-content: flex-start;
}

.modal[hidden],
.confirm-modal[hidden] {
  display: none;
}

.modal,
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.38);
}

.modal-dialog,
.confirm-dialog {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.modal-dialog.wide {
  width: min(920px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--ui-line);
}

.modal-header h2 {
  margin-bottom: 4px;
}

.modal-body {
  padding: 24px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #ffffff;
  color: var(--ui-text);
  cursor: pointer;
}

.danger-zone {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #fecaca;
  border-radius: var(--ui-radius);
  background: #fff1f2;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef7;
}

.grading-summary-panel .progress-track {
  margin-top: 16px;
}

.grading-assignment-meta {
  padding-top: 6px;
}

.batch-log {
  margin: 10px 0 0;
  color: var(--ui-muted);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--ui-primary);
}

.class-switcher,
.teacher-class-bar,
.student-class-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.teacher-class-bar,
.student-class-bar {
  padding: 20px 24px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
  box-shadow: var(--ui-shadow);
}

.classroom-heading-card {
  padding: 16px 18px;
}

.static-class-summary {
  justify-content: flex-start;
  min-width: 0;
}

.class-select-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 360px;
  padding: 14px 48px 14px 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
}

.class-select-icon,
.assignment-file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #d9edff;
  color: var(--ui-primary);
}

.class-select-icon::before {
  content: "\f02d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.assignment-file-icon::before {
  content: "\f15c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.class-select-copy {
  display: grid;
  min-width: 0;
}

.class-select-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-select-copy small,
.class-switcher-label {
  color: var(--ui-muted);
  font-size: 13px;
}

.class-select-card select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.class-bar-edit-button {
  color: var(--ui-primary);
  font-size: 18px;
  font-weight: 600;
}

.class-bar-edit-button:hover {
  border-color: #95c9f5;
  background: #eef8ff;
}

.edit-icon-button {
  color: var(--ui-primary);
}

.edit-icon-button:hover {
  border-color: #95c9f5;
  background: #eef8ff;
}

.teacher-dashboard-layout,
.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

.profile-stack,
.profile-layout {
  display: grid;
  gap: 22px;
  align-items: start;
}

.profile-stack {
  grid-template-columns: minmax(0, 1fr);
}

.profile-layout {
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
}

.profile-layout > * {
  min-width: 0;
}

.profile-layout .summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.assignment-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-assignment-table {
  overflow-x: hidden;
}

.teacher-assignment-table table {
  min-width: 0;
  table-layout: fixed;
}

.teacher-assignment-table th,
.teacher-assignment-table td {
  padding: 12px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.teacher-assignment-table th:nth-child(1),
.teacher-assignment-table td:nth-child(1) {
  width: 40%;
}

.teacher-assignment-table th:nth-child(2),
.teacher-assignment-table td:nth-child(2) {
  width: 18%;
}

.teacher-assignment-table th:nth-child(3),
.teacher-assignment-table td:nth-child(3),
.teacher-assignment-table th:nth-child(4),
.teacher-assignment-table td:nth-child(4),
.teacher-assignment-table th:nth-child(5),
.teacher-assignment-table td:nth-child(5) {
  width: 14%;
}

.teacher-assignment-table .assignment-name-cell {
  min-width: 0;
}

.teacher-assignment-table .assignment-name-cell > span:last-child {
  min-width: 0;
}

.teacher-assignment-table .assignment-name-cell strong,
.teacher-assignment-table .assignment-name-cell small {
  display: block;
  overflow-wrap: anywhere;
}

.assignment-action-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.student-assignment-table {
  container-type: inline-size;
}

.student-assignment-table table {
  min-width: 0;
  table-layout: fixed;
}

.student-assignment-table th:nth-child(1),
.student-assignment-table td:nth-child(1) {
  width: 40%;
}

.student-assignment-table th:nth-child(2),
.student-assignment-table td:nth-child(2) {
  width: 18%;
}

.student-assignment-table th:nth-child(3),
.student-assignment-table td:nth-child(3) {
  width: 28%;
}

.student-assignment-table th:nth-child(4),
.student-assignment-table td:nth-child(4) {
  width: 14%;
  text-align: center;
}

.student-assignment-table td {
  overflow-wrap: anywhere;
}

.student-assignment-cards {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.student-assignment-cards table,
.student-assignment-cards tbody {
  display: block;
  width: 100%;
  min-width: 0;
  background: transparent;
}

.student-assignment-cards thead {
  display: none;
}

.student-assignment-cards tbody {
  display: grid;
  gap: 14px;
}

.student-assignment-cards tr {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  grid-template-areas:
    "main summary"
    "actions actions"
    "status status";
  align-items: start;
  gap: 12px 18px;
  width: 100%;
  min-height: 0;
  padding: 18px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.student-assignment-cards td {
  display: block;
  width: auto !important;
  padding: 0;
  border: 0;
  text-align: left !important;
}

.student-assignment-cards td::before {
  display: none;
}

.student-assignment-cards .assignment-card-main {
  grid-area: main;
  min-width: 0;
  padding-right: 0;
}

.student-assignment-cards .assignment-card-type {
  grid-area: summary;
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: none;
  padding: 0;
  background: transparent;
  text-align: right !important;
}

.student-assignment-cards .assignment-card-status {
  grid-area: status;
  margin-top: 12px;
  padding-right: 0;
  padding-top: 12px;
  border-top: 1px solid var(--ui-line);
  border-left: 0;
}

.student-assignment-cards .assignment-card-status[hidden] {
  display: none !important;
}

.student-assignment-cards .assignment-detail-badges,
.student-assignment-cards .assignment-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.student-assignment-cards .assignment-detail-meta {
  margin-top: 7px;
  color: var(--ui-muted);
  font-size: 12px;
}

.student-assignment-cards .assignment-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.student-assignment-cards .assignment-card-actions {
  grid-area: actions;
  position: static;
  align-self: end;
  padding-top: 12px;
  border-top: 1px solid var(--ui-line);
}

.student-assignment-cards .assignment-name-cell {
  align-items: flex-start;
}

.student-assignment-cards .assignment-name-cell strong {
  font-size: 16px;
}

.student-assignment-cards .assignment-card-copy {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
}

.student-assignment-cards .assignment-card-copy strong,
.student-assignment-cards .assignment-card-meta {
  line-height: 1.35;
}

.student-assignment-cards .assignment-card-meta {
  display: block;
  margin: 0;
}

.student-assignment-cards .assignment-action-icons {
  justify-content: flex-end;
  gap: 6px;
}

.student-assignment-cards .assignment-card-work-mode {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.2;
}

.student-assignment-cards .assignment-action-icons > .action-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  min-height: 28px;
  max-height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1;
}

.student-assignment-cards .assignment-action-icons > .action-icon-button i {
  width: 12px;
  line-height: 1;
  text-align: center;
}

.student-assignment-cards .assignment-card-score {
  position: static;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  line-height: 1;
}

.student-assignment-cards .assignment-card-score-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.modal-submit-actions {
  justify-content: flex-end;
}

@container (max-width: 680px) {
  .student-assignment-table table,
  .student-assignment-table tbody,
  .student-assignment-table tr,
  .student-assignment-table td {
    display: block;
    width: 100% !important;
  }

  .student-assignment-table table {
    background: transparent;
  }

  .student-assignment-table thead {
    display: none;
  }

  .student-assignment-table tbody {
    display: grid;
    gap: 18px;
    padding: 2px;
  }

  .student-assignment-table tr {
    padding: 16px;
    border: 1px solid #d5e5f5;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  .student-assignment-table td {
    display: grid;
    grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-line);
    text-align: left !important;
    font-size: 14px;
  }

  .student-assignment-table td:last-child {
    border-bottom: 0;
  }

  .student-assignment-table td::before {
    content: attr(data-label);
    color: #607089;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .student-assignment-table .assignment-name-cell,
  .student-assignment-table .assignment-name-cell > span:last-child {
    min-width: 0;
  }

  .student-assignment-table .assignment-name-cell strong,
  .student-assignment-table .assignment-name-cell .muted {
    overflow-wrap: anywhere;
  }

  .student-assignment-table .assignment-action-icons {
    justify-content: flex-start;
  }
}

.action-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #ffffff;
  color: var(--ui-primary);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.action-icon-button:hover {
  border-color: #95c9f5;
  background: #eef8ff;
}

.action-icon-button.primary {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: #ffffff;
}

.action-icon-button.primary:hover {
  border-color: var(--ui-primary-strong);
  background: var(--ui-primary-strong);
}

.submissions-table {
  table-layout: fixed;
}

.submissions-table th:nth-child(1),
.submissions-table td:nth-child(1) {
  width: 22%;
}

.submissions-table th:nth-child(2),
.submissions-table td:nth-child(2),
.submissions-table th:nth-child(3),
.submissions-table td:nth-child(3) {
  width: 14%;
}

.submissions-table th:last-child,
.submissions-table td:last-child {
  width: 190px;
  padding-right: 18px;
  text-align: center;
}

.submission-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.submissions-table .action-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  text-decoration: none;
}

.submissions-table .grade-one-button {
  min-width: 38px;
}

.submissions-table .feedback-cell {
  width: 36%;
  max-width: 360px;
}

.submissions-table .feedback-value {
  display: block;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.display-list {
  display: grid;
  gap: 14px;
}

.group-project-card {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #b9dcff;
  border-radius: var(--ui-radius-sm);
  background: #eef8ff;
}

.group-select {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.group-selector-placeholder {
  margin-top: 14px;
}

.group-management-panel,
.group-create-panel {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.group-management-panel[hidden],
.group-create-panel[hidden],
.group-selector-placeholder[hidden] {
  display: none;
}

.group-management-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #b9dcff;
}

.group-management-actions h3 {
  margin-bottom: 0;
}

.group-member-action {
  margin-top: 16px;
}

.member-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.member-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ui-line);
}

.member-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.member-item strong,
.member-item small {
  display: block;
}

.member-item small {
  color: var(--ui-muted);
}

@media (max-width: 1200px) {
  .teacher-dashboard-layout,
  .dashboard-split,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .teacher-class-detail-mobile {
    display: grid;
  }

  .teacher-class-detail-desktop {
    display: none;
  }

  .global-search {
    min-width: 240px;
  }
}

@media (max-width: 900px) {
  .score-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-page-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .score-filters {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .score-filters label {
    flex: 1 1 180px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: grid;
  }

  .drawer-toggle {
    display: grid !important;
  }

  .brand {
    min-height: 42px;
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand > span:last-child {
    min-width: 0;
  }

  .mobile-menu-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: #ffffff;
    color: var(--ui-primary);
    cursor: pointer;
  }

  .main-nav {
    display: none;
    grid-column: 1 / -1;
    gap: 8px;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 2px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .sidebar-spacer {
    display: none;
  }

  .sidebar-account {
    display: none;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 10px 12px;
    border-color: #d9e6f5;
    border-radius: var(--ui-radius-sm);
    background: #f8fbff;
  }

  .sidebar-account small {
    flex: 0 0 auto;
    margin: 0;
    color: var(--ui-muted);
    font-size: 12px;
  }

  .sidebar-account strong {
    flex: 1 1 160px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-account .text-link,
  .sidebar-account a {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
  }

  .sidebar.is-mobile-open .main-nav,
  .sidebar.is-mobile-open .sidebar-account {
    display: flex;
  }

  .sidebar.is-mobile-open .main-nav {
    flex-wrap: wrap;
  }

  .topbar .user-chip {
    display: none;
  }

  .main-panel {
    padding: 22px;
  }

  .topbar-actions,
  .toolbar-between,
  .class-switcher,
  .teacher-class-bar,
  .student-class-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .global-search,
  .class-select-card {
    min-width: 0;
    width: 100%;
  }

  .grid.stats.dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .grid.stats.dashboard-stats.score-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.stats.classroom-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .grading-summary-panel .toolbar-between {
    gap: 18px;
  }

  .grading-summary-panel #batchGradeButton {
    align-self: stretch;
    margin-top: 4px;
  }

  .grading-summary-panel .progress-track {
    margin-top: 20px;
  }

  .grading-assignment-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .submissions-table-wrap table { min-width: 0 !important; }

  .grid.two,
  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .student-assignment-table {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .student-assignment-table table,
  .student-assignment-table tbody,
  .student-assignment-table tr,
  .student-assignment-table td {
    display: block;
    width: 100% !important;
  }

  .student-assignment-table table {
    background: transparent;
  }

  .student-assignment-table thead {
    display: none;
  }

  .student-assignment-table tbody {
    display: grid;
    gap: 18px;
    padding: 2px;
  }

  .student-assignment-table tr {
    padding: 16px;
    border: 1px solid #d5e5f5;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  .student-assignment-table td {
    display: grid;
    grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-line);
    text-align: left !important;
    font-size: 14px;
  }

  .student-assignment-table td:last-child {
    border-bottom: 0;
  }

  .student-assignment-table td::before {
    content: attr(data-label);
    color: #607089;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .student-assignment-table .assignment-name-cell {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .student-assignment-table .assignment-name-cell > span:last-child {
    min-width: 0;
  }

  .student-assignment-table td:first-child {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .student-assignment-table td:first-child::before {
    display: block;
  }

  .student-assignment-table .assignment-file-icon {
    width: 44px;
    height: 44px;
  }

  .student-assignment-table .assignment-name-cell strong,
  .student-assignment-table .assignment-name-cell .muted {
    display: block;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .student-assignment-table .assignment-action-icons {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .score-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-filters label,
  .score-filters button {
    width: 100%;
  }

  .student-score-main {
    display: grid;
  }

  .student-score-result {
    justify-content: flex-start;
    text-align: left;
    padding-left: 50px;
  }

  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .class-list-header .class-list-action {
    width: auto;
    min-height: 36px;
    margin-top: 0;
    padding: 8px 14px;
    align-self: flex-start;
  }

  .sidebar {
    padding: 12px 14px 10px;
  }

  .brand small {
    display: none;
  }

  .sidebar-account {
    gap: 6px 10px;
    padding: 9px 10px;
  }

  .sidebar-account small {
    display: none;
  }

  .sidebar-account strong {
    flex-basis: 100%;
    font-size: 14px;
  }

  .sidebar-account .text-link,
  .sidebar-account a {
    font-size: 12px;
  }

  .main-nav a {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 14px;
  }

  .sidebar.is-mobile-open .main-nav a {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .panel,
  .assignment-item,
  .card {
    padding: 18px;
  }

  .class-overview-grid {
    grid-template-columns: 1fr;
  }

  .class-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .class-overview-card {
    gap: 12px;
    padding: 16px;
  }

  .class-overview-head {
    align-items: center;
    gap: 12px;
  }

  .class-overview-head .class-select-icon {
    width: 44px;
    height: 44px;
  }

  .class-overview-metrics span {
    padding: 9px 10px;
    font-size: 12px;
  }

  .class-overview-metrics strong {
    display: inline;
    margin-right: 4px;
    font-size: 18px;
    line-height: 1.3;
  }

  .class-overview-card > .muted {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .teacher-class-bar .static-class-summary,
  .student-class-bar .static-class-summary {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .teacher-class-bar .static-class-summary .class-select-icon,
  .student-class-bar .static-class-summary .class-select-icon {
    width: 44px;
    height: 44px;
  }

  .teacher-class-bar .static-class-summary .class-select-copy,
  .student-class-bar .static-class-summary .class-select-copy {
    flex: 1 1 auto;
  }

  .class-card-action {
    justify-self: stretch;
  }

  .row-actions > *,
  .toolbar > * {
    width: 100%;
  }

  .teacher-class-bar > .row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .teacher-class-bar > .row-actions > * {
    width: auto;
  }

  .teacher-class-bar .class-bar-edit-button {
    width: 44px;
    min-width: 44px;
    height: 40px;
    min-height: 40px;
  }
}

.mobile-menu-toggle {
  display: none !important;
}

@media (max-width: 900px) {
  .class-list-header .class-list-action {
    width: auto;
    min-width: 0;
    margin-top: 0;
    align-self: flex-start;
  }

  .mobile-menu-toggle {
    display: grid !important;
  }
}

/* ==========================================================================
   ONE-PAGE LIGHT MINIMAL REDESIGN
   Visual language adapted from onepagedesign.html.
   ========================================================================== */

:root {
  --ui-bg: #f3f7fa;
  --ui-surface: #ffffff;
  --ui-soft: #f0f7ff;
  --ui-soft-2: #f8fafc;
  --ui-text: #0f1e36;
  --ui-muted: #64748b;
  --ui-line: #e2eaf4;
  --ui-border: #e2eaf4;
  --ui-primary: #1d73c9;
  --ui-primary-strong: #155ca3;
  --ui-success: #10b981;
  --ui-warning: #d97706;
  --ui-danger: #e11d48;
  --ui-purple: #6d5bd0;
  --ui-radius: 14px;
  --ui-radius-sm: 9px;
  --ui-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.025),
    0 2px 6px -1px rgba(15, 23, 42, 0.015);
}

html,
body {
  background: var(--ui-bg);
}

body {
  color: var(--ui-text);
  font-family: "Sarabun", "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--ui-bg);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--ui-bg);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 256px;
  height: 100vh;
  min-height: 100vh;
  gap: 0;
  padding: 0;
  border-right: 1px solid var(--ui-line);
  background: #ffffff;
  box-shadow: none;
}

.brand {
  min-height: 82px;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #e6eef7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.brand strong {
  color: #0f172a;
  font-family: "Inter", "Sarabun", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.brand small {
  margin-top: 2px;
  color: #94a3b8;
  font-family: "Inter", "Sarabun", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-role {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 10px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: rgba(243, 247, 250, 0.4);
  color: #475569;
  font-size: 13px;
}

.sidebar-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ui-primary);
}

.sidebar-role small {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--ui-soft);
  color: var(--ui-primary);
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.main-nav {
  gap: 4px;
  padding: 16px 12px;
}

.main-nav a {
  min-height: 43px;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
}

.main-nav a:hover {
  border-color: #eef2f7;
  background: #f8fafc;
  color: #334155;
}

.main-nav a.active {
  border-color: #dbeafe;
  background: var(--ui-soft);
  color: var(--ui-primary);
  font-weight: 600;
}

.main-nav i {
  width: 18px;
  font-size: 15px;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-top: 1px solid #f1f5f9;
  border-radius: 0;
  background: #ffffff;
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid #dbeafe;
  border-radius: 50%;
  background: var(--ui-soft);
  color: var(--ui-primary);
  font-size: 13px;
  font-weight: 600;
}

.sidebar-account-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-account-copy small {
  margin-top: 1px;
  color: #94a3b8;
  font-size: 11px;
}

.sidebar-account-action {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #94a3b8 !important;
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease;
}

.sidebar-account-action:hover {
  background: #f1f5f9;
  color: #475569 !important;
}

.sidebar-account-action.logout:hover {
  background: #fff1f2;
  color: #e11d48 !important;
}

.main-panel {
  min-width: 0;
  padding: 0;
  background: var(--ui-bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 72px;
  margin: 0;
  padding: 13px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid var(--ui-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.topbar-title h1 {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-title p,
.topbar-title .eyebrow {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
}

.topbar-actions {
  gap: 12px;
}

.global-search {
  min-width: min(280px, 32vw);
}

.global-search input {
  min-height: 39px;
  padding: 8px 66px 8px 37px;
  border-color: #e2e8f0;
  border-radius: 9px;
  background: rgba(243, 247, 250, 0.68);
  font-size: 13px;
  transition: border-color 0.16s ease, background 0.16s ease,
    box-shadow 0.16s ease;
}

.global-search input:focus {
  border-color: #bfdbfe;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 115, 201, 0.08);
}

.global-search span {
  left: 13px;
  color: #94a3b8;
}

.global-search-count {
  right: 8px;
  min-width: 38px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--ui-soft);
  font-size: 10px;
}

.content-area {
  gap: 18px;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px);
}

.flash,
.dashboard-flash {
  padding: 11px 14px;
  border-color: #bfdbfe;
  border-radius: 10px;
  background: #f0f7ff;
  box-shadow: var(--ui-shadow);
  color: #155ca3;
  font-size: 13px;
}

.panel,
.card,
.assignment-item,
.login-card,
.class-overview-card,
.student-score-card,
.teacher-side-card {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
  box-shadow: var(--ui-shadow);
}

.panel {
  padding: clamp(18px, 2.3vw, 26px);
}

.panel,
.card,
.assignment-item,
.class-overview-card,
.student-score-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease;
}

.assignment-item:hover,
.class-overview-card:hover,
.student-score-card:hover {
  border-color: #cfddea;
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.eyebrow {
  margin-bottom: 4px;
  color: #94a3b8;
  font-family: "Inter", "Sarabun", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

h2 {
  margin-bottom: 7px;
  color: #0f172a;
  font-size: 19px;
  font-weight: 700;
}

h3 {
  color: #172033;
  font-size: 16px;
  font-weight: 600;
}

.muted,
.help-text {
  color: var(--ui-muted);
}

.grid {
  gap: 14px;
}

.grid.stats {
  gap: 12px;
}

.grid.stats.dashboard-stats {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}

.summary-grid {
  gap: 10px;
  margin-top: 16px;
}

.summary-item,
.stat-card {
  border-color: var(--ui-line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--ui-shadow);
}

.summary-item {
  min-height: 72px;
  padding: 13px 15px;
}

.stat-card,
.dashboard-stats .stat-card {
  min-height: 98px;
  gap: 4px;
  padding: 17px 18px;
}

.stat-card span,
.summary-item span {
  color: #64748b;
  font-size: 13px;
}

.stat-card strong {
  color: #0f172a;
  font-size: 28px;
  font-weight: 700;
}

.summary-item strong {
  color: #172033;
  font-size: 18px;
  font-weight: 600;
}

.stat-card small {
  color: #94a3b8;
  font-size: 11px;
}

.class-overview-grid,
.assignment-list,
.display-list,
.student-score-list {
  gap: 12px;
}

.class-overview-card {
  gap: 15px;
  padding: 19px;
}

.class-select-icon,
.assignment-file-icon {
  border: 1px solid #dbeafe;
  background: var(--ui-soft);
  color: var(--ui-primary);
  box-shadow: none;
}

.class-overview-metrics {
  gap: 7px;
}

.class-overview-metrics span,
.side-metrics span {
  border: 1px solid #edf2f7;
  border-radius: 9px;
  background: #f8fafc;
}

.assignment-item {
  padding: 18px 20px;
}

.assignment-meta {
  gap: 6px;
}

.pill,
.status,
.score-level {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.pill {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.status.open {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.status.done,
.score-level.very-good {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.status.pending,
.score-level.fair {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.status.missing,
.score-level.fail {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.score-level.good {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.button,
button:not(.icon-button):not(.notification-button):not(.icon-btn):not(.mobile-menu-toggle):not(.action-icon-button),
input[type="submit"] {
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid var(--ui-primary);
  border-radius: 9px;
  background: var(--ui-primary);
  box-shadow: 0 2px 5px rgba(29, 115, 201, 0.14);
  font-size: 13px;
  font-weight: 500;
}

.button:hover,
button:not(.icon-button):not(.notification-button):not(.icon-btn):not(.mobile-menu-toggle):not(.action-icon-button):hover,
input[type="submit"]:hover {
  border-color: var(--ui-primary-strong);
  background: var(--ui-primary-strong);
  box-shadow: 0 4px 10px rgba(29, 115, 201, 0.18);
  transform: none;
}

.button.secondary,
button.secondary {
  border-color: #dbe3ed;
  background: #ffffff;
  box-shadow: none;
  color: #334155;
}

.button.secondary:hover,
button.secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.button.danger,
button.danger {
  border-color: #e11d48;
  background: #e11d48;
}

.icon-button,
.action-icon-button,
.icon-btn {
  border-color: #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: none;
  color: #64748b;
}

.icon-button:hover,
.action-icon-button:hover,
.icon-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1d73c9;
}

select,
input,
textarea {
  min-height: 41px;
  padding: 9px 11px;
  border-color: #dbe3ed;
  border-radius: 9px;
  background: #ffffff;
  color: #1e293b;
  font-size: 14px;
}

textarea {
  min-height: 110px;
  line-height: 1.65;
}

select:focus,
input:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(29, 115, 201, 0.08);
}

.grading-settings,
.student-score-feedback,
.danger-zone {
  border-color: #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.table-wrap {
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

table {
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-color: #edf2f7;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #fbfdff;
}

.modal {
  padding: 20px;
  background: rgba(15, 30, 54, 0.38);
  backdrop-filter: blur(4px);
}

.modal-dialog,
.confirm-dialog {
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.modal-header {
  padding: 18px 20px;
  border-bottom-color: #edf2f7;
}

.modal-body {
  padding: 20px;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: #e8eef5;
}

.progress-fill {
  border-radius: inherit;
  background: var(--ui-primary);
}

.empty-state {
  padding: 36px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
}

.login-page {
  background:
    radial-gradient(circle at 86% 14%, rgba(96, 165, 250, 0.16), transparent 26rem),
    #f6f9fd;
}

.login-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.92), transparent 20rem),
    linear-gradient(145deg, #eaf5ff 0%, #d9edff 52%, #c7e3ff 100%);
  color: #16324f;
}

.login-visual::before,
.login-visual::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 999px;
}

.login-visual::before {
  top: -110px;
  right: -90px;
  width: 330px;
  height: 330px;
  border: 56px solid rgba(37, 99, 235, 0.08);
}

.login-visual::after {
  right: 10%;
  bottom: 9%;
  width: 150px;
  height: 150px;
  background: rgba(14, 165, 233, 0.10);
  box-shadow: -190px 90px 0 rgba(59, 130, 246, 0.07);
}

.login-visual .eyebrow {
  color: #2563eb;
  letter-spacing: 0.12em;
}

.login-visual h1 {
  color: #123a63;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.login-form {
  border-color: #d8e4f0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(30, 64, 175, 0.10);
}

.login-form > div:first-child .eyebrow {
  color: #2878c8;
}

.login-form input {
  background: #fbfdff;
  border-color: #cfddeb;
}

.login-form input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.login-form .google-button {
  border-color: #cfddeb;
  background: #ffffff;
  color: #246bb2;
}

.login-form .google-button:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.login-form form > button[type="submit"] {
  background: linear-gradient(135deg, #2878c8, #1766b4);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }

  .brand {
    min-height: 64px;
    padding: 12px 16px;
    border-bottom: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 17px;
  }

  .sidebar-role,
  .sidebar-account,
  .sidebar-spacer {
    display: none;
  }

  .mobile-menu-toggle {
    align-self: center;
    margin-right: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
  }

  .main-nav {
    grid-column: 1 / -1;
    padding: 8px 14px 14px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
  }

  .sidebar.is-mobile-open .main-nav {
    display: flex;
  }

  .topbar {
    position: static;
    min-height: auto;
    padding: 18px 20px 0;
    border-bottom: 0;
    background: var(--ui-bg);
    backdrop-filter: none;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar-left {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-action {
    order: 1;
  }

  .drawer-toggle {
    order: 2;
    margin-left: auto;
  }

  .topbar-right {
    display: contents;
  }

  .global-search {
    order: 3;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .content-area {
    padding: 18px 20px 28px;
  }

  .grid.stats.dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Bottom-nav + drawer system ≤900px */
  .sidebar { display: none !important; }
  .bottom-nav { display: grid; }
  .drawer-toggle { display: grid !important; }
  .back-button.is-visible { display: grid; }
  .topbar-action.is-visible { display: grid; }
  .fab.is-visible { display: grid !important; }
  .fab:active { transform: scale(0.92); }
  .fab[hidden] { display: none !important; }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .login-page .login-visual {
    display: none;
  }

  .topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 0;
    flex-wrap: wrap;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    order: 0;
  }

  .topbar-action {
    order: 1;
  }

  .drawer-toggle {
    order: 2;
    margin-left: auto;
  }

  .topbar-right {
    display: contents;
  }

  .global-search {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .topbar-title h1 {
    font-size: 19px;
  }

  .content-area {
    gap: 14px;
    padding: 14px 14px 24px;
  }

  .panel,
  .card,
  .assignment-item {
    padding: 16px;
  }

  .grid.stats.dashboard-stats,
  .grid.stats.dashboard-stats.score-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.stats.dashboard-stats.admin-summary-grid {
    gap: 8px;
  }

  .dashboard-stats.admin-summary-grid .stat-card {
    min-height: 68px;
    padding: 9px 12px;
    gap: 2px;
    border-radius: 10px;
  }

  .dashboard-stats.admin-summary-grid .stat-card span {
    font-size: 11px;
    line-height: 1.2;
  }

  .dashboard-stats.admin-summary-grid .stat-card strong {
    font-size: 22px;
    line-height: 1.1;
  }

  .grid.stats.dashboard-stats.classes-summary-grid {
    height: 76px;
    min-height: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .classes-summary-grid .stat-card,
  .dashboard-stats.classes-summary-grid .stat-card {
    height: 76px;
    min-height: 76px;
    align-content: center;
    grid-template-rows: auto auto auto;
    gap: 1px;
    padding: 10px 11px;
    border-radius: 10px;
    box-shadow: none;
  }

  .classes-summary-grid .stat-card span {
    overflow: hidden;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .classes-summary-grid .stat-card strong {
    font-size: 21px;
    line-height: 1.2;
  }

  .classes-summary-grid .stat-card small {
    display: block;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-card,
  .dashboard-stats .stat-card {
    min-height: 88px;
    padding: 14px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .student-work-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .student-work-stats .stat-card,
  .dashboard-stats.student-work-stats .stat-card {
    min-height: 76px;
    align-content: center;
    gap: 1px;
    padding: 9px 10px;
    border-radius: 10px;
    box-shadow: none;
  }

  .student-work-stats .stat-card span {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-work-stats .stat-card strong {
    font-size: 21px;
    line-height: 1.15;
  }

  .student-work-stats .stat-card small {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .spa-view .grid.stats.dashboard-stats.classroom-stats {
    height: 72px;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .spa-view .classroom-stats .stat-card,
  .spa-view .dashboard-stats.classroom-stats .stat-card {
    height: 72px;
    min-height: 72px;
    align-content: center;
    grid-template-rows: auto auto auto;
    gap: 1px;
    padding: 9px 8px;
    border-radius: 10px;
    box-shadow: none;
  }

  .spa-view .classroom-stats .stat-card span {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .spa-view .classroom-stats .stat-card strong {
    font-size: 20px;
    line-height: 1.2;
  }

  .spa-view .classroom-stats .stat-card small {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .grid.stats.teacher-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .teacher-stat-grid .stat-card {
    height: 72px;
    min-height: 72px;
    align-content: center;
    grid-template-rows: auto auto auto;
    gap: 1px;
    padding: 8px 7px;
    border-radius: 10px;
    box-shadow: none;
  }

  .teacher-stat-grid .stat-card span {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-stat-grid .stat-card strong {
    font-size: 19px;
    line-height: 1.2;
  }

  .teacher-stat-grid .stat-card small {
    display: block;
    overflow: hidden;
    margin-top: 0;
    font-size: 8px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar-between {
    gap: 14px;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog,
  .modal-dialog.wide {
    width: 100%;
    max-width: none;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-header,
  .modal-body {
    padding-inline: 17px;
  }

  #create-assignment-modal .modal-header {
    gap: 12px;
    padding-block: 16px;
  }

  #create-assignment-modal .modal-dialog {
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  #create-assignment-modal .modal-body {
    padding-block: 14px;
  }

  #create-assignment-modal .modal-body > .form-grid {
    gap: 11px;
  }

  #create-assignment-modal .grading-settings {
    gap: 10px;
    padding: 12px;
  }

  /* Submissions table → card layout on mobile */
  .submissions-table-wrap table { min-width: 0 !important; }
  .submissions-table { table-layout: auto !important; }
  .submissions-table thead { display: none; }
  .submissions-table,
  .submissions-table tbody,
  .submissions-table tr { display: block; }
  .submissions-table tr {
    padding: 14px;
    border-bottom: 1px solid var(--ui-line);
    background: #ffffff;
  }
  .submissions-table tr:last-child { border-bottom: 0; }
  .submissions-table td {
    display: block;
    width: auto !important;
    padding: 5px 0;
    border: 0;
    text-align: left !important;
  }
  .submissions-table td:first-child { padding-top: 0; }
  .submissions-table td:nth-child(2)::before { content: "สถานะ: "; font-size: 11px; color: var(--ui-muted); }
  .submissions-table td:nth-child(3)::before { content: "คะแนน: "; font-size: 11px; color: var(--ui-muted); }
  .submissions-table td:nth-child(4)::before { content: "Feedback: "; font-size: 11px; color: var(--ui-muted); }
  .grading-assignment-meta { overflow-wrap: anywhere; word-break: break-word; }
  .toolbar-between { gap: 14px; }
}

/* Role one-page applications */

.student-spa-page .content-area,
.role-spa-page .content-area {
  align-content: start;
  min-height: calc(100vh - 72px);
}

.student-spa-page .content-area > .flash,
.role-spa-page .content-area > .flash {
  align-self: start;
  min-height: 0;
}

.spa-view {
  display: grid;
  align-content: start;
  gap: 18px;
}

.spa-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  color: var(--ui-muted);
}

.spa-loading .button-spinner {
  border-color: #bfdbfe;
  border-top-color: var(--ui-primary);
}

.spa-toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  top: 88px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #ecfdf5;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  color: #047857;
  font-size: 13px;
}

.spa-toast.error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.spa-error-state {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.spa-error-state i {
  color: var(--ui-danger);
  font-size: 28px;
}

.spa-error-state p {
  margin: 0;
}

.spa-assignment-list {
  display: grid;
  gap: 12px;
}

.spa-assignment-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.spa-assignment-card:hover {
  border-color: #cfddea;
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.08);
}

.spa-assignment-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.spa-assignment-heading h3,
.spa-assignment-heading p {
  margin-bottom: 3px;
}

.spa-assignment-result {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.spa-assignment-result > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.spa-assignment-result small {
  color: var(--ui-muted);
}

.student-spa-page [data-spa-search-item][hidden],
.role-spa-page [data-spa-search-item][hidden] {
  display: none !important;
}

.student-spa-page .class-overview-grid {
  justify-items: start;
}

.student-spa-page .class-overview-card {
  width: 100%;
  max-width: 680px;
}

.role-summary-grid,
.admin-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.teacher-assignment-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-block: 10px;
  border-block: 1px solid #edf2f7;
  color: var(--ui-muted);
  font-size: 13px;
}

.teacher-classes-toolbar {
  padding-bottom: 16px;
}

.teacher-assignment-metrics strong {
  color: var(--ui-text);
}

.role-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.role-list {
  display: grid;
  gap: 10px;
}

.role-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: #fff;
}

.role-list-item p {
  margin: 2px 0 0;
}

.admin-user-card {
  scroll-margin-top: 90px;
}

.class-code-share {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 0;
}

.class-code-share p {
  margin: 0;
}

.class-link-copy {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ui-primary);
  font-size: 10px;
}

.class-link-copy:hover {
  border-color: #60a5fa;
  background: #eff6ff;
  color: var(--ui-primary-strong);
}

.class-link-copy.is-copied {
  border-color: #86efac;
  background: #f0fdf4;
  color: #16a34a;
}

.admin-account-create-toolbar {
  justify-content: flex-end;
  padding-bottom: 12px;
}

.admin-pagination {
  padding-top: 4px;
  border-top: 1px solid var(--ui-line);
}

.pagination-page {
  display: inline-grid !important;
  place-items: center;
  min-width: 36px !important;
  width: 36px;
  height: 36px;
  min-height: 36px !important;
  padding: 0 !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: var(--ui-muted) !important;
  box-shadow: none !important;
}

.pagination-page:hover,
.pagination-page.is-active {
  border-color: var(--ui-primary) !important;
  background: var(--ui-primary) !important;
  color: #ffffff !important;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-actions form {
  margin: 0;
}

.approve-icon-button {
  border-color: #86efac;
  background: #f0fdf4;
  color: #16a34a;
}

.approve-icon-button:hover {
  border-color: #4ade80;
  background: #dcfce7;
  color: #15803d;
}

.student-simple-scores {
  display: grid;
  gap: 18px;
}

.score-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.score-overview-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.04);
}

.score-overview-card > div:not(.score-progress) {
  display: grid;
  min-width: 0;
}

.score-overview-card small,
.score-overview-card span {
  color: var(--ui-muted);
  font-size: 12px;
}

.score-overview-card strong {
  color: #0f172a;
  font-size: 25px;
  line-height: 1.1;
}

.score-overview-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 17px !important;
}

.score-overview-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}

.score-overview-icon.amber {
  background: #fffbeb;
  color: #d97706;
}

.score-overview-icon.rose {
  background: #fff1f2;
  color: #e11d48;
}

.score-overview-icon.green {
  background: #ecfdf5;
  color: #059669;
}

.score-overview-total {
  padding-bottom: 23px;
}

.score-progress {
  position: absolute;
  right: 16px;
  bottom: 10px;
  left: 16px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.score-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #10b981;
  transition: width 0.25s ease;
}

.simple-score-heading {
  align-items: end;
}

.simple-score-heading .score-filters {
  align-items: end;
}

.score-heading-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.score-total-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #475569;
}

.score-total-strip > strong {
  color: #0f172a;
  font-size: 20px;
}

.score-total-percent {
  min-width: 84px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--ui-primary);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.simple-score-table table {
  min-width: 560px;
}

.simple-score-table th:nth-child(2),
.simple-score-table th:nth-child(3),
.simple-score-table td:nth-child(2),
.simple-score-table td:nth-child(3) {
  width: 150px;
  text-align: center;
}

.simple-score-table td {
  vertical-align: middle;
}

.score-table-class {
  display: block;
  margin-top: 4px;
  color: var(--ui-muted);
  font-weight: 400;
}

.score-table-value {
  white-space: nowrap;
}

.score-table-value .score-level {
  margin-right: 7px;
}

.score-table-value small {
  color: var(--ui-muted);
}

.score-table-percent strong {
  color: var(--ui-primary-strong);
  font-size: 16px;
}

.embedded-page {
  min-height: 100vh;
  background: var(--ui-bg);
}

html.in-spa-frame .sidebar,
html.in-spa-frame .topbar {
  display: none !important;
}

html.in-spa-frame .app-shell {
  display: block;
  min-height: 100vh;
}

html.in-spa-frame .main-panel {
  min-height: 100vh;
}

html.in-spa-frame .content-area {
  min-height: 100vh;
  padding: 20px;
}

.embedded-content {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

.spa-embedded-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 126px);
  min-height: 640px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--ui-bg);
}

/* ── Bottom Navigation (mobile/tablet ≤900px) ── */
.bottom-nav {
  display: none;
}

.bottom-nav__item {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 50px;
  padding: 6px 4px;
  border: 0;
  border-radius: 11px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s;
}

.bottom-nav__item i {
  font-size: 19px;
}

.bottom-nav__item.active {
  color: var(--ui-primary);
}

.bottom-nav__item:hover {
  background: var(--ui-soft);
  color: var(--ui-primary-strong);
}

/* ── Right Drawer ── */
.right-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  padding: 20px;
  background: #ffffff;
  box-shadow: -4px 0 28px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-drawer.is-open {
  transform: translateX(0);
}

.drawer-account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--ui-soft);
  color: var(--ui-primary);
  font-size: 20px;
  font-weight: 600;
}

.drawer-account strong {
  display: block;
  font-size: 16px;
}

.drawer-account small {
  color: var(--ui-muted);
  font-size: 12px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(15, 23, 42, 0.3);
}

.drawer-overlay[hidden] {
  display: none;
}

.right-drawer hr {
  border: 0;
  border-top: 1px solid var(--ui-line);
}

.right-drawer [data-logout-link] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ui-danger);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.right-drawer [data-logout-link]:hover {
  background: #fef2f2;
}

/* ── FAB (Floating Action Button) ── */
.fab {
  display: none !important;
  position: fixed;
  z-index: 70;
  right: 20px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50% !important;
  background: var(--ui-primary);
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.22);
  place-items: center;
  cursor: pointer;
  font-size: 22px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.back-button {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ui-primary);
  font-size: 16px;
  cursor: pointer;
}

.back-button.is-visible {
  display: grid;
}

.back-button[hidden] {
  display: none !important;
}

@media (min-width: 641px) {
  .back-button.is-visible { display: none !important; }
}

/* ── Topbar Context Action ── */
.topbar-action {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--ui-primary);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
}

.topbar-action.is-visible {
  display: grid;
}

.topbar-action[hidden] {
  display: none !important;
}

/* ── Drawer Toggle (Hamburger right) ── */
.drawer-toggle {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
}

.login-account-note {
  padding-top: 6px;
}

.spa-view:has(.spa-embedded-frame) {
  display: block;
}

.role-spa-page .content-area:has(.spa-embedded-frame),
.student-spa-page .content-area:has(.spa-embedded-frame) {
  padding: 0;
}

.role-spa-page .topbar-title,
.role-spa-page .topbar-actions,
.role-spa-page .spa-assignment-heading > div,
.role-spa-page .class-select-copy,
.role-spa-page .role-list-item > div {
  min-width: 0;
}

.role-spa-page h1,
.role-spa-page h2,
.role-spa-page h3,
.role-spa-page p,
.role-spa-page small {
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .spa-toast {
    top: 74px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .spa-assignment-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .spa-assignment-heading > .status {
    grid-column: 2;
    justify-self: start;
  }

  .spa-assignment-result {
    display: grid;
    align-items: stretch;
  }

  .spa-assignment-result .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .spa-assignment-result .row-actions > * {
    width: 100%;
  }

  .student-spa-page .class-overview-card {
    max-width: none;
  }

  .role-summary-grid,
  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-spa-page .role-summary-grid {
    gap: 7px;
  }

  .teacher-spa-page .role-summary-grid .stat-card {
    min-height: 72px;
    align-content: center;
    gap: 1px;
    padding: 9px 12px;
    border-radius: 10px;
    box-shadow: none;
  }

  .teacher-spa-page .role-summary-grid .stat-card span {
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-spa-page .role-summary-grid .stat-card strong {
    font-size: 22px;
    line-height: 1.15;
  }

  .teacher-spa-page .role-summary-grid .stat-card small {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .role-detail-grid {
    grid-template-columns: 1fr;
  }

  .role-list-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .role-list-item > .status {
    grid-column: 2;
    justify-self: start;
  }

  .embedded-content {
    gap: 14px;
    padding: 14px;
  }

  .teacher-class-detail-mobile .side-actions > button,
  .teacher-class-detail-mobile .side-actions > a {
    display: none !important;
  }

  .teacher-class-detail-mobile .side-actions {
    margin-top: 0;
  }

  .teacher-class-detail-mobile .side-actions > .status {
    justify-self: start;
  }

  .embedded-page .teacher-class-bar > .row-actions > a.button.secondary {
    display: none;
  }

  .embedded-page .teacher-class-bar {
    position: relative;
  }

  .embedded-page .teacher-class-bar .static-class-summary {
    padding-right: 52px;
  }

  .embedded-page .teacher-class-bar > .row-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    width: auto;
    grid-template-columns: 44px;
    justify-content: end;
  }

  .student-class-bar > .row-actions {
    display: none;
  }

  .teacher-spa-page:has(.bottom-nav) .teacher-classes-toolbar > .row-actions {
    display: none;
  }

  .student-spa-page.has-bottom-nav .class-list-header .class-list-action {
    display: none !important;
  }

/* ── Bottom Nav — visible ≤900px ── */
  .bottom-nav {
    position: fixed;
    z-index: 75;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
  }

  body.has-bottom-nav {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .spa-embedded-frame {
    height: calc(100vh - 137px);
    height: calc(100dvh - 137px);
    min-height: 0;
    border-radius: 0;
  }

  .role-spa-page .teacher-class-bar > .row-actions {
    grid-template-columns: 1fr;
  }

  .role-spa-page .teacher-class-bar > .row-actions > * {
    width: 100%;
  }

  .simple-score-heading {
    display: grid;
    gap: 14px;
  }

  .score-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .score-overview-card {
    gap: 8px;
    min-height: 82px;
    padding: 11px;
    border-radius: 10px;
  }

  .score-overview-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px !important;
  }

  .score-overview-card small,
  .score-overview-card span {
    font-size: 10px;
  }

  .score-overview-card strong {
    font-size: 20px;
  }

  .score-overview-total {
    padding-bottom: 20px;
  }

  .score-progress {
    right: 11px;
    bottom: 8px;
    left: 11px;
    height: 4px;
  }

  .simple-score-heading .score-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .score-heading-actions {
    display: grid;
    width: 100%;
  }

  .score-heading-actions > .button {
    width: 100%;
  }

  .score-total-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  .score-total-percent {
    grid-column: 1 / -1;
    width: 100%;
  }

  .simple-score-table table {
    min-width: 0;
  }

  .simple-score-table th,
  .simple-score-table td {
    padding-inline: 9px;
  }

  .simple-score-table th:nth-child(2),
  .simple-score-table th:nth-child(3),
  .simple-score-table td:nth-child(2),
  .simple-score-table td:nth-child(3) {
    width: 76px;
  }

  .score-table-class {
    font-size: 11px;
  }

  .score-table-value .score-level {
    display: block;
    margin: 0 0 3px;
  }
}

/* Student assignment cards override legacy responsive table rules. */
.student-assignment-cards tr {
  display: grid;
}

.student-assignment-cards td {
  display: block;
}

@media (max-width: 760px) {
  .student-assignment-cards tr {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px 12px;
    min-height: 0;
    padding: 16px;
  }

  .student-assignment-cards td,
  .student-assignment-cards td:first-child {
    display: block;
    width: auto !important;
    padding: 0;
    border: 0;
  }

  .student-assignment-cards td::before,
  .student-assignment-cards td:first-child::before {
    display: none;
  }

  .student-assignment-cards .assignment-card-status {
    margin-top: 12px;
    padding-right: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--ui-line);
    border-left: 0;
  }

  .student-assignment-cards .assignment-card-actions {
    padding-top: 10px;
    border-top: 1px solid var(--ui-line);
  }

  .student-assignment-cards .assignment-action-icons {
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .student-assignment-cards tr {
    grid-template-columns: minmax(0, 1fr) 94px;
    padding: 14px;
  }

  .student-assignment-cards .assignment-card-main {
    padding-right: 0;
  }

  .student-assignment-cards .assignment-card-type {
    max-width: none;
    padding: 0;
    font-size: 10px;
  }

  .student-assignment-cards .assignment-card-score {
    padding: 5px 8px;
    font-size: 12px;
  }
}
