:root {
  --color-primary: #4600a3;
  --color-secondary: #a300a3;
  --color-text-light: white;
  --color-accent-yellow: #ffcc00;
  --color-accent-yellow-hover: #e6b800;
  --color-overlay-white-50: rgba(255, 255, 255, 0.5);
  --color-overlay-white-10: rgba(255, 255, 255, 0.1);
}

h1 {
  font-size: 4rem; /* Very large heading */
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 2.5rem; /* Large sub-heading for questions */
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.8rem; /* Large paragraph text */
  line-height: 1.6;
  max-width: 800px; /* Limit line length for readability */
}

/* ── Reusable button classes (also apply to HTMX-injected fragments) ── */

.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-overlay-white-50) !important;
  color: var(--color-text-light) !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem !important;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem !important;
  transition: border-color 0.15s, background-color 0.15s;
}

.btn-ghost:hover {
  background: var(--color-overlay-white-10);
  border-color: var(--color-text-light) !important;
}

.btn-danger {
  border-color: rgba(255, 80, 80, 0.5) !important;
  color: #ff8080 !important;
}

.btn-danger:hover {
  background: rgba(255, 80, 80, 0.1);
  border-color: #ff8080 !important;
}

.btn-promote {
  border-color: rgba(0, 200, 100, 0.5) !important;
  color: #00c864 !important;
}

.btn-promote:hover {
  background: rgba(0, 200, 100, 0.1);
  border-color: #00c864 !important;
}

.btn-manage {
  border-color: rgba(255, 180, 0, 0.5) !important;
  color: #ffb400 !important;
}

.btn-manage:hover {
  background: rgba(255, 180, 0, 0.1);
  border-color: #ffb400 !important;
}

/* ── Staff dashboard ── */

.managed-banner {
  align-items: center;
  background: rgba(255, 180, 0, 0.08);
  border: 1px solid rgba(255, 180, 0, 0.4);
  color: #ffb400;
  display: flex;
  font-size: 0.85rem;
  font-weight: bold;
  gap: 1rem;
  justify-content: space-between;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1.25rem;
}

.managed-banner strong { color: var(--color-text-light); }

.btn-exit-managed {
  background: transparent;
  border: 1px solid rgba(255, 80, 80, 0.5);
  color: #ff8080;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.75rem;
}

.btn-exit-managed:hover { background: rgba(255, 80, 80, 0.1); }

.managed-banner-right {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.managed-lang-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.school-lang-switcher { position: relative; }

.school-lang-btn {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 180, 0, 0.5);
  color: #ffb400;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  gap: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
}

.school-lang-btn .fi { font-size: 1rem; line-height: 1; }

.school-lang-dropdown {
  background: #1a1a2e;
  border: 1px solid rgba(255, 180, 0, 0.4);
  display: none;
  min-width: 100%;
  position: absolute;
  right: 0;
  top: calc(100% + 3px);
  z-index: 200;
}

.school-lang-dropdown.open { display: block; }

.school-lang-option {
  align-items: center;
  background: transparent;
  border: none;
  color: #ffb400;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  gap: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.5rem;
  width: 100%;
}

.school-lang-option:hover { background: rgba(255, 180, 0, 0.1); }

.school-lang-option .fi { font-size: 1rem; line-height: 1; }

.banner-tz-select {
  background: #1a1a2e;
  border: 1px solid rgba(255, 180, 0, 0.5);
  color: #ffb400;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  max-width: 200px;
  padding: 0.2rem 0.4rem;
}

.banner-tz-select option,
.banner-tz-select optgroup {
  background: #1a1a2e;
  color: #ffb400;
}

.staff-dash {
  color: var(--color-text-light);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1100px;
}

.schools-table { display: flex; flex-direction: column; }

.schools-table-header,
.school-row {
  align-items: center;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: 1.5fr 5rem 7rem 5rem 1fr;
  padding: 0.55rem 0;
}

