:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0b63f6;
  --primary-strong: #0957d9;
  --blue: #0b63f6;
  --amber: #b45309;
  --rose: #e11d48;
  --success: #059669;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-lift: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --ease: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Kanit", "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 32rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

button,
.button,
input,
select,
textarea,
.pill,
.status,
td,
th {
  overflow-wrap: anywhere;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #0f172a 0%, #111827 62%, #0f172a 100%);
  color: #e5e7eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #bfdbfe, #0b63f6);
  color: #1e1b4b;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.22);
}

.brand strong,
.sidebar-account strong {
  display: block;
}

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

.brand small,
.sidebar-account small {
  color: #94a3b8;
}

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

.main-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  transition: var(--ease);
}

.main-nav a.active,
.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.main-nav a:hover {
  transform: translateX(2px);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
}

.main-nav a.active .nav-dot {
  background: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(199, 210, 254, 0.16);
}

.sidebar-account {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.text-link {
  width: fit-content;
  color: #a5f3fc;
  text-decoration: none;
  font-weight: 500;
}

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

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-title {
  min-width: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.grid.two {
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.35fr);
}

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

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

.panel {
  padding: 28px 30px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 22px 24px;
  transition: var(--ease);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.08)),
    url("data:image/svg+xml,%3Csvg width='38' height='38' viewBox='0 0 38 38' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 25V18M19 25V12M28 25V16' stroke='%234F46E5' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 28H30' stroke='%230F172A' stroke-opacity='.35' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.stat-card:hover,
.assignment-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.stat-card strong {
  display: block;
  margin-top: 7px;
  font-size: 34px;
  line-height: 1;
}

.stat-card span,
.muted {
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.toolbar-between {
  justify-content: space-between;
}

.toolbar > div,
.toolbar-between > div,
.assignment-head > div,
.modal-header > div {
  min-width: 0;
}

.toolbar > button,
.toolbar > .button,
.row-actions > button,
.row-actions > .button {
  min-height: 40px;
  min-width: 96px;
  flex-shrink: 0;
}

.toolbar > label.field-wide + .button,
.toolbar > label.field-wide + button {
  align-self: end;
}

.section-stack {
  margin-top: 26px;
}

.pre-wrap {
  margin-top: 10px;
  white-space: pre-wrap;
}

.stacked-link {
  display: inline-block;
  margin-top: 12px;
}

.stacked-link.loose {
  margin-top: 14px;
}

.field-wide {
  min-width: 280px;
}

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

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

label {
  display: grid;
  gap: 9px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  line-height: 1.45;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 16px;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: var(--ease);
}

textarea {
  min-height: 118px;
  line-height: 1.6;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(79, 70, 229, 0.16);
  border-color: var(--primary);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--ease);
}

.button:hover,
button:hover {
  background: var(--primary-strong);
  box-shadow: 0 14px 24px rgba(79, 70, 229, 0.18);
  transform: translateY(-1px);
}

.button.secondary,
button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.button.secondary:hover,
button.secondary:hover {
  background: #f8fafc;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.google-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1f2937;
}

.google-button:hover {
  background: #f8fafc;
}

.google-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  color: #2563eb;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.button.danger,
button.danger {
  background: var(--rose);
}

.button.blue,
button.blue {
  background: var(--blue);
}

.button[disabled],
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}

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

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.status.done {
  background: #d1fae5;
  color: #065f46;
}

.status.pending {
  background: #fef3c7;
  color: #92400e;
}

.status.missing {
  background: #ffe4e6;
  color: #9f1239;
}

.status.open {
  background: #dbeafe;
  color: #1e40af;
}

.assignment-list,
.display-list,
.account-list,
.api-key-list {
  display: grid;
  gap: 16px;
}

.assignment-item {
  padding: 22px 24px;
  transition: var(--ease);
}

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

.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 500;
}

.flash {
  margin-bottom: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 18px;
  background: #eff6ff;
  color: #1e3a8a;
}

.flash.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.flash.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #78350f;
}

.flash.error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}

.flash.info {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0b63f6, #22c55e);
  transition: width 180ms ease;
}

.batch-log {
  min-height: 42px;
  margin-top: 10px;
  color: var(--muted);
}

.pagination-bar {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
}

.pagination-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.12), transparent 30rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.72fr);
  overflow: hidden;
}

.login-visual {
  display: grid;
  align-content: end;
  gap: 18px;
  min-height: 540px;
  padding: 42px 44px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.92)),
    url("../img/myclass-pattern.svg");
  background-size: cover;
  color: #ffffff;
}

.login-visual h1 {
  font-size: clamp(32px, 5vw, 48px);
}

.login-form {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 42px 44px;
  background: rgba(255, 255, 255, 0.96);
}

.account-hints {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.google-profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.google-profile-preview img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.google-profile-preview strong,
.google-profile-preview span {
  display: block;
}

.google-profile-preview span {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.row-actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.row-actions > .status {
  align-self: center;
}

.score-input {
  width: 112px;
}

.feedback-input {
  min-width: 280px;
  min-height: 92px;
}

td .row-actions {
  min-width: max-content;
}

td .row-actions > button,
td .row-actions > .button {
  min-height: 42px;
  padding-inline: 20px;
}

.grade-one-button {
  min-width: 132px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 38px 42px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at top, rgba(79, 70, 229, 0.08), transparent 18rem);
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-state::before {
  content: "";
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(14, 165, 233, 0.12)),
    url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 23.5C20 20.4624 22.4624 18 25.5 18H46.5C49.5376 18 52 20.4624 52 23.5V48.5C52 51.5376 49.5376 54 46.5 54H25.5C22.4624 54 20 51.5376 20 48.5V23.5Z' stroke='%234F46E5' stroke-width='2'/%3E%3Cpath d='M27 29H45M27 36H45M27 43H38' stroke='%230F172A' stroke-opacity='.48' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-lift);
}

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

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

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

.modal-body {
  padding: 26px 28px;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.icon-button:hover {
  background: #f8fafc;
}

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

.summary-item {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.summary-item span {
  color: var(--muted);
  font-size: 13px;
}

.summary-item strong {
  font-size: 20px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) repeat(4, minmax(150px, 1fr)) minmax(160px, 1fr) minmax(150px, 1fr) minmax(150px, 0.9fr) minmax(130px, 0.7fr);
  gap: 16px;
  align-items: end;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.api-key-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1fr) minmax(130px, 0.7fr) minmax(90px, 0.4fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr);
  gap: 16px;
  align-items: end;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.danger-zone {
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid #fecdd3;
  border-radius: 16px;
  background: #fff1f2;
}

.danger-zone .muted {
  color: #9f1239;
}

.action-menu {
  position: relative;
  display: inline-grid;
  align-self: stretch;
  margin-top: 0;
  min-height: 40px;
}

.action-menu summary {
  display: grid;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  list-style: none;
  cursor: pointer;
  transition: var(--ease);
}

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

.action-menu summary:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateY(-1px);
}

.action-menu[open] summary {
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-lift);
}

.action-menu-panel .button,
.action-menu-panel button {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  padding-inline: 20px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(10px);
}

.confirm-dialog {
  width: min(440px, 100%);
  border: 1px solid #fecdd3;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.confirm-dialog header {
  padding: 24px 28px 10px;
}

.confirm-dialog header h2 {
  margin-bottom: 6px;
  color: #9f1239;
}

.confirm-dialog .confirm-body {
  display: grid;
  gap: 16px;
  padding: 0 28px 26px;
}

.confirm-dialog .confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px 26px;
  background: #fff1f2;
}

body input,
body select,
body textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 16px;
  line-height: 1.45;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

body textarea {
  min-height: 118px;
  line-height: 1.6;
}

body input::placeholder,
body textarea::placeholder {
  color: #94a3b8;
}

body .google-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1f2937;
}

body .icon-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
}

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

body .action-menu summary {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  background: #ffffff;
  color: #475569;
}

body .action-menu-panel button,
body .action-menu-panel .button {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  padding-inline: 20px;
}

/* myClass dashboard theme */
body {
  background: #f8fafc;
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  background: #f8fafc;
}

.sidebar {
  gap: 24px;
  padding: 24px;
  border-right: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.03);
}

.brand {
  gap: 12px;
  padding: 0 4px 22px;
  border-bottom: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #0b63f6;
  color: #ffffff;
  font-size: 0;
  font-weight: 900;
  box-shadow: 0 16px 30px rgba(11, 99, 246, 0.18);
}

.brand-mark::before {
  content: "";
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg width='34' height='34' viewBox='0 0 34 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 7.5C6 6.12 7.12 5 8.5 5H15.5C16.33 5 17 5.67 17 6.5V28C17 26.34 15.66 25 14 25H8.5C7.12 25 6 23.88 6 22.5V7.5Z' stroke='white' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cpath d='M28 7.5C28 6.12 26.88 5 25.5 5H18.5C17.67 5 17 5.67 17 6.5V28C17 26.34 18.34 25 20 25H25.5C26.88 25 28 23.88 28 22.5V7.5Z' stroke='white' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cpath d='M10 11H13M21 11H24M21 16H24' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.brand strong {
  color: #0b63f6;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.brand small {
  color: #475569;
  font-size: 13px;
}

.main-nav {
  gap: 8px;
}

.main-nav a {
  min-height: 44px;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
}

.main-nav a.active,
.main-nav a:hover {
  background: #eaf2ff;
  color: #0b63f6;
  transform: none;
}

.nav-dot {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: transparent;
  opacity: 0.8;
}

.main-nav a.active .nav-dot {
  background: #0b63f6;
  border-color: #0b63f6;
  box-shadow: 0 8px 18px rgba(11, 99, 246, 0.2);
}

.sidebar-account {
  gap: 8px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  color: #334155;
}

.sidebar-account strong {
  color: #0f172a;
}

.sidebar-account .text-link {
  color: #0b63f6;
}

.main-panel {
  padding: 0;
  background: #f8fafc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.topbar-title h1 {
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 500;
  line-height: 1.18;
}

.topbar-title .eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

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

.global-search {
  position: relative;
  flex: 1;
  max-width: 420px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-weight: 400;
}

.global-search span {
  position: absolute;
  left: 15px;
  z-index: 1;
  font-size: 18px;
  line-height: 1;
}

body .global-search input {
  min-height: 44px;
  padding-left: 44px;
  border-color: #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #64748b;
  cursor: default;
}

.notification-button {
  position: relative;
}

body .notification-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid transparent;
  background: #ffffff;
  color: #475569;
}

.notification-button::before {
  content: "";
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 4px 4px;
}

.notification-button span {
  position: absolute;
  top: 5px;
  right: 6px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #0b63f6;
  font-size: 16px;
  font-weight: 600;
}

.user-chip strong,
.user-chip small {
  display: block;
  line-height: 1.25;
}

.user-chip strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.user-chip small {
  color: #64748b;
  font-size: 12px;
}

.content-area {
  padding: 24px;
}

.panel,
.stat-card,
.assignment-item,
.login-card,
.table-wrap,
.summary-item,
.account-row,
.api-key-row {
  border-color: #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.panel {
  padding: 24px;
}

.grid.stats {
  gap: 20px;
}

.stat-card {
  min-height: 118px;
  padding: 24px 22px 20px 86px;
  border-radius: 12px;
}

.stat-card::after {
  top: 24px;
  left: 22px;
  right: auto;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(11, 99, 246, 0.12), rgba(11, 99, 246, 0.05)),
    url("data:image/svg+xml,%3Csvg width='38' height='38' viewBox='0 0 38 38' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 25V17M19 25V12M27 25V15' stroke='%230B63F6' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M9 28H29' stroke='%230B63F6' stroke-opacity='.55' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.stat-card strong {
  color: #0b63f6;
  font-size: 32px;
  font-weight: 600;
}

