/* Global teacher workspace */
:root {
  --teacher-ui-scale: 1;
}

@media screen and (min-width: 1920px) and (min-height: 960px) {
  :root {
    --teacher-ui-scale: 1.3;
  }
}

@media screen and (min-width: 1181px) {
  body {
    zoom: var(--teacher-ui-scale);
  }
}

.page {
  width: min(1880px, 100%);
  padding: 16px;
}

/* Liquid Glass surfaces across all workspaces. */
.home-class-student-layout,
.student-management-content,
.hygiene-workspace-content {
  display: grid;
  gap: 12px;
}

.portal-workspace.home-workspace {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-class-setup-card,
.home-student-directory-panel,
.student-hygiene-panel {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.home-class-setup-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
}

.home-class-setup-card > header {
  display: flex;
  height: 40px;
  min-width: 78px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.home-class-setup-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent);
}

.home-class-setup-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.home-class-setup-card > header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.home-class-context-grid {
  display: grid;
  height: 40px;
  grid-template-columns: minmax(132px, 0.78fr) repeat(4, minmax(92px, 0.58fr)) minmax(384px, 1.18fr);
  align-items: stretch;
  gap: 8px;
}

.home-class-context-grid label {
  display: grid;
  height: 40px;
  min-height: 40px;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  margin: 0;
}

.home-class-context-grid label:first-child {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-panel) 76%, transparent)),
    var(--surface);
}

.home-class-context-grid label > span {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  margin: 0;
}

.home-class-context-grid select:not(.sr-only),
.home-class-import-actions button {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
}

.home-class-context-grid select:not(.sr-only) {
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 32px 0 8px;
  color: var(--ink);
  text-align: center;
  text-align-last: center;
}

.home-class-context-grid label:focus-within {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.home-class-context-grid select:not(.sr-only):focus {
  outline: 0;
}

.home-class-context-grid select:not(.sr-only):disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

.home-class-import-actions {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
}

.home-class-import-actions button {
  justify-content: center;
  padding-inline: 9px;
  white-space: nowrap;
}

.home-class-import-actions button[aria-disabled="true"] {
  color: var(--muted);
  opacity: 0.62;
}

.home-student-directory-head {
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(126px, auto) minmax(290px, 1fr) 220px auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 9px 12px;
  background: var(--surface-panel);
}

.home-student-directory-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.home-student-directory-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.home-student-directory-head .student-manager-section-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.home-student-directory-head .workspace-search {
  width: 100%;
}

.home-student-directory-head .workspace-search input,
.home-student-directory-actions button {
  min-height: 38px;
}

.home-student-directory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.home-student-directory-actions button {
  min-width: 104px;
  justify-content: center;
  white-space: nowrap;
}

.home-student-directory-actions .danger:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--accent);
}

#homeStudentEditBtn[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent);
}

.home-student-directory-panel .student-directory-list {
  min-height: 210px;
}

.home-student-directory-panel .student-directory-empty {
  min-height: 230px;
}

.student-management-content > .student-cadre-panel,
.student-management-content > .student-hygiene-panel {
  min-height: 0;
}

.hygiene-workspace-content > .student-hygiene-panel {
  min-height: 0;
}

.student-hygiene-toolbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
}

.student-hygiene-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.student-hygiene-heading > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.student-hygiene-heading h2 {
  margin: 0;
}

.student-hygiene-heading h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 780;
  line-height: 1.1;
}

.workspace-inline-title-editor {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.workspace-title-edit-button,
.workspace-title-edit-form button {
  display: grid;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 0;
  color: var(--muted);
}

.workspace-title-edit-button:hover,
.workspace-title-edit-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transform: none;
}

.workspace-title-edit-button .ui-icon,
.workspace-title-edit-form button .ui-icon {
  width: 15px;
  height: 15px;
}

.workspace-title-edit-form[hidden] {
  display: none;
}

.workspace-title-edit-form {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(150px, 280px) 30px 30px;
  align-items: center;
  gap: 4px;
}

.workspace-title-edit-form input {
  min-width: 0;
  min-height: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  padding: 0 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.workspace-title-edit-form .workspace-title-confirm {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}

.workspace-title-edit-form .workspace-title-cancel {
  border-color: var(--line);
  background: var(--surface);
}

.workspace-title-edit-form button:hover,
.workspace-title-edit-form button:focus-visible {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: none;
}

.student-hygiene-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.student-hygiene-toolbar .workspace-head-action {
  min-height: 38px;
}

.student-hygiene-edit-mode-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}

.student-hygiene-board {
  padding: 14px 18px 2px;
}

.student-hygiene-grid-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.student-hygiene-grid {
  display: grid;
  min-width: calc(166px + var(--hygiene-area-count) * 176px);
  grid-template-columns: 94px repeat(var(--hygiene-area-count), minmax(176px, 1fr)) 72px;
  align-items: stretch;
}

.student-hygiene-grid > * {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.student-hygiene-corner,
.student-hygiene-day {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.student-hygiene-corner {
  position: relative;
  min-height: 52px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}

.student-hygiene-corner-line {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.student-hygiene-corner-line line {
  stroke: color-mix(in srgb, var(--ink) 48%, var(--line-strong));
  stroke-width: 1.45;
}

.student-hygiene-corner > span {
  position: absolute;
  z-index: 1;
  line-height: 1;
}

.student-hygiene-corner-area {
  top: 8px;
  right: 9px;
}

.student-hygiene-corner-day {
  bottom: 8px;
  left: 9px;
}

.student-hygiene-day {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 96px;
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
}

.student-hygiene-day.is-optional {
  grid-template-columns: minmax(0, 1fr) 25px;
  padding: 6px 5px 6px 9px;
}

.student-hygiene-day.is-optional > span {
  text-align: center;
}

.student-hygiene-day.is-optional > button {
  display: grid;
  width: 24px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.student-hygiene-day.is-optional > button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  transform: none;
}

.student-hygiene-day.is-optional > button .ui-icon {
  width: 13px;
  height: 13px;
}

.student-hygiene-area-head {
  position: relative;
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  background: var(--surface);
  padding: 6px;
  cursor: grab;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.student-hygiene-area-label {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 0 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.student-hygiene-board.is-edit-mode .student-hygiene-area-label {
  display: none;
}

.student-hygiene-area-head:active {
  cursor: grabbing;
}

.student-hygiene-board.is-edit-mode .student-hygiene-area-head {
  cursor: default;
}

.student-hygiene-area-head input {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 0 5px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.student-hygiene-board.is-edit-mode .student-hygiene-area-head input {
  display: block;
  border-color: var(--line);
  background: var(--surface);
  cursor: text;
}

.student-hygiene-board.is-edit-mode .student-hygiene-area-head input:hover,
.student-hygiene-board.is-edit-mode .student-hygiene-area-head input:focus {
  border-color: var(--line-strong);
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, #0f766e 10%, transparent);
}

.student-hygiene-area-head .student-hygiene-area-remove,
.student-hygiene-rule > button {
  display: grid;
  width: 30px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.student-hygiene-area-head .student-hygiene-area-remove {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 4;
  display: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(31, 35, 41, 0.2);
}

.student-hygiene-board.is-edit-mode .student-hygiene-area-remove {
  display: grid;
  animation: student-cadre-edit-badge-in 180ms cubic-bezier(.2,.8,.2,1) both;
}

.student-hygiene-area-head .student-hygiene-area-remove:hover,
.student-hygiene-rule > button:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--accent);
  transform: none;
}

.student-hygiene-area-head .student-hygiene-area-remove .ui-icon,
.student-hygiene-rule > button .ui-icon {
  width: 14px;
  height: 14px;
}

.student-hygiene-area-head.is-dragging {
  z-index: 4;
  opacity: 0.45;
  transform: scale(0.98);
}

.student-hygiene-area-head.is-drop-target {
  z-index: 3;
  background: color-mix(in srgb, #0f766e 15%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #0f766e 62%, var(--line));
}

.student-hygiene-add-area {
  display: grid;
  min-height: 52px;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  border-right: 0;
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  padding: 5px;
  color: var(--muted);
  font-size: 10px;
}

.student-hygiene-add-area:hover {
  background: var(--surface-soft);
  color: var(--ink);
  transform: none;
}

.student-hygiene-add-area .ui-icon {
  width: 15px;
  height: 15px;
}

.student-hygiene-cell {
  display: grid;
  min-height: 96px;
  align-items: center;
  padding: 7px;
  background: var(--surface);
}

.student-hygiene-picker {
  position: relative;
  min-width: 0;
}

.student-hygiene-select {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 6px 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  text-align: left;
}

.student-hygiene-select .student-assignment-plus {
  align-self: center;
}

.student-hygiene-selected-names {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  font-size: 14px;
  text-align: center;
}

.student-hygiene-selected-names > span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.student-hygiene-selection-empty {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-hygiene-day-additions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 6px 0 0;
  color: var(--muted);
}

.student-hygiene-day-additions > span {
  margin-right: 2px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.65;
}

.student-hygiene-day-additions button {
  display: inline-flex;
  min-width: 72px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  padding: 3px 8px;
  color: var(--muted);
  border-style: dashed;
  font-size: 10px;
  opacity: 0.62;
}

.student-hygiene-day-additions button:hover,
.student-hygiene-day-additions button:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  opacity: 1;
  transform: none;
}

.student-hygiene-day-additions button .ui-icon {
  width: 13px;
  height: 13px;
}

.student-hygiene-select:hover,
.student-hygiene-picker.is-open .student-hygiene-select {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: none;
}

.student-hygiene-select:disabled {
  border-style: dashed;
  color: var(--muted);
  cursor: not-allowed;
}

.student-hygiene-popover {
  position: fixed;
  z-index: 180;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.2);
}

.student-hygiene-popover > header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 11px;
  background: var(--surface-panel);
}

.student-hygiene-popover > header strong {
  font-size: 13px;
}

.student-hygiene-popover > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-hygiene-no-option {
  display: grid;
  min-height: 74px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.student-hygiene-row-end {
  border-right: 0;
  background: var(--surface-panel);
}

.student-hygiene-rules {
  margin: 10px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-panel) 54%, transparent);
  padding: 10px 12px 12px;
}

.student-hygiene-rules > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.student-hygiene-rules > header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.student-hygiene-rules > header .compact {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.student-hygiene-rules-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.student-hygiene-rule {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px;
}

.student-hygiene-rule > span {
  display: grid;
  width: 22px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.student-hygiene-rule textarea {
  width: 100%;
  min-height: 38px;
  max-height: 78px;
  resize: vertical;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 4px 6px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.student-hygiene-rule textarea:hover,
.student-hygiene-rule textarea:focus {
  border-color: var(--line-strong);
  outline: 0;
  background: var(--surface);
}

.student-hygiene-rules-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1080px) {
  .home-class-setup-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
  }

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

  .home-student-directory-head {
    grid-template-columns: minmax(126px, auto) minmax(180px, 1fr) auto;
  }

  .home-student-directory-head .student-directory-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

@media screen and (min-width: 1181px) and (max-width: 1320px) {
  .home-class-setup-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
  }

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

  .home-student-directory-head {
    grid-template-columns: minmax(126px, auto) minmax(180px, 1fr) auto;
  }

  .home-student-directory-head .student-directory-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

.brand-hero {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  margin-bottom: 12px;
  border-bottom-color: var(--line-strong);
  padding: 4px 2px 12px;
}

.brand-mark {
  width: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 5px 14px rgba(22, 27, 36, 0.14);
}

.brand-mark img {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: grid;
  align-items: center;
  gap: 4px;
}

.brand-title-row {
  align-items: center;
  gap: 8px;
}

.brand-copy h1 {
  font-size: 29px;
  line-height: 1.08;
}

.teacher-account-button {
  display: flex;
  min-width: 132px;
  height: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 3px 4px 3px 10px;
  color: var(--ink);
}

.teacher-account-button:hover,
.teacher-account-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: none;
}

.teacher-account-button strong {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.teacher-account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}

.teacher-account-avatar .ui-icon {
  width: 17px;
  height: 17px;
}

.app-shell {
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.primary-sidebar {
  position: sticky;
  top: 12px;
  z-index: 16;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--line-strong) 78%, #ffffff);
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.08) 44%, transparent 72%),
    color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow:
    0 14px 34px rgba(32, 36, 44, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 color-mix(in srgb, var(--line) 62%, transparent);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.primary-nav {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 7px;
}

.primary-nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--nav-indicator-width, calc(100% - 14px));
  height: var(--nav-indicator-height, 43px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, #ffffff);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.15) 46%, transparent 72%),
    color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow:
    0 7px 18px rgba(32, 36, 44, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 color-mix(in srgb, var(--line-strong) 58%, transparent);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transform: translate3d(var(--nav-indicator-x, 7px), var(--nav-indicator-y, 7px), 0);
  transition:
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
    width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    height 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease;
  will-change: transform, width, height;
}

.primary-nav-indicator::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), transparent);
  content: "";
}

.primary-nav-indicator::after {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 42%, transparent);
  content: "";
}

.primary-nav-indicator.is-ready {
  opacity: 1;
}

.primary-nav-indicator:not(.is-ready) {
  transition: none;
}

.primary-nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  text-align: left;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.primary-nav-item:hover:not(.is-active) {
  border-color: color-mix(in srgb, var(--line-strong) 62%, transparent);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  color: var(--ink);
  transform: translateX(2px);
}

.primary-nav-item.is-active {
  border-color: color-mix(in srgb, var(--line-strong) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--ink);
  font-weight: 800;
}