.schools-table-header {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

.school-row {
  border-top: 1px solid var(--color-overlay-white-50);
  font-size: 0.9rem;
}

.school-name { font-weight: bold; }
.school-country { opacity: 0.6; }
.school-users { opacity: 0.7; }

.sub-badge {
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  width: fit-content;
}

.sub-badge.trial    { background: rgba(100,150,255,0.15); border: 1px solid rgba(100,150,255,0.4); color: #90b8ff; }
.sub-badge.active   { background: rgba(0,200,100,0.15);   border: 1px solid rgba(0,200,100,0.4);   color: #00c864; }
.sub-badge.suspended{ background: rgba(255,80,80,0.15);   border: 1px solid rgba(255,80,80,0.4);   color: #ff8080; }
.sub-badge.cancelled{ background: rgba(150,150,150,0.15); border: 1px solid rgba(150,150,150,0.4); color: #aaa; }
.sub-badge.past_due { background: rgba(255,180,0,0.15);   border: 1px solid rgba(255,180,0,0.4);   color: #ffb400; }

.inline-form {
  align-items: center;
  border: 1px solid var(--color-overlay-white-50);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 1rem;
}

.form-input {
  background: transparent;
  border: 1px solid var(--color-overlay-white-50);
  box-sizing: border-box;
  color: var(--color-text-light);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
}

.form-input:focus { border-color: var(--color-text-light); outline: none; }

/* Browser renders <option> elements outside our styling context — force readable colours */
select.form-input { background: var(--color-primary); }
select.form-input option { background: var(--color-primary); color: var(--color-text-light); }

.inline-form-actions { display: flex; gap: 0.5rem; }

.api-error   { color: #ff8080; font-size: 0.9rem; }
.api-success { color: #00c864; font-size: 0.9rem; }

.block-heading {
  border-bottom: 2px solid var(--color-text-light);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  margin: 0;
  padding: 0.6rem 1.25rem;
  text-transform: uppercase;
}

.block-body { display: flex; flex-direction: column; gap: 0; }

.placeholder { font-size: 0.9rem; opacity: 0.5; padding: 0.5rem 0; }

.section {
  border-top: 1px solid var(--color-overlay-white-50);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.section:first-child { border-top: none; }

.section-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.section-header h3,
.dialog-header h3 {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin: 0;
}

.btn-primary {
  background: var(--color-accent-yellow);
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s;
}

.btn-primary:hover { background: var(--color-accent-yellow-hover); }

.btn-secondary {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--color-overlay-white-50);
  color: var(--color-text-light);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.btn-secondary:hover {
  background: var(--color-overlay-white-10);
  border-color: var(--color-text-light);
}

.class-card {
  border: 1px solid var(--color-overlay-white-50);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.class-card-header { align-items: center; display: flex; justify-content: space-between; }
.class-name { display: block; font-size: 1.1rem; font-weight: bold; }
.class-meta { display: block; font-size: 0.8rem; opacity: 0.6; margin-top: 0.2rem; }
.class-actions { display: flex; gap: 0.5rem; }

.assignment-list {
  border-top: 1px solid var(--color-overlay-white-50);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.assignment-row { align-items: center; display: flex; gap: 1rem; }
.assignment-name { flex: 1; font-size: 0.95rem; }

.assignment-mode {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
}

.assignment-mode.practice { background: rgba(0,200,100,0.15); border: 1px solid rgba(0,200,100,0.4); color: #00c864; }
.assignment-mode.exam     { background: rgba(255,180,0,0.15);  border: 1px solid rgba(255,180,0,0.4);  color: #ffb400; }

.assignment-progress { font-size: 0.85rem; opacity: 0.7; white-space: nowrap; }
.assignment-actions  { display: flex; gap: 0.5rem; }

.units-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.unit-list { display: flex; flex-direction: column; gap: 0.5rem; }

.upload-unit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}
.upload-unit-top {
  display: flex;
  gap: 0.75rem;
}
.upload-unit-top .form-input:first-child { flex: 1; }
.upload-unit-top .form-input:last-child  { flex: 0 0 auto; min-width: 10rem; }
.upload-unit-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.upload-unit-file { flex: 1; }

.unit-row {
  align-items: center;
  border: 1px solid var(--color-overlay-white-50);
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.unit-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.unit-meta { font-size: 0.78rem; opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.unit-card {
  align-items: center;
  border: 1px solid var(--color-overlay-white-50);
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.unit-title { flex: 1; font-size: 0.95rem; font-weight: bold; }

.unit-visibility {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
}

.unit-visibility.public  { background: rgba(0,150,255,0.15); border: 1px solid rgba(0,150,255,0.4); color: #60b8ff; }
.unit-visibility.private { background: rgba(200,200,200,0.1); border: 1px solid rgba(200,200,200,0.3); color: rgba(255,255,255,0.6); }
.unit-actions { display: flex; gap: 0.5rem; }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.role-badge {
  border: 1px solid var(--color-text-light);
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.role-badge.school_admin { background: rgba(255,180,0,0.15); border: 1px solid rgba(255,180,0,0.4); color: #ffb400; }
.role-badge.teacher      { background: rgba(0,150,255,0.15); border: 1px solid rgba(0,150,255,0.4); color: #60b8ff; }
.role-badge.student      { background: rgba(100,100,100,0.15); border: 1px solid rgba(100,100,100,0.4); color: #aaa; }
.role-badge.public       { background: rgba(0,200,100,0.15); border: 1px solid rgba(0,200,100,0.4); color: #00c864; }
.role-badge.private      { background: rgba(100,100,100,0.15); border: 1px solid rgba(100,100,100,0.4); color: #aaa; }
.role-badge.unlisted     { background: rgba(180,100,255,0.15); border: 1px solid rgba(180,100,255,0.4); color: #b464ff; }
.role-badge.practice     { background: rgba(0,200,100,0.15);  border: 1px solid rgba(0,200,100,0.4);  color: #00c864; }
.role-badge.exam         { background: rgba(255,180,0,0.15);  border: 1px solid rgba(255,180,0,0.4);  color: #ffb400; }

.status-verified   { color: #00c864; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.08em; }
.status-unverified { color: #ffb400; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.08em; }

/* Members / users dialog */
dialog.dash-dialog {
  background: var(--color-primary);
  border: 2px solid var(--color-overlay-white-50);
  color: var(--color-text-light);
  font-family: inherit;
  max-height: 80vh;
  max-width: 700px;
  overflow: hidden;
  padding: 0;
  width: 90vw;
}

#class-members-body,
#members-dialog-body { max-height: calc(80vh - 60px); overflow-y: auto; }

dialog.dash-dialog::backdrop { background: rgba(0,0,0,0.6); }

.dialog-header {
  align-items: center;
  border-bottom: 1px solid var(--color-overlay-white-50);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.dialog-close {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  padding: 0.25rem;
}

.dialog-close:hover { opacity: 1; }

.dialog-search {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-overlay-white-50);
  box-sizing: border-box;
  color: var(--color-text-light);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  padding: 0.75rem 1.25rem;
  width: 100%;
}

.dialog-search::placeholder { color: var(--color-text-light); opacity: 0.6; }

.members-grid {
  align-items: center;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto auto;
  max-height: calc(80vh - 9rem);
  overflow-y: auto;
  padding: 0 0.1rem;
}

.user-row { display: contents; }

.user-row > * {
  border-top: 1px solid var(--color-overlay-white-50);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.user-row:first-child > * { border-top: none; }

.user-name { font-weight: bold; padding-left: 1.25rem; }
.user-email { opacity: 0.7; }

/* School admin — users grid (load-once, filter client-side) */
.su-grid {
  align-items: center;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto auto 1fr;
}

.su-row { display: contents; }

.su-row > * {
  border-top: 1px solid var(--color-overlay-white-50);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.su-row:first-child > * { border-top: none; }

.su-name { font-weight: bold; }
.su-email { opacity: 0.7; }
.su-cell { display: flex; align-items: center; }

.su-role-select {
  background: var(--color-primary);
  border: 1px solid var(--color-overlay-white-50);
  color: var(--color-text-light);
  font: inherit;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
}

/* colour handled by select.form-input option rule */

/* Invitations grid */
.inv-grid {
  align-items: center;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto auto 1fr;
}

.inv-row { display: contents; }

.inv-row > * {
  border-top: 1px solid var(--color-overlay-white-50);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.inv-row:first-child > * { border-top: none; }

.inv-name { font-weight: bold; }
.inv-email { opacity: 0.7; }
.inv-cell { display: flex; align-items: center; }
.inv-expiry { font-size: 0.8rem; opacity: 0.6; }
.status-expired { color: #ff8080; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.06em; }

/* Section search input */
.section-search {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-overlay-white-50);
  color: var(--color-text-light);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  padding: 0.2rem 0.5rem;
  width: 220px;
}

.section-search::placeholder { color: var(--color-text-light); opacity: 0.5; }

/* Invite dialog form */
.dialog-form-body { padding: 1.25rem; }

.invite-fields {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.invite-fields .form-input { flex: 1; min-width: 160px; }

.no-results {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.5;
  padding: 1rem 1.25rem;
}

/* ── Classes list (school admin block) ─────────────────────────────────────── */

.cl-list { display: flex; flex-direction: column; }

.cl-row {
  align-items: center;
  border-top: 1px solid var(--sep-color);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.cl-row:first-child { border-top: none; }

.cl-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.cl-name {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-meta { font-size: 0.8rem; opacity: 0.6; }

.cl-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.cl-badge-expired {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.5);
  border-radius: 2px;
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 0.5rem;
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
}

/* ── Class assignments (teacher block) ─────────────────────────────────────── */

.cl-assign-body { background: var(--color-overlay-white-10, rgba(255,255,255,0.04)); border-bottom: 1px solid var(--sep-color); min-height: 0; }
.cl-assign-list { display: flex; flex-direction: column; gap: 0; padding: 0.4rem 1.25rem 0.6rem; }
.cl-assign-row  { align-items: center; border-top: 1px solid var(--sep-color); display: flex; gap: 0.6rem; padding: 0.4rem 0; }
.cl-assign-row:first-child { border-top: none; }
.cl-assign-title  { flex: 1; font-size: 0.85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-assign-status { font-size: 0.75rem; opacity: 0.6; }
.cl-assign-progress { font-size: 0.78rem; font-weight: 600; opacity: 0.75; white-space: nowrap; }
.cl-assign-none { font-size: 0.8rem; opacity: 0.5; padding: 0.4rem 1.25rem 0.6rem; }
.cl-assign-edit   { font-size: 0.7rem; opacity: 0.7; padding: 0.15rem 0.5rem; }
.cl-assign-edit:hover { opacity: 1; }
.cl-assign-export { font-size: 0.7rem; margin-left: auto; opacity: 0.7; padding: 0.15rem 0.5rem; text-decoration: none; }
.cl-assign-export:hover { opacity: 1; }

/* ── Assign / Edit assignment dialogs ──────────────────────────────────────── */

.assign-unit-name   { font-size: 1rem; font-weight: 700; margin: 0 0 1rem; opacity: 0.85; }
.assign-fields      { display: flex; flex-direction: column; gap: 0.75rem; }
.assign-label       { display: flex; flex-direction: column; font-size: 0.78rem; font-weight: 600; gap: 0.3rem; letter-spacing: 0.05em; }
.assign-dates       { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; }
.edit-assign-actions { align-items: center; display: flex; gap: 0.75rem; }

/* ── Class members dialog ───────────────────────────────────────────────────── */

.cm-section { display: flex; flex-direction: column; }

.cm-section-label {
  background: var(--color-overlay-white-10);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 0.35rem 1.25rem;
  text-transform: uppercase;
}

.cm-divider {
  border: none;
  border-top: 2px solid var(--sep-color);
  margin: 0;
}

.cm-list { display: flex; flex-direction: column; }

.cm-row,
.cm-add-row {
  align-items: center;
  border-top: 1px solid var(--sep-color);
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
}

.cm-row:first-child,
.cm-add-row:first-child { border-top: none; }

.cm-identity {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.cm-name  { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-email { font-size: 0.78rem; opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cm-empty {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 400;
  margin: 0;
  padding: 0.65rem 1.25rem;
}

.cm-add-search-wrap { padding: 0.6rem 1.25rem; }

.cm-add-search {
  background: var(--input-bg, transparent);
  border: 1px solid var(--sep-color);
  border-radius: 3px;
  color: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  width: 100%;
}

.cm-add-search:focus { outline: 1px solid var(--color-accent, #555); }

.cm-add-actions { display: flex; flex-shrink: 0; gap: 0.4rem; }

/* CSV import section inside class members dialog */
.cm-import-form { padding: 0.75rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.cm-import-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.cm-import-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; white-space: nowrap; }
.cm-import-file { flex: 1; min-width: 0; font-size: 0.82rem; }
.cm-import-template { font-size: 0.78rem; opacity: 0.6; white-space: nowrap; text-decoration: underline; color: var(--color-text-light)}
.cm-import-template:hover { opacity: 1; }
.import-error-list { margin: 0.25rem 0 0 1rem; padding: 0; font-size: 0.82rem; color: #e05; }
.import-error-list li { margin-bottom: 0.15rem; }

.cm-uploading { align-items: center; display: flex; flex-direction: column; gap: 1.25rem; justify-content: center; min-height: 180px; padding: 2rem; }
.cm-uploading-label { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; opacity: 0.7; }
.cm-uploading-spinner { animation: cm-spin 0.8s linear infinite; border: 3px solid var(--color-overlay-white-50); border-top-color: currentColor; border-radius: 50%; height: 36px; width: 36px; }
@keyframes cm-spin { to { transform: rotate(360deg); } }

/* Date row in new-class dialog */
.date-row { display: flex; gap: 0.75rem; width: 100%; }
.date-label { display: flex; flex-direction: column; flex: 1; font-size: 0.8rem; font-weight: 600; gap: 0.3rem; letter-spacing: 0.05em; }
.date-label .form-input { min-width: 0; width: 100%; }

/* ── Student dashboard ───────────────────────────────────────────────────── */
.st-assignments     { display: flex; flex-direction: column; gap: 1.25rem; max-width: 760px; }
.st-heading         { color: var(--color-text-light); font-size: 0.85rem; font-weight: bold; letter-spacing: 0.2em; margin: 0 0 0.75rem; }
.st-card            { background: var(--color-overlay-white-10); border: 1px solid var(--color-overlay-white-50); border-radius: 8px; display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.25rem; }
.st-card-faded      { opacity: 0.55; }
.st-card-header     { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; }
.st-unit-title      { color: var(--color-text-light); font-size: 1.05rem; font-weight: 700; }
.st-card-meta       { color: var(--color-text-light); display: flex; flex-wrap: wrap; font-size: 0.82rem; gap: 0.6rem; opacity: 0.75; }
.st-class-name      { font-weight: 600; }
.st-tag             { font-style: italic; }
.st-progress-row    { align-items: center; display: flex; gap: 0.75rem; }
.st-progress-bar    { background: var(--color-overlay-white-10); border-radius: 4px; flex: 1; height: 6px; overflow: hidden; }
.st-progress-fill   { background: var(--color-accent-yellow); border-radius: 4px; height: 100%; }
.st-progress-label  { color: var(--color-text-light); font-size: 0.8rem; opacity: 0.75; white-space: nowrap; }
.st-card-actions    { display: flex; justify-content: flex-end; }
.st-open-btn        { background: var(--color-accent-yellow); border-radius: 4px; color: var(--color-primary); cursor: pointer; font-size: 0.75rem; font-weight: bold; letter-spacing: 0.08em; padding: 0.3rem 0.9rem; text-decoration: none; transition: background-color 0.15s; }
.st-open-btn:hover  { background: var(--color-accent-yellow-hover); }

/* ── Exercise result fragment ─────────────────────────────────────────────── */
.exercise-result         { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem 0; }
.result-score            { font-size: 1.6rem; font-weight: 700; }
.result-score-number     { color: var(--color-accent-yellow); }
.result-breakdown        { display: flex; flex-direction: column; gap: 0.4rem; }
.result-row              { border-radius: 6px; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.5rem 0.75rem; }
.result-correct          { background: rgba(0,200,100,0.12); border: 1px solid rgba(0,200,100,0.35); }
.result-wrong            { background: rgba(255,80,80,0.12);  border: 1px solid rgba(255,80,80,0.35); }
.result-q-label          { font-size: 1rem; font-weight: 600; }
.result-q-answer         { font-size: 0.9rem; opacity: 0.9; }
.result-explanation      { border: 1px solid var(--color-overlay-white-50); border-radius: 6px; font-size: 1rem; line-height: 1.5; padding: 0.75rem 1rem; }
.result-pending          { font-size: 1.1rem; font-style: italic; opacity: 0.75; }
.result-reviewed         { color: var(--color-accent-yellow); font-size: 1.1rem; font-weight: 700; }
.result-free-answer      { display: flex; flex-direction: column; gap: 0.3rem; }
.result-free-text        { background: var(--color-overlay-white-10); border: 1px solid var(--color-overlay-white-50); border-radius: 4px; font-size: 1rem; line-height: 1.5; padding: 0.5rem 0.75rem; white-space: pre-wrap; }
.result-error            { color: #ff8080; font-size: 1rem; }
.exercise-preview-note   { font-size: 1rem; font-style: italic; opacity: 0.65; }
.result-retry-btn        { background: transparent; border: 1px solid var(--color-overlay-white-50); border-radius: 4px; color: var(--color-text-light); cursor: pointer; font-family: inherit; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.08em; margin-top: 0.5rem; padding: 0.4rem 1rem; transition: background-color 0.15s, border-color 0.15s; }
.result-retry-btn:hover  { background: var(--color-overlay-white-10); border-color: var(--color-text-light); }

/* ── Review queue dialog ─────────────────────────────────────────────────── */
dialog.dash-dialog-wide { max-width: 860px; }
#review-queue-body { max-height: calc(80vh - 60px); overflow-y: auto; }
.rq-list   { display: flex; flex-direction: column; }
.rq-item   { border-bottom: 1px solid var(--sep-color); padding: 1rem 1.25rem; }
.rq-item:last-child { border-bottom: none; }
.rq-meta   { align-items: center; display: flex; gap: 0.75rem; margin-bottom: 0.6rem; }
.rq-student { font-size: 0.9rem; font-weight: 600; }
.rq-qa     { margin-bottom: 0.5rem; }
.rq-question { font-size: 0.78rem; font-style: italic; margin: 0 0 0.25rem; opacity: 0.65; }
.rq-answer  { background: var(--color-overlay-white-10); border-left: 3px solid var(--color-accent-yellow); border-radius: 0 4px 4px 0; font-size: 0.88rem; line-height: 1.55; margin: 0; padding: 0.5rem 0.75rem; white-space: pre-wrap; word-break: break-word; }
.rq-form    { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.rq-score-row { align-items: center; display: flex; gap: 0.75rem; }
.rq-score   { max-width: 14rem; }
.rq-feedback { min-height: 3.5rem; resize: vertical; }
.rq-actions { align-items: center; display: flex; gap: 0.5rem; }
.rq-actions .btn-ghost:disabled { cursor: not-allowed; opacity: 0.35; }
.rq-none    { opacity: 0.55; padding: 1rem 1.25rem; }
.rq-badge-btn { font-size: 0.72rem; letter-spacing: 0.04em; }

/* ── AI detection badge ───────────────────────────────────────────────────── */
.rq-ai-container  { align-items: center; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ai-step2-btn     { font-size: 0.72rem; padding: 0.15rem 0.5rem; }
.ai-badge         { border-radius: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.2rem 0.5rem; white-space: nowrap; }
.ai-badge-high    { background: rgba(255,80,80,0.18); border: 1px solid rgba(255,80,80,0.5); color: #ff6060; }
.ai-badge-low     { background: rgba(0,200,100,0.12); border: 1px solid rgba(0,200,100,0.35); color: #40c878; }
.ai-badge-none    { background: var(--color-overlay-white-10); border: 1px solid var(--color-overlay-white-50); color: inherit; opacity: 0.7; }
.ai-badge-working { background: rgba(255,200,50,0.12); border: 1px solid rgba(255,200,50,0.4); color: #ffc832; font-weight: 400; }
.ai-badge-error   { background: rgba(255,80,80,0.12); border: 1px solid rgba(255,80,80,0.3); color: #ff8080; font-weight: 400; }