.stat-card span {
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.table-wrap {
  border-radius: 14px;
}

table {
  min-width: 900px;
}

th,
td {
  padding: 14px 16px;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

td {
  color: #334155;
}

.feedback-cell {
  width: 260px;
  max-width: 260px;
}

.feedback-value {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-history-list {
  display: grid;
  gap: 12px;
}

.version-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.version-history-item p {
  margin: 8px 0 0;
}

@media (max-width: 640px) {
  .version-history-item {
    align-items: stretch;
    flex-direction: column;
  }

  .version-history-item > .button {
    width: 100%;
  }
}

.assignment-item {
  border-radius: 14px;
}

.status.done,
.pill.done {
  background: #dcfce7;
  color: #15803d;
}

.status.pending {
  background: #ffedd5;
  color: #c2410c;
}

.status.missing {
  background: #fee2e2;
  color: #dc2626;
}

.status.open {
  background: #dbeafe;
  color: #0b63f6;
}

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

.modal {
  background: rgba(15, 23, 42, 0.28);
}

.modal-dialog {
  border-radius: 24px;
}

.modal-header {
  border-bottom-color: #dbe3ef;
}

.danger-zone {
  border-color: #fecaca;
  background: #fff1f2;
}

.login-page {
  padding: 0;
  background: #f8fbff;
}

.login-card {
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1fr) minmax(420px, 0.78fr);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-visual {
  min-height: 100vh;
  align-content: center;
  padding: 64px 72px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(219, 234, 254, 0.55)),
    url("../img/myclass-pattern.svg");
  color: #0f172a;
}

.login-visual .eyebrow {
  color: #0b63f6;
}

.login-visual h1 {
  color: #0b63f6;
}

.login-form {
  align-content: center;
  margin: auto;
  width: min(640px, calc(100% - 64px));
  padding: 42px 44px;
  border: 1px solid #dbe3ef;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.teacher-empty-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.class-switcher {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.class-switcher-label {
  color: #334155;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.class-select-card {
  position: relative;
  display: flex;
  width: min(520px, 54vw);
  min-width: 340px;
  min-height: 64px;
  align-items: center;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 11px 48px 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.class-select-card::after {
  content: "v";
  position: absolute;
  right: 18px;
  color: #475569;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

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

.class-select-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #0b63f6;
  box-shadow: 0 14px 24px rgba(11, 99, 246, 0.18);
}

.class-select-icon::before {
  content: "";
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 7.5C6 6.67 6.67 6 7.5 6H13.5C14.05 6 14.5 6.45 14.5 7V23C14.5 21.9 13.6 21 12.5 21H7.5C6.67 21 6 20.33 6 19.5V7.5Z' stroke='white' stroke-width='2'/%3E%3Cpath d='M22 7.5C22 6.67 21.33 6 20.5 6H14.5V23C14.5 21.9 15.4 21 16.5 21H20.5C21.33 21 22 20.33 22 19.5V7.5Z' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

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

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

.class-select-copy strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
}

.class-select-copy small {
  color: #64748b;
  font-size: 13px;
}

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

.stat-card-deadline small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-weight: 400;
  line-height: 1.4;
}

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

.teacher-main-panel {
  min-width: 0;
}

.teacher-assignment-table table {
  min-width: 980px;
}

.assignment-name-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

.assignment-name-cell strong,
.assignment-name-cell small {
  display: block;
}

.assignment-name-cell small {
  margin-top: 3px;
  color: #64748b;
}

.assignment-file-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(11, 99, 246, 0.12), rgba(11, 99, 246, 0.06)),
    url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3H14L19 8V21H7V3Z' stroke='%230B63F6' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M14 3V8H19' stroke='%230B63F6' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.compact-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.compact-actions .button {
  min-width: 92px;
  min-height: 38px;
  padding: 8px 14px;
}

.center-link {
  display: flex;
  width: fit-content;
  margin: 18px auto 0;
  color: #0b63f6;
  font-weight: 500;
  text-decoration: none;
}

.teacher-side-stack {
  display: grid;
  gap: 18px;
}

.teacher-side-card {
  padding: 20px;
}

.side-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.side-card-head h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.side-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.side-metrics span {
  display: grid;
  gap: 2px;
  min-height: 64px;
  align-content: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.side-metrics strong {
  color: #0b63f6;
  font-size: 20px;
}

.side-actions {
  display: grid;
}

.student-mini-list,
.recent-submission-list {
  display: grid;
  gap: 12px;
}

.student-mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf2ff;
  color: #0b63f6;
  font-weight: 500;
}

.student-mini-row strong,
.student-mini-row small,
.recent-submission-item strong,
.recent-submission-item span,
.recent-submission-item small {
  display: block;
}

.student-mini-row strong,
.recent-submission-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
}

.student-mini-row small,
.recent-submission-item span {
  color: #64748b;
  font-size: 12px;
}