.primary-nav.has-liquid-indicator .primary-nav-item.is-active {
  border-color: transparent;
  background: transparent;
}

.primary-nav-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: -3px;
}

.primary-nav-item .ui-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  transition: color 180ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.primary-nav-item.is-active .ui-icon {
  color: var(--accent);
  transform: scale(1.08);
}

:root.theme-dark .primary-sidebar {
  border-color: color-mix(in srgb, var(--line-strong) 84%, transparent);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025) 45%, transparent 74%),
    color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

:root.theme-dark .primary-nav-indicator {
  border-color: color-mix(in srgb, var(--line-strong) 88%, rgba(255, 255, 255, 0.18));
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035) 48%, transparent 74%),
    color-mix(in srgb, var(--surface-panel) 80%, transparent);
  box-shadow:
    0 9px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .primary-nav-indicator,
  .primary-nav-item,
  .primary-nav-item .ui-icon {
    transition-duration: 0.01ms !important;
  }
}

.workspace-stage {
  min-width: 0;
}

.portal-workspace {
  min-height: calc(100vh - 96px);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.workspace-page-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}

.workspace-page-head > div {
  display: grid;
  gap: 4px;
}

.workspace-page-head h2 {
  font-size: 23px;
  line-height: 1.15;
}

.workspace-kicker,
.workspace-section-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.workspace-page-head time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.home-head-tools,
.student-workspace-head-actions {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px !important;
}

.home-account {
  position: relative;
  display: grid;
  grid-template-columns: 38px auto;
  align-items: center;
  gap: 9px;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.home-avatar {
  display: grid;
  width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0;
}

.home-avatar:hover,
.home-avatar[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--surface);
  transform: none;
}

.home-avatar .ui-icon {
  width: 18px;
  height: 18px;
}

.home-welcome-copy {
  display: grid;
  gap: 1px;
  line-height: 1.25;
}

.home-welcome-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.home-welcome-copy strong {
  font-size: 13px;
  white-space: nowrap;
}

.home-account-menu,
.student-cadre-export-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 120;
  width: 188px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    0 14px 34px rgba(15, 18, 24, 0.16),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.home-account-menu > header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 11px;
  background: var(--surface-panel);
}

.home-account-menu > header strong {
  font-size: 13px;
}

.home-account-menu > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.home-account-menu > button,
.student-cadre-export-menu > button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.home-account-menu > button:last-child,
.student-cadre-export-menu > button:last-child {
  border-bottom: 0;
}

.home-account-menu > button:hover,
.student-cadre-export-menu > button:hover {
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
  transform: none;
}

.home-account-menu .ui-icon,
.student-cadre-export-menu .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.student-cadre-export-control {
  position: relative;
}

.student-cadre-export-control .workspace-head-action {
  width: auto;
  white-space: nowrap;
}

.student-cadre-export-menu {
  top: calc(100% + 6px);
  width: 156px;
}

#seatWorkspace .seat-export-menu {
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 240;
  width: 100%;
  min-width: 160px;
  overflow: visible;
}

.workspace-head-action {
  min-height: 36px;
  padding: 0 13px;
  font-size: 13px;
}

.home-dashboard-content {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 174px);
  align-content: start;
  padding: 20px;
  background: var(--surface-panel);
}

.home-daily-quote {
  display: grid;
  min-width: 0;
  min-height: 108px;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 17px 18px;
  box-shadow: var(--shadow-soft);
}

.home-daily-quote[hidden] {
  display: none;
}

.home-quote-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #e7a72c 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #f3b33d 12%, var(--surface));
  color: #b87800;
}

.home-quote-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.home-quote-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.home-quote-copy > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.home-quote-copy blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 720;
  line-height: 1.5;
}

.home-quote-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.home-quote-edit {
  width: 34px;
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.home-quote-edit:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  transform: none;
}

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

.home-metric {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 126px;
  grid-template-rows: 38px auto auto;
  place-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 15px 12px;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.home-metric:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(27, 31, 38, 0.1);
  transform: translateY(-2px);
}

.home-metric:focus-visible {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
  outline-offset: 2px;
}

.home-metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.home-metric-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.home-metric.is-attention .home-metric-icon {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}

.home-metric-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-metric-value-group {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.home-metric strong {
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.home-metric strong small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
}

.home-metric-gender-stats {
  display: flex;
  align-items: center;
  gap: 7px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.home-gender-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  white-space: nowrap;
}

.home-gender-count .ui-icon {
  width: 13px;
  height: 13px;
}

.home-gender-count.is-male .ui-icon {
  color: var(--state-edit);
}

.home-gender-count.is-female .ui-icon {
  color: var(--accent);
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  text-align: center;
}

.home-section-head > div {
  display: grid;
  gap: 3px;
}

.home-section-head span,
.home-attention-panel > header > div > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.home-section-head h3,
.home-attention-panel h3 {
  margin: 0;
  font-size: 18px;
}

.home-status-section {
  min-width: 0;
  padding-top: 4px;
}

.home-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.home-status-card {
  display: grid;
  min-width: 0;
  min-height: 130px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.home-status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.home-status-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.home-status-card > span:not(.home-status-icon) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.home-status-card strong {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-attention-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.home-attention-panel > header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.home-attention-panel > header > div {
  display: grid;
  gap: 3px;
}

.home-attention-panel > header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.home-attention-panel > header .icon-button {
  width: 32px;
  min-height: 32px;
}

.home-attention-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
  padding: 14px;
}

.home-attention-student {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.home-attention-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
}

.home-attention-avatar .ui-icon {
  width: 16px;
  height: 16px;
}

.home-attention-student > div {
  display: grid;
  gap: 6px;
}

.home-attention-student strong {
  font-size: 14px;
}

.home-attention-student ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  list-style: none;
}

.home-attention-student li::before {
  margin-right: 6px;
  color: var(--accent);
  content: "·";
}

.home-attention-empty {
  display: grid;
  min-height: 132px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.home-attention-empty > .ui-icon {
  width: 22px;
  height: 22px;
  color: #16803b;
}

.home-attention-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.home-attention-empty p {
  margin: 0;
  font-size: 12px;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  background: var(--surface-panel);
}

.workspace-search {
  position: relative;
  display: block;
  width: 220px;
  margin: 0;
}

.workspace-search input {
  min-height: 36px;
  border-color: var(--line);
  border-radius: 5px;
  padding: 7px 10px 7px 34px;
  font-size: 13px;
}

.workspace-search > .ui-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  z-index: 2;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transform: translateY(-50%);
}

.workspace-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.student-workspace {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.student-workspace > .workspace-page-head {
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.student-manager-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(600px, 1.22fr);
  align-items: start;
  gap: 12px;
  min-height: 680px;
}

.student-directory-panel,
.student-cadre-panel {
  min-width: 0;
  min-height: 680px;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.student-manager-section-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
}

.student-manager-section-head > div:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.student-manager-section-head h3 {
  font-size: 16px;
  line-height: 1.3;
}

.student-manager-section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.student-manager-section-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent);
}

.student-manager-section-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.student-directory-actions {
  display: flex !important;
  flex: 0 0 auto;
  gap: 7px !important;
}

.student-directory-actions button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.student-directory-toolbar {
  gap: 12px;
  background: var(--surface);
}

.student-directory-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.student-directory-stat,
.student-gender-count {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.student-directory-stat:hover,
.student-gender-count:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: none;
}

.student-directory-stat.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.student-gender-count.is-male.is-active {
  border-color: color-mix(in srgb, var(--state-edit) 46%, var(--line));
  background: color-mix(in srgb, var(--state-edit) 6%, var(--surface));
}

.student-gender-count.is-female.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.student-directory-stat strong,
.student-gender-count strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.student-directory-stat small,
.student-gender-count small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-directory-summary [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

.student-gender-icon,
.student-gender-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.student-gender-count.is-male .student-gender-icon {
  color: var(--state-edit);
}

.student-gender-count.is-female .student-gender-icon {
  color: var(--accent);
}

.student-directory-list {
  padding: 14px 16px 24px;
}

.student-directory-list.is-adaptive-columns {
  display: grid;
  width: 100%;
  max-width: var(--student-directory-max-width, 100%);
  margin-inline: 0 auto;
  grid-template-columns: repeat(var(--student-directory-columns, 1), minmax(0, 1fr));
  align-items: start;
  gap: 7px 32px;
}

.student-directory-list.is-adaptive-columns > .student-directory-item,
.student-directory-list.is-adaptive-columns > .student-directory-add {
  grid-column: var(--student-list-column);
  grid-row: var(--student-list-row);
  margin-bottom: 0;
}

.student-directory-list.is-adaptive-columns > .student-directory-empty {
  grid-column: 1 / -1;
}

.student-directory-list.is-gender-split {
  display: block;
  column-count: auto;
}

.student-directory-gender-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
}

.student-directory-gender-column {
  min-width: 0;
  padding: 0 14px;
}

.student-directory-gender-column > div {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  grid-template-rows: repeat(10, auto);
  gap: 7px 32px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.student-directory-gender-column:first-child {
  border-right: 1px solid var(--line);
}

.student-directory-gender-column > header,
.student-directory-unspecified > header {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.student-directory-gender-column > header > [data-icon] {
  width: 15px;
  height: 15px;
}

.student-directory-gender-column.is-male > header > [data-icon] {
  color: var(--state-edit);
}

.student-directory-gender-column.is-female > header > [data-icon] {
  color: var(--accent);
}

.student-directory-gender-column > header strong,
.student-directory-unspecified > header strong {
  color: var(--ink);
  font-size: 14px;
}

.student-directory-gender-column > header span:last-child,
.student-directory-unspecified > header span:last-child {
  margin-left: auto;
  font-weight: 750;
}

.student-directory-gender-column .student-directory-item:last-child,
.student-directory-unspecified .student-directory-item:last-child {
  margin-bottom: 0;
}

.student-directory-gender-column .student-directory-item {
  margin-bottom: 0;
}

.student-directory-column-empty {
  display: grid;
  min-height: 70px;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.student-directory-unspecified {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.student-directory-unspecified > header {
  padding-inline: 14px;
}

.student-directory-unspecified > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  padding-inline: 14px;
}

.student-directory-item {
  position: relative;
  display: grid;
  min-height: 44px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  break-inside: avoid;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 5px 9px 5px 6px;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.student-directory-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.student-directory-list.is-edit-mode .student-directory-item {
  cursor: grab;
  padding-right: 32px;
  touch-action: none;
  user-select: none;
}

.student-directory-list.is-edit-mode .student-directory-item:active {
  cursor: grabbing;
}

.student-directory-add {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--muted) 50%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  padding: 0;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  box-shadow: inset 0 1px 8px color-mix(in srgb, var(--muted) 4%, transparent);
  opacity: 0.76;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.student-directory-add:hover,
.student-directory-add:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line-strong));
  outline: 0;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
}

.student-directory-add .ui-icon {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.student-directory-new-item {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

.student-directory-new-item .student-directory-name-input::placeholder {
  color: var(--muted);
  font-weight: 650;
  opacity: 0.78;
}

.student-directory-name-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  padding: 3px 7px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  user-select: text;
}

.student-directory-name-input:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line-strong));
}

.student-directory-name-input:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 11%, transparent);
}

.student-directory-delete {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 3;
  display: grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  padding: 0;
  color: #fff;
  box-shadow: 0 3px 9px color-mix(in srgb, var(--accent) 28%, transparent);
}