.recent-submission-item {
  padding: 13px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.recent-submission-item small {
  margin-top: 6px;
  color: #0b63f6;
  font-size: 12px;
  font-weight: 500;
}

/* HTML reference tuning from gemini-code-1781595522346.html */
:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #edf2f7;
  --ink: #2d3748;
  --muted: #718096;
  --line: #e2e8f0;
  --primary: #3182ce;
  --primary-strong: #2b6cb0;
  --blue: #3182ce;
  --shadow: none;
  --shadow-lift: 0 12px 28px rgba(45, 55, 72, 0.08);
}

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.app-shell {
  grid-template-columns: 250px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

.brand {
  gap: 12px;
  padding: 0 0 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  box-shadow: none;
}

.brand-mark::before {
  width: 26px;
  height: 26px;
}

.brand strong {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.brand small {
  color: #4a5568;
  font-size: 12px;
  font-weight: 300;
}

.main-nav {
  gap: 16px;
}

.main-nav a {
  min-height: 42px;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

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

.nav-dot {
  width: 20px;
  height: 20px;
  border-color: currentColor;
  border-radius: 7px;
}

.main-nav a.active .nav-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.sidebar-account {
  padding: 20px;
  border: 1px solid #bee3f8;
  border-radius: 12px;
  background: #edf2f7;
}

.sidebar-account strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

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

.topbar {
  position: static;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 24px;
  padding: 24px 24px 0;
  border-bottom: 0;
  background: var(--bg);
  backdrop-filter: none;
}

.topbar-title h1 {
  color: #1a202c;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.topbar-title .eyebrow {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.topbar-actions {
  gap: 16px;
}

.global-search {
  max-width: 360px;
  min-width: 280px;
}

body .global-search input {
  min-height: 42px;
  padding: 10px 16px 10px 40px;
  border-color: var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 14px;
}

.global-search span {
  left: 14px;
  color: var(--muted);
  font-size: 16px;
}

body .notification-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.user-chip {
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: #e2e8f0;
  color: var(--muted);
  font-size: 14px;
}

.user-chip strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

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

.content-area {
  padding: 24px;
}

.panel,
.stat-card,
.assignment-item,
.login-card,
.table-wrap,
.summary-item,
.account-row,
.api-key-row,
.teacher-side-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.panel {
  padding: 24px;
}

.grid.stats {
  gap: 20px;
}

.stat-card {
  min-height: 116px;
  padding: 24px 20px 20px 86px;
  border-radius: 12px;
}

.stat-card::after {
  top: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #ebf8ff;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.stat-card strong {
  color: var(--primary);
  font-size: 32px;
  font-weight: 600;
}

th,
td {
  padding: 16px;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 500;
}

body input,
body select,
body textarea {
  min-height: 42px;
  padding: 10px 16px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}

body button,
body .button,
body button[type="button"],
body button[type="submit"],
body button[type="reset"] {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

body button.secondary,
body .button.secondary,
body .google-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
}

.teacher-class-bar {
  align-items: center;
  gap: 20px;
}

.class-switcher-label {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.class-select-card {
  width: min(520px, 54vw);
  min-height: 64px;
  padding: 11px 48px 11px 14px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.class-select-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  box-shadow: none;
}

.class-select-copy strong {
  color: #1a202c;
  font-size: 15px;
  font-weight: 600;
}

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

.teacher-dashboard-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.teacher-assignment-table table {
  min-width: 880px;
}

.assignment-name-cell strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.assignment-name-cell small {
  color: var(--muted);
  font-size: 12px;
}

.assignment-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.compact-actions .button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.side-card-head h2 {
  color: #1a202c;
  font-size: 16px;
  font-weight: 500;
}

.side-metrics span {
  min-height: 64px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.side-metrics strong {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.recent-submission-item {
  border-color: #bee3f8;
  border-radius: 8px;
  background: #ebf8ff;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .topbar-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .global-search {
    max-width: none;
    min-width: 100%;
  }

  .content-area {
    padding: 24px;
  }

  .teacher-class-bar,
  .class-switcher,
  .teacher-empty-dashboard {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .teacher-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.stats,
  .login-card {
    grid-template-columns: 1fr;
  }

  .account-row,
  .api-key-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-visual {
    min-height: 320px;
  }
}

@media (min-width: 981px) {
  .grid.stats .stat-card:first-child:nth-last-child(n + 4) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .sidebar,
  .login-form,
  .login-visual {
    padding: 18px;
  }

  .main-panel {
    padding: 0;
  }

  .topbar,
  .content-area {
    padding: 18px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .user-chip {
    min-width: 0;
  }

  .user-chip strong,
  .user-chip small {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar,
  .assignment-head {
    display: grid;
  }

  .grid.stats.teacher-stat-grid {
    grid-template-columns: 1fr;
  }

  .side-metrics {
    grid-template-columns: 1fr;
  }

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

  .toolbar,
  .row-actions,
  .account-actions,
  .confirm-dialog .confirm-actions {
    align-items: stretch;
  }

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

  .row-actions > .action-menu,
  .row-actions > .status,
  .row-actions > .icon-button {
    width: auto;
    min-width: auto;
  }

  .row-actions > .action-menu {
    align-self: flex-start;
  }

  .toolbar > label.field-wide + .button,
  .toolbar > label.field-wide + button {
    align-self: stretch;
  }

  body .button,
  body button {
  min-height: 44px;
    padding-inline: 16px;
  }

  .form-grid.two,
  .account-row,
  .api-key-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }
}

/* ── Exercise Creator (ex- prefix) ── */
.ex-workspace {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 24px;
  align-items: start;
}
.ex-col-main {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.ex-col-side {
  position: sticky; top: 80px;
}

.ex-header-card {
  padding: 20px 24px; border: 1px solid var(--ui-line); border-radius: 14px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ex-header-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ex-header-title { display: flex; align-items: center; gap: 8px; color: var(--ui-primary); }
.ex-header-title h2 { margin: 0; font-size: 1.15rem; }
.ex-header-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ex-header-form { display: flex; flex-direction: column; gap: 12px; }
.ex-form-title-row { display: grid; grid-template-columns: 1fr 130px 170px; gap: 12px; align-items: end; }
.ex-deadline-label input { font-size: .8rem; }
.ex-score-label input { text-align: center; font-weight: 600; color: var(--ui-primary); background: var(--ui-surface); }

.ex-label { display: block; font-size: .875rem; font-weight: 600; color: var(--ui-text); margin-bottom: .25rem; }
.ex-label input, .ex-label textarea { display: block; width: 100%; padding: .5rem .75rem; border: 1px solid var(--ui-line); border-radius: 8px; font-size: .875rem; }

.ex-questions-section { display: flex; flex-direction: column; gap: 10px; }
.ex-section-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0; }
.ex-section-subtitle { margin: 6px 0 0; font-size: .82rem; color: #64748b; line-height: 1.45; }
.ex-questions-list { display: flex; flex-direction: column; gap: 10px; }

.ex-question-card {
  padding: 16px 18px; border: 1px solid var(--ui-line); border-radius: 12px;
  background: #fff; transition: border-color .2s;
}
.ex-question-card:hover { border-color: var(--ui-border-hover, #cbd5e1); }
.ex-question-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--spacing-3); margin-bottom: .5rem; }
.ex-question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2); }
.ex-question-num { font-size: .75rem; font-weight: 700; color: var(--ui-muted); text-transform: uppercase; }
.ex-type-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.ex-type-badge.bg-blue-100 { background: #dbeafe; }
.ex-type-badge.text-blue-700 { color: #1d4ed8; }
.ex-type-badge.bg-emerald-100 { background: #d1fae5; }
.ex-type-badge.text-emerald-700 { color: #047857; }
.ex-type-badge.bg-amber-100 { background: #fef3c7; }
.ex-type-badge.text-amber-700 { color: #b45309; }
.ex-type-badge.bg-purple-100 { background: #f3e8ff; }
.ex-type-badge.text-purple-700 { color: #7e22ce; }
.ex-score-badge { font-size: .75rem; font-weight: 500; padding: .25rem .5rem; border-radius: 6px; background: var(--ui-surface); color: var(--ui-muted); }
.ex-question-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.ex-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--ui-line); border-radius: 8px; background: #fff; cursor: pointer; color: var(--ui-muted); transition: all .15s; }
.ex-icon-btn:hover { color: var(--ui-primary); border-color: var(--ui-primary); }
.ex-icon-btn.ex-danger:hover { color: #dc2626; border-color: #dc2626; }
.ex-question-text { margin: .5rem 0; font-size: 1rem; line-height: 1.5; }
.ex-question-image { display: flex; justify-content: center; margin: .5rem 0; }
.ex-question-image img { max-height: 160px; max-width: 100%; border-radius: 8px; border: 1px solid var(--ui-line); }
.ex-question-link { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; color: var(--ui-primary); background: rgba(29,115,201,.08); padding: .25rem .5rem; border-radius: 6px; margin-top: .25rem; }
.ex-question-link a { color: inherit; font-weight: 600; text-decoration: underline; }

.ex-answers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .5rem; }
.ex-option { font-size: .75rem; padding: .375rem .625rem; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-muted); }
.ex-option.ex-correct { background: rgba(29,115,201,.08); border-color: rgba(29,115,201,.3); color: var(--ui-primary); font-weight: 600; }
.ex-tf-row { display: flex; gap: .5rem; margin-top: .5rem; }
.ex-tf-pill { font-size: .75rem; padding: .375rem .625rem; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-muted); }
.ex-tf-pill.ex-correct { background: rgba(29,115,201,.08); border-color: rgba(29,115,201,.3); color: var(--ui-primary); font-weight: 600; }
.ex-text-answer { font-size: .75rem; padding: .5rem; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-surface); margin-top: .5rem; }
.ex-correct-text { color: var(--ui-primary); font-weight: 600; }
.ex-matching-list { display: flex; flex-direction: column; gap: .375rem; margin-top: .5rem; }
.ex-match-pair { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .75rem; padding: .375rem .625rem; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-surface); }
.ex-hint { display: flex; align-items: flex-start; gap: .375rem; font-size: .75rem; padding: .5rem; border-radius: 8px; background: rgba(245,158,11,.08); color: #92400e; margin-top: .5rem; }

.ex-empty-state { text-align: center; padding: var(--spacing-6); border: 2px dashed var(--ui-line); border-radius: 12px; color: var(--ui-muted); }
.ex-empty-state i { font-size: 2rem; margin-bottom: .5rem; display: block; }
.ex-empty-state h4 { margin: 0 0 .25rem; font-size: 1rem; color: var(--ui-text); }
.ex-empty-state p { margin: 0; font-size: .875rem; }

/* ── Exercise settings section (feedback display) ── */
.ex-settings-section { background: #fff; border: 1px solid var(--ui-border); border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; }
.ex-settings-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; background: transparent; color: var(--ui-text); cursor: pointer; text-align: left; }
.ex-settings-toggle-hint { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--ui-primary) 40%, var(--ui-line)); border-radius: 999px; color: var(--ui-primary-strong); font-size: .78rem; font-weight: 700; background: color-mix(in srgb, var(--ui-primary) 6%, var(--ui-surface)); transition: color .15s, border-color .15s, background .15s; }
.ex-settings-toggle:hover .ex-settings-toggle-hint { color: #fff; border-color: var(--ui-primary-strong); background: var(--ui-primary-strong); }
.ex-settings-toggle-hint i { font-size: .72rem; transition: transform .15s; }
.ex-settings-toggle[aria-expanded="true"] .ex-settings-toggle-hint i { transform: rotate(180deg); }
.ex-settings-grid { display: flex; flex-direction: column; gap: 12px; }
.ex-settings-grid[hidden] { display: none; }
.ex-settings-grid:not([hidden]) { margin-top: 16px; }
.ex-ai-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: .82rem; line-height: 1.45; }
.ex-ai-empty[hidden] { display: none !important; }
.ex-toggle-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .875rem; font-weight: 500; }
.ex-toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.ex-toggle-label { user-select: none; }
.ex-release-mode-group { margin-top: 4px; padding: 14px 16px; background: var(--ui-bg-secondary, #f8fafc); border-radius: 10px; border: 1px solid var(--ui-border); min-width: 0; }
.ex-release-mode-label { font-size: .8rem; font-weight: 600; color: var(--ui-muted); margin-bottom: 10px; }
.ex-release-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.ex-release-card {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--ui-border);
  background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.ex-release-card:hover { border-color: #94a3b8; background: #f8fafc; }
.ex-release-card input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.ex-release-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); box-shadow: 0 0 0 1px var(--accent); }
.ex-release-card:has(input:checked) .ex-release-card-head { color: var(--accent); }
.ex-release-card--recommended { position: relative; }
.ex-release-card--recommended:has(input:checked) { border-color: #059669; background: color-mix(in srgb, #059669 6%, #fff); box-shadow: 0 0 0 1px #059669; }
.ex-release-card--recommended:has(input:checked) .ex-release-card-head { color: #059669; }
.ex-release-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-release-card-head { font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.35; overflow-wrap: anywhere; }
.ex-release-card-head i { font-size: .8rem; flex-shrink: 0; }
.ex-release-card-desc { font-size: .75rem; color: #64748b; line-height: 1.4; overflow-wrap: anywhere; }
.ex-recommended-badge {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 20px;
  font-size: .65rem; font-weight: 700; background: #d1fae5; color: #065f46; letter-spacing: .02em;
}
.ex-release-warning { margin-top: 10px; padding: 10px 14px; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; font-size: .8rem; color: #92400e; display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.ex-release-warning i { margin-top: 2px; flex-shrink: 0; }
@media (max-width: 640px) {
  .ex-settings-section { padding: 16px 14px; }
  .ex-release-mode-group { padding: 12px; }
  .ex-release-card { padding: 10px 12px; }
  .ex-release-card-desc { font-size: .72rem; }
}

/* ── Student exercise feedback display ── */
.ws-q-score-badge { display: none; margin-left: 8px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.ws-q-score-badge.correct { display: inline; background: #dcfce7; color: #166534; }
.ws-q-score-badge.wrong { display: inline; background: #fee2e2; color: #991b1b; }
.ws-correct-answer { margin-top: 8px; padding: 8px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: .8rem; color: #166534; display: flex; align-items: center; gap: 6px; }
.ws-feedback-content { font-size: .8rem; line-height: 1.5; color: #334155; }
.ws-feedback-pending { font-size: .8rem; color: #64748b; font-style: italic; display: flex; align-items: center; gap: 6px; }
.ws-question.submitted .ws-q-input { opacity: .85; pointer-events: none; }

/* ── Exercise confirm grade (teacher) ── */
.status.ai-graded { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.confirm-grade-button { color: #059669 !important; }
.confirm-grade-button:hover { background: color-mix(in srgb, #059669 12%, transparent); }
.ex-confirm-student { font-weight: 600; margin: 0 0 12px; font-size: .95rem; }
.ex-confirm-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ex-confirm-fields .ex-label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 500; }
.ex-confirm-fields input,
.ex-confirm-fields textarea {
  padding: 8px 12px; border: 1px solid var(--ui-border); border-radius: 8px;
  font-size: .85rem; font-family: inherit; resize: vertical;
}
.ex-confirm-fields input:focus,
.ex-confirm-fields textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.ex-confirm-notice { font-size: .8rem; color: #64748b; margin: 0; display: flex; align-items: center; gap: 6px; }

.ex-sticky-spacer { height: 1px; }

/* ── Sticky action bar (bottom) ── */
.ex-sticky-actions {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 0; margin-top: 4px;
  background: linear-gradient(to top, #fff 60%, transparent);
  border-top: 1px solid var(--ui-line);
  grid-column: 1 / -1;
}
.ex-sticky-actions .button { min-height: 44px; padding: 10px 20px; font-size: .875rem; }

/* ── Inline add-bar (desktop: right sidebar) ── */
.ex-add-bar {
  display: flex; flex-direction: column; gap: 0;
  padding: 12px; border: 1px solid var(--ui-line); border-radius: 12px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  overflow: hidden;
}
.ex-side-section { padding: 0; min-width: 0; }
.ex-side-label {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; color: #0f172a;
  padding: 0 0 6px;
}
.ex-side-label i { color: var(--ui-primary); font-size: .75rem; }
.ex-side-separator {
  height: 1px; margin: 12px 0;
  background: var(--ui-line);
}
.ex-add-type-actions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px;
}

/* ── Block type buttons (white bg, thin border, blue icon) ── */
.ex-type-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 36px; padding: 6px 2px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fff !important; color: #334155 !important; cursor: pointer;
  font-size: .65rem; font-weight: 600;
  transition: background .15s, border-color .15s, box-shadow .15s;
  overflow: hidden; min-width: 0;
}
.ex-type-btn:hover { background: #eff6ff !important; border-color: #93c5fd; box-shadow: 0 0 0 1px #93c5fd; }
.ex-type-btn:active { background: #dbeafe !important; }
.ex-type-btn i { font-size: .85rem; color: var(--ui-primary) !important; }
.ex-type-btn span { line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.ex-mobile-add-btn { display: none; }

/* ── Mobile floating action button (hidden on desktop) ── */
.ex-mobile-fab {
  display: none; position: fixed;
  right: 20px; bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 50; width: 56px; height: 56px;
  border: none; border-radius: 50%;
  background: var(--ui-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(29,115,201,.35);
  font-size: 1.4rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.ex-mobile-fab:active { transform: scale(.92); }

/* ── Mobile bottom sheet + overlay (hidden on desktop) ── */
.ex-add-bar-mobile-overlay { display: none; }
.ex-add-bar-mobile-sheet { display: none; }

/* ── Exercise add-sheet modal ── */
.ex-add-sheet-dialog { max-width: 620px; }
.ex-add-sheet-body { display: grid; gap: 16px; }
.ex-method-segmented { display: flex; gap: 8px; background: #f1f5f9; padding: 4px; border-radius: 12px; }
.ex-method-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #64748b; font-weight: 600; font-size: .85rem; cursor: pointer; transition: all .15s; }
.ex-method-btn:hover { color: #334155; }
.ex-method-btn.active { background: #fff; border-color: #cbd5e1; color: #0b63f6; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ex-method-btn i { font-size: .95rem; }
.ex-ai-disabled-note { margin: 0; font-size: .78rem; color: #92400e; }
.ex-ai-generate-panel { display: grid; gap: 12px; padding: 12px; border: 1px solid #ddeaf7; border-radius: 12px; background: #f8fafc; }
.ex-ai-generate-panel[hidden],
.ex-manual-form[hidden],
#ex-add-manual-actions[hidden],
#ex-add-ai-actions[hidden],
#ex-ai-disabled-note[hidden] { display: none !important; }
.ex-ai-context-box { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e2e8f0; font-size: .8rem; color: #475569; }
.ex-ai-context-box b { color: #0f172a; font-weight: 600; }
.ex-ghost-close { width: 36px; min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: none; background: #f1f5f9; color: #94a3b8; border-radius: 8px; cursor: pointer; font-size: 1.2rem; line-height: 1; transition: all .15s; padding: 0; }
.ex-ghost-close:hover { background: #e2e8f0; color: #475569; }
.ex-manual-form { display: grid; gap: 14px; }
.ex-manual-form .ex-choice-row { display: flex; align-items: center; gap: 8px; }
.ex-manual-form .ex-choice-row input[type="text"] { flex: 1; }
.ex-manual-form .ex-tf-options { display: flex; gap: 16px; }
.ex-manual-form .ex-tf-option { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 10px; cursor: pointer; background: #fff; font-size: .85rem; }
.ex-manual-form .ex-tf-option:has(input:checked) { border-color: #0b63f6; background: #eff6ff; color: #0b63f6; }
.ex-manual-form .ex-score-hint-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.ex-manual-form .ex-score-hint-row .ex-hint-label { flex: 1; }
.ex-manual-form .ex-score-hint-row input[type="number"] { width: 100%; }
.ex-manual-form .ex-match-row { display: flex; gap: 8px; margin-bottom: 6px; }
.ex-manual-form .ex-match-row input { flex: 1; }
.ex-add-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

@media (max-width: 900px) {
  .ex-workspace { grid-template-columns: 1fr; }
  .ex-col-side { display: none; }
  .ex-form-title-row { grid-template-columns: 1fr 1fr; }
  .ex-header-tools .button { min-height: 44px; }
}
@media (max-width: 640px) {
  .ex-workspace { padding-bottom: 96px; }
  .ex-form-title-row { grid-template-columns: 1fr; }
  .ex-answers-grid { grid-template-columns: 1fr; }
  .ex-sticky-actions { flex-wrap: wrap; gap: 8px; }
  .ex-sticky-actions .button { flex: 1; min-width: 0; font-size: .8rem; padding: 10px 12px; }

  /* Mobile: add-bar hidden by default, shown as bottom sheet on toggle */
  .ex-add-bar-desktop { display: none !important; }
  .ex-mobile-fab { display: grid; place-items: center; }
  .ex-add-bar-mobile-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    max-height: 70dvh; overflow-y: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: #fff; box-shadow: 0 -8px 30px rgba(15,23,42,.18);
    transform: translateY(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .ex-add-bar-mobile-sheet.open { transform: translateY(0); }
  .ex-add-bar-mobile-sheet .ex-add-type-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ex-add-bar-mobile-sheet .ex-type-btn { min-height: 48px; font-size: .75rem; }
  .ex-add-bar-mobile-sheet .ex-type-btn i { font-size: 1.15rem; }
  .ex-add-bar-mobile-overlay {
    display: block; position: fixed; inset: 0; z-index: 78;
    background: rgba(15,23,42,.3); opacity: 0; pointer-events: none;
    transition: opacity .25s;
  }
  .ex-add-bar-mobile-overlay.open { opacity: 1; pointer-events: auto; }

  .ex-add-sheet .modal-dialog { width: 100%; max-width: none; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 18px 18px 0 0; overflow: hidden; }
  .ex-add-sheet .modal-body { overflow-y: auto; }
  .ex-method-segmented { border-radius: 10px; }
  .ex-header-card { padding: 14px 16px; }
  .ex-question-card { padding: 12px 14px; }
  .ex-header-tools .button { font-size: .78rem; padding-inline: 10px; }
  .ex-release-card { padding: 10px 12px; }
  .ex-release-card-desc { font-size: .72rem; }
}

/* Exercise Modal */
.ex-modal .modal-dialog.ex-modal-dialog { max-width: 700px; max-height: calc(100vh - 72px); display: flex; flex-direction: column; overflow: hidden; }
.ex-modal-header { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: .625rem 1rem; border-bottom: 1px solid var(--ui-line); background: #fff; border-radius: 16px 16px 0 0; flex-shrink: 0; }

/* Submissions tab bar */
.submissions-tabs { gap: 6px; }
.submissions-tabs .button.active { background: var(--ui-primary, #4f46e5); color: #fff; border-color: var(--ui-primary, #4f46e5); }
.submissions-tabs .button.active:hover { opacity: .9; }
.submissions-page .submissions-tabs .button.secondary { color: var(--ui-muted, #64748b); border-color: var(--ui-line, #e2eaf4); background: #fff; }
.submissions-page .submissions-tabs .button.secondary:hover { color: var(--ui-primary, #1d73c9); border-color: var(--ui-primary, #1d73c9); background: #fff; }
.ex-modal-header-left { display: flex; align-items: center; gap: .5rem; }
.ex-modal-accent { width: 4px; height: 22px; border-radius: 2px; background: var(--ui-primary, #4f46e5); flex-shrink: 0; }
.ex-modal-header.ex-accent-blue .ex-modal-accent { background: #2563eb; }
.ex-modal-header.ex-accent-emerald .ex-modal-accent { background: #059669; }
.ex-modal-header.ex-accent-amber .ex-modal-accent { background: #d97706; }
.ex-modal-header.ex-accent-purple .ex-modal-accent { background: #7c3aed; }
.ex-modal-header h2 { margin: 0; font-size: 1rem; color: var(--ui-text); font-weight: 700; }
.ex-modal-header .ex-modal-close { width: 36px; min-width: 36px; min-height: 36px; font-size: 1.1rem; border-color: #e2e8f0; background: #fff; color: #64748b; border-radius: 8px; }
.ex-modal-header .ex-modal-close:hover { background: #f8fafc; color: #334155; }
.ex-modal-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.ex-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .625rem 1.25rem; border-top: 1px solid var(--ui-line); background: #fff; border-radius: 0 0 16px 16px; flex-shrink: 0; }
.ex-modal-footer .button { min-height: 38px; }

.ex-section-label { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .03em; }
.ex-form-section { margin-bottom: 1rem; }
.ex-form-section:last-child { margin-bottom: 0; }
.ex-sr-only-label { display: block; }
.ex-optional-section { border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); overflow: hidden; }
.ex-optional-section > summary { list-style: none; cursor: pointer; padding: .625rem .75rem; font-size: .75rem; font-weight: 700; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: .375rem; user-select: none; }
.ex-optional-section > summary::-webkit-details-marker { display: none; }
.ex-collapse-icon { font-size: .6rem; transition: transform .15s; }
.ex-optional-section[open] > summary .ex-collapse-icon { transform: rotate(90deg); }
.ex-optional-tag { font-size: .65rem; font-weight: 500; color: var(--ui-muted); background: #f1f5f9; padding: 1px 6px; border-radius: 99px; text-transform: none; letter-spacing: 0; }
.ex-optional-content { padding: .5rem .75rem .75rem; }

.ex-image-section, .ex-link-section { padding: .5rem .625rem; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); }
.ex-image-section { margin-bottom: .5rem; }
.ex-image-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .375rem; }
.ex-image-actions { display: flex; gap: .375rem; }
.ex-image-preview-container { margin-top: .375rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--ui-line); max-height: 10rem; display: flex; justify-content: center; background: rgba(0,0,0,.03); }
.ex-image-preview-container img { max-height: 10rem; width: 100%; object-fit: contain; }
.ex-upload-status { font-size: .7rem; }
.ex-upload-status.processing { color: #d97706; font-weight: 600; }
.ex-upload-status.success { color: #059669; font-weight: 600; }
.ex-danger-btn { color: #dc2626; }

.ex-link-section { margin-bottom: 0; }
.ex-link-row { display: grid; grid-template-columns: 1fr 1fr; gap: .375rem; }
.ex-link-row input { padding: .375rem .5rem; border: 1px solid var(--ui-line); border-radius: 6px; font-size: .72rem; }

.ex-choice-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.ex-choice-row input[type="radio"] { width: 1rem; height: 1rem; accent-color: var(--ui-primary); }
.ex-choice-row input[type="text"] { flex: 1; padding: .375rem .625rem; border: 1px solid var(--ui-line); border-radius: 8px; font-size: .75rem; }
.ex-tf-options { display: flex; gap: .625rem; }
.ex-tf-option { flex: 1; display: flex; align-items: center; justify-content: center; gap: .375rem; padding: .625rem; border: 1px solid var(--ui-line); border-radius: 8px; cursor: pointer; background: var(--ui-surface); font-size: .875rem; font-weight: 600; }
.ex-tf-option:hover { background: rgba(0,0,0,.03); }
.ex-match-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .375rem; }
.ex-match-row input { padding: .375rem .625rem; border: 1px solid var(--ui-line); border-radius: 8px; font-size: .75rem; }
.ex-help { display: block; font-size: .75rem; color: var(--ui-muted); margin-top: .25rem; }

.ex-score-hint-row { display: grid; grid-template-columns: auto 1fr; gap: .75rem; }
.ex-score-hint-row .ex-label input { width: 100%; }

@media (max-width: 640px) {
  .ex-modal .modal-dialog.ex-modal-dialog { max-width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .ex-modal-header { border-radius: 0; padding: .5rem .75rem; }
  .ex-modal-body { padding: .75rem; }
  .ex-modal-footer { flex-direction: row; padding: .5rem .75rem; padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0)); border-radius: 0; }
  .ex-modal-footer .button { flex: 1; }
  .ex-link-row { grid-template-columns: 1fr; }
  .ex-match-row { grid-template-columns: 1fr; }
  .ex-score-hint-row { grid-template-columns: 1fr; }
}

/* Exercise list in manage page */
.exercise-list-panel { margin-bottom: var(--spacing-4); }
.exercise-list { display: flex; flex-direction: column; gap: .5rem; margin-top: var(--spacing-3); }
.exercise-item { display: flex; flex-direction: column; gap: .375rem; padding: var(--spacing-3); border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); }
.exercise-head { display: flex; justify-content: space-between; align-items: center; }
.exercise-head h4 { margin: 0; font-size: .9rem; }
.exercise-meta { display: flex; gap: .5rem; align-items: center; font-size: .8rem; }
.exercise-actions { display: flex; gap: .5rem; margin-top: .25rem; }
.btn-sm { padding: .375rem .75rem; font-size: .8rem; }

/* ── Student worksheet exercise view ── */
.ws-paper-wrapper { background: #f1f5f9; padding: 24px 16px; min-height: 80vh; }
@media (min-width: 768px) { .ws-paper-wrapper { padding: 32px 24px; } }
.worksheet-paper {
  background-color: #fff;
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  padding: 2rem 1.5rem;
  position: relative;
}
@media (min-width: 768px) { .worksheet-paper { padding: 3rem 3.5rem; } }
@media (max-width: 640px) { .worksheet-paper { border-radius: 0; border-left: none; border-right: none; padding: 1.5rem 1.25rem; } .ws-paper-wrapper { padding: 0; } }
.worksheet-top-bar { position: absolute; top: 0; left: 0; right: 0; height: .375rem; background: var(--ui-primary, #4f46e5); border-radius: 12px 12px 0 0; }
.worksheet-header { text-align: center; padding-bottom: 1.25rem; border-bottom: 2px solid #e2e8f0; margin-bottom: 1.5rem; margin-top: .75rem; }
.worksheet-badge { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .75rem; background: rgba(79,70,229,.08); border: 1px solid rgba(79,70,229,.2); color: var(--ui-primary, #4f46e5); font-size: .7rem; font-weight: 700; border-radius: 99px; margin-bottom: .75rem; }
.worksheet-title { font-size: 1.35rem; font-weight: 700; color: #0f172a; margin: 0 0 .375rem; }
.worksheet-instructions { font-size: .85rem; color: #64748b; font-style: italic; margin: 0 auto; max-width: 80%; }
@media (max-width: 640px) { .worksheet-instructions { max-width: 100%; } }
.ws-header-meta { font-size: .78rem; color: #94a3b8; margin-top: .5rem; letter-spacing: .01em; }
.ws-group-gate {
  --gate-accent: var(--ui-primary, #2f86d4);
  --gate-soft: #eef6ff;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(700px, calc(100% - 32px));
  margin: clamp(32px, 7vh, 72px) auto;
  padding: 38px 42px 34px;
  overflow: hidden;
  border: 1px solid #dbe5f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
  color: #475569;
  text-align: center;
}
.ws-group-gate::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gate-accent) 25%, var(--gate-accent) 75%, transparent);
}
.ws-group-gate-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 2px;
  border: 1px solid color-mix(in srgb, var(--gate-accent) 22%, white);
  border-radius: 20px;
  background: var(--gate-soft);
  color: var(--gate-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--gate-accent) 12%, transparent);
}
.ws-group-gate-icon i { font-size: 28px; }
.ws-group-gate-kicker {
  color: var(--gate-accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ws-group-gate h2 { margin: 0; color: #172033; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.35; }
.ws-group-gate > p { max-width: 540px; margin: 0; color: #64748b; font-size: .9rem; line-height: 1.65; }
.ws-group-gate-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}
.ws-group-gate-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: .73rem;
  font-weight: 600;
}
.ws-group-gate-meta span i { color: #64748b; }
.ws-group-gate-meta span.is-waiting { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.ws-group-gate-meta span.is-waiting i { color: var(--ui-primary, #2f86d4); }
.ws-group-gate-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ws-group-gate-actions .button { min-width: 154px; justify-content: center; }
.ws-group-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  max-width: 680px;
  margin: 1rem auto 0;
  padding: .625rem .75rem;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #334155;
  font-size: .76rem;
  text-align: left;
}
.ws-group-strip > span { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.ws-group-strip > span i { color: #2563eb; }
.ws-group-strip .button { flex-shrink: 0; }
.ws-group-manager-dialog { width: min(680px, calc(100vw - 2rem)); }
.ws-group-manager-body { display: grid; gap: 14px; max-height: min(70vh, 680px); overflow-y: auto; }
.ws-group-manager-modal .eyebrow { color: var(--ui-primary, #2f86d4); }
.ws-group-manager-modal .group-member-item.is-leader { border-color: #bfdbfe; background: #eff6ff; }
.ws-group-manager-modal .group-member-badge.leader { background: #dbeafe; color: #1d4ed8; }
.ws-group-invite-form { padding: 12px; border: 1px solid #bfdbfe; border-radius: 10px; background: #f8fbff; }
.ws-group-invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.ws-group-invite-row input { min-width: 0; }
.ws-group-lock-notice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: #f1f5f9; color: #475569; font-size: .78rem; }
.ws-group-lock-notice i { color: #64748b; }

@media (max-width: 640px) {
  .ws-group-gate { width: calc(100% - 24px); margin: 20px auto; padding: 30px 20px 24px; border-radius: 17px; }
  .ws-group-gate-icon { width: 60px; height: 60px; border-radius: 17px; }
  .ws-group-gate-icon i { font-size: 24px; }
  .ws-group-gate-actions { width: 100%; }
  .ws-group-gate-actions .button { width: 100%; }
  .ws-group-strip { align-items: stretch; flex-direction: column; }
  .ws-group-strip .button { width: 100%; justify-content: center; }
  .modal.ws-group-manager-modal { align-items: stretch; }
  .ws-group-manager-modal .modal-dialog.ws-group-manager-dialog { width: 100%; height: 100dvh; max-width: none; max-height: 100dvh; border-radius: 0; }
  .ws-group-manager-body { max-height: none; }
  .ws-group-invite-row { grid-template-columns: 1fr; }
  .ws-group-invite-row button { width: 100%; justify-content: center; }
}

/* Progress banner */
.ws-progress-banner { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
@media (max-width: 640px) { .ws-progress-banner { grid-template-columns: 1fr; } }
.ws-progress-box { display: flex; flex-direction: column; justify-content: center; background: #f8fafc; padding: .5rem .875rem; border-radius: 8px; border: 1px solid #e2e8f0; }
.ws-progress-label { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; color: #64748b; margin-bottom: .25rem; }
.ws-progress-pct { font-weight: 700; color: var(--ui-primary, #4f46e5); }
.ws-progress-track { width: 100%; background: #e2e8f0; border-radius: 99px; height: .375rem; overflow: hidden; }
.ws-progress-fill { background: var(--ui-primary, #4f46e5); height: .375rem; border-radius: 99px; transition: width .3s; }
.ws-tab-box { display: flex; align-items: center; justify-content: space-between; background: #f8fafc; padding: .5rem .875rem; border-radius: 8px; border: 1px solid #e2e8f0; font-size: .7rem; color: #64748b; }
.ws-tab-count { font-weight: 700; color: #0f172a; }

/* Visibility warning banner */
.ws-warning-banner { background: #fff5f5; border: 1px solid #fed7d7; color: #9b2c2c; padding: .625rem 1rem; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 600; margin-bottom: 1.25rem; gap: .75rem; }
.ws-warning-banner i { color: #e53e3e; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Question flow */
.ws-questions { display: flex; flex-direction: column; }
.ws-question { padding: 1.5rem 0; border-bottom: 1px solid #e2e8f0; }
.ws-question:last-child { border-bottom: none; padding-bottom: 0; }
.ws-question:first-child { padding-top: 0; }
.ws-question.correct { background: rgba(16,185,129,.03); margin: 0 -1rem; padding: 1.5rem 1rem; border-left: 3px solid #10b981; }
.ws-question.wrong { background: rgba(244,63,94,.03); margin: 0 -1rem; padding: 1.5rem 1rem; border-left: 3px solid #f43f5e; }
.ws-question.partial { background: rgba(245,158,11,.03); margin: 0 -1rem; padding: 1.5rem 1rem; border-left: 3px solid #f59e0b; }
.ws-q-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.ws-q-num { font-weight: 700; color: var(--ui-primary, #4f46e5); font-size: .85rem; }
.ws-q-score { font-size: .7rem; color: #94a3b8; }
.ws-q-score-badge { display: none; font-size: .7rem; font-weight: 700; padding: .125rem .5rem; border-radius: 99px; margin-left: .5rem; }
.ws-q-text { font-size: .95rem; font-weight: 600; color: #0f172a; line-height: 1.55; margin-bottom: .75rem; }
.ws-q-image { display: flex; justify-content: center; margin: .75rem 0; }
.ws-q-image img { max-height: 18rem; max-width: 100%; border-radius: 8px; border: 1px solid #e2e8f0; background: #fafafa; object-fit: contain; }
.ws-q-link { margin: .5rem 0; }
.ws-q-link a { display: inline-flex; align-items: center; gap: .375rem; background: rgba(79,70,229,.06); border: 1px solid rgba(79,70,229,.18); color: var(--ui-primary, #4f46e5); font-size: .73rem; font-weight: 600; padding: .4rem .7rem; border-radius: 8px; text-decoration: none; transition: background .15s; }
.ws-q-link a:hover { background: rgba(79,70,229,.12); }

/* Choice radio cards */
.ws-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; margin-top: .75rem; }
@media (max-width: 640px) { .ws-choice-grid { grid-template-columns: 1fr; } }
.ws-choice-card { display: flex; align-items: center; gap: .625rem; padding: .625rem .75rem; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; background: #fff; transition: all .12s; }
.ws-choice-card:hover { border-color: var(--ui-primary, #4f46e5); background: rgba(79,70,229,.03); }
.ws-choice-card input[type="radio"] { width: .95rem; height: .95rem; accent-color: var(--ui-primary, #4f46e5); }
.ws-choice-card span { font-size: .85rem; font-weight: 500; color: #1e293b; }

/* True/false buttons */
.ws-tf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .75rem; }
.ws-tf-card { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .625rem; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; background: #fff; transition: all .12s; }
.ws-tf-card input[type="radio"] { width: .95rem; height: .95rem; }
.ws-tf-card span { font-size: .85rem; font-weight: 700; }
.ws-tf-true:hover { border-color: #10b981; background: rgba(16,185,129,.04); }
.ws-tf-true input { accent-color: #10b981; }
.ws-tf-false:hover { border-color: #f43f5e; background: rgba(244,63,94,.04); }
.ws-tf-false input { accent-color: #f43f5e; }

/* Text answer textarea — paper-like writing lines */
.ws-text-answer { width: 100%; min-height: 100px; background: transparent; border: 1px solid #cbd5e1; border-radius: 8px; padding: .75rem; font-size: .875rem; color: #0f172a; outline: none; transition: border-color .15s; resize: vertical; font-weight: 500; line-height: 1.6; }
.ws-text-answer:focus { border-color: var(--ui-primary, #4f46e5); box-shadow: 0 0 0 2px rgba(79,70,229,.1); }
.ws-text-answer::placeholder { color: #c0c8d4; font-weight: 400; }

/* Matching select */
.ws-match-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; margin-top: .625rem; padding-bottom: .625rem; border-bottom: 1px dashed #cbd5e1; }
.ws-match-row:last-child { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 640px) { .ws-match-row { grid-template-columns: 1fr; padding-bottom: .875rem; } }
.ws-match-key { background: #f8fafc; border: 1px solid #e2e8f0; padding: .625rem .75rem; border-radius: 8px; font-size: .85rem; font-weight: 500; color: #0f172a; }
.ws-match-arrow { text-align: center; color: #94a3b8; }
.ws-match-arrow i { font-size: .8rem; }
.ws-match-select { width: 100%; padding: .6rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: .8rem; background: #fff; outline: none; }
.ws-match-select:focus { border-color: var(--ui-primary, #4f46e5); box-shadow: 0 0 0 2px rgba(79,70,229,.1); }

/* Feedback (shown after grading) */
.ws-feedback { display: none; padding: .75rem; border-radius: 8px; font-size: .75rem; margin-top: .75rem; line-height: 1.5; }
.ws-feedback.show { display: block; }
.ws-feedback-correct { background: #f0fdf4; border: 1px solid #bbf7d0; }
.ws-feedback-wrong { background: #fff1f2; border: 1px solid #fecdd3; }

/* Submit section */
.ws-submit-section { display: flex; justify-content: center; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; gap: .75rem; flex-wrap: wrap; }
.ws-submit-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.75rem; background: var(--ui-primary, #4f46e5); color: #fff; font-weight: 700; font-size: .95rem; border-radius: 12px; border: none; cursor: pointer; transition: background .15s; }
.ws-submit-btn:hover { background: #4338ca; }
.ws-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.ws-back-btn { display: inline-flex; align-items: center; gap: .375rem; padding: .6rem 1.1rem; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #1e293b; font-size: .83rem; cursor: pointer; transition: background .15s; }
.ws-back-btn:hover { background: #f8fafc; }

/* Toast */
.ws-toast { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9999; background: #1e293b; color: #fff; padding: .75rem 1.25rem; border-radius: 16px; font-size: .85rem; display: flex; align-items: center; gap: .5rem; box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(1.25rem); opacity: 0; transition: all .3s; }
.ws-toast.show { transform: translateY(0); opacity: 1; }
.ws-toast i { color: #818cf8; }

/* Student exercise view — print / PDF */
@media print {
  .sidebar, .topbar, .right-drawer, .drawer-overlay, .ws-progress-banner, .ws-warning-banner, .ws-paper-wrapper,
  .ws-submit-section, .ws-back-btn, .ws-sticky-bar, .ws-toast, [data-exercise-submit], .ws-confirm-modal { display: none !important; }
  .main-panel { padding: 0 !important; }
  .worksheet-paper { border: none; box-shadow: none; padding: 0; max-width: 100%; }
  .ws-text-answer { border-bottom: 1px solid #000 !important; border-style: solid !important; }
}

/* ── Work card (shared exercise + assignment card style) ── */
.work-section { margin-bottom: var(--spacing-4); }
.work-card-list { display: flex; flex-direction: column; gap: .625rem; }
.work-card { display: flex; flex-direction: column; gap: .375rem; padding: 16px 18px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); transition: border-color .15s; }
.work-card:hover { border-color: #818cf8; }
.work-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.work-card-head h3 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--ui-text); }
.work-card-head p { margin: .125rem 0 0; font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-card-badges { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.work-card-meta { display: flex; flex-wrap: wrap; gap: .3125rem; align-items: center; }
.work-card-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 0; padding-top: .5rem; border-top: 1px dashed var(--ui-line); }
.work-card-actions .btn-sm { font-size: .78rem; padding-inline: 12px; min-height: 36px; }
.work-card-actions .btn-sm i,
.work-card-actions .btn-sm svg { font-size: 16px; }
.work-card-actions .btn-sm.primary-action { }
.work-card-actions .btn-sm.secondary-action { background: transparent; border: 1px solid var(--ui-border); color: var(--ui-muted); }
.work-card-actions .btn-sm.secondary-action:hover { background: var(--ui-bg-secondary, #f1f5f9); border-color: #94a3b8; color: var(--ui-text); }
.work-card-actions .btn-sm.disabled-hint { background: transparent; border: 1px dashed #cbd5e1; color: #94a3b8; cursor: default; opacity: .7; }
.feedback-chip {
  background: #ecfdf5 !important; color: #065f46 !important; border: 1px solid #a7f3d0 !important;
  font-weight: 600;
}
.work-card-details { font-size: .75rem; margin: 0; }
.work-card-details summary { cursor: pointer; color: var(--ui-primary); font-weight: 500; user-select: none; display: flex; align-items: center; gap: .25rem; }
.work-card-details summary i { font-size: .6rem; transition: transform .15s; }
.work-card-details[open] summary i { transform: rotate(90deg); }
.work-card-details p { margin: .375rem 0 0; font-size: .75rem; }

.ex-type-pill { background: #eef2ff; color: #4338ca; }
.assignment-type-pill { background: #ecfdf5; color: #047857; }

.work-card-actions .icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 9px; font-size: 16px; flex-shrink: 0;
  border: 1px solid #ddeaf7; background: #fff; color: #1976d2;
}
.work-card-actions .icon-btn:hover { background: #eaf4ff; border-color: #1976d2; color: #1565c0; }
.work-card-actions .icon-btn.primary { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
.work-card-actions .icon-btn.primary:hover { background: var(--ui-primary-strong); border-color: var(--ui-primary-strong); }
.work-card-details { margin-top: .375rem; }
.work-card-details .assignment-detail-badges,
.work-card-details .assignment-detail-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
}
.work-card-details .assignment-detail-meta {
  margin-top: 7px; color: var(--ui-muted); font-size: 12px;
}
.work-card-details .assignment-detail-meta span {
  display: inline-flex; align-items: center; gap: 5px;
}

/* more dropdown inside work-card */
.more-wrap { position: relative; }
.more-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: #64748b;
  font-size: 16px; cursor: pointer;
  transition: background .15s, color .15s;
}
.more-trigger:hover { background: #f1f5f9; color: #0f172a; }
.more-trigger:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.more-menu {
  position: absolute; top: 100%; right: 0; margin-top: 4px; z-index: 50;
  min-width: 160px; max-width: 200px; background: #fff;
  border: 1px solid #f1f5f9; border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  padding: 6px 0; overflow: hidden;
  opacity: 0; transform: scale(0.95); transform-origin: top right;
  transition: opacity .15s ease-out, transform .15s ease-out;
  pointer-events: none;
}
.more-menu.is-open {
  opacity: 1; transform: scale(1); pointer-events: auto;
}
.more-menu button,
.more-menu a {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 16px; border: none; background: #fff;
  font-size: 14px; cursor: pointer;
  white-space: nowrap; text-decoration: none; color: #374151;
  transition: background .15s, color .15s;
}
.more-menu button:hover,
.more-menu a:hover { background: #f9fafb; }
.more-menu button.danger { color: #dc2626; background: #fff; }
.more-menu button.danger:hover { background: #fef2f2; }
.more-menu-divider { height: 1px; background: #f1f5f9; margin: 6px 0; }

.desktop-only { display: inline-flex; }
.mobile-only { display: none !important; }

@media (max-width: 640px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }

  .work-card-head { gap: .5rem; }
  .work-card-head h3 { font-size: 1.05rem; line-height: 1.3; }
  .work-card-head p { font-size: .85rem; line-height: 1.45; }
  .work-card-badges { justify-content: flex-start; }
  .work-card { padding: 12px 14px; border-radius: 14px; border-color: #e2e8f0; }
  .work-card-meta .pill,
  .work-card-meta .status { padding: 4px 9px; font-size: .68rem; min-height: 22px; }
  .work-card-meta { gap: .25rem; }
  .work-card-actions { flex-direction: row !important; gap: 6px; }
  .work-card-actions .btn-sm { width: auto !important; font-size: .78rem; padding-inline: 10px; min-height: 34px; }
  .work-card-details { font-size: .7rem; }

  /* Mobile: bottom sheet for more-menu */
  .more-trigger { width: 34px; height: 34px; }
  .more-menu.is-open { transform: scale(1); }
  .more-menu-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 99;
    animation: fadeIn .15s ease;
  }
  .more-menu.is-mobile-sheet {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    margin: 0; border-radius: 16px 16px 0 0;
    min-width: 100%; max-width: 100%; z-index: 100;
    padding: 8px 12px 24px; box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    animation: slideUp .2s ease;
  }
  .more-menu.is-mobile-sheet::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: #CBD5E1; border-radius: 2px; margin: 0 auto 8px;
  }
  .more-menu.is-mobile-sheet button,
  .more-menu.is-mobile-sheet a { height: 48px; font-size: 15px; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Exercise creator: save status + more dropdown + deadline ── */
.ex-save-status { font-size: .75rem; padding: .25rem 0; display: flex; align-items: center; gap: .375rem; }
.ex-save-status.saved { color: #059669; }
.ex-save-status.unsaved { color: #d97706; }
.ex-more-dropdown { position: relative; }
.ex-more-menu { position: absolute; top: 100%; right: 0; margin-top: .25rem; background: #fff; border: 1px solid var(--ui-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 100; min-width: 180px; overflow: hidden; }
.ex-more-menu button { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .625rem 1rem; border: none; background: none; text-align: left; font-size: .85rem; cursor: pointer; transition: background .1s; }
.ex-more-menu button:hover { background: #f8fafc; }
.ex-deadline-label { min-width: 200px; }
.ex-q-summary { font-size: .75rem; color: var(--ui-muted); margin-left: auto; }

/* ── Exercise creator: preview bar ── */
.ex-preview-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: rgba(79,70,229,.04); border: 1px solid rgba(79,70,229,.15); border-radius: 8px; margin-bottom: 1rem; max-width: 920px; margin-left: auto; margin-right: auto; }
.ex-preview-label { font-size: .78rem; color: var(--ui-primary, #4f46e5); font-weight: 600; display: flex; align-items: center; gap: .375rem; }
.ex-preview-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 600; padding: .2rem .6rem; background: rgba(79,70,229,.1); border-radius: 6px; color: var(--ui-primary, #4f46e5); }

/* ── Student exercise: sticky submit bar ── */
.ws-sticky-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid #e2e8f0; }
.ws-sticky-inner { max-width: 920px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 1rem; }
.ws-sticky-actions { display: flex; align-items: center; gap: .5rem; }
.ws-sticky-progress { font-size: .85rem; font-weight: 700; color: var(--ui-primary, #4f46e5); white-space: nowrap; }
.ws-draft-status { color: #64748b; font-size: .72rem; white-space: nowrap; }
@media (min-width: 769px) { .ws-sticky-bar { left: var(--sidebar-width, 240px); } }
.worksheet-paper { padding-bottom: 68px; }
.ws-submit-section { display: none; }

/* ── Student exercise: confirm modal ── */
.modal.ws-confirm-modal { backdrop-filter: blur(4px); background: rgba(15,23,42,.35); }
.ws-confirm-modal .modal-dialog { max-width: 420px; border-radius: 18px; }
.ws-confirm-modal .modal-header { padding: 18px 22px 0; border-bottom: none; }
.ws-confirm-modal .modal-header h2 { font-size: 1.1rem; }
.ws-confirm-modal .modal-body { padding: 14px 22px 10px; }
.ws-confirm-modal .modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: 10px 22px 18px; border-top: 1px solid var(--line); }
.ws-confirm-modal .ws-close-btn { width: 36px; min-width: 36px; min-height: 36px; font-size: 1.2rem; border-radius: 8px; border-color: #e2e8f0; background: #fff; color: #64748b; }
.ws-confirm-modal .ws-close-btn:hover { background: #f8fafc; color: #334155; }
.ws-confirm-status { margin-bottom: .75rem; }
.ws-confirm-unanswered { margin-bottom: .75rem; }
.ws-confirm-warning { color: #d97706; font-weight: 600; display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: .5rem; }
.ws-confirm-ok { color: #059669; font-weight: 600; display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.ws-confirm-notice { display: flex; align-items: center; gap: .375rem; margin: .75rem 0 0; font-size: .78rem; color: #64748b; line-height: 1.45; }
.ws-confirm-notice i { font-size: .7rem; color: #94a3b8; }
.ws-unanswered-list { display: flex; flex-wrap: wrap; gap: .375rem; }
.ws-unanswered-pill { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; padding: .25rem .625rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
body.modal-open .ws-sticky-bar { opacity: .25; pointer-events: none; }

/* ── Student exercise: confirm modal on mobile ── */
@media (max-width: 640px) {
  .modal.ws-confirm-modal { align-items: center; padding: 16px; }
  .ws-confirm-modal .modal-dialog { max-width: 100%; border-radius: 16px; max-height: 90vh; }
  .ws-confirm-modal .modal-header { padding: 16px 18px 0; }
  .ws-confirm-modal .modal-body { padding: 12px 18px 8px; }
  .ws-confirm-modal .modal-footer { padding: 8px 18px 16px; }
  .ws-confirm-modal .ws-close-btn { width: 32px; min-width: 32px; min-height: 32px; font-size: 1.1rem; }
  .ws-confirm-ok { font-size: .82rem; }
  .ws-confirm-warning { font-size: .82rem; }
}

/* ── Responsive: ensure sticky bar doesn't overlap bottom nav ── */
@media (max-width: 768px) {
  .ws-sticky-bar { padding-bottom: env(safe-area-inset-bottom, 0); }
}
@media (max-width: 640px) {
  .ws-sticky-inner { flex-direction: column; gap: .375rem; padding: .5rem .75rem; }
  .ws-sticky-bar { padding-bottom: 0; }
  .ws-sticky-progress { width: 100%; text-align: center; font-size: 1rem; padding: .25rem 0; }
  .ws-draft-status { width: 100%; text-align: center; }
  .ws-sticky-actions { width: 100%; justify-content: stretch; }
  .ws-sticky-actions .ws-back-btn { flex: 1; justify-content: center; }
  .ws-sticky-actions .ws-submit-btn { flex: 1; justify-content: center; padding: .75rem 1rem; font-size: .9rem; }
  .worksheet-paper { padding-bottom: 110px; }
}

/* ── Work card: medium screens (tablet / small notebook) ── */
@media (min-width: 641px) and (max-width: 900px) {
  .work-card { padding: 18px 20px; }
  .work-card-head h3 { font-size: 1.125rem; line-height: 1.35; }
  .work-card-head p { font-size: .82rem; line-height: 1.5; }
  .work-card-badges { max-width: 55%; }
  .work-card-meta { gap: .35rem; }
  .work-card-meta .pill,
  .work-card-meta .status { padding: 4px 10px; font-size: .7rem; min-height: 24px; }
  .work-card-actions { flex-wrap: wrap; gap: .35rem; }
  .work-card-actions .btn-sm { width: auto; font-size: .73rem; padding-inline: 9px; min-height: 28px; }
  .more-trigger { width: 30px; height: 30px; }
}

/* ── Feedback modal ── */
.fb-modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.35); backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.fb-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.fb-modal-dialog { max-width: 600px; width: calc(100% - 2rem); max-height: 85vh; display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.18); overflow: hidden; }
.fb-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--ui-line); background: #f8fafc; flex-shrink: 0; }
.fb-modal-header h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ui-text); display: flex; align-items: center; gap: .5rem; }
.fb-modal-close { width: 36px; min-width: 36px; min-height: 36px; font-size: 1.2rem; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fb-modal-close:hover { background: #f1f5f9; color: #334155; }
.fb-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.fb-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.fb-card:last-child { margin-bottom: 0; }
.fb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fb-card-num { font-weight: 700; font-size: .88rem; color: var(--ui-text); }
.fb-score { background: #dcfce7; color: #166534; font-weight: 700; font-size: .82rem; padding: 3px 10px; border-radius: 8px; }
.fb-score-pending { background: #fef3c7; color: #92400e; }
.fb-card-question { font-size: .88rem; line-height: 1.5; color: var(--ui-text); margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #e2e8f0; }
.fb-card-answer-label { font-size: .72rem; font-weight: 600; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.fb-card-answer { font-size: .85rem; line-height: 1.55; color: #334155; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.fb-feedback-section { margin-top: 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; }
.fb-feedback-header { font-weight: 700; font-size: .88rem; color: #1e40af; margin-bottom: 8px; display: flex; align-items: center; gap: .5rem; }
.fb-feedback-body { font-size: .85rem; line-height: 1.6; color: #1e3a5f; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 640px) {
  .fb-modal-dialog { max-width: 100%; width: 100%; max-height: 100vh; border-radius: 0; height: 100%; }
  .fb-modal-overlay { padding: 0; align-items: stretch; }
  .fb-modal-header { padding: 14px 16px; border-radius: 0; }
  .fb-modal-header h2 { font-size: .92rem; }
  .fb-modal-body { padding: 14px 16px; }
  .fb-card { padding: 12px; border-radius: 10px; }
  .fb-card-question { font-size: .82rem; }
  .fb-card-answer { font-size: .82rem; padding: 8px 10px; }
  .fb-feedback-section { padding: 12px; border-radius: 10px; }
  .fb-feedback-header { font-size: .82rem; }
  .fb-feedback-body { font-size: .82rem; }
}

/* ── AI provider badges ── */
.provider-badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; line-height: 1.4; }
.provider-gemini { background: #e8f4fd; color: #1a73e8; }
.provider-openai { background: #e6f7e6; color: #10a37f; }
.provider-anthropic { background: #f3e8ff; color: #7c3aed; }
.provider-groq { background: #fde8e8; color: #dc2626; }

/* ── Exercise creator: AI model selector ── */
.ex-ai-key-row { margin-bottom: 4px; }
.ex-select { width: 100%; padding: 6px 10px; font-size: .85rem; border: 1px solid var(--ui-line, #e2e8f0); border-radius: 8px; background: #fff; }
.ex-badge-new { display: inline-block; font-size: .6rem; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #fef3c7; color: #92400e; vertical-align: middle; margin-left: 6px; letter-spacing: .02em; }

/* ── Submission grading table refinements ── */
.sg-status-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; border-radius: 999px; padding: 3px 10px; font-size: .72rem; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.sg-status-badge i { font-size: .65rem; }
.sg-graded { background: #d1fae5; color: #065f46; }
.sg-ai-graded { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.sg-submitted { background: #dbeafe; color: #1e40af; }
.sg-not-submitted { background: #ffe4e6; color: #9f1239; }
.sg-replaced { background: #ffedd5; color: #c2410c; }

.sg-pill-sub-after { display: inline-block; font-size: .6rem; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #fde8e8; color: #dc2626; vertical-align: middle; margin-top: 3px; letter-spacing: .02em; }

.sg-score { font-weight: 700; font-size: .9rem; color: var(--ink, #0f172a); white-space: nowrap; }
.sg-score .sg-score-max { font-weight: 400; color: #94a3b8; font-size: .78rem; }

.sg-feedback-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; max-width: 220px; font-size: .82rem; line-height: 1.45; color: #475569; word-break: break-word; }
.sg-feedback-preview.muted { color: #94a3b8; }

.sg-action-cell { white-space: nowrap; }
.sg-action-cell .action-icon-button,
.sg-action-cell .sg-action-btn { vertical-align: middle; }

.sg-btn-view { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; font-size: .78rem; font-weight: 600; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #334155; cursor: pointer; white-space: nowrap; transition: background .12s; }
.sg-btn-view:hover { background: #f8fafc; border-color: #cbd5e1; }
.sg-btn-view i { font-size: .75rem; color: #64748b; }

.sg-row-not-submitted td { opacity: .6; }
.sg-row-not-submitted td:first-child { opacity: 1; }
.sg-row-not-submitted .sg-status-badge { opacity: 1; }

.submissions-table th { font-size: .75rem; padding: 10px 12px; white-space: nowrap; }
.submissions-table td { padding: 10px 12px; font-size: .85rem; vertical-align: middle; }
.submissions-table .sg-action-cell { text-align: right; width: 150px; }

/* ── Icon action buttons for submissions table ── */
.sg-action-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; font-size: 15px; transition: all .12s; text-decoration: none; vertical-align: middle; }
.sg-action-icon:hover { background: #f8fafc; border-color: #cbd5e1; }
.sg-action-icon:focus-visible { outline: 2px solid #0b63f6; outline-offset: 2px; }
.sg-action-icon:disabled { opacity: .4; cursor: not-allowed; }
.sg-action-icon.sg-action-confirm { color: #059669; border-color: #bbf7d0; }
.sg-action-icon.sg-action-confirm:hover { background: #f0fdf4; border-color: #86efac; }
.sg-action-icon.sg-action-regrade { color: #d97706; border-color: #fde68a; }
.sg-action-icon.sg-action-regrade:hover { background: #fffbeb; border-color: #fcd34d; }
.sg-action-icon.sg-action-grade { color: #0b63f6; border-color: #bfdbfe; }
.sg-action-icon.sg-action-grade:hover { background: #eff6ff; border-color: #93c5fd; }

.submission-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* ── Grading detail modal ── */
.sg-detail-modal .modal-dialog { max-width: 680px; max-height: calc(100vh - 72px); display: flex; flex-direction: column; overflow: hidden; }
.sg-detail-header { display: flex; justify-content: space-between; align-items: center; min-height: 50px; padding: .625rem 1rem; border-bottom: 1px solid var(--ui-line); background: #f8fafc; border-radius: 16px 16px 0 0; flex-shrink: 0; }
.sg-detail-header h2 { margin: 0; font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.sg-detail-header .sg-detail-close { width: 32px; min-width: 32px; min-height: 32px; font-size: 1.25rem; border-radius: 8px; border: none; background: transparent; color: #94a3b8; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s; }
.sg-detail-header .sg-detail-close:hover { background: #f1f5f9; color: #64748b; }
.sg-detail-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.sg-detail-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .625rem 1.25rem; border-top: 1px solid var(--ui-line); background: #fff; border-radius: 0 0 16px 16px; flex-shrink: 0; }
.sg-detail-footer .button { min-height: 36px; }

.sg-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; font-size: .82rem; color: #64748b; }
.sg-detail-meta strong { color: #334155; }

.sg-detail-section { margin-bottom: 1rem; }
.sg-detail-section:last-child { margin-bottom: 0; }
.sg-detail-section-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; margin: 0 0 6px; }

.sg-question-card { padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 10px; background: #fff; }
.sg-question-card:last-child { margin-bottom: 0; }
.sg-question-text { font-weight: 600; font-size: .85rem; margin: 0 0 8px; color: #0f172a; }
.sg-question-type { font-size: .65rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .02em; margin-left: 6px; }

.sg-answer-block { margin-bottom: 8px; }
.sg-answer-label { font-size: .7rem; font-weight: 600; color: #64748b; margin-bottom: 2px; }
.sg-answer-text { font-size: .85rem; color: #0f172a; background: #f8fafc; padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.sg-ai-feedback { font-size: .82rem; color: #475569; background: #fefce8; padding: 8px 10px; border-radius: 6px; border: 1px solid #fde68a; line-height: 1.5; margin-top: 6px; }
.sg-ai-feedback strong { color: #92400e; }

.sg-score-awarded { font-size: .8rem; font-weight: 600; color: #065f46; margin-top: 4px; }

.sg-detail-score-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.sg-detail-score-row label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; font-weight: 500; color: #334155; }
.sg-detail-score-row input { width: 100px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .85rem; font-family: inherit; }
.sg-detail-score-row input:focus { border-color: #0b63f6; outline: none; box-shadow: 0 0 0 2px rgba(11,99,246,.15); }
.sg-detail-feedback-row label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; font-weight: 500; color: #334155; width: 100%; }
.sg-detail-feedback-row textarea { width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .85rem; font-family: inherit; resize: vertical; min-height: 60px; }
.sg-detail-feedback-row textarea:focus { border-color: #0b63f6; outline: none; box-shadow: 0 0 0 2px rgba(11,99,246,.15); }

.sg-detail-file-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; background: #f1f5f9; color: #0b63f6; font-size: .82rem; font-weight: 600; text-decoration: none; }
.sg-detail-file-link:hover { background: #e2e8f0; }

/* ── Accordion for exercise detail (redesigned) ── */
.sg-accordion { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.sg-accordion-item { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .12s; }
.sg-accordion-item.is-open { border-color: #93c5fd; box-shadow: inset 0 0 0 1px #93c5fd; }
.sg-accordion-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: #fff; cursor: pointer; font-family: inherit; font-size: .85rem; text-align: left; transition: background .12s; }
.sg-accordion-trigger:hover { background: #f8fafc; }
.sg-accordion-num { font-weight: 700; color: #0f172a; flex-shrink: 0; }
.sg-accordion-chevron { margin-left: auto; font-size: .75rem; color: #94a3b8; transition: transform .2s; }
.sg-accordion-item.is-open .sg-accordion-chevron { transform: rotate(180deg); }
.sg-accordion-content { display: none; padding: 0 14px 14px; border-top: 1px solid #e2e8f0; }
.sg-accordion-item.is-open .sg-accordion-content { display: block; }

/* ── Status badges per question ── */
.sg-ex-status-badge { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; line-height: 1.4; }
.sg-ex-badge-pending { background: #fef3c7; color: #92400e; }
.sg-ex-badge-graded { background: #d1fae5; color: #065f46; }
.sg-ex-badge-ai-graded { background: #dbeafe; color: #1e40af; }
.sg-ex-badge-no-answer { background: #f1f5f9; color: #64748b; }
.sg-ex-badge-manual { background: #ffedd5; color: #9a3412; }

/* ── Score in accordion header ── */
.sg-ex-score-label { font-size: .78rem; font-weight: 600; color: #64748b; flex-shrink: 0; }

/* ── Section label (คำถาม / การตรวจ) ── */
.sg-ex-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin: 0 0 4px; }

/* ── Question block ── */
.sg-ex-q-block { margin-bottom: 12px; }

/* ── Read-only answer box ── */
.sg-ex-answer-box { margin-bottom: 12px; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.sg-ex-answer-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-bottom: 4px; }
.sg-ex-answer-text { font-size: .88rem; color: #0f172a; line-height: 1.5; white-space: pre-wrap; }

/* ── AI feedback display ── */
.sg-ex-ai-feedback { margin-bottom: 12px; padding: 10px 12px; background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px; }
.sg-ex-ai-feedback-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #2563eb; margin-bottom: 4px; }
.sg-ex-ai-feedback-text { font-size: .82rem; color: #1e3a5f; line-height: 1.5; white-space: pre-wrap; }

/* ── Grading section (score + feedback) ── */
.sg-ex-grade-section { padding-top: 12px; border-top: 1px solid #f1f5f9; }
.sg-ex-grade-row { display: flex; gap: 12px; margin-top: 6px; }
.sg-ex-grade-score { flex: 0 0 130px; }
.sg-ex-grade-score label { display: block; font-size: .78rem; font-weight: 500; color: #334155; margin-bottom: 3px; }
.sg-ex-grade-score input { width: 80px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: .82rem; font-family: inherit; }
.sg-ex-grade-score input:focus { border-color: #0b63f6; outline: none; box-shadow: 0 0 0 2px rgba(11,99,246,.15); }
.sg-ex-grade-score .sg-score-max { font-size: .78rem; color: #94a3b8; font-weight: 400; margin-left: 4px; }
.sg-ex-grade-feedback { flex: 1; }
.sg-ex-grade-feedback label { display: block; font-size: .78rem; font-weight: 500; color: #334155; margin-bottom: 3px; }
.sg-ex-grade-feedback textarea { width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .85rem; font-family: inherit; resize: vertical; min-height: 48px; }
.sg-ex-grade-feedback textarea:focus { border-color: #0b63f6; outline: none; box-shadow: 0 0 0 2px rgba(11,99,246,.15); }

/* ── Summary bar (รวม / ตรวจแล้ว / รอตรวจ) ── */
.sg-ex-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 14px; margin-bottom: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: .82rem; color: #475569; }
.sg-ex-summary strong { color: #0f172a; }
.sg-ex-summary-divider { width: 1px; height: 14px; background: #e2e8f0; flex-shrink: 0; }
.sg-ex-summary-pending strong { color: #d97706; }

/* ── Footer warning (ยังมีข้อรอตรวจ) ── */
.sg-ex-footer-warn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; margin-right: auto; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; font-size: .78rem; color: #92400e; font-weight: 500; }

@media (max-width: 640px) {
  .sg-ex-grade-row { flex-direction: column; }
  .sg-ex-grade-score { flex: none; }
}

/* ── Submission checked count ── */
.checked-count { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.checked-count.done { color: #059669; }
.checked-count.partial { color: #d97706; }
.checked-count i { font-size: .75rem; }

@media (max-width: 780px) {
  .sg-feedback-preview { max-width: 140px; }
  .sg-detail-modal .modal-dialog { max-width: 100%; border-radius: 0; max-height: 100vh; max-height: 100dvh; }
  .sg-detail-header { border-radius: 0; }
  .sg-detail-footer { border-radius: 0; }
}

/* ── Mobile card list for submissions ── */
.sg-card-list { display: none; }

@media (max-width: 640px) {
  .submissions-table-wrap { overflow-x: unset; }
  .submissions-table-wrap table { display: none; }
  .sg-card-list { display: flex; flex-direction: column; gap: 8px; }

  .sg-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; }
  .sg-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
  .sg-card-name { font-weight: 600; font-size: .88rem; color: #0f172a; }
  .sg-card-code { font-size: .72rem; color: #94a3b8; }
  .sg-card-status { flex-shrink: 0; }
  .sg-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .75rem; color: #64748b; margin-bottom: 6px; }
  .sg-card-score { font-weight: 700; font-size: .88rem; color: #0f172a; }
  .sg-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f5f9; }
  .sg-card-actions button,
  .sg-card-actions a { font-size: .78rem; }
  .sg-card-not-submitted { opacity: .55; }
  .sg-card-not-submitted .sg-card-name { opacity: 1; }

  .sg-feedback-preview { max-width: none; }
}

/* ── Group management card (student classroom) ── */
.group-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.group-stat {
  font-size: .72rem;
  color: var(--ui-muted);
  background: var(--ui-bg-secondary, #f8fafc);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.group-stat strong { font-weight: 700; color: var(--ui-text); margin-right: 2px; }
.group-stat.is-done strong { color: #059669; }
.group-stat.is-missing strong { color: #dc2626; }
.group-stat.is-pending strong { color: #d97706; }

.group-select-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--ui-muted);
  margin-bottom: 4px;
}

.group-assignment-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  font-size: .85rem;
  background: var(--ui-surface);
  color: var(--ui-text);
  cursor: pointer;
  margin-bottom: 14px;
}

.group-detail-wrap { min-height: 0; }

.group-detail-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-bg-secondary, #f8fafc);
}

.group-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.group-detail-header strong {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ui-text);
  line-height: 1.3;
}

.group-detail-panel p { margin: 0; font-size: .78rem; }
.group-detail-panel p i { width: 16px; text-align: center; margin-right: 4px; }

.group-detail-action {
  padding-top: 10px;
  border-top: 1px dashed var(--ui-line);
}
.group-detail-action .btn-sm { font-size: .78rem; padding-inline: 12px; min-height: 36px; }
.group-detail-action .btn-sm i { font-size: 16px; }

/* ── Group members section ── */
.group-members-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.group-members-loading {
  font-size: .75rem;
  color: var(--ui-muted);
  text-align: center;
  padding: 12px;
}
.group-members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.group-members-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ui-text);
}
.group-members-count {
  font-size: .72rem;
  color: var(--ui-muted);
  background: var(--ui-bg-secondary, #f1f5f9);
  padding: 2px 8px;
  border-radius: 10px;
}
.group-members-list {
  display: grid;
  gap: 4px;
}
.group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
}
.group-member-item.is-leader {
  border-color: #fde68a;
  background: #fffbeb;
}
.group-member-name {
  display: grid;
  gap: 1px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ui-text);
}
.group-member-name small { color: var(--ui-muted); font-size: .68rem; font-weight: 400; }
.group-member-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.group-member-actions .btn-sm { min-height: 28px; padding: 3px 7px; font-size: .68rem; }
.group-member-item.is-pending { border-style: dashed; background: #fffbeb; }
.group-member-badge {
  font-size: .65rem;
  color: var(--ui-muted);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--ui-bg-secondary, #f1f5f9);
  white-space: nowrap;
  flex-shrink: 0;
}
.group-member-badge.leader {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}
.group-members-empty {
  font-size: .78rem;
  color: var(--ui-muted);
  text-align: center;
  padding: 10px;
}
.group-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}
.group-role-actions .btn-sm {
  font-size: .78rem;
  padding-inline: 12px;
  min-height: 36px;
}
.group-role-actions .btn-sm i { font-size: 16px; }
.group-role-actions .btn-sm.secondary {
  background: transparent;
  border: 1px solid var(--ui-border);
  color: var(--ui-muted);
}
.group-role-actions .btn-sm.secondary:hover {
  background: var(--ui-bg-secondary, #f1f5f9);
  color: var(--ui-text);
}
.group-invitation-card,
.group-reuse-section,
.group-pending-section,
.group-history-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
}
.group-invitation-card { border-color: #93c5fd; background: #eff6ff; }
.group-invitation-card > strong,
.group-reuse-section > strong { font-size: .82rem; color: var(--ui-text); }
.group-invitation-card p,
.group-reuse-section p { margin: 0; font-size: .72rem; }
.group-invitation-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.group-reuse-list,
.group-history-list { display: grid; gap: 6px; }
.group-reuse-option {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
}
.group-reuse-option:hover { border-color: var(--ui-primary, #2563eb); background: #eff6ff; }
.group-reuse-option strong { font-size: .78rem; }
.group-reuse-option span { color: var(--ui-muted); font-size: .7rem; line-height: 1.4; }
.group-history-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-left: 3px solid #93c5fd;
  background: var(--ui-bg-secondary, #f8fafc);
  font-size: .72rem;
}
.group-history-item strong { font-size: .76rem; }
.group-history-item small { color: var(--ui-muted); }

@media (max-width: 640px) {
  .group-member-item { align-items: flex-start; flex-wrap: wrap; }
  .group-member-actions { width: 100%; justify-content: flex-start; }
  .group-invitation-actions .button { flex: 1; }
}

/* ── Plan comparison modal ── */
.pf-plan-overlay { position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,0.5);display:flex;align-items:center;justify-content:center;padding:20px;overflow-y:auto; }
.pf-plan-wrap { background:#fff;border-radius:16px;max-width:960px;width:100%;box-shadow:0 20px 60px rgba(15,23,42,0.25);overflow:hidden;margin:auto; }
.pf-plan-head { display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #e2e8f0; }
.pf-plan-head h3 { margin:0;font-size:17px;font-weight:700;color:#0f172a; }
.pf-plan-close { width:36px;min-width:36px;height:36px;border-radius:8px;border:1px solid transparent;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.2rem;transition:all .15s; }
.pf-plan-close:hover { background:#f1f5f9;color:#475569;border-color:#e2e8f0; }
.pf-plan-body { padding:20px 24px;display:grid;gap:16px; }
@media (min-width:900px) { .pf-plan-body { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (min-width:600px) and (max-width:899px) { .pf-plan-body { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:599px) { .pf-plan-body { grid-template-columns:minmax(0,1fr); } }
.pf-pc-card { border:2px solid #e2e8f0;border-radius:14px;overflow:hidden;display:flex;flex-direction:column;transition:border-color .15s; }
.pf-pc-card.current { border-color:#0b63f6; }
.pf-pc-head { display:flex;flex-direction:column;align-items:center;padding:16px 16px 12px;text-align:center;position:relative;min-height:165px; }
.pf-pc-head.current { background:#f0f5ff; }
.pf-pc-name { font-size:15px;font-weight:700;color:#0f172a; }
.pf-pc-price { font-size:18px;font-weight:700;color:#0f172a;margin:4px 0; }
.pf-pc-price span { font-size:13px;color:#64748b;font-weight:400; }
.pf-pc-desc { font-size:12px;color:#475569;margin-top:2px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.pf-pc-badge { display:inline-block;padding:2px 10px;border-radius:999px;font-size:10px;font-weight:600;letter-spacing:.02em;margin-top:6px; }
.pf-pc-badge-current { background:#e0f2fe;color:#0369a1; }
.pf-pc-badge-rec { background:#fef3c7;color:#92400e; }
.pf-pc-badge-rec.pro { background:#ede9fe;color:#5b21b6; }
.pf-pc-badge-rec.max { background:#fce7f3;color:#9d174d; }
.pf-pc-body { padding:12px 16px;flex:1;display:flex;flex-direction:column;gap:6px; }
.pf-pc-feature { font-size:12px;color:#475569;display:flex;align-items:flex-start;gap:6px;line-height:1.4; }
.pf-pc-feature i { color:#22c55e;font-size:11px;margin-top:2px;flex-shrink:0; }
.pf-pc-footer { padding:12px 16px;border-top:1px solid #f1f5f9; }
.pf-pc-btn { display:block;width:100%;padding:9px;border-radius:10px;font-size:13px;font-weight:600;text-align:center;border:none;cursor:pointer;transition:all .15s; }
.pf-pc-btn-current { background:#f1f5f9;color:#94a3b8;cursor:not-allowed;box-shadow:none; }
.pf-pc-btn-upgrade { background:#0b63f6;color:#fff;box-shadow:0 2px 8px rgba(11,99,246,0.25); }
.pf-pc-btn-upgrade:hover { background:#1d4ed8;box-shadow:0 3px 12px rgba(11,99,246,0.35); }
.pf-plan-note { padding:10px 14px;background:#fffbeb;border:1px solid #fde68a;border-radius:10px;font-size:13px;color:#92400e;line-height:1.6;text-align:left;margin-top:4px; }
.pf-plan-note strong { display:block;margin-bottom:2px; }

.pf-qrow-token .pf-qrow-token-meter { display:flex;align-items:center;gap:10px;min-width:180px; }
.pf-token-percent { min-width:46px;text-align:right;font-weight:700;color:#0f172a;font-variant-numeric:tabular-nums; }
.pf-token-bar { width:150px;height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 2px rgba(15,23,42,0.08); }
.pf-token-fill { display:block;height:100%;border-radius:999px;transition:width .25s ease; }
.pf-token-fill-ok { background:#22c55e; }
.pf-token-fill-warn { background:#f59e0b; }
.pf-token-fill-danger { background:#ef4444; }
@media (max-width:640px) {
  .pf-qrow-token .pf-qrow-token-meter { width:100%;min-width:0; }
  .pf-token-bar { flex:1;width:auto; }
}

/* ── Admin plan change modal ── */
.ap-modal-dialog { max-width: 520px; }
.ap-plan-selector { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ap-plan-card { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; transition: border-color .15s; position: relative; }
.ap-plan-card:has(input:checked) { border-color: #0b63f6; background: #f8faff; }
.ap-plan-card.ap-plan-current { opacity: .6; cursor: default; }
.ap-plan-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.ap-plan-card-body { flex: 1; min-width: 0; }
.ap-plan-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-plan-card-header strong { font-size: .9rem; }
.ap-plan-price { font-size: .75rem; font-weight: 600; color: #64748b; white-space: nowrap; }
.ap-plan-card-desc { font-size: .72rem; color: #64748b; margin: 2px 0 4px; }
.ap-plan-card-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .68rem; color: #94a3b8; }
.ap-plan-card-meta strong { color: #334155; font-weight: 600; }
.ap-plan-current-badge { position: absolute; top: 8px; right: 8px; font-size: .62rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e0f2fe; color: #0369a1; }
.ap-otp-section { padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 12px; }
.ap-otp-input-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ap-otp-input-row label { font-size: .82rem; font-weight: 500; color: #334155; }
.ap-otp-input-row .ap-confirm-btn { min-height: 40px; }
.ap-plan-feedback { margin-bottom: 12px; }
.ap-plan-ok { font-size: .85rem; color: #059669; font-weight: 600; padding: 8px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; }
.ap-plan-err { font-size: .85rem; color: #dc2626; font-weight: 500; padding: 8px 12px; background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; }

.ap-plan-step-1 { display: flex; justify-content: center; padding: 4px 0 8px; width: 100%; }
.ap-plan-step-2 { display: flex; align-items: center; gap: .5rem; width: 100%; }

@media (max-width: 480px) {
  .ap-otp-input-row { flex-direction: column; align-items: stretch; }
  .ap-otp-input-row .ap-otp-input { width: 100% !important; box-sizing: border-box; }
  .ap-otp-input-row .ap-confirm-btn { width: 100%; }
}

.transfer-teacher-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.transfer-teacher-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--ui-border,#e2e8f0); border-radius: 10px; cursor: pointer; transition: border-color .15s,background .15s; background: #fff; }
.transfer-teacher-item:hover { border-color: #94a3b8; background: #f8fafc; }
.transfer-teacher-item:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.transfer-teacher-item input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.transfer-teacher-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.transfer-teacher-body strong { font-size: .875rem; font-weight: 600; }
.transfer-teacher-meta { font-size: .78rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-plan-apply-existing { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #f59e0b; border-radius: 12px; background: #fffbeb; color: #92400e; }
.admin-plan-apply-existing input { width: 18px; height: 18px; margin-top: 2px; accent-color: #d97706; flex-shrink: 0; }
.admin-plan-apply-existing span { display: flex; flex-direction: column; gap: 2px; }
.admin-plan-apply-existing small { color: #a16207; line-height: 1.45; }