.student-directory-delete:hover {
  background: color-mix(in srgb, var(--accent) 88%, #7d001b);
  transform: scale(1.07);
}

.student-directory-delete .ui-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.student-directory-drag-handle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 20px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.student-directory-drag-handle .ui-icon {
  width: 14px;
  height: 14px;
}

.student-directory-item.is-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.student-directory-item.is-reorder-animating {
  will-change: transform;
  box-shadow: 0 8px 22px color-mix(in srgb, #2876d2 13%, transparent);
}

.student-directory-item.is-drop-swap {
  border-color: #2876d2;
  background: color-mix(in srgb, #2876d2 8%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, #2876d2 15%, transparent);
}

.student-directory-item.is-drop-before::before,
.student-directory-item.is-drop-after::after {
  position: absolute;
  z-index: 4;
  right: -3px;
  left: -3px;
  height: 3px;
  border-radius: 999px;
  background: #2876d2;
  box-shadow: 0 0 0 2px color-mix(in srgb, #2876d2 12%, transparent);
  content: "";
  pointer-events: none;
}

.student-directory-item.is-drop-before::before {
  top: -6px;
}

.student-directory-item.is-drop-after::after {
  bottom: -6px;
}

.student-directory-seat {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.student-directory-item strong {
  overflow: hidden;
  font-size: 14px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-directory-gender {
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.student-directory-gender.is-male::before,
.student-directory-gender.is-female::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
  vertical-align: 2px;
}

.student-directory-gender.is-female::before {
  background: var(--state-drop);
}

.student-directory-empty {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.student-directory-empty > .ui-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}

.student-directory-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.student-directory-empty p {
  font-size: 12px;
}

.student-cadre-toolbar {
  position: relative;
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
}

.student-cadre-toolbar-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.student-cadre-toolbar-title h2 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 780;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-cadre-toolbar .workspace-count {
  min-width: max-content;
  text-align: center;
  white-space: nowrap;
}

.student-cadre-toolbar .workspace-head-action {
  min-height: 38px;
}

.student-cadre-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.student-cadre-edit-mode-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}

.student-cadre-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  padding: 16px 18px 22px;
}

.student-cadre-print-sheet,
.student-hygiene-print-sheet,
.study-group-print-sheet,
.assistant-print-sheet {
  display: none;
}

.student-cadre-group {
  min-width: 0;
}

.student-cadre-group + .student-cadre-group {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.student-cadre-group > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.student-cadre-group > header h4 {
  font-size: 16px;
}

.student-cadre-group > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-cadre-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 7px;
  column-gap: 2em;
}

.student-cadre-role-picker {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-columns: minmax(128px, 3fr) minmax(88px, 2fr);
  grid-auto-rows: 34px;
  align-items: stretch;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 5px;
  cursor: grab;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 180ms ease, opacity 160ms ease, transform 160ms ease;
}

.student-cadre-role-picker:active {
  cursor: grabbing;
}

.student-cadre-role-picker:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-soft) 52%, var(--surface));
  box-shadow: 0 5px 16px color-mix(in srgb, var(--ink) 6%, transparent);
}

.student-cadre-role-label {
  position: relative;
  display: grid;
  height: 100%;
  min-width: 0;
  place-items: center;
}

.student-cadre-role-name-input,
.student-cadre-select {
  box-sizing: border-box;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0;
}

.student-cadre-role-name-input {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 7px 8px 5px;
  color: var(--ink);
  text-align: center;
  text-overflow: ellipsis;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.student-cadre-role-label.has-subject-icon .student-cadre-role-name-input {
  padding-inline: 2px;
}

.student-cadre-subject-icon {
  position: static;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
  pointer-events: none;
  transform: translateY(3px);
}

.student-cadre-role-label.has-subject-icon {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px;
  padding-inline: 5px;
}

.student-cadre-role-name-input.is-long-name {
  font-size: 13px;
}

.student-cadre-subject-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.student-cadre-board.is-edit-mode .student-cadre-role-name-input:hover {
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.student-cadre-board.is-edit-mode .student-cadre-role-name-input {
  border-color: var(--line);
  background: var(--surface);
  cursor: text;
}

.student-cadre-board:not(.is-edit-mode) .student-cadre-role-name-input {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: default;
}

.student-cadre-board.is-edit-mode .student-cadre-role-name-input:focus {
  border-color: color-mix(in srgb, var(--blue) 52%, var(--line));
  background: var(--surface);
  outline: 3px solid color-mix(in srgb, var(--blue) 9%, transparent);
}

.student-cadre-select {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 6px 8px;
  color: var(--ink);
  text-align: center;
}

.student-cadre-select:hover,
.student-cadre-role-picker.is-open .student-cadre-select {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: none;
}

.student-cadre-select:disabled {
  border-style: dashed;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.student-cadre-role-picker .student-cadre-role-remove {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 3;
  display: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  padding: 0;
  box-shadow: 0 4px 10px rgba(31, 35, 41, 0.2);
}

.student-cadre-board.is-edit-mode .student-cadre-role-picker .student-cadre-role-remove {
  display: grid;
  animation: student-cadre-edit-badge-in 180ms cubic-bezier(.2,.8,.2,1) both;
}

.student-cadre-board.is-edit-mode .student-cadre-role-picker {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  cursor: default;
}

.student-cadre-board.is-edit-mode .student-cadre-select {
  pointer-events: none;
}

.student-cadre-role-picker.is-dragging {
  z-index: 4;
  animation: none;
  opacity: 0.45;
  transform: scale(0.98);
}

.student-cadre-role-picker.is-drop-target {
  animation: none;
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

.student-cadre-role-remove:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
  transform: scale(1.08);
}

.student-cadre-role-remove .ui-icon {
  width: 12px;
  height: 12px;
}

@keyframes student-cadre-edit-badge-in {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

.student-cadre-selection {
  flex: 0 1 auto;
  overflow: hidden;
  line-height: 20px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-assignment-trigger {
  justify-content: center;
  border-style: dashed;
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-soft) 58%, var(--surface));
  color: var(--muted);
}

.student-assignment-trigger:hover {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line-strong));
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  color: var(--ink);
}

.student-assignment-trigger.has-selection {
  border-style: solid;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.student-assignment-plus {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: 0.86;
}

.student-assignment-plus .ui-icon {
  width: 12px;
  height: 12px;
}

.student-assignment-trigger.has-selection .student-assignment-plus {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

.student-selection-modal {
  z-index: var(--layer-modal);
}

.student-selection-dialog {
  display: grid;
  width: min(820px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(160px, 1fr) auto;
  overflow: hidden;
  border-top: 4px solid var(--accent);
  padding: 18px;
}

.student-selection-head {
  margin-bottom: 12px;
}

.student-selection-head h2,
.student-selection-head p {
  margin: 0;
}

.student-selection-head h2 {
  font-size: 19px;
}

.student-selection-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.student-selection-status {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-block: 1px solid var(--line);
  background: var(--surface-panel);
  padding: 7px 10px;
}

.student-selection-status strong {
  color: var(--accent);
  font-size: 13px;
}

.student-selection-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-selection-list {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding: 12px 2px;
}

.student-selection-option {
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  grid-template-areas:
    "check name meta"
    "check seat meta";
  align-items: center;
  column-gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 7px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.student-selection-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.student-selection-option.is-selected {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  box-shadow: inset 3px 0 0 var(--blue);
}

.student-selection-option.is-unavailable {
  background: var(--surface-panel);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.student-selection-option input {
  grid-area: check;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.student-selection-option strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-selection-seat {
  grid-area: seat;
  color: var(--muted);
  font-size: 10px;
}

.student-selection-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.student-selection-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.student-selection-footer button {
  min-width: 96px;
}

.student-cadre-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}

.student-cadre-role-picker.is-open .student-cadre-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.student-cadre-popover {
  position: absolute;
  top: calc(100% + 5px);
  right: 39px;
  z-index: 90;
  width: max(270px, calc(100% - 124px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.student-cadre-popover > header {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 11px;
  background: var(--surface-panel);
}

.student-cadre-popover > header strong {
  font-size: 13px;
}

.student-cadre-popover > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-cadre-option-list {
  max-height: 292px;
  overflow-y: auto;
  padding: 5px;
}

.student-cadre-option {
  display: grid;
  min-height: 36px;
  grid-template-columns: 18px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 4px;
  padding: 5px 7px;
  cursor: pointer;
}

.student-cadre-option:hover,
.student-cadre-option.is-selected {
  background: var(--surface-soft);
}

.student-cadre-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.student-cadre-option-seat,
.student-cadre-option > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.student-cadre-option strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-cadre-add-role,
.student-cadre-add-form {
  min-height: 38px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
}

.student-cadre-add-role {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  opacity: 0.72;
}

.student-cadre-add-role:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
  opacity: 1;
  transform: none;
}

.student-cadre-add-role .ui-icon {
  width: 15px;
  height: 15px;
}

.student-cadre-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-style: solid;
  border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
  background: var(--surface);
}

.student-cadre-add-form input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 0;
  background: transparent;
  padding: 0 7px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  outline: 0;
}

.student-cadre-add-form button {
  display: grid;
  width: 30px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0;
}

.student-cadre-add-form button[type="submit"] {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  color: var(--blue);
}

.student-cadre-add-form button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: none;
}

.student-cadre-add-form .ui-icon {
  width: 14px;
  height: 14px;
}

.student-source-tag,
.privacy-badge,
.settings-state {
  display: inline-flex;
  width: max-content;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.table-icon-action {
  width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
}

.table-icon-action:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.workspace-empty-row {
  height: 180px;
  color: var(--muted);
  text-align: center !important;
}

.growth-scope-picker {
  position: relative;
  min-width: 0;
}

.growth-scope-trigger {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  justify-content: flex-start;
  gap: 9px;
  padding: 5px 12px;
  text-align: left;
}

.growth-scope-trigger > span:not(.ui-icon) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.growth-scope-trigger small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.growth-scope-trigger strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-scope-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 390px;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    0 14px 34px rgba(15, 18, 24, 0.16),
    inset 0 1px 0 var(--glass-highlight);
  padding: 14px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.growth-scope-menu[hidden] {
  display: none;
}

.growth-scope-menu > header,
.growth-scope-menu > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.growth-scope-menu > header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.growth-scope-menu > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.growth-scope-menu > header strong {
  font-size: 15px;
}

.growth-scope-menu > header span,
.growth-scope-menu > footer span {
  color: var(--muted);
  font-size: 11px;
}

.growth-scope-menu .icon-button {
  width: 30px;
  min-height: 30px;
  border-color: transparent;
}

.growth-scope-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 0;
}

.growth-scope-presets button,
.growth-scope-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 12px;
}

.growth-scope-presets button:hover,
.growth-scope-option:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: none;
}

.growth-scope-presets button.is-active,
.growth-scope-option.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.growth-scope-options {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.growth-scope-grade {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.growth-scope-grade > strong {
  font-size: 12px;
}

.growth-scope-grade > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.growth-scope-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface);
}

.growth-scope-option > span {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.growth-scope-option.is-selected > span {
  border-color: currentColor;
}

.growth-scope-option .ui-icon {
  width: 11px;
  height: 11px;
}

.growth-scope-menu > footer {
  padding-top: 12px;
}

.growth-scope-menu > footer button {
  min-width: 82px;
  min-height: 34px;
  border-radius: 4px;
  font-size: 12px;
}

.growth-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  align-items: start;
}

.growth-detail-column {
  min-width: 0;
  background: color-mix(in srgb, var(--surface) 42%, transparent);
}

.growth-detail-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.growth-context-bar {
  display: grid;
  width: min(100%, 720px);
  grid-template-columns: minmax(420px, 1fr) minmax(140px, 180px);
  align-items: stretch;
  gap: 7px;
}

.growth-linked-context {
  display: grid;
  min-width: 0;
  min-height: 40px;
  grid-template-columns: 30px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 11px;
}

.growth-linked-context > .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.growth-linked-context > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.growth-linked-context > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-context-bar > label {
  display: grid;
  min-width: 0;
  min-height: 40px;
  grid-template-columns: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.growth-context-bar > label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.growth-context-bar select {
  width: 100%;
  height: 38px;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 24px 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-align-last: center;
}

.growth-student-index {
  position: sticky;
  top: 0;
  display: flex;
  height: calc((100dvh / var(--teacher-ui-scale)) - 90px);
  min-height: 420px;
  max-height: calc((100dvh / var(--teacher-ui-scale)) - 90px);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
  padding: 14px;
}

.growth-student-index .workspace-search {
  width: 100%;
  margin-bottom: 12px;
}

.growth-student-list {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.growth-student-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}

.growth-student-identity {
  display: inline-grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.growth-student-identity > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-student-seat,
.growth-detail-seat {
  display: inline-grid;
  min-width: 26px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.growth-detail-seat {
  min-width: 0;
  height: auto;
  margin-right: 10px;
  vertical-align: middle;
}

.growth-student-seat.is-empty {
  visibility: hidden;
}

.growth-student-button:hover {
  border-color: var(--line);
  background: var(--surface);
  transform: none;
}

.growth-student-button.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}

.growth-student-button small {
  color: var(--muted);
  font-size: 10px;
}

.growth-student-detail {
  min-width: 0;
  padding: 18px 20px 24px;
}

.growth-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.growth-detail-head > div {
  display: grid;
  gap: 4px;
}

.growth-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.growth-detail-head h3 {
  margin: 0;
  font-size: 25px;
}

.growth-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.growth-summary > div {
  display: grid;
  min-height: 80px;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 13px;
}

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

.growth-summary strong {
  font-size: 21px;
}

.growth-ability-card,
.growth-subject-trends {
  min-width: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.growth-visual-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
}

.growth-visual-head > div:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.growth-visual-head > div:first-child > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 4px;
  color: var(--accent);
}

.growth-visual-head .ui-icon {
  width: 15px;
  height: 15px;
}

.growth-visual-head h4,
.growth-visual-head p {
  margin: 0;
}

.growth-visual-head h4 {
  font-size: 14px;
}

.growth-visual-head p,
.growth-visual-head > small {
  color: var(--muted);
  font-size: 11px;
}

.growth-radar-legend {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.growth-radar-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.growth-radar-legend span::before {
  width: 18px;
  height: 0;
  border-top: 2px solid var(--accent);
  content: "";
}

.growth-radar-legend .is-start::before {
  border-top-color: var(--muted);
  border-top-style: dashed;
}

.growth-ability-body {
  display: grid;
  grid-template-columns: minmax(430px, 1.25fr) minmax(240px, 0.75fr);
  min-height: 360px;
  align-items: stretch;
}

.growth-radar-chart {
  display: block;
  width: min(100%, 520px);
  height: auto;
  align-self: center;
  justify-self: center;
  overflow: visible;
  font-family: inherit;
}

.growth-radar-ring,
.growth-radar-axis {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.growth-radar-start {
  fill: none;
  stroke: var(--muted);
  stroke-dasharray: 5 5;
  stroke-linejoin: round;
  stroke-width: 2;
}

.growth-radar-current {
  fill: color-mix(in srgb, var(--accent) 13%, transparent);
  stroke: var(--accent);
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.growth-radar-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.growth-radar-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.growth-radar-label-value {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.growth-ability-insights {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}

.growth-ability-group {
  --growth-group-color: var(--state-edit);
  display: grid;
  align-content: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.growth-ability-group.is-strong {
  --growth-group-color: var(--state-drop);
}

.growth-ability-group.is-growth {
  --growth-group-color: var(--accent);
}

.growth-ability-group:last-child {
  border-bottom: 0;
}

.growth-ability-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.growth-ability-group > header strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

.growth-ability-group > header strong::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--growth-group-color);
  content: "";
}

.growth-ability-group > header small {
  color: var(--muted);
  font-size: 11px;
}

.growth-ability-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.growth-ability-subject {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--growth-group-color) 28%, var(--line));
  border-radius: 4px;
  background: color-mix(in srgb, var(--growth-group-color) 6%, var(--surface));
  padding: 4px 7px;
}

.growth-ability-subject strong {
  color: var(--ink);
  font-size: 12px;
}

.growth-ability-subject small {
  color: var(--growth-group-color);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.growth-ability-group-empty {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.growth-ability-empty,
.growth-subject-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.growth-rank-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.growth-rank-chart-card {
  --growth-chart-color: var(--state-edit);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.growth-rank-chart-card.is-grade {
  --growth-chart-color: var(--accent);
}

.growth-rank-chart-card > header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}

.growth-rank-chart-card > header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.growth-rank-chart-card > header > div > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--growth-chart-color) 42%, var(--line));
  border-radius: 4px;
  color: var(--growth-chart-color);
}

.growth-rank-chart-card > header .ui-icon {
  width: 15px;
  height: 15px;
}

.growth-rank-chart-card > header h4,
.growth-rank-chart-card > header p {
  margin: 0;
}

.growth-rank-chart-card > header h4 {
  font-size: 16px;
}

.growth-rank-chart-card > header p,
.growth-rank-chart-card > header small {
  color: var(--muted);
  font-size: 12px;
}

.growth-rank-card-meta {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.growth-rank-card-meta strong {
  font-size: 14px;
}

.growth-rank-chart-scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: color-mix(in srgb, var(--surface-panel) 78%, var(--surface));
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.growth-rank-chart-scroll:focus-visible {
  outline: 2px solid var(--state-edit);
  outline-offset: -2px;
}

.growth-rank-chart {
  display: block;
  min-width: 100%;
  color: var(--growth-chart-color);
  font-family: inherit;
}

.growth-chart-semester-band {
  fill: color-mix(in srgb, var(--surface) 54%, transparent);
}

.growth-chart-semester.is-lower .growth-chart-semester-band {
  fill: color-mix(in srgb, var(--growth-chart-color) 3.5%, var(--surface));
}

.growth-chart-semester.has-data .growth-chart-semester-band {
  fill: color-mix(in srgb, var(--growth-chart-color) 5%, var(--surface));
}

.growth-chart-semester-divider {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.growth-chart-semester-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.growth-chart-semester-label tspan:last-child {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.growth-chart-empty-label,
.growth-chart-exam-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.growth-chart-exam-label {
  fill: var(--ink);
}

.growth-chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.growth-chart-context-divider {
  stroke: var(--line-strong);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.growth-chart-line {
  fill: none;
  stroke: var(--growth-chart-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.growth-chart-line.is-gap {
  stroke-dasharray: 4 6;
  opacity: .72;
}

.growth-chart-arrow.is-improving {
  fill: var(--state-drop);
}

.growth-chart-arrow.is-declining {
  fill: var(--accent);
}

.growth-chart-arrow.is-steady {
  fill: var(--muted);
}

.growth-chart-line.is-improving,
.growth-subject-trend-line.is-improving {
  stroke: var(--state-drop);
}

.growth-chart-line.is-declining,
.growth-subject-trend-line.is-declining {
  stroke: var(--accent);
  stroke-dasharray: 6 4;
}

.growth-chart-line.is-steady,
.growth-subject-trend-line.is-steady {
  stroke: var(--muted);
}

.growth-chart-point circle {
  fill: var(--surface);
  stroke: var(--growth-chart-color);
  stroke-width: 3;
}

.growth-chart-point.is-improving circle {
  stroke: var(--state-drop);
}

.growth-chart-point.is-declining circle {
  stroke: var(--accent);
}

.growth-chart-point.is-steady circle {
  stroke: var(--muted);
}

.growth-chart-point text {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.growth-chart-axis-title,
.growth-chart-axis-label,
.growth-chart-x-label {
  fill: var(--muted);
  font-size: 10px;
}

.growth-chart-no-rank text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.growth-chart-axis-title {
  font-weight: 800;
}

.growth-chart-context-label {
  fill: var(--growth-chart-color);
  font-weight: 750;
}

.growth-chart-change-label {
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--surface-panel);
  stroke-width: 5px;
  font-size: 10px;
  font-weight: 800;
}

.growth-chart-change-label.is-improving {
  fill: var(--state-drop);
}

.growth-chart-change-label.is-declining {
  fill: var(--accent);
}

.growth-ability-insights .is-improving,
.growth-rank-card-meta .is-improving,
.growth-subject-score .is-improving {
  color: var(--state-drop);
}

.growth-ability-insights .is-declining,
.growth-rank-card-meta .is-declining,
.growth-subject-score .is-declining {
  color: var(--accent);
}

.growth-ability-insights .is-steady,
.growth-rank-card-meta .is-steady,
.growth-subject-score .is-steady {
  color: var(--muted);
}

.growth-subject-trends {
  margin-bottom: 0;
  border: 0;
  background: transparent;
}

.growth-subject-trends > .growth-visual-head {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.growth-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 10px;
  padding-top: 10px;
}

.growth-subject-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.growth-subject-card > header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}

.growth-subject-card > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.growth-subject-card > header > div > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.growth-subject-card > header .ui-icon {
  width: 14px;
  height: 14px;
}

.growth-subject-card > header strong {
  font-size: 13px;
}

.growth-subject-card > header > span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.growth-subject-score {
  display: flex;
  min-height: 52px;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px 4px;
}

.growth-subject-score > strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.growth-subject-score > span {
  font-size: 11px;
  font-weight: 800;
}

.growth-subject-sparkline {
  display: block;
  width: 100%;
  height: 88px;
  padding: 0 4px;
  color: var(--state-edit);
}

.growth-subject-midline {
  stroke: var(--line);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.growth-subject-trend-line {
  fill: none;
  stroke: var(--state-edit);
  stroke-linecap: round;
  stroke-width: 2.5;
}

.growth-subject-trend-point {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.growth-subject-card > footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--surface-panel);
}

.growth-subject-card > footer span {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 7px 9px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.growth-subject-card > footer span:last-child {
  border-right: 0;
}

.growth-rank-chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 12px;
}

.growth-empty-detail,
.workspace-empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.assistant-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) minmax(480px, 2fr) minmax(150px, .55fr);
  align-items: center;
  gap: 12px;
  margin: 14px 18px 0;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 7px 10px;
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, var(--surface-panel) 62%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.assistant-toolbar-intro {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.assistant-toolbar-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent);
}

.assistant-toolbar-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.assistant-toolbar-intro strong {
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

.assistant-toolbar-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.assistant-toolbar label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin: 0;
}

.assistant-toolbar label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.assistant-toolbar select,
.assistant-generate-all {
  width: 100%;
  min-height: 34px;
  border-radius: 5px;
  font-size: 13px;
}

.assistant-generate-all {
  min-width: 0;
  padding-inline: 16px;
}

.assistant-generate-all:disabled {
  border-color: color-mix(in srgb, #16834a 28%, var(--line));
  background: color-mix(in srgb, #16834a 7%, var(--surface));
  color: #16834a;
  box-shadow: none;
  opacity: 1;
}

.assistant-generate-all[aria-busy="true"] {
  cursor: wait;
  opacity: .72;
}

.assistant-student-table {
  margin: 14px 18px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.assistant-table-head,
.assistant-student-row {
  display: grid;
  grid-template-columns: minmax(130px, .52fr) minmax(280px, 1.08fr) minmax(380px, 1.5fr);
}

.assistant-table-head {
  min-height: 40px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-table-head span,
.assistant-student-row > div {
  min-width: 0;
  padding: 12px 14px;
}

.assistant-table-head span + span,
.assistant-student-row > div + div {
  border-left: 1px solid var(--line);
}

.assistant-student-row {
  min-height: 152px;
  border-bottom: 1px solid var(--line);
  transition: background-color 160ms ease, opacity 160ms ease;
}

.assistant-student-row:last-child {
  border-bottom: 0;
}

.assistant-student-row:hover {
  background: color-mix(in srgb, var(--surface-panel) 62%, transparent);
}

.assistant-student-row.is-generating {
  cursor: wait;
  opacity: .68;
}

.assistant-student-cell {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.assistant-student-cell strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.assistant-student-cell > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.assistant-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.assistant-profile-tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 7px;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.assistant-profile-tag.is-muted {
  border-style: dashed;
}

.assistant-analysis-cell {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.assistant-analysis-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-analysis-meta small,
.assistant-evidence-count {
  color: var(--muted);
  font-size: 10px;
}

.assistant-trend {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 7px;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.assistant-trend.is-positive,
.assistant-trend.is-stable {
  border-color: color-mix(in srgb, #16834a 32%, var(--line));
  color: #16834a;
}

.assistant-trend.is-warning {
  border-color: color-mix(in srgb, #b45600 34%, var(--line));
  color: #a44f00;
}

.assistant-trend.is-fluctuating {
  border-color: color-mix(in srgb, #3667c8 34%, var(--line));
  color: #3667c8;
}

.assistant-analysis-cell p {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.68;
}

.assistant-evidence-count {
  margin-top: auto;
}

.assistant-comment-cell {
  display: grid;
  grid-template-rows: auto minmax(84px, 1fr) auto;
  gap: 7px;
}

.assistant-comment-head {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-comment-source {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.assistant-comment-cell textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.assistant-comment-cell textarea:hover {
  border-color: var(--line);
  background: var(--surface-panel);
}

.assistant-comment-cell textarea:focus {
  border-color: #3667c8;
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, #3667c8 16%, transparent);
}

.assistant-comment-cell footer {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.assistant-row-actions {
  display: flex;
  gap: 5px;
}

.assistant-row-actions .icon-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 4px;
}

.assistant-row-actions .icon-button:disabled {
  border-color: color-mix(in srgb, #16834a 24%, var(--line));
  background: color-mix(in srgb, #16834a 5%, var(--surface));
  color: #16834a;
  opacity: 1;
}

.assistant-row-actions .ui-icon {
  width: 13px;
  height: 13px;
}

.assistant-empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.assistant-empty-state > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
}

.assistant-empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.assistant-empty-state p {
  max-width: 420px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.assistant-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Compact roster + focused term-comment editor. */
.assistant-comment-workbench {
  min-height: 0;
}

.assistant-student-rows {
  display: grid;
  height: calc((100dvh / var(--teacher-ui-scale)) - 90px);
  min-height: 420px;
  max-height: calc((100dvh / var(--teacher-ui-scale)) - 90px);
  grid-template-columns: calc(230px / var(--teacher-ui-scale)) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}

.assistant-roster-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-panel) 62%, transparent);
  padding: 14px;
}

.assistant-roster-search {
  width: 100%;
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.assistant-roster-search input {
  min-height: 38px;
}

.assistant-roster-head {
  display: grid;
  min-height: 154px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.assistant-roster-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.assistant-roster-title strong,
.assistant-roster-title > div > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.assistant-roster-title > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.assistant-roster-title small {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-roster-head strong {
  color: var(--ink);
  font-size: 19px;
}

.assistant-roster-title > div > span,
.assistant-roster-title > small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.assistant-roster-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.assistant-roster-tools label {
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.assistant-roster-tools label > span {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.assistant-roster-tools select {
  width: 100%;
  height: 42px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 24px 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-align-last: center;
}

.assistant-roster-tools button {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  justify-content: center;
  font-size: 12px;
}

.assistant-roster-list {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 40px;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.assistant-student-option {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 40px;
  grid-template-columns: 26px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0 9px;
  color: var(--ink);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.assistant-student-seat {
  display: grid;
  min-width: 26px;
  width: auto;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.assistant-student-option.is-active .assistant-student-seat {
  color: var(--ink);
}

.assistant-student-option:hover {
  border-color: var(--line);
  background: var(--surface);
  transform: none;
}

.assistant-student-option.is-active {
  border-color: var(--line-strong);
  background: transparent;
  box-shadow: none;
}

.assistant-student-option.is-complete {
  border-color: transparent;
  background: transparent;
}

.assistant-student-option-name {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
}

.assistant-student-option-name strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-student-option-name small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.assistant-student-status-dot {
  display: block;
  width: 8px;
  height: 8px;
  justify-self: end;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.assistant-student-option.is-complete .assistant-student-status-dot {
  background: #16834a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16834a 11%, transparent);
  transform: scale(1.04);
}

.assistant-student-option-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.assistant-student-option-status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.assistant-student-option-status.is-complete {
  color: #16834a;
}

.assistant-student-option-status.is-complete::before {
  background: #16834a;
}

.assistant-student-option-status.is-edited {
  color: #3667c8;
}

.assistant-student-option-status.is-edited::before {
  background: #3667c8;
}

.assistant-comment-workbench .assistant-comment-editor {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-comment-workbench .assistant-comment-editor:hover {
  background: transparent;
}

.assistant-comment-editor > div {
  padding: 0;
}

.assistant-comment-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.assistant-comment-config {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.assistant-comment-config > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.assistant-current-student {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.assistant-current-student > strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.assistant-current-student .assistant-profile-tags {
  justify-content: flex-start;
}

.assistant-profile-tag.is-primary {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}

.assistant-profile-tag {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12.5px;
}

.assistant-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.assistant-export-actions > span {
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.assistant-export-actions button {
  min-height: 38px;
  justify-content: center;
  font-size: 13px;
}

.assistant-style-card-grid {
  display: grid;
  min-height: 0;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: start;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
}

.assistant-style-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 5px 14px rgba(16, 24, 40, .035);
  transition: opacity 190ms ease, filter 190ms ease, border-color 190ms ease, box-shadow 190ms ease, transform 190ms ease;
}

.assistant-style-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.assistant-style-card.is-recommended:not(.is-selected) {
  border-style: dashed;
}

.assistant-style-card.is-selected {
  border-color: var(--line-strong);
  background: color-mix(in srgb, #23877c 11%, var(--surface));
  box-shadow: 0 8px 22px rgba(16, 24, 40, .09);
}

.assistant-style-card-grid.has-selection .assistant-style-card:not(.is-selected) {
  opacity: 0.46;
  filter: grayscale(0.7) blur(0.25px);
}

.assistant-style-card-grid.has-selection .assistant-style-card:not(.is-selected):hover,
.assistant-style-card-grid.has-selection .assistant-style-card:not(.is-selected):focus-within {
  opacity: 0.76;
  filter: grayscale(0.25);
}

.assistant-style-card-header {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 5px 7px 5px 8px;
  color: var(--ink);
  text-align: left;
}

.assistant-style-select {
  display: flex;
  min-width: 0;
  min-height: 34px;
  flex: 1;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.assistant-style-select:hover,
.assistant-style-select:focus-visible {
  background: var(--surface-soft);
  outline: none;
  transform: none;
}

.assistant-style-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.assistant-style-regenerate,
.assistant-style-copy {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--muted);
}

.assistant-style-regenerate:hover,
.assistant-style-copy:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.assistant-style-regenerate .ui-icon,
.assistant-style-copy .ui-icon {
  width: 15px;
  height: 15px;
}

.assistant-style-card.is-generating .assistant-style-regenerate .ui-icon {
  animation: assistant-card-spin 800ms linear infinite;
}

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

.assistant-style-name {
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.assistant-style-name .ui-icon {
  width: 16px;
  height: 16px;
}

.assistant-style-card textarea {
  width: 100%;
  height: auto;
  min-height: 96px;
  max-height: none;
  flex: 0 0 auto;
  resize: none;
  overflow-y: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: transparent;
  padding: 12px 13px;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.72;
}

.assistant-style-card textarea:focus {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.assistant-style-card > footer {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.assistant-style-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.assistant-style-option {
  min-width: 0;
  min-height: 38px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.assistant-style-option:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.assistant-style-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.assistant-comment-field {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 16px 18px;
}

.assistant-comment-field textarea {
  width: 100%;
  min-height: 360px;
  flex: 1;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 16px 17px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.9;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.assistant-comment-field textarea:hover {
  border-color: color-mix(in srgb, var(--ink) 52%, var(--line));
}

.assistant-comment-field textarea:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.assistant-editor-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 12px 22px;
}

.assistant-comment-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.assistant-comment-count strong {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.assistant-comment-count small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 10px;
}

.assistant-comment-workbench .assistant-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assistant-footer-length {
  display: grid;
  width: 150px;
  height: 36px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.assistant-footer-select {
  display: grid;
  width: 150px;
  height: 36px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.assistant-footer-style {
  width: 174px;
  grid-template-columns: 66px minmax(0, 1fr);
}

.assistant-footer-length > span,
.assistant-footer-select > span {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.assistant-footer-length select,
.assistant-footer-select select {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 22px 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-align-last: center;
}

.assistant-comment-workbench .assistant-row-actions button {
  min-width: 112px;
  min-height: 36px;
}

.assistant-comment-workbench .assistant-row-actions #assistantGenerateAllBtn {
  min-width: 142px;
  font-size: 12px;
}

.assistant-comment-workbench .assistant-row-actions button:disabled {
  cursor: wait;
  opacity: .58;
}

.license-gate[hidden] {
  display: none;
}

.license-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.license-gate-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #eef1f5 72%, transparent);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.license-login-card {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 28px 72px rgba(16, 24, 40, 0.2), inset 0 1px 0 var(--glass-highlight);
  color: var(--ink);
}

.license-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.license-login-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.license-login-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.license-login-brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.license-login-form {
  display: grid;
  gap: 10px;
  padding: 20px 24px 18px;
}

.license-login-form > label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.license-key-field {
  position: relative;
}

.license-key-field > .ui-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.license-key-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 14px 0 42px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
}

.license-key-field input:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.license-login-form > button {
  min-height: 46px;
  justify-content: center;
  margin-top: 2px;
  border-radius: 6px;
  font-size: 14px;
}

.license-login-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.license-login-status[data-tone="danger"] {
  color: var(--danger);
}

.license-login-status[data-tone="warning"] {
  color: #a55a00;
}

.license-login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-panel) 74%, transparent);
  padding: 13px 20px 15px;
}

.license-login-footer a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.license-login-footer a:hover {
  text-decoration: underline;
}

.license-login-footer p {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.license-login-footer .license-login-filing {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.site-compliance-footer {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.site-compliance-footer a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.site-compliance-footer a:hover,
.site-compliance-footer a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

body.license-gate-open {
  overflow: hidden;
}

html.access-required .page {
  pointer-events: none;
  user-select: none;
}

:root.theme-dark .license-gate-backdrop {
  background: color-mix(in srgb, #171a21 78%, transparent);
}

.training-workspace {
  min-height: calc(100vh - 96px);
}

.training-page-head {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.training-page-title,
.training-page-title > div {
  display: flex;
  min-width: 0;
  align-items: center;
}

.training-page-title {
  gap: 12px;
}

.training-page-title > div {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.training-page-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--accent);
}

.training-page-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.training-page-title h2 {
  font-size: 22px;
  line-height: 1.1;
}

.training-page-title p {
  color: var(--muted);
  font-size: 12px;
}

.training-summary {
  display: flex;
  min-height: 42px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
}

.training-summary > span {
  display: flex;
  min-width: 104px;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.training-summary > span + span {
  border-left: 1px solid var(--line);
}

.training-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.training-toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}

.training-search {
  position: relative;
  display: block;
}

.training-search > [data-icon] {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.training-search > [data-icon] .ui-icon {
  width: 15px;
  height: 15px;
}

.training-search input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px 0 36px;
  font-size: 13px;
}

.training-stage-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-panel);
}

.training-stage-filters button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.training-stage-filters button:last-child {
  border-right: 0;
}

.training-stage-filters button.is-active {
  background: var(--ink);
  color: var(--surface);
}

.training-custom-button {
  min-height: 40px;
  justify-content: center;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

.training-content {
  display: grid;
  gap: 14px;
  padding: 18px 20px 26px;
}

.training-program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.training-program-card {
  display: grid;
  min-width: 0;
  min-height: 190px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: border-color 170ms ease, box-shadow 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.training-program-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 10px 24px rgba(18, 24, 34, 0.08);
  transform: translateY(-2px);
}

.training-program-card:focus-visible {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 13%, transparent);
  outline-offset: 1px;
}

.training-program-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--accent);
}

.training-program-card-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.training-program-card-body {
  display: flex;
  min-width: 0;
  min-height: 160px;
  flex-direction: column;
}

.training-program-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.training-program-card-top strong {
  font-size: 14px;
  line-height: 1.35;
}

.training-program-card-top small {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.training-program-source {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-program-description {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
}

.training-program-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  font-size: 10px;
}

.training-program-footer em {
  color: var(--muted);
  font-style: normal;
}

.training-program-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 750;
}

.training-program-footer .ui-icon {
  width: 12px;
  height: 12px;
}

.training-empty-state,
.training-plan-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.training-empty-state {
  grid-column: 1 / -1;
}

.training-empty-state > span,
.training-plan-empty > span {
  color: var(--accent);
}

.training-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.training-empty-state p,
.training-plan-empty p {
  font-size: 12px;
}

.training-plan-section {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.training-plan-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.training-plan-empty {
  min-height: 100px;
  grid-column: 1 / -1;
}

.training-plan-item {
  display: grid;
  min-width: 0;
  min-height: 66px;
  grid-template-columns: 4px minmax(0, 1fr) auto 32px 32px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 8px 9px;
}

.training-plan-status {
  width: 4px;
  height: 34px;
  border-radius: 3px;
  background: var(--line-strong);
}

.training-plan-status[data-tone="warning"] {
  background: #c16a00;
}

.training-plan-status[data-tone="danger"] {
  background: var(--danger);
}

.training-plan-item > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.training-plan-item strong,
.training-plan-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-plan-item strong {
  font-size: 13px;
}

.training-plan-item p {
  color: var(--muted);
  font-size: 10px;
}

.training-plan-price {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.training-plan-item .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 5px;
}

.training-request-dialog {
  width: min(600px, calc(100vw - 28px));
}

.training-request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.training-request-form > label:not(.training-consent) {
  display: grid;
  gap: 6px;
}

.training-request-form > label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.training-request-form input,
.training-request-form select {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 13px;
}

.training-form-full {
  grid-column: 1 / -1;
}

.training-open-site {
  width: max-content;
  min-height: 34px;
  justify-self: end;
  margin-top: -6px;
  border-radius: 5px;
  padding: 0 10px;
  font-size: 11px;
}

.training-security-notice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid color-mix(in srgb, #15805f 28%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, #15805f 6%, var(--surface));
  padding: 11px 12px;
  color: #146347;
}

.training-security-notice > .ui-icon {
  width: 19px;
  height: 19px;
  margin-top: 1px;
}

.training-security-notice strong {
  font-size: 12px;
}

.training-security-notice p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.training-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.training-consent input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  flex: 0 0 15px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.training-form-actions,
.training-payment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.training-form-actions button,
.training-payment-actions button {
  min-width: 120px;
  min-height: 40px;
  border-radius: 5px;
  justify-content: center;
  font-size: 12px;
}

.training-payment-dialog {
  width: min(460px, calc(100vw - 28px));
}

.training-payment-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 12px;
}

.training-payment-summary > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--accent);
}

.training-payment-summary strong {
  font-size: 13px;
}

.training-payment-summary p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.training-payment-summary b {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.training-payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.training-payment-methods button {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px 11px;
  color: var(--ink);
  text-align: left;
}

.training-payment-methods button > span:last-child {
  display: grid;
  gap: 3px;
}

.training-payment-methods small {
  color: var(--muted);
  font-size: 10px;
}

.training-payment-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.training-payment-mark.is-wechat {
  background: #16834a;
}

.training-payment-mark.is-alipay {
  background: #1677ff;
}

.training-payment-actions {
  margin: 0 18px 18px;
}

:root.theme-dark .training-security-notice {
  color: #78d6b3;
}

html.has-liquid-glass .training-page-head,
html.has-liquid-glass .training-toolbar,
html.has-liquid-glass .training-program-card,
html.has-liquid-glass .training-summary {
  border-color: color-mix(in srgb, var(--glass-border) 86%, transparent);
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 24px rgba(16, 24, 40, 0.045);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

html.no-liquid-glass .training-program-card,
html.no-liquid-glass .training-summary {
  background: var(--surface);
}

/* V0.4: province-aware teacher training directory. */
.training-workspace {
  min-height: calc(100vh - 96px);
  background: var(--page);
}

.training-page-head {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 16px;
}

.training-location-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 172px));
  gap: 8px;
}

.training-location-controls label {
  display: grid;
  min-height: 42px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.training-location-controls label > span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.training-location-controls select {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 28px 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-align-last: center;
}

.training-location-controls select:disabled {
  opacity: 0.52;
}

.training-content {
  gap: 12px;
  padding: 14px 0 24px;
}

.training-stage-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.training-stage-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-panel);
  padding: 10px;
}

.training-stage-column > header {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px 9px;
}

.training-stage-column > header > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--accent);
}

.training-stage-column > header .ui-icon {
  width: 16px;
  height: 16px;
}

.training-stage-column h4 {
  color: var(--ink);
  font-size: 15px;
}

.training-stage-column header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.training-stage-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  padding-top: 10px;
}

.training-program-card-shell {
  position: relative;
  min-width: 0;
}

.training-program-card {
  min-height: 154px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  border-radius: 7px;
  padding: 10px;
}

.training-program-card-icon {
  width: 30px;
  height: 30px;
}

.training-program-card-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.training-program-card-body {
  min-height: 132px;
}

.training-program-card-top {
  display: grid;
  gap: 4px;
}

.training-program-card-top strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.42;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.training-program-card-top small {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-program-source {
  margin-top: 4px;
  font-size: 9px;
}

.training-program-description {
  margin-top: 8px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.training-program-footer {
  gap: 4px;
  padding-top: 7px;
  font-size: 9px;
}

.training-program-footer em {
  display: none;
}

.training-program-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 27px;
  min-width: 27px;
  height: 27px;
  min-height: 27px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--danger);
  opacity: 0;
  transition: opacity 150ms ease;
}

.training-program-card-shell:hover .training-program-delete,
.training-program-delete:focus-visible {
  opacity: 1;
}

.training-add-card {
  display: grid;
  min-height: 154px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.training-add-card:hover,
.training-add-card:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  color: var(--accent);
}

.training-add-card .ui-icon {
  width: 20px;
  height: 20px;
}

.training-add-card strong {
  color: currentColor;
  font-size: 12px;
}

.training-add-card span:last-child {
  font-size: 9px;
}

.training-portal-dialog {
  width: min(520px, calc(100vw - 28px));
}

.training-portal-form {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.training-portal-form > label {
  display: grid;
  gap: 6px;
}

.training-portal-form > label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.training-portal-form input {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
}

.training-portal-context {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  padding: 8px 11px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.training-portal-context > .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.training-portal-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.training-portal-form-actions button {
  min-height: 42px;
  justify-content: center;
}

html.has-liquid-glass .training-stage-column,
html.has-liquid-glass .training-add-card,
html.has-liquid-glass .training-location-controls label,
html.has-liquid-glass .training-portal-dialog {
  border-color: color-mix(in srgb, var(--glass-border) 86%, transparent);
  background: var(--glass-sheen-soft), color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 8px 24px rgba(16, 24, 40, 0.045);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

@media (max-width: 1380px) {
  .training-stage-directory {
    grid-template-columns: 1fr;
  }

  .training-stage-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .training-page-head {
    align-items: stretch;
    flex-direction: column;
  }

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

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

.settings-list {
  width: min(100%, 980px);
  padding: 8px 20px 28px;
}

.settings-row {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

html.has-liquid-glass .settings-row {
  min-height: 74px;
  margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--glass-border) 84%, transparent);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 24px rgba(16, 24, 40, 0.055);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

html.has-liquid-glass .settings-row:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--glass-border));
  transform: translateY(-1px);
}

.settings-row > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.settings-row > div > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}

.settings-row > div > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.settings-row strong {
  font-size: 14px;
}

.settings-row p {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.has-liquid-glass .workspace-page-head,
html.has-liquid-glass .home-student-card,
html.has-liquid-glass .student-directory-card,
html.has-liquid-glass .student-cadre-role-picker,
html.has-liquid-glass .student-hygiene-table-shell,
html.has-liquid-glass .growth-student-detail,
html.has-liquid-glass .growth-detail-toolbar,
html.has-liquid-glass .growth-linked-context,
html.has-liquid-glass .growth-rank-card,
html.has-liquid-glass .assistant-toolbar,
html.has-liquid-glass .assistant-comment-config,
html.has-liquid-glass .assistant-style-card,
html.has-liquid-glass .assistant-comment-workbench,
html.has-liquid-glass .grade-context-bar,
html.has-liquid-glass .grade-sidebar,
html.has-liquid-glass .grade-analysis-main,
html.has-liquid-glass .grade-kpi,
html.has-liquid-glass .grade-panel,
html.has-liquid-glass .grade-student-table-wrap {
  border-color: color-mix(in srgb, var(--glass-border) 86%, transparent);
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 26px rgba(16, 24, 40, 0.055);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

html.has-liquid-glass .assistant-style-card.is-selected {
  border-color: color-mix(in srgb, #23877c 34%, var(--glass-border));
  background:
    var(--glass-sheen-soft),
    color-mix(in srgb, #23877c 13%, var(--surface));
}

html.no-liquid-glass .portal-workspace,
html.no-liquid-glass .primary-sidebar,
html.no-liquid-glass .primary-nav-indicator,
html.no-liquid-glass .home-class-setup-card,
html.no-liquid-glass .home-student-directory-panel,
html.no-liquid-glass .student-hygiene-panel,
html.no-liquid-glass .student-cadre-export-menu,
html.no-liquid-glass .home-account-menu {
  background: var(--surface);
}

.settings-row button {
  min-height: 34px;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 12px;
}

.settings-row > button {
  width: auto;
  min-width: 128px;
  justify-content: center;
}

.settings-state {
  gap: 5px;
}

.settings-state .ui-icon {
  width: 13px;
  height: 13px;
}

.settings-state.is-private {
  border-color: color-mix(in srgb, #15805f 28%, var(--line));
  background: color-mix(in srgb, #15805f 8%, var(--surface));
  color: #146347;
}

.settings-state.is-cloud {
  border-color: color-mix(in srgb, #3667c8 28%, var(--line));
  background: color-mix(in srgb, #3667c8 8%, var(--surface));
  color: #315aa6;
}

:root.theme-dark .settings-state.is-private,
:root.theme-dark .settings-privacy-icon {
  color: #78d6b3;
}

:root.theme-dark .settings-state.is-cloud {
  color: #9eb9f1;
}

.settings-danger-row {
  margin-top: 6px;
  border-top: 1px solid var(--line-strong);
}

.settings-danger-row > div > span {
  border-color: color-mix(in srgb, var(--danger) 25%, var(--line));
  color: var(--danger);
}

.settings-privacy {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-panel);
}

.settings-privacy summary {
  display: grid;
  min-height: 70px;
  cursor: pointer;
  list-style: none;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.settings-privacy summary::-webkit-details-marker {
  display: none;
}

.settings-privacy summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: -2px;
}

.settings-privacy summary > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.settings-privacy summary strong {
  font-size: 14px;
}

.settings-privacy summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-privacy-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #15805f 28%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, #15805f 7%, var(--surface));
  color: #146347;
}

.settings-privacy-chevron {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  transition: transform 160ms ease;
}

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

.settings-privacy-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding: 4px 14px 16px;
  column-gap: 28px;
}

.settings-privacy-version {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.settings-privacy-content section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-privacy-content section:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.settings-privacy-content h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
}

.settings-privacy-content section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.settings-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.settings-switch-track {
  position: relative;
  display: block;
  width: 44px;
  height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  pointer-events: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.settings-switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.22);
  content: "";
  transition: transform 160ms ease;
}

.settings-switch input:checked + .settings-switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.settings-switch input:checked + .settings-switch-track::after {
  transform: translateX(19px);
}

.settings-switch input:focus-visible + .settings-switch-track {
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 2px;
}

.data-deletion-dialog {
  width: min(520px, calc(100vw - 32px));
}

.data-deletion-content {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.data-deletion-warning {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border-left: 3px solid var(--danger);
  padding: 12px 13px;
  background: color-mix(in srgb, var(--danger) 6%, var(--surface-panel));
}

.data-deletion-warning > .ui-icon {
  width: 21px;
  height: 21px;
  margin: 1px auto 0;
  color: var(--danger);
}

.data-deletion-warning strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.data-deletion-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.data-deletion-confirmation {
  display: flex;
  min-height: 42px;
  cursor: pointer;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.data-deletion-confirmation input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--danger);
}

.data-deletion-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
}

.data-deletion-actions button {
  width: auto;
  min-width: 112px;
  white-space: nowrap;
}

.data-deletion-actions .danger {
  min-width: 142px;
}

.data-deletion-actions .danger:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.teacher-quote-dialog {
  width: min(520px, calc(100vw - 32px));
}

.teacher-quote-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.teacher-quote-form label {
  display: grid;
  gap: 7px;
}

.teacher-quote-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.teacher-quote-form textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.65;
}

.teacher-quote-form textarea:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 15%, transparent);
  outline-offset: 0;
}

.teacher-quote-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.teacher-quote-form-footer button {
  min-height: 38px;
  padding-inline: 15px;
}

/* Grade controls use the same compact class toolbar pattern as the workbench. */
#gradeWorkspace .grade-dashboard {
  grid-template-columns: 176px minmax(0, 1fr);
  grid-template-rows: max-content minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  min-height: calc(100vh - 96px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#gradeWorkspace .grade-context-bar {
  display: grid;
  position: relative;
  z-index: 12;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  overflow: visible;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  padding: 9px 12px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

#gradeWorkspace .grade-context-title {
  display: flex;
  height: 40px;
  min-width: 78px;
  align-items: center;
  gap: 8px;
}

#gradeWorkspace .grade-context-title > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent);
}

#gradeWorkspace .grade-context-title h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 40px;
  white-space: nowrap;
}

#gradeWorkspace .grade-context-grid {
  display: grid;
  overflow: visible;
  height: 40px;
  grid-template-columns:
    minmax(138px, 0.95fr)
    minmax(92px, 0.58fr)
    minmax(108px, 0.7fr)
    minmax(104px, 0.68fr)
    minmax(92px, 0.58fr)
    minmax(190px, 1.25fr)
    minmax(190px, 1.05fr);
  align-items: stretch;
  gap: 8px;
}

#gradeWorkspace .grade-sidebar {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
}

#gradeWorkspace .grade-sidebar-section {
  min-width: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 13px 14px;
}

#gradeWorkspace .grade-sidebar-section:last-child {
  border-right: 0;
}

#gradeWorkspace .grade-command-title {
  min-height: 36px;
  margin-bottom: 10px;
}

#gradeWorkspace .grade-context-select {
  display: grid;
  height: 40px;
  min-height: 40px;
  grid-template-columns: 40px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

#gradeWorkspace .grade-context-select > span {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
}

#gradeWorkspace .grade-context-select select {
  display: block;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 30px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 38px;
  text-align: center;
  text-align-last: center;
}

#gradeWorkspace .grade-context-actions {
  display: grid;
  min-width: 0;
  overflow: visible;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#gradeWorkspace .grade-context-actions button,
#gradeWorkspace .grade-context-actions .file-button {
  display: flex;
  width: 100%;
  height: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

#gradeWorkspace .grade-template-download {
  position: relative;
  z-index: 20;
  min-width: 0;
}

#gradeWorkspace .grade-template-menu {
  z-index: 1000;
}

#gradeWorkspace .grade-subject-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  padding-top: 13px;
}

#gradeWorkspace .grade-subject-toolbar {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

#gradeWorkspace .grade-subject-title {
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 auto;
  margin: 0;
}

#gradeWorkspace .grade-inline-score-mode {
  margin: 0;
  min-width: 0;
}

#gradeWorkspace .grade-score-key {
  display: none;
}

#gradeWorkspace .grade-score-toolbar {
  grid-template-columns: minmax(82px, 1fr) 36px;
  width: 100%;
}

#gradeWorkspace .grade-score-toolbar button {
  min-height: 36px;
  font-size: 13px;
}

#gradeWorkspace .grade-score-toolbar .grade-score-settings-icon-button {
  width: 36px;
  min-width: 36px;
}

#gradeWorkspace .grade-subject-filters {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 7px;
}

#gradeWorkspace .grade-subject-button {
  min-height: 36px;
  padding: 0 24px;
  font-size: 13px;
}

#gradeWorkspace .grade-subject-icon {
  left: 7px;
  width: 14px;
  height: 14px;
}

#gradeWorkspace .grade-subject-status {
  right: 5px;
  font-size: 8px;
}

#gradeWorkspace .grade-analysis-main {
  grid-column: 2;
  grid-row: 2;
  padding-top: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 1500px) {
  .training-program-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #gradeWorkspace .grade-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  #gradeWorkspace .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-cadre-role-picker {
    grid-template-columns: repeat(2, minmax(104px, 1fr));
    gap: 5px;
  }

  .assistant-style-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1380px) and (min-width: 1181px) {
  #seatWorkspace .function-bar,
  #seatWorkspace .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  #seatWorkspace .workbench {
    grid-template-areas: "left" "board" "side";
  }
}

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

  .primary-sidebar {
    position: sticky;
    top: 0;
    overflow-x: auto;
  }

  .primary-nav {
    display: grid;
    grid-auto-columns: minmax(120px, 1fr);
    grid-auto-flow: column;
    width: max-content;
    min-width: 100%;
  }

  .primary-nav-item {
    justify-content: center;
    white-space: nowrap;
  }

  .training-toolbar {
    grid-template-columns: minmax(200px, 0.8fr) minmax(380px, 1.5fr) auto;
  }

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

  .primary-nav-indicator::after {
    top: auto;
    right: 12px;
    bottom: -1px;
    left: 12px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }

  #gradeWorkspace .grade-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  #gradeWorkspace .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .growth-rank-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .training-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-stage-filters {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .training-plan-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-cadre-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-cadre-group + .student-cadre-group {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 16px;
    padding-left: 0;
  }

  .student-selection-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .student-hygiene-rules-list {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .student-manager-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-directory-panel {
    min-height: 0;
  }

  .student-cadre-panel {
    min-height: 0;
  }

  .student-cadre-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title actions";
  }

  .student-cadre-toolbar-title {
    grid-area: title;
  }

  .student-cadre-toolbar-actions {
    grid-area: actions;
  }

  #gradeWorkspace .grade-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  #gradeWorkspace .grade-subject-section {
    grid-column: auto;
    border-top: 0;
  }

  #gradeWorkspace .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .growth-context-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .growth-detail-toolbar {
    min-height: auto;
  }

  .growth-student-index {
    position: static;
    height: auto;
    min-height: 0;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .growth-student-list {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .growth-student-button {
    min-width: 120px;
  }

  .growth-student-detail {
    padding: 16px;
  }

  .growth-ability-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .growth-ability-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(96px, auto);
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .growth-ability-group {
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 13px;
  }

  .growth-ability-group:last-child {
    border-right: 0;
  }

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

  .assistant-toolbar {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .assistant-student-rows {
    grid-template-columns: 230px minmax(0, 1fr);
  }

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

  .assistant-comment-config > header {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistant-export-actions {
    justify-content: flex-start;
  }

  .assistant-roster-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistant-toolbar-intro {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .training-page-head {
    align-items: flex-start;
    padding: 13px 14px;
  }

  .training-summary {
    flex-direction: column;
  }

  .training-summary > span {
    min-width: 82px;
    padding: 6px 9px;
  }

  .training-summary > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .training-toolbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 14px;
  }

  .training-custom-button,
  .training-stage-filters {
    grid-column: 1;
  }

  .training-stage-filters {
    grid-row: auto;
  }

  .training-content {
    padding: 14px;
  }

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

  .training-request-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .training-form-full {
    grid-column: 1;
  }

  .training-payment-methods {
    grid-template-columns: minmax(0, 1fr);
  }

  .growth-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page {
    padding: 10px;
  }

  .brand-hero {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
    padding-bottom: 10px;
  }

  .brand-mark {
    width: 40px;
  }

  .brand-copy h1 {
    font-size: 21px;
  }

  .teacher-account-button {
    min-width: 40px;
    width: 40px;
    padding: 3px;
  }

  .teacher-account-button strong {
    display: none;
  }

  .primary-nav {
    grid-auto-columns: minmax(104px, 1fr);
  }

  .primary-nav-item {
    min-height: 40px;
    padding: 0 9px;
    font-size: 12px;
  }

  .primary-nav-item:hover:not(.is-active) {
    transform: translateY(-1px);
  }

  .portal-workspace {
    min-height: calc(100vh - 124px);
  }

  .workspace-page-head {
    min-height: 68px;
    padding: 12px 14px;
  }

  .workspace-page-head h2 {
    font-size: 20px;
  }

  .workspace-page-head time {
    display: none;
  }

  .home-head-tools {
    gap: 0 !important;
  }

  .home-account {
    border-left: 0;
    padding-left: 0;
  }

  .home-account-menu {
    right: -2px;
  }

  .student-workspace .workspace-page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .student-workspace-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .student-workspace .privacy-badge {
    margin-top: 2px;
  }

  .student-manager-section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .student-directory-actions {
    width: 100%;
  }

  .student-directory-actions button {
    flex: 1 1 0;
  }

  .student-directory-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .student-directory-summary {
    width: 100%;
    justify-content: flex-start;
  }

  .student-directory-list {
    padding-inline: 14px;
  }

  .student-directory-list.is-adaptive-columns {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-directory-list.is-adaptive-columns > .student-directory-item,
  .student-directory-list.is-adaptive-columns > .student-directory-add {
    grid-column: var(--student-list-tablet-column);
    grid-row: var(--student-list-tablet-row);
  }

  .student-cadre-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title actions";
    padding: 11px 12px;
  }

  .student-cadre-toolbar-title h2 {
    font-size: 15px;
  }

  .student-cadre-toolbar-actions {
    align-self: center;
  }

  .workspace-title-edit-form {
    grid-template-columns: minmax(120px, 1fr) 30px 30px;
  }

  .student-cadre-board {
    padding: 15px 14px 24px;
  }

  .student-cadre-role-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .student-cadre-role-picker {
    grid-template-columns: repeat(2, minmax(104px, 1fr));
  }

  .student-cadre-popover {
    right: 39px;
    width: min(290px, calc(100vw - 58px));
  }

  .growth-scope-picker {
    width: 100%;
  }

  .growth-scope-trigger {
    width: 100%;
    min-width: 0;
  }

  .growth-scope-menu {
    right: auto;
    left: 0;
    width: min(390px, calc(100vw - 42px));
  }

  .growth-detail-toolbar {
    padding: 10px 14px;
  }

  .growth-ability-insights {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
  }

  .growth-ability-group {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-metrics,
  .growth-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-dashboard-content {
    gap: 12px;
    padding: 12px;
  }

  .home-daily-quote {
    min-height: 100px;
    grid-template-columns: 38px minmax(0, 1fr) 32px;
    gap: 11px;
    padding: 14px;
  }

  .home-quote-icon {
    width: 38px;
    height: 38px;
  }

  .home-quote-copy blockquote {
    font-size: 16px;
  }

  .home-metric {
    min-height: 112px;
    grid-template-rows: 32px auto auto;
    gap: 6px;
    padding: 12px 8px;
  }

  .home-metric-icon {
    width: 32px;
    height: 32px;
  }

  .home-metric strong {
    font-size: 22px;
  }

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

  .home-status-card {
    min-height: 116px;
    padding: 10px;
  }

  .home-attention-list {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .workspace-section,
  .growth-student-detail {
    padding: 14px;
  }

  .workspace-toolbar {
    padding: 9px 14px;
  }

  .workspace-search {
    width: min(190px, 70vw);
  }

  #gradeWorkspace .grade-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  #gradeWorkspace .grade-sidebar-section,
  #gradeWorkspace .grade-stage-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #gradeWorkspace .grade-subject-section {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
  }

  #gradeWorkspace .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .growth-student-list {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .growth-rank-chart-card > header {
    padding-inline: 11px;
  }

  .assistant-toolbar {
    grid-template-columns: minmax(0, 1fr);
    margin-inline: 10px;
  }

  .assistant-toolbar-intro,
  .assistant-toolbar-options {
    grid-column: auto;
  }

  .assistant-toolbar-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistant-generate-all {
    min-width: 0;
  }

  .assistant-table-head {
    display: none;
  }

  .assistant-student-rows {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistant-style-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistant-roster-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .assistant-roster-list {
    max-height: 230px;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .assistant-comment-workbench .assistant-comment-editor {
    min-height: 520px;
  }

  .assistant-editor-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistant-editor-status,
  .assistant-comment-workbench .assistant-row-actions {
    width: 100%;
  }

  .assistant-comment-workbench .assistant-row-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .assistant-student-row {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .assistant-comment-cell {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0 !important;
  }

  .assistant-student-table {
    margin-inline: 10px;
  }

  .settings-list {
    padding: 4px 14px 18px;
  }

  .settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .settings-row p {
    white-space: normal;
  }

  .settings-switch {
    align-self: flex-end;
  }

  .settings-privacy-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-privacy-content section:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@page {
  size: A4 portrait;
  margin: 14mm;
}

@page hygiene {
  size: A4 portrait;
  margin: 10mm;
}

@page study-groups {
  size: A4 portrait;
  margin: 10mm;
}

@page assistant {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  html,
  body {
    background: #ffffff !important;
  }

  body {
    zoom: 1 !important;
  }

  .app-shell {
    display: block;
  }

  .primary-sidebar {
    display: none;
  }

  .site-compliance-footer {
    display: none !important;
  }

  .portal-workspace {
    border: 0;
    background: #ffffff;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .home-class-setup-card,
  .home-student-directory-panel,
  .student-hygiene-panel,
  .student-cadre-panel {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.study-group-print-mode {
    page: study-groups;
  }

  body.study-group-print-mode .page {
    width: 190mm;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.study-group-print-mode .app-shell,
  body.study-group-print-mode .workspace-stage {
    display: block;
  }

  body.study-group-print-mode .primary-sidebar,
  body.study-group-print-mode .workspace-stage > :not(#studyGroupsWorkspace),
  body.study-group-print-mode #studyGroupsWorkspace > :not(.study-group-print-sheet) {
    display: none !important;
  }

  body.study-group-print-mode #studyGroupsWorkspace {
    display: block !important;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body.study-group-print-mode .study-group-print-sheet {
    display: block !important;
    width: 100%;
    color: #111111;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  }

  .study-group-print-sheet > h1 {
    margin: 0 0 9mm;
    padding: 0;
    font-size: 20pt;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
  }

  .study-group-print-grid {
    display: grid;
    grid-template-columns: repeat(var(--study-group-print-columns, 5), minmax(0, 1fr));
    align-items: start;
    row-gap: 5mm;
  }

  .study-group-print-column {
    min-width: 0;
    break-inside: avoid;
  }

  .study-group-print-column > h2 {
    display: grid;
    min-height: 13mm;
    place-items: center;
    margin: 0;
    border: 0.28mm solid #7f8792;
    background: #edf0f3;
    padding: 1mm;
    font-size: 10pt;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
  }

  .study-group-print-column + .study-group-print-column > h2,
  .study-group-print-column + .study-group-print-column > .study-group-print-names {
    border-left: 0;
  }

  .study-group-print-column:nth-child(5n + 1):not(:first-child) > h2,
  .study-group-print-column:nth-child(5n + 1):not(:first-child) > .study-group-print-names {
    border-left: 0.28mm solid #aeb6c0;
  }

  .study-group-print-names {
    display: grid;
    box-sizing: border-box;
    min-height: var(--study-group-print-body-height, 48mm);
    align-content: start;
    border: 0.28mm solid #aeb6c0;
    border-top: 0;
    padding: 3mm 1mm;
  }

  .study-group-print-names > span {
    display: flex;
    min-height: var(--study-group-print-name-height, 7mm);
    align-items: center;
    justify-content: center;
    gap: 1.2mm;
    padding: 0.2mm;
    font-size: var(--study-group-print-name-font-size, 9.5pt);
    font-weight: 600;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .study-group-print-names > span.is-leader {
    font-weight: 800;
  }

  .study-group-print-names > span strong {
    min-width: 0;
  }

  .study-group-print-names > span i,
  .study-group-print-names > span i > .ui-icon {
    display: block;
    width: 3.1mm;
    height: 3.1mm;
    flex: 0 0 3.1mm;
    color: #111111;
  }

  body.student-cadre-print-mode .page {
    width: 182mm;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.student-cadre-print-mode .app-shell,
  body.student-cadre-print-mode .workspace-stage {
    display: block;
  }

  body.student-cadre-print-mode .primary-sidebar,
  body.student-cadre-print-mode .workspace-stage > :not(#studentWorkspace),
  body.student-cadre-print-mode #studentWorkspace > :not(.student-cadre-print-sheet) {
    display: none !important;
  }

  body.student-cadre-print-mode #studentWorkspace {
    display: block !important;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body.student-cadre-print-mode .student-cadre-print-sheet {
    display: block !important;
    width: 100%;
    color: #111111;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  }

  .student-cadre-print-sheet > h1 {
    margin: 0 0 10mm;
    padding: 0;
    font-size: 20pt;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
  }

  .student-cadre-print-group {
    margin: 0 0 5mm;
    break-inside: avoid;
  }

  .student-cadre-print-group > h2 {
    margin: 0;
    border: 0.28mm solid #8f98a3;
    background: #e7eaee;
    box-shadow: inset 1.2mm 0 0 #20242c;
    padding: 2.45mm 3.6mm;
    font-size: 11pt;
    font-weight: 800;
    line-height: 1.2;
  }

  .student-cadre-print-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-cadre-print-entry {
    display: grid;
    min-height: 11.5mm;
    grid-template-columns: 31mm minmax(0, 1fr);
    align-items: stretch;
    break-inside: avoid;
  }

  .student-cadre-print-entry > strong,
  .student-cadre-print-entry > span {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 0.28mm solid #aeb6c0;
    border-top: 0;
    padding: 1.55mm 2.2mm;
    font-size: 9.5pt;
    line-height: 1.35;
    text-align: center;
  }

  .student-cadre-print-entry > strong {
    gap: 1.8mm;
    background: #f8f9fa;
    font-weight: 750;
  }

  .student-cadre-print-entry > strong > i {
    display: inline-grid;
    width: 4.8mm;
    height: 4.8mm;
    flex: 0 0 4.8mm;
    place-items: center;
    color: #3f4854;
    font-style: normal;
    transform: translateY(0.35mm);
  }

  .student-cadre-print-entry > strong > i .ui-icon,
  .student-cadre-print-entry > strong > i svg {
    width: 100%;
    height: 100%;
  }

  .student-cadre-print-entry > strong > em {
    min-width: 0;
    font-style: normal;
  }

  .student-cadre-print-entry > span {
    border-left: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .student-cadre-print-sheet.is-dense > h1 {
    margin-bottom: 4.5mm;
    padding-bottom: 3mm;
    font-size: 20pt;
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-group {
    margin-bottom: 3mm;
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-group > h2 {
    padding-block: 1.8mm;
    font-size: 10pt;
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-entry {
    min-height: 9mm;
    grid-template-columns: 34mm minmax(0, 1fr);
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-entry > strong,
  .student-cadre-print-sheet.is-dense .student-cadre-print-entry > span {
    padding: 1mm 1.5mm;
    font-size: 8.6pt;
    line-height: 1.2;
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-entry > strong {
    gap: 1.2mm;
  }

  .student-cadre-print-sheet.is-dense .student-cadre-print-entry > strong > i {
    width: 4.2mm;
    height: 4.2mm;
    flex-basis: 4.2mm;
  }

  .student-cadre-print-entry:nth-child(even) > strong {
    border-left: 0;
  }

  body.student-hygiene-print-mode {
    page: hygiene;
  }

  body.student-hygiene-print-mode .page {
    width: 190mm;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.student-hygiene-print-mode .app-shell,
  body.student-hygiene-print-mode .workspace-stage {
    display: block;
  }

  body.student-hygiene-print-mode .primary-sidebar,
  body.student-hygiene-print-mode .workspace-stage > :not(#hygieneWorkspace),
  body.student-hygiene-print-mode #hygieneWorkspace > :not(.student-hygiene-print-sheet) {
    display: none !important;
  }

  body.student-hygiene-print-mode #hygieneWorkspace {
    display: block !important;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body.student-hygiene-print-mode .student-hygiene-print-sheet {
    display: block !important;
    width: 100%;
    color: #111111;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  }

  body.assistant-print-mode {
    page: assistant;
  }

  body.assistant-print-mode .page {
    width: 186mm;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.assistant-print-mode .app-shell,
  body.assistant-print-mode .workspace-stage {
    display: block;
  }

  body.assistant-print-mode .primary-sidebar,
  body.assistant-print-mode .workspace-stage > :not(#assistantWorkspace),
  body.assistant-print-mode #assistantWorkspace > :not(.assistant-print-sheet) {
    display: none !important;
  }

  body.assistant-print-mode #assistantWorkspace {
    display: block !important;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body.assistant-print-mode .assistant-print-sheet {
    display: block !important;
    width: 100%;
    color: #111111;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  }

  .assistant-print-sheet > h1 {
    margin: 0 0 5mm;
    border-bottom: 0.35mm solid #111111;
    padding: 0 0 3mm;
    font-size: 18pt;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
  }

  .assistant-print-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .assistant-print-table th,
  .assistant-print-table td {
    border: 0.25mm solid #aeb5bf;
    padding: 2.2mm 2.4mm;
    color: #111111;
    font-size: 10pt;
    line-height: 1.55;
  }

  .assistant-print-table thead th {
    background: #ffffff;
    font-weight: 800;
    text-align: center;
  }

  .assistant-print-table th:first-child,
  .assistant-print-table td:first-child {
    width: 13mm;
    text-align: center;
  }

  .assistant-print-table th:nth-child(2),
  .assistant-print-table td:nth-child(2) {
    width: 23mm;
    text-align: center;
  }

  .assistant-print-table tbody tr {
    break-inside: avoid;
  }

  .student-hygiene-print-sheet > h1 {
    margin: 0 0 6mm;
    padding: 0;
    font-size: 17pt;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
  }

  .student-hygiene-print-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .student-hygiene-print-table th,
  .student-hygiene-print-table td {
    height: 20mm;
    border: 0.25mm solid #aeb5bf;
    padding: 2.5mm 1.4mm;
    color: #111111;
    font-size: 10.5pt;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .student-hygiene-print-table thead th,
  .student-hygiene-print-table tbody th {
    background: #ffffff;
    color: #111111;
    font-size: 11pt;
    font-weight: 800;
  }

  .student-hygiene-print-table thead th:first-child {
    width: 22mm;
  }

  .student-hygiene-print-corner {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
  }

  .student-hygiene-print-corner .student-hygiene-corner-line {
    display: block !important;
    color: #6f7782;
  }

  .student-hygiene-print-corner .student-hygiene-corner-line line {
    stroke: #6f7782 !important;
    stroke-width: 1.6;
  }

  .student-hygiene-print-corner > span {
    position: absolute;
    line-height: 1;
  }

  .student-hygiene-print-corner .student-hygiene-corner-area {
    top: 2.4mm;
    right: 2.2mm;
  }

  .student-hygiene-print-corner .student-hygiene-corner-day {
    bottom: 2.4mm;
    left: 2.2mm;
  }

  .student-hygiene-print-names {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 1.7mm;
    font-size: 11pt;
    font-weight: 600;
    text-align: center;
  }

  .student-hygiene-print-names > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .student-hygiene-print-rules {
    margin-top: 4mm;
    break-inside: avoid;
  }

  .student-hygiene-print-rules h2 {
    margin: 0 0 2mm;
    font-size: 11pt;
  }

  .student-hygiene-print-rules ol {
    margin: 0;
    padding-left: 6mm;
  }

  .student-hygiene-print-rules li {
    display: list-item;
    margin: 0 0 1.3mm;
    padding-left: 0.5mm;
    font-size: 9.5pt;
    line-height: 1.45;
  }
}

/* V0.4412: teacher training and legal-learning directories. */
.training-page-head {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  align-items: center;
}

.training-directory-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-panel);
}

.training-directory-tabs button {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.training-directory-tabs button + button {
  border-left: 1px solid var(--line);
}

.training-directory-tabs button::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: transparent;
  content: "";
}

.training-directory-tabs button .ui-icon {
  width: 16px;
  height: 16px;
}

.training-directory-tabs button.is-active {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--ink);
}

.training-directory-tabs button.is-active::after {
  background: var(--accent);
}

.training-content {
  padding-right: 0;
  padding-left: 0;
}

.training-stage-directory[hidden],
.training-legal-directory[hidden] {
  display: none !important;
}

.training-legal-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.training-legal-directory .training-program-card,
.training-legal-directory .training-add-card {
  min-height: 162px;
}

.training-legal-directory .training-program-card-body {
  min-height: 140px;
}

.training-program-card-shell.is-legal .training-program-card-icon {
  border-color: color-mix(in srgb, #15765b 28%, var(--line));
  background: color-mix(in srgb, #15765b 6%, var(--surface));
  color: #15765b;
}

.training-legal-add-card {
  width: 100%;
}

@media (max-width: 1380px) {
  .training-legal-directory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .training-page-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-directory-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 860px) {
  .training-page-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .training-page-title,
  .training-directory-tabs,
  .training-location-controls {
    grid-column: 1;
  }

  .training-directory-tabs {
    grid-row: auto;
  }

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

@media (max-width: 560px) {
  .training-legal-directory {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Learning groups: Swiss grid with draggable student tokens. */
.study-groups-workspace {
  min-height: calc(100vh - 96px);
  background: var(--page);
}

.study-groups-toolbar {
  display: grid;
  min-height: 84px;
  grid-template-columns: minmax(230px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 16px;
}

.study-groups-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.study-groups-title > div {
  min-width: 0;
}

.study-groups-title-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--accent);
}

.study-groups-title-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.study-groups-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.1;
}

.study-groups-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.study-groups-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.study-groups-summary > span {
  display: grid;
  min-height: 48px;
  grid-template-columns: auto auto;
  align-content: center;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
}

.study-groups-summary > span + span {
  border-left: 1px solid var(--line);
}

.study-groups-summary strong {
  color: var(--ink);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.study-groups-summary small {
  color: var(--muted);
  font-size: 11px;
}

.study-groups-settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-groups-stepper {
  display: grid;
  min-width: 144px;
  grid-template-columns: auto minmax(76px, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 5px 6px 5px 10px;
}

.study-groups-stepper > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.study-groups-stepper > div {
  display: grid;
  grid-template-columns: 26px 28px 26px;
  align-items: center;
  justify-content: end;
}

.study-groups-stepper button {
  display: grid;
  width: 26px;
  min-width: 26px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.study-groups-stepper button:hover:not(:disabled),
.study-groups-stepper button:focus-visible {
  background: var(--surface);
  color: var(--accent);
}

.study-groups-stepper button:disabled {
  opacity: 0.28;
}

.study-groups-stepper button .ui-icon {
  width: 14px;
  height: 14px;
}

.study-groups-stepper strong {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.study-group-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.study-group-clear-button {
  color: var(--muted);
}

.study-group-clear-button:hover,
.study-group-clear-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line-strong));
  color: var(--accent);
}

.study-group-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  padding: 12px 0;
}

.study-group-card {
  position: relative;
  min-width: 0;
  min-height: 252px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 180ms ease, box-shadow 240ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.study-group-card > header {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  padding: 0 5px;
}

.study-group-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.study-group-card > header p {
  position: absolute;
  right: 6px;
  bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.study-group-card > header p strong {
  color: var(--ink);
  font-size: 12px;
}

.study-group-card.is-full > header p strong {
  color: var(--accent);
}

.study-group-members {
  display: grid;
  min-height: 194px;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  padding: 10px;
}

.study-group-member,
.study-pool-student {
  position: relative;
  display: grid;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: grab;
  user-select: none;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 220ms ease, opacity 170ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.study-group-member {
  min-height: 34px;
  grid-template-columns: 23px minmax(0, 1fr) 23px;
}

.study-group-member:hover,
.study-pool-student:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line-strong));
  box-shadow: 0 7px 16px rgba(21, 26, 35, 0.07);
  transform: translateY(-1px);
}

.study-group-member:active,
.study-pool-student:active {
  cursor: grabbing;
}

.study-student-seat {
  display: grid;
  min-width: 23px;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.study-group-member > strong,
.study-pool-student > strong {
  min-width: 0;
  overflow: hidden;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.study-group-member > strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.study-group-member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-group-leader-toggle {
  position: relative;
  z-index: 1;
  display: grid;
  width: 12px;
  min-width: 12px;
  height: 12px;
  min-height: 12px;
  flex: 0 0 12px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #111111;
  cursor: pointer;
  opacity: 0;
  padding: 0;
  transition: color 120ms ease, opacity 120ms ease, transform 160ms ease;
}

.study-group-leader-toggle > .ui-icon {
  width: 12px;
  height: 12px;
}

.study-group-leader-toggle.is-active,
.study-group-member:hover .study-group-leader-toggle,
.study-group-leader-toggle:focus-visible {
  opacity: 1;
}

.study-group-leader-toggle:not(.is-active) {
  color: var(--muted);
}

.study-group-leader-toggle:hover,
.study-group-leader-toggle:focus-visible {
  color: #111111;
  transform: scale(1.18);
}

.study-group-leader-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: 2px;
}

@media (hover: none) {
  .study-group-leader-toggle:not(.is-active) {
    opacity: 0.42;
  }
}

.study-group-member > button {
  display: grid;
  width: 23px;
  min-width: 23px;
  height: 100%;
  min-height: 36px;
  place-items: center;
  border: 0;
  border-left: 1px solid transparent;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  padding: 0;
}

.study-group-member:hover > button,
.study-group-member > button:focus-visible {
  border-left-color: var(--line);
  color: var(--accent);
  opacity: 1;
}

.study-group-member > button .ui-icon {
  width: 13px;
  height: 13px;
}

.study-group-add-student {
  display: flex;
  width: 100%;
  min-height: 34px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 6px;
  border: 1px dashed color-mix(in srgb, var(--line-strong) 75%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-panel) 56%, transparent);
  color: var(--muted);
  opacity: 0.72;
}

.study-group-add-student:hover:not(:disabled),
.study-group-add-student:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  color: var(--accent);
  opacity: 1;
}

.study-group-add-student:disabled {
  cursor: default;
  opacity: 0.4;
}

.study-group-card.is-full .study-group-add-student {
  display: none;
}

.study-group-add-student .ui-icon {
  width: 16px;
  height: 16px;
}

.study-group-add-student span:last-child {
  font-size: 11px;
  font-weight: 700;
}

.study-group-inline-picker {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 8;
  max-height: 184px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line-strong));
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(20, 24, 32, 0.16);
  animation: studyGroupPickerIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.study-group-inline-picker > header {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 8px 0 11px;
}

.study-group-inline-picker > header strong {
  font-size: 12px;
}

.study-group-inline-picker > header button {
  display: grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.study-group-inline-picker > header button .ui-icon {
  width: 14px;
  height: 14px;
}

.study-group-inline-picker > div {
  display: grid;
  max-height: 144px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow-y: auto;
  padding: 7px;
}

.study-group-inline-picker > div > button {
  display: grid;
  min-height: 32px;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-panel);
  padding: 0;
  color: var(--ink);
  text-align: left;
}

.study-group-inline-picker > div > button:hover,
.study-group-inline-picker > div > button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.study-group-inline-picker > div > button span {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.study-group-inline-picker > div > button strong {
  overflow: hidden;
  padding: 0 7px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-group-inline-picker > div > p {
  grid-column: 1 / -1;
  margin: 15px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.study-student-pool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.study-student-pool-panel > header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 13px;
}

.study-student-pool-panel > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-student-pool-panel > header .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.study-student-pool-panel h3 {
  margin: 0;
  font-size: 15px;
}

.study-student-pool-panel > header small {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.study-student-pool {
  display: grid;
  min-height: 104px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  align-content: start;
  gap: 7px;
  padding: 10px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.study-pool-student {
  min-height: 38px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.study-pool-student small {
  margin-right: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.study-pool-student:not(.is-assigned) {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

.study-pool-student:not(.is-assigned) small {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  color: var(--accent);
}

.study-pool-student.is-assigned {
  background: var(--surface-panel);
  opacity: 0.72;
}

.study-groups-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 12px;
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.study-groups-empty > .ui-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.study-groups-empty h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.study-groups-empty button {
  min-height: 38px;
}

.study-group-card.is-drop-target,
.study-student-pool.is-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent), 0 12px 28px rgba(228, 0, 43, 0.1);
  transform: translateY(-2px);
}

.study-group-card.is-drop-blocked {
  border-color: var(--danger);
  animation: studyGroupBlocked 360ms ease;
}

.study-group-member.is-dragging,
.study-pool-student.is-dragging {
  opacity: 0.34;
  transform: scale(0.96) rotate(-1deg);
}

.study-group-member.is-drop-arrival {
  animation: studyGroupArrival 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.study-group-member.is-swap-target {
  z-index: 2;
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 14%, transparent), 0 10px 22px rgba(21, 26, 35, 0.14);
  transform: translateY(-2px) scale(1.025);
}

body.study-group-dragging .study-group-card:not(.is-full),
body.study-group-dragging .study-student-pool {
  border-style: dashed;
}

@keyframes studyGroupArrival {
  0% { opacity: 0; transform: translateY(-12px) scale(0.86); box-shadow: 0 14px 24px rgba(228, 0, 43, 0.2); }
  58% { opacity: 1; transform: translateY(2px) scale(1.025); }
  100% { opacity: 1; transform: translateY(0) scale(1); box-shadow: none; }
}

@keyframes studyGroupPickerIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes studyGroupBlocked {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  65% { transform: translateX(4px); }
}

@media (max-width: 1380px) {
  .study-groups-toolbar {
    grid-template-columns: minmax(220px, 1fr) auto auto;
  }

  .study-groups-settings {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
  }

  .study-group-toolbar-actions {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 920px) {
  .study-groups-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-groups-summary,
  .study-groups-settings,
  .study-group-toolbar-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .study-groups-summary {
    width: 100%;
  }

  .study-groups-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-group-toolbar-actions {
    justify-self: end;
  }

  .study-groups-stepper {
    min-width: 0;
  }

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

@media (max-width: 620px) {
  .study-groups-settings,
  .study-group-board {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (prefers-reduced-motion: reduce) {
  .study-group-card,
  .study-group-member,
  .study-pool-student,
  .study-group-inline-picker {
    animation: none !important;
    transition: none !important;
  }
}
