:root {
  --ink: #13333f;
  --muted: #66818a;
  --paper: rgba( 255, 255, 255, 0.82 );
  --paper-solid: #fffdf7;
  --line: rgba( 19, 51, 63, 0.12 );
  --mint: #5ac8a7;
  --mint-deep: #12806d;
  --sky: #7dc8ff;
  --sun: #ffd36f;
  --coral: #ff8f78;
  --lavender: #b9c5ff;
  --shadow: 0 24px 70px rgba( 42, 85, 94, 0.18 );
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shell-max-width: 1440px;
  --shell-gutter: clamp( 16px, 2.8vw, 40px );
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var( --ink );
  background:
    radial-gradient( circle at 8% 4%, rgba( 125, 200, 255, 0.32 ), transparent 30% ),
    radial-gradient( circle at 92% 10%, rgba( 255, 211, 111, 0.34 ), transparent 26% ),
    radial-gradient( circle at 50% 100%, rgba( 90, 200, 167, 0.22 ), transparent 34% ),
    linear-gradient( 145deg, #f3fbf7 0%, #eef8ff 46%, #fff6e8 100% );
}

body.sim-view-active .site-shell {
  width: min( 100% - 20px, 100vw );
  max-width: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient( rgba( 255, 255, 255, 0.42 ) 1px, transparent 1px ),
    linear-gradient( 90deg, rgba( 255, 255, 255, 0.34 ) 1px, transparent 1px );
  background-size: 34px 34px;
  mask-image: linear-gradient( 180deg, rgba( 0, 0, 0, 0.58 ), transparent 84% );
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min( var( --shell-max-width ), calc( 100% - ( var( --shell-gutter ) * 2 ) ) );
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 64px;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  min-height: 0;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax( 0, 1fr ) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid rgba( 255, 255, 255, 0.72 );
  border-radius: 999px;
  background: rgba( 255, 255, 255, 0.78 );
  box-shadow: 0 18px 50px rgba( 65, 108, 117, 0.14 );
  backdrop-filter: blur( 20px );
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark small {
  margin-top: 2px;
  color: var( --muted );
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  color: #093c37;
  font-weight: 900;
  background: linear-gradient( 135deg, var( --mint ), var( --sun ) );
  box-shadow: inset 0 -8px 16px rgba( 255, 255, 255, 0.25 );
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.topnav a,
.topnav button,
.auth-area button,
.primary-action,
.ghost-action,
.card-link,
.inline-form button,
.grid-form button,
.profile-form button,
.auth-form button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.topnav a,
.topnav button {
  padding: 10px 14px;
  color: rgba( 19, 51, 63, 0.78 );
  background: transparent;
}

.topnav a:hover,
.topnav button:hover,
.auth-area button:hover,
.primary-action:hover,
.ghost-action:hover,
.card-link:hover,
.inline-form button:hover,
.grid-form button:hover,
.profile-form button:hover {
  transform: translateY( -1px );
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  min-width: 0;
  white-space: normal;
}

.auth-area button {
  padding: 10px 14px;
  background: #153b43;
  color: #fff;
}

.auth-area .ghost {
  color: var( --ink );
  background: rgba( 19, 51, 63, 0.08 );
}

.auth-menu {
  position: relative;
}

.auth-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba( 19, 51, 63, 0.08 );
  border-radius: 999px;
  color: var( --ink );
  background: rgba( 255, 255, 255, 0.82 ) !important;
  box-shadow: 0 12px 28px rgba( 65, 108, 117, 0.1 );
}

.auth-menu-avatar-wrap {
  width: 38px;
  height: 38px;
  flex: none;
}

.auth-menu-avatar {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  object-fit: cover;
  background: linear-gradient( 145deg, rgba( 221, 247, 242, 0.9 ), rgba( 224, 241, 255, 0.86 ) );
}

.auth-menu-avatar-fallback {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba( 255, 255, 255, 0.8 );
  box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.45 );
}

.auth-menu-avatar-fallback::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba( 15, 92, 104, 0.22 );
  transform: translateY( -5px );
}

.auth-menu-avatar-fallback::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 20px;
  height: 11px;
  border-radius: 999px 999px 8px 8px;
  background: rgba( 15, 92, 104, 0.18 );
}

.auth-menu-copy {
  min-width: 0;
  display: grid;
  text-align: left;
}

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

.auth-menu-copy strong {
  color: var( --ink );
  font-size: 14px;
  line-height: 1.15;
}

.auth-menu-copy small {
  margin-top: 2px;
  color: var( --muted );
  font-size: 11px;
}

.auth-menu-caret {
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2px solid rgba( 19, 51, 63, 0.55 );
  border-bottom: 2px solid rgba( 19, 51, 63, 0.55 );
  transform: rotate( 45deg );
  transition: transform 160ms ease;
}

.auth-menu.is-open .auth-menu-caret {
  transform: rotate( -135deg );
}

.auth-menu-panel {
  position: absolute;
  top: calc( 100% + 10px );
  right: 0;
  min-width: 184px;
  padding: 8px;
  border: 1px solid rgba( 19, 51, 63, 0.08 );
  border-radius: 18px;
  background: rgba( 255, 253, 247, 0.96 );
  box-shadow: 0 20px 44px rgba( 65, 108, 117, 0.16 );
  backdrop-filter: blur( 16px );
}

.auth-menu-panel[hidden] {
  display: none !important;
}

.auth-menu-panel button {
  width: 100%;
  justify-content: flex-start;
  padding: 11px 14px;
  color: var( --ink );
  background: transparent !important;
  box-shadow: none;
  border-radius: 14px;
}

.auth-menu-panel button:hover {
  background: rgba( 19, 51, 63, 0.08 ) !important;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.teacher-tabs,
.sub-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.teacher-tabs button,
.sub-tabs button,
.pill-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  color: var( --ink );
  background: rgba( 19, 51, 63, 0.08 );
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.teacher-tabs button.is-active,
.sub-tabs button.is-active {
  color: #fff;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
}

.pill-button {
  color: #fff;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
  box-shadow: 0 10px 24px rgba( 14, 100, 112, 0.18 );
}

.pill-button.danger {
  background: linear-gradient( 135deg, #c85252, #9d2f4f );
}

.teacher-pane {
  display: none;
}

.teacher-pane.is-active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: 380px minmax( 0, 1fr );
  gap: 20px;
}

.split-left,
.split-right {
  min-height: 520px;
}

.panel-scroll-body,
.panel-scroll-stack {
  min-height: 0;
}

.panel-scroll-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.panel-scroll-stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

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

.panel-head h2 {
  margin: 0;
}

.panel-head p {
  margin: 6px 0 0;
}

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

.view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba( 19, 51, 63, 0.08 );
}

.subject-switch {
  position: relative;
}

.subject-switch-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba( 19, 51, 63, 0.1 );
  border-radius: 999px;
  color: var( --ink );
  background: rgba( 255, 255, 255, 0.86 );
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.subject-switch-button:hover:not(:disabled) {
  transform: translateY( -1px );
  box-shadow: 0 10px 22px rgba( 65, 108, 117, 0.12 );
}

.subject-switch-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.subject-switch-menu {
  position: absolute;
  top: calc( 100% + 8px );
  right: 0;
  z-index: 8;
  display: grid;
  min-width: 140px;
  padding: 8px;
  border: 1px solid rgba( 19, 51, 63, 0.1 );
  border-radius: 18px;
  background: rgba( 255, 253, 247, 0.98 );
  box-shadow: 0 18px 40px rgba( 65, 108, 117, 0.16 );
  backdrop-filter: blur( 14px );
}

.subject-switch-menu[hidden] {
  display: none !important;
}

.subject-switch-option {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: var( --ink );
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.subject-switch-option.is-active {
  color: #fff;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
}

.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: rgba( 19, 51, 63, 0.62 );
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.icon-toggle:hover {
  transform: translateY( -1px );
}

.icon-toggle.is-active {
  color: #fff;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
  box-shadow: 0 10px 24px rgba( 14, 100, 112, 0.18 );
}

.icon-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.panel-filter-row {
  flex: none;
  margin: 0 0 14px;
}

.panel-filter-row-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-filter-row-inline input[type="search"] {
  flex: 1 1 auto;
}

.panel-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: none;
}

.panel-filter-row input[type="search"] {
  min-height: 44px;
}

.class-list,
.assessment-list {
  display: grid;
  gap: 12px;
}

.class-item,
.assessment-item {
  padding: 16px;
  border: 1px solid var( --line );
  border-radius: 18px;
  background: rgba( 255, 255, 255, 0.74 );
  cursor: pointer;
}

.class-item.is-active,
.assessment-item.is-active {
  border-color: rgba( 20, 148, 126, 0.36 );
  box-shadow: 0 12px 26px rgba( 20, 148, 126, 0.14 );
}

.class-item-head,
.assessment-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.class-item-title,
.assessment-item-title {
  font-weight: 900;
}

.class-item-meta,
.assessment-item-meta {
  margin-top: 8px;
  color: var( --muted );
  font-size: 13px;
  line-height: 1.6;
}

.ghost-mini {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  color: var( --ink );
  background: rgba( 19, 51, 63, 0.08 );
}

.ghost-mini.danger {
  color: #fff;
  background: rgba( 188, 53, 74, 0.9 );
}

.request-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.request-card {
  padding: 14px;
  border: 1px solid rgba( 255, 211, 111, 0.6 );
  border-radius: 16px;
  background: rgba( 255, 248, 228, 0.86 );
}

.request-card strong {
  display: block;
}

.request-card p {
  margin: 6px 0 10px;
}

.request-actions {
  display: flex;
  gap: 10px;
}

.checkbox-grid {
  display: grid;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

.hint-box {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  color: var( --mint-deep );
  background: rgba( 90, 200, 167, 0.12 );
}

.auth-panel[hidden],
.form-dialog[hidden] {
  display: none !important;
}

.form-dialog {
  position: relative;
  width: min( 460px, calc( 100% - 30px ) );
  border: 0;
  border-radius: 26px;
  padding: 24px;
  background: var( --paper-solid );
  box-shadow: var( --shadow );
}

.form-dialog.form-dialog-wide {
  width: min( 620px, calc( 100% - 30px ) );
}

.form-dialog::backdrop {
  background: rgba( 8, 30, 37, 0.36 );
  backdrop-filter: blur( 10px );
}

.form-dialog h3 {
  margin: 0 0 16px;
  font-size: 1.45rem;
}

.form-dialog-head {
  margin: 0 48px 16px 0;
}

.dialog-close-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}

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

.fun-card p {
  min-height: 72px;
}

.score-input,
.star-input {
  max-width: 92px;
}

.assessment-chart-view {
  display: grid;
  gap: 16px;
}

.analytics-stat-grid {
  display: grid;
  grid-template-columns: repeat( 6, minmax( 0, 1fr ) );
  gap: 12px;
}

.analytics-stat-card,
.chart-card {
  border: 1px solid var( --line );
  border-radius: 22px;
  background: rgba( 255, 255, 255, 0.8 );
  box-shadow: 0 16px 36px rgba( 65, 108, 117, 0.1 );
}

.analytics-stat-card {
  padding: 18px;
}

.analytics-stat-card span {
  display: block;
  color: var( --muted );
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.65rem;
  line-height: 1;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax( 0, 1fr );
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px;
}

.chart-card-head h3 {
  margin: 0;
}

.chart-card-head p {
  margin: 6px 0 0;
  color: var( --muted );
  font-size: 13px;
  line-height: 1.6;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed var( --line );
  border-radius: 18px;
  color: var( --muted );
  text-align: center;
  background: rgba( 255, 255, 255, 0.7 );
}

.chart-host {
  width: 100%;
  height: 320px;
  margin-top: 14px;
}

.pie-chart-host {
  height: 280px;
  margin-top: 0;
}

.pie-chart-layout {
  display: grid;
  grid-template-columns: minmax( 320px, 420px ) minmax( 0, 1fr );
  gap: 18px;
  align-items: center;
  margin-top: 12px;
}

.pie-legend {
  display: grid;
  gap: 12px;
}

.pie-legend-item {
  display: grid;
  grid-template-columns: 14px minmax( 0, 1fr );
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba( 19, 51, 63, 0.08 );
  border-radius: 16px;
  background: rgba( 255, 255, 255, 0.72 );
}

.pie-legend-item strong {
  display: block;
}

.pie-legend-item span {
  display: block;
  margin-top: 4px;
  color: var( --muted );
  font-size: 13px;
  line-height: 1.5;
}

.legend-swatch {
  display: block;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba( 255, 255, 255, 0.72 );
}

.analytics-footnote {
  margin: 0;
  color: var( --muted );
  font-size: 13px;
  line-height: 1.7;
}

.award-stack {
  display: grid;
  gap: 8px;
}

.award-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.award-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 16px;
  background: rgba( 19, 51, 63, 0.08 );
}

.award-token.star {
  background: rgba( 255, 211, 111, 0.2 );
}

.award-token.moon {
  background: rgba( 125, 200, 255, 0.18 );
}

.award-token.sun {
  background: rgba( 255, 143, 120, 0.18 );
}

.award-empty,
.award-total {
  color: var( --muted );
  font-size: 12px;
}

.star-actions {
  display: flex;
  gap: 8px;
}

.star-actions .ghost-mini,
.star-actions .pill-button {
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax( 0, 1fr ) 340px;
  gap: 24px;
  margin-top: 26px;
  padding: clamp( 28px, 5vw, 58px );
  border: 1px solid rgba( 255, 255, 255, 0.76 );
  border-radius: var( --radius-xl );
  background:
    linear-gradient( 135deg, rgba( 255, 255, 255, 0.9 ), rgba( 255, 250, 236, 0.68 ) ),
    radial-gradient( circle at 20% 20%, rgba( 90, 200, 167, 0.24 ), transparent 32% );
  box-shadow: var( --shadow );
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 340px;
  height: 340px;
  border-radius: 52% 48% 44% 56%;
  background: linear-gradient( 135deg, rgba( 255, 211, 111, 0.62 ), rgba( 125, 200, 255, 0.52 ) );
  filter: blur( 2px );
  opacity: 0.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var( --mint-deep );
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2 {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei UI", serif;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp( 2.35rem, 5vw, 4.7rem );
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-copy p:not(.eyebrow) {
  max-width: 820px;
  margin: 22px 0 0;
  color: var( --muted );
  font-size: 1.08rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-action,
.ghost-action,
.card-link,
.inline-form button,
.grid-form button,
.profile-form button,
.auth-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-weight: 800;
}

.primary-action,
.inline-form button,
.grid-form button,
.profile-form button,
.auth-form button {
  color: #fff;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
  box-shadow: 0 14px 28px rgba( 14, 100, 112, 0.24 );
}

.ghost-action,
.card-link {
  color: #12333e;
  background: rgba( 255, 255, 255, 0.72 );
  border: 1px solid rgba( 19, 51, 63, 0.12 );
}

.button-link {
  width: max-content;
}

.hero-card {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 24px;
  border-radius: var( --radius-lg );
  background: linear-gradient( 160deg, rgba( 19, 51, 63, 0.94 ), rgba( 15, 111, 97, 0.9 ) );
  color: #fff;
  box-shadow: 0 28px 60px rgba( 19, 51, 63, 0.22 );
}

.hero-card span {
  color: rgba( 255, 255, 255, 0.64 );
  font-size: 12px;
  letter-spacing: 0.14em;
}

.hero-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.5rem;
}

.hero-card p {
  color: rgba( 255, 255, 255, 0.74 );
  line-height: 1.7;
}

.hero-card a {
  display: inline-flex;
  margin-top: 10px;
  color: #ffe8a8;
  font-weight: 800;
}

.module-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

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

.module-grid.lower {
  grid-template-columns: 1fr 1.2fr 1fr;
}

.feature-card,
.info-card,
.panel-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba( 255, 255, 255, 0.78 );
  border-radius: var( --radius-lg );
  background: var( --paper );
  box-shadow: 0 18px 44px rgba( 65, 108, 117, 0.12 );
  backdrop-filter: blur( 16px );
}

.feature-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -46px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  opacity: 0.32;
}

.tone-a::after {
  background: var( --sky );
}

.tone-b::after {
  background: var( --mint );
}

.tone-c::after {
  background: var( --sun );
}

.module-label {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba( 19, 51, 63, 0.08 );
  color: var( --mint-deep );
  font-size: 12px;
  font-weight: 800;
}

.feature-card h2,
.info-card h2,
.panel-card h2 {
  margin: 18px 0 8px;
}

.feature-card p,
.info-card p,
.panel-card p {
  color: var( --muted );
  line-height: 1.75;
}

.mini-list,
.stack-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.mini-item,
.stack-item {
  padding: 12px 14px;
  border: 1px solid var( --line );
  border-radius: 16px;
  background: rgba( 255, 255, 255, 0.62 );
}

.mini-item strong,
.stack-item strong {
  display: block;
}

.mini-item span,
.stack-item span {
  display: block;
  margin-top: 4px;
  color: var( --muted );
  font-size: 13px;
  line-height: 1.55;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.card-heading span {
  font-size: 1.35rem;
  font-weight: 900;
}

.card-heading strong {
  color: rgba( 19, 51, 63, 0.34 );
  letter-spacing: 0.12em;
}

.inline-form {
  display: grid;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba( 19, 51, 63, 0.12 );
  border-radius: 14px;
  padding: 11px 13px;
  color: var( --ink );
  background: rgba( 255, 255, 255, 0.82 );
}

.multi-select {
  position: relative;
}

.assessment-form {
  gap: 14px;
}

.assessment-subject-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.assessment-subject-row .multi-select {
  flex: 1;
}

.assessment-subject-row .pill-button {
  min-width: 98px;
}

.multi-select-trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba( 19, 51, 63, 0.12 );
  border-radius: 14px;
  color: var( --ink );
  background: rgba( 255, 255, 255, 0.82 );
  cursor: pointer;
}

.multi-select.is-open .multi-select-trigger {
  outline: 3px solid rgba( 90, 200, 167, 0.28 );
  border-color: rgba( 18, 128, 109, 0.46 );
}

.multi-select-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-caret {
  width: 10px;
  height: 10px;
  flex: none;
  border-right: 2px solid rgba( 19, 51, 63, 0.52 );
  border-bottom: 2px solid rgba( 19, 51, 63, 0.52 );
  transform: rotate( 45deg );
  transition: transform 160ms ease;
}

.multi-select.is-open .multi-select-caret {
  transform: rotate( -135deg );
}

.multi-select-menu {
  position: absolute;
  top: calc( 100% + 8px );
  left: 0;
  right: 0;
  z-index: 12;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba( 19, 51, 63, 0.12 );
  border-radius: 16px;
  background: rgba( 255, 255, 255, 0.96 );
  box-shadow: 0 18px 44px rgba( 65, 108, 117, 0.16 );
  backdrop-filter: blur( 16px );
}

.multi-select-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba( 19, 51, 63, 0.08 );
}

.multi-select-option {
  padding: 8px 10px;
  border-radius: 12px;
}

.multi-select-option:hover {
  background: rgba( 19, 51, 63, 0.05 );
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba( 90, 200, 167, 0.28 );
  border-color: rgba( 18, 128, 109, 0.46 );
}

.free-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.free-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba( 255, 211, 111, 0.32 );
  color: #725219;
  font-weight: 800;
  font-size: 13px;
}

.dashboard-view {
  margin-top: 30px;
}

#view-teacher.dashboard-view {
  margin-top: 18px;
}

.teacher-hero {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax( 0, 1.1fr ) minmax( 420px, 560px );
  gap: 22px;
  align-items: start;
  margin: 0 0 18px;
  overflow: visible;
}

.teacher-hero .section-title {
  margin: 8px 0 0;
}

.teacher-summary {
  --flower-offset-y: 34px;
  position: relative;
  display: block;
  min-height: 120px;
  margin-bottom: 0;
  isolation: isolate;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
}

.teacher-summary:empty {
  min-height: 0;
}

.teacher-summary::before,
.teacher-summary::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc( 50% + var( --flower-offset-y ) );
  transform: translate( -50%, -50% );
  border-radius: 999px;
  pointer-events: none;
}

.teacher-summary::before {
  width: 62px;
  height: 62px;
  border: 1px solid rgba( 255, 255, 255, 0.84 );
  background:
    radial-gradient( circle at 34% 30%, rgba( 255, 255, 255, 0.96 ), rgba( 255, 248, 228, 0.94 ) 42%, rgba( 255, 211, 111, 0.86 ) 100% );
  box-shadow:
    0 18px 40px rgba( 160, 123, 31, 0.2 ),
    inset 0 8px 18px rgba( 255, 255, 255, 0.4 );
}

.teacher-summary::after {
  width: 26px;
  height: 26px;
  border: 1px solid rgba( 255, 255, 255, 0.9 );
  background: radial-gradient( circle at 34% 30%, rgba( 255, 255, 255, 0.98 ), rgba( 255, 248, 228, 0.92 ) );
}

.teacher-summary:empty::before,
.teacher-summary:empty::after {
  display: none;
}

.teacher-summary .stat-card {
  position: absolute;
  left: 50%;
  top: calc( 50% + var( --flower-offset-y ) );
  z-index: 1;
  width: 94px;
  min-height: 84px;
  aspect-ratio: 1.12 / 1;
  margin: 0;
  padding: 10px 8px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate( calc( -50% + var( --petal-x, 0px ) ), calc( -50% + var( --petal-y, 0px ) ) );
}

.teacher-summary .stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var( --petal-radius, 50% / 42% );
  border: 1px solid rgba( 255, 255, 255, 0.84 );
  background: linear-gradient( 160deg, rgba( 255, 255, 255, 0.96 ), rgba( 255, 249, 238, 0.84 ) );
  box-shadow:
    0 16px 32px rgba( 65, 108, 117, 0.12 ),
    inset 0 -10px 18px rgba( 255, 255, 255, 0.28 );
  transform: rotate( var( --petal-rotate, 0deg ) );
}

.teacher-summary .stat-card:nth-child( 1 ) {
  --petal-x: 0px;
  --petal-y: -52px;
  --petal-rotate: 4deg;
  --petal-radius: 50% / 40%;
}

.teacher-summary .stat-card:nth-child( 1 )::before {
  background: linear-gradient( 160deg, rgba( 255, 244, 211, 0.98 ), rgba( 255, 224, 145, 0.84 ) );
}

.teacher-summary .stat-card:nth-child( 2 ) {
  --petal-x: 74px;
  --petal-y: -6px;
  --petal-rotate: 16deg;
  --petal-radius: 50% / 43%;
}

.teacher-summary .stat-card:nth-child( 2 )::before {
  background: linear-gradient( 160deg, rgba( 221, 247, 242, 0.98 ), rgba( 152, 224, 209, 0.84 ) );
}

.teacher-summary .stat-card:nth-child( 3 ) {
  --petal-x: 46px;
  --petal-y: 52px;
  --petal-rotate: 28deg;
  --petal-radius: 50% / 44%;
}

.teacher-summary .stat-card:nth-child( 3 )::before {
  background: linear-gradient( 160deg, rgba( 224, 241, 255, 0.98 ), rgba( 155, 205, 255, 0.84 ) );
}

.teacher-summary .stat-card:nth-child( 4 ) {
  --petal-x: -46px;
  --petal-y: 52px;
  --petal-rotate: -28deg;
  --petal-radius: 50% / 44%;
}

.teacher-summary .stat-card:nth-child( 4 )::before {
  background: linear-gradient( 160deg, rgba( 255, 231, 226, 0.98 ), rgba( 255, 178, 164, 0.84 ) );
}

.teacher-summary .stat-card:nth-child( 5 ) {
  --petal-x: -74px;
  --petal-y: -6px;
  --petal-rotate: -16deg;
  --petal-radius: 50% / 43%;
}

.teacher-summary .stat-card:nth-child( 5 )::before {
  background: linear-gradient( 160deg, rgba( 236, 238, 255, 0.98 ), rgba( 194, 204, 255, 0.84 ) );
}

.teacher-summary .stat-card strong {
  position: relative;
  font-size: 1.08rem;
  line-height: 1;
}

.teacher-summary .stat-card span {
  position: relative;
  color: rgba( 19, 51, 63, 0.72 );
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.teacher-tabs,
.teacher-pane {
  position: relative;
  z-index: 1;
}

body.teacher-view-active {
  height: 100vh;
  overflow: hidden;
}

body.teacher-view-active .site-shell {
  height: 100vh;
  padding-bottom: 20px;
}

body.teacher-view-active #view-teacher.is-active {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

body.teacher-view-active #view-teacher .teacher-hero,
body.teacher-view-active #view-teacher .teacher-tabs {
  flex: none;
}

body.teacher-view-active #view-teacher .teacher-pane {
  display: none;
  min-height: 0;
}

body.teacher-view-active #view-teacher .teacher-pane.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.teacher-view-active #view-teacher .split-layout {
  flex: 1;
  min-height: 0;
  height: 0;
  overflow: hidden;
  align-items: stretch;
}

body.teacher-view-active #view-teacher .split-left,
body.teacher-view-active #view-teacher .split-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

body.teacher-view-active #view-teacher .panel-head,
body.teacher-view-active #view-teacher .sub-tabs {
  flex: none;
}

body.teacher-view-active #view-teacher .panel-scroll-body,
body.teacher-view-active #view-teacher .panel-scroll-stack {
  flex: 1;
  min-height: 0;
  height: 0;
  overflow: hidden;
}

body.teacher-view-active #view-teacher .split-right .panel-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

body.teacher-view-active #view-teacher .panel-scroll-body > .table-wrap,
body.teacher-view-active #view-teacher .panel-scroll-body > .assessment-list,
body.teacher-view-active #view-teacher .panel-scroll-body > .class-list,
body.teacher-view-active #view-teacher .panel-scroll-body > .panel-card,
body.teacher-view-active #view-teacher .panel-scroll-stack > .request-panel,
body.teacher-view-active #view-teacher .panel-scroll-stack > .class-list {
  flex: 1;
  min-height: 0;
  height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.teacher-view-active #view-teacher .panel-scroll-body > .table-wrap {
  flex: 1 1 auto;
  width: 100%;
  max-height: 100%;
  height: auto;
  block-size: 100%;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

body.teacher-view-active #view-teacher .split-layout {
  height: auto;
}

body.teacher-view-active #view-teacher .split-right .panel-scroll-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
}

body.teacher-view-active #view-teacher #studentTable,
body.teacher-view-active #view-teacher #assessmentTable,
body.teacher-view-active #view-teacher #starTable {
  flex: none;
  min-height: 0;
  height: auto;
  block-size: auto;
  max-height: none;
  overflow: visible;
  scrollbar-gutter: auto;
}

body.teacher-view-active #view-teacher .table-wrap > table {
  border-collapse: separate;
  border-spacing: 0;
}

body.teacher-view-active #view-teacher .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba( 255, 253, 247, 0.96 );
  backdrop-filter: blur( 14px );
  box-shadow: inset 0 -1px 0 rgba( 19, 51, 63, 0.14 );
}

body.teacher-view-active #view-teacher #studentTable th:nth-child( 1 ),
body.teacher-view-active #view-teacher #studentTable td:nth-child( 1 ) {
  min-width: 56px;
  width: 56px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.94 );
}

body.teacher-view-active #view-teacher #studentTable th:nth-child( 2 ),
body.teacher-view-active #view-teacher #studentTable td:nth-child( 2 ) {
  min-width: 126px;
  width: 126px;
  position: sticky;
  left: 56px;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.94 );
}

body.teacher-view-active #view-teacher #studentTable th:nth-child( 3 ),
body.teacher-view-active #view-teacher #studentTable td:nth-child( 3 ) {
  min-width: 140px;
  width: 140px;
  position: sticky;
  left: 182px;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.94 );
  box-shadow: 1px 0 0 rgba( 19, 51, 63, 0.08 ), 10px 0 18px rgba( 19, 51, 63, 0.06 );
}

body.teacher-view-active #view-teacher #assessmentTable th:nth-child( 1 ),
body.teacher-view-active #view-teacher #assessmentTable td:nth-child( 1 ),
body.teacher-view-active #view-teacher #starTable th:nth-child( 1 ),
body.teacher-view-active #view-teacher #starTable td:nth-child( 1 ) {
  min-width: 126px;
  width: 126px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.94 );
}

body.teacher-view-active #view-teacher #assessmentTable th:nth-child( 2 ),
body.teacher-view-active #view-teacher #assessmentTable td:nth-child( 2 ),
body.teacher-view-active #view-teacher #starTable th:nth-child( 2 ),
body.teacher-view-active #view-teacher #starTable td:nth-child( 2 ) {
  min-width: 140px;
  width: 140px;
  position: sticky;
  left: 126px;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.94 );
  box-shadow: 1px 0 0 rgba( 19, 51, 63, 0.08 ), 10px 0 18px rgba( 19, 51, 63, 0.06 );
}

body.teacher-view-active #view-teacher #studentTable thead th:nth-child( 1 ),
body.teacher-view-active #view-teacher #studentTable thead th:nth-child( 2 ),
body.teacher-view-active #view-teacher #studentTable thead th:nth-child( 3 ),
body.teacher-view-active #view-teacher #assessmentTable thead th:nth-child( 1 ),
body.teacher-view-active #view-teacher #assessmentTable thead th:nth-child( 2 ),
body.teacher-view-active #view-teacher #starTable thead th:nth-child( 1 ),
body.teacher-view-active #view-teacher #starTable thead th:nth-child( 2 ) {
  z-index: 3;
  background: rgba( 255, 253, 247, 0.98 );
}

body.teacher-view-active #view-teacher #starTable th:last-child,
body.teacher-view-active #view-teacher #starTable td:last-child {
  min-width: 120px;
  width: 120px;
  position: sticky;
  right: 0;
  z-index: 1;
  background: rgba( 255, 255, 255, 0.96 );
  box-shadow: -1px 0 0 rgba( 19, 51, 63, 0.08 ), -10px 0 18px rgba( 19, 51, 63, 0.06 );
}

body.teacher-view-active #view-teacher #starTable thead th:last-child {
  z-index: 4;
  background: rgba( 255, 253, 247, 0.98 );
}

/* Teacher panes: final height + scroll model for both columns */
body.teacher-view-active main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

body.teacher-view-active #view-teacher.is-active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

body.teacher-view-active #view-teacher .teacher-pane.is-active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

body.teacher-view-active #view-teacher .split-layout {
  display: grid;
  grid-template-columns: 380px minmax( 0, 1fr );
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  align-items: stretch;
}

body.teacher-view-active #view-teacher .split-left,
body.teacher-view-active #view-teacher .split-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.teacher-view-active #view-teacher .split-left > .panel-head,
body.teacher-view-active #view-teacher .split-left > .panel-filter-row,
body.teacher-view-active #view-teacher .split-right > .panel-head,
body.teacher-view-active #view-teacher .split-right > .sub-tabs,
body.teacher-view-active #view-teacher .split-right > .panel-filter-row {
  flex: none;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack {
  flex-direction: column;
  align-content: start;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .request-panel,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .class-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .assessment-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .class-list,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body > .table-wrap {
  flex: none;
  min-height: fit-content;
  height: auto;
  overflow: visible;
}

body.teacher-view-active #view-teacher #studentTable,
body.teacher-view-active #view-teacher #assessmentTable,
body.teacher-view-active #view-teacher #starTable {
  height: auto;
  max-height: none;
  block-size: auto;
  overflow: visible;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .request-panel {
  max-height: none;
}

body.teacher-view-active #view-teacher .split-layout {
  height: 100% !important;
}

body.teacher-view-active #view-teacher .split-left,
body.teacher-view-active #view-teacher .split-right {
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body {
  flex: none !important;
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .request-panel,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .class-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .assessment-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .class-list,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body > .table-wrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.teacher-view-active #view-teacher #studentTable,
body.teacher-view-active #view-teacher #assessmentTable,
body.teacher-view-active #view-teacher #starTable {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

body.teacher-view-active #view-teacher .panel-scroll-stack > .request-panel {
  flex: none;
  height: auto;
  max-height: 30%;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .request-panel {
  max-height: none;
}

body.teacher-view-active #view-teacher [data-teacher-pane="fun"].is-active {
  overflow: auto;
  scrollbar-gutter: stable;
}

/* Teacher panes: fixed headers, only list/content areas scroll */
body.teacher-view-active #view-teacher .split-layout {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.teacher-view-active #view-teacher .split-left,
body.teacher-view-active #view-teacher .split-right {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-head,
body.teacher-view-active #view-teacher .split-left > .panel-filter-row,
body.teacher-view-active #view-teacher .split-right > .panel-head,
body.teacher-view-active #view-teacher .split-right > .sub-tabs,
body.teacher-view-active #view-teacher .split-right > .panel-filter-row {
  flex: none !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable both-edges !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack {
  flex-direction: column !important;
}

body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .request-panel,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-stack > .class-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .assessment-list,
body.teacher-view-active #view-teacher .split-left > .panel-scroll-body > .class-list,
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body > .table-wrap {
  flex: none !important;
  min-height: fit-content !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.teacher-view-active #view-teacher #studentTable,
body.teacher-view-active #view-teacher #assessmentTable,
body.teacher-view-active #view-teacher #starTable {
  height: auto !important;
  max-height: none !important;
  block-size: auto !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Right-side tables: header fixed, data area scrollable by mouse wheel */
body.teacher-view-active #view-teacher .split-right > .panel-scroll-body {
  overflow: hidden !important;
}

body.teacher-view-active #view-teacher .split-right > .panel-scroll-body > .table-wrap {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable both-edges !important;
}

body.teacher-view-active #view-teacher #studentTable,
body.teacher-view-active #view-teacher #assessmentTable,
body.teacher-view-active #view-teacher #starTable {
  height: 100% !important;
  max-height: 100% !important;
  block-size: 100% !important;
  overflow: auto !important;
}

body.teacher-view-active #view-teacher #studentTable > table,
body.teacher-view-active #view-teacher #assessmentTable > table,
body.teacher-view-active #view-teacher #starTable > table {
  margin: 0;
}

.section-title {
  margin: 28px 0 20px;
}

.section-title h1 {
  margin: 0;
  font-size: clamp( 2rem, 4vw, 3.2rem );
}

.section-title span {
  display: block;
  margin-top: 10px;
  color: var( --muted );
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat( 5, minmax( 0, 1fr ) );
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba( 255, 255, 255, 0.8 );
  border: 1px solid rgba( 255, 255, 255, 0.72 );
  box-shadow: 0 14px 32px rgba( 65, 108, 117, 0.1 );
}

.stat-card strong {
  display: block;
  font-size: 2rem;
}

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

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

.profile-layout {
  display: grid;
  grid-template-columns: 340px minmax( 0, 1fr );
  gap: 18px;
  align-items: start;
}

.profile-overview-card {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 18px;
  background:
    radial-gradient( circle at top right, rgba( 255, 211, 111, 0.22 ), transparent 34% ),
    radial-gradient( circle at left top, rgba( 125, 200, 255, 0.18 ), transparent 28% ),
    rgba( 255, 255, 255, 0.82 );
}

.profile-overview-head {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.profile-avatar-wrap {
  position: relative;
  width: 128px;
  height: 128px;
}

.profile-avatar-button {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.profile-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 32px;
  border: 1px solid rgba( 255, 255, 255, 0.84 );
  box-shadow:
    0 18px 40px rgba( 65, 108, 117, 0.16 ),
    inset 0 1px 0 rgba( 255, 255, 255, 0.5 );
  object-fit: cover;
  background: linear-gradient( 145deg, rgba( 221, 247, 242, 0.9 ), rgba( 224, 241, 255, 0.86 ) );
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient( circle at 32% 28%, rgba( 255, 255, 255, 0.96 ), rgba( 255, 248, 228, 0.92 ) 40%, rgba( 255, 211, 111, 0.82 ) 100% ),
    linear-gradient( 145deg, rgba( 255, 255, 255, 0.9 ), rgba( 221, 247, 242, 0.86 ) );
}

.profile-avatar-fallback::before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba( 15, 92, 104, 0.16 );
  transform: translateY( -8px );
}

.profile-avatar-fallback::after {
  content: "";
  position: absolute;
  bottom: 24px;
  width: 56px;
  height: 30px;
  border-radius: 999px 999px 18px 18px;
  background: rgba( 15, 92, 104, 0.14 );
}

.profile-avatar-overlay {
  position: absolute;
  inset: auto 10px 10px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  background: rgba( 19, 51, 63, 0.72 );
  opacity: 0;
  transform: translateY( 4px );
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.profile-avatar-button:hover .profile-avatar,
.profile-avatar-button:hover .profile-avatar-fallback {
  box-shadow:
    0 22px 44px rgba( 65, 108, 117, 0.2 ),
    inset 0 1px 0 rgba( 255, 255, 255, 0.54 );
}

.profile-avatar-button:hover .profile-avatar-overlay,
.profile-avatar-button:focus-visible .profile-avatar-overlay {
  opacity: 1;
  transform: translateY( 0 );
}

.profile-avatar-button:focus-visible {
  outline: none;
}

.profile-avatar-button:focus-visible .profile-avatar,
.profile-avatar-button:focus-visible .profile-avatar-fallback {
  outline: 3px solid rgba( 90, 200, 167, 0.28 );
  outline-offset: 4px;
}

.profile-avatar-button.is-uploading {
  cursor: wait;
}

.profile-avatar-button.is-uploading .profile-avatar,
.profile-avatar-button.is-uploading .profile-avatar-fallback {
  opacity: 0.68;
}

.profile-avatar-button.is-uploading .profile-avatar-overlay {
  opacity: 1;
  transform: translateY( 0 );
}

.profile-overview-copy h2 {
  margin: 14px 0 6px;
  font-size: clamp( 1.7rem, 2.4vw, 2.2rem );
}

.profile-overview-copy p {
  margin: 0;
}

.profile-meta-grid {
  display: grid;
  gap: 10px;
}

.profile-meta-item {
  padding: 14px 16px;
  border: 1px solid rgba( 19, 51, 63, 0.1 );
  border-radius: 18px;
  background: rgba( 255, 255, 255, 0.66 );
}

.profile-meta-item span,
.field-block span {
  display: block;
  color: var( --muted );
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-meta-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

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

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

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

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

.field-block {
  display: grid;
  gap: 8px;
}

.field-block input[readonly] {
  color: rgba( 19, 51, 63, 0.7 );
  background: rgba( 19, 51, 63, 0.05 );
}

.profile-form button {
  justify-self: start;
  min-width: 132px;
}

.profile-invite-card {
  display: grid;
  gap: 16px;
}

.profile-invite-box {
  padding: 18px 20px;
  border: 1px solid rgba( 19, 51, 63, 0.08 );
  border-radius: 22px;
  background:
    linear-gradient( 135deg, rgba( 255, 244, 211, 0.52 ), rgba( 224, 241, 255, 0.42 ) ),
    rgba( 255, 255, 255, 0.74 );
}

.profile-invite-label {
  display: block;
  color: var( --muted );
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-invite-code {
  display: block;
  margin-top: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp( 1.6rem, 3vw, 2.2rem );
  letter-spacing: 0.18em;
}

.profile-invite-usage {
  margin: 10px 0 0;
}

.profile-invite-card .pill-button {
  justify-self: start;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 260px minmax( 0, 1fr );
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 18px;
}

.admin-sidebar-head span,
.admin-sidebar-head strong {
  display: block;
}

.admin-sidebar-head span {
  color: var( --muted );
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-sidebar-head strong {
  margin-top: 8px;
  font-size: 1.5rem;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.admin-nav-button {
  width: 100%;
  border: 1px solid rgba( 19, 51, 63, 0.08 );
  border-radius: 18px;
  padding: 14px 16px;
  color: var( --ink );
  text-align: left;
  background: rgba( 255, 255, 255, 0.64 );
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.admin-nav-button:hover {
  transform: translateY( -1px );
  box-shadow: 0 14px 30px rgba( 65, 108, 117, 0.12 );
}

.admin-nav-button.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient( 135deg, #14947e, #0e6470 );
  box-shadow: 0 16px 32px rgba( 14, 100, 112, 0.2 );
}

.admin-content {
  min-width: 0;
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: grid;
  gap: 18px;
}

.admin-panel {
  display: grid;
  gap: 16px;
}

.admin-panel-head h2 {
  margin: 0;
}

.admin-panel-head p {
  margin: 6px 0 0;
  color: var( --muted );
}

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

.admin-toolbar > input[type="search"] {
  flex: 1 1 320px;
  min-height: 44px;
}

.admin-toolbar .toolbar-actions {
  margin-left: auto;
}

.admin-panel .table-wrap {
  min-height: 320px;
}

.admin-subtabs {
  margin-bottom: 0;
}

.admin-log-panel {
  display: none;
}

.admin-log-panel.is-active {
  display: block;
}

.sim-embed-view {
  margin-top: 24px;
}

.simulation-index-frame {
  width: 100%;
  min-height: calc( 100vh - 128px );
  height: calc( 100vh - 128px );
  border: 0;
  border-radius: var( --radius-xl );
  background: #fff;
  box-shadow: var( --shadow );
}

.sim-library-panel {
  display: grid;
  gap: 18px;
}

.sim-library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.sim-library-head h2 {
  margin: 0;
}

.sim-library-head p {
  margin: 6px 0 0;
}

.sim-library-toolbar {
  display: flex;
  gap: 12px;
}

.sim-library-toolbar input[type="search"] {
  min-height: 46px;
}

.simulation-library-grid {
  display: grid;
  grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
  gap: 18px;
}

.simulation-card {
  overflow: hidden;
  display: grid;
  gap: 16px;
  border: 1px solid var( --line );
  border-radius: 22px;
  background: rgba( 255, 255, 255, 0.8 );
  box-shadow: 0 18px 40px rgba( 65, 108, 117, 0.1 );
}

.simulation-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient( circle at 20% 20%, rgba( 125, 200, 255, 0.28 ), transparent 34% ),
    linear-gradient( 135deg, rgba( 243, 251, 247, 0.94 ), rgba( 238, 248, 255, 0.86 ) );
}

.simulation-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.simulation-card-cover::after {
  content: "";
  position: absolute;
  inset: auto -32px -42px auto;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: rgba( 255, 211, 111, 0.22 );
  filter: blur( 2px );
}

.simulation-card-body {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.simulation-card-title {
  margin: 0;
  font-size: 1.22rem;
}

.simulation-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simulation-card-tags span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: var( --mint-deep );
  font-size: 12px;
  font-weight: 800;
  background: rgba( 19, 51, 63, 0.08 );
}

.simulation-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.simulation-card-actions a {
  display: inline-flex;
}

.admin-select-cell {
  width: 52px;
}

.admin-select-cell input {
  width: auto;
}

.pill-button:disabled,
.icon-toggle:disabled,
.subject-switch-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.panel-card.wide {
  grid-column: 1 / -1;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat( 4, minmax( 0, 1fr ) ) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

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

.grid-form button {
  min-height: 44px;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var( --line );
  text-align: left;
  white-space: nowrap;
}

th {
  color: var( --muted );
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-empty-cell {
  color: var( --muted );
  text-align: center;
  padding: 28px 12px;
}

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

.tool-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var( --line );
  background: rgba( 255, 255, 255, 0.68 );
}

.tool-card strong {
  display: block;
  margin-bottom: 8px;
}

.tool-card span {
  display: block;
  color: var( --muted );
  line-height: 1.55;
}

.tool-card a {
  display: inline-flex;
  margin-top: 12px;
  color: var( --mint-deep );
  font-weight: 900;
}

.auth-dialog {
  width: min( 440px, calc( 100% - 30px ) );
  border: 0;
  border-radius: 26px;
  padding: 26px;
  background: var( --paper-solid );
  box-shadow: var( --shadow );
}

.auth-dialog::backdrop {
  background: rgba( 8, 30, 37, 0.36 );
  backdrop-filter: blur( 10px );
}

.dialog-close-form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.dialog-close-form button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.6rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat( 2, 1fr );
  gap: 8px;
  margin: 6px 0 18px;
  padding: 6px;
  border-radius: 999px;
  background: rgba( 19, 51, 63, 0.06 );
}

.auth-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 10px;
  background: transparent;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: #fff;
  background: var( --mint-deep );
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-suggestion-wrap {
  position: relative;
}

.auth-suggestion-panel {
  position: absolute;
  top: calc( 100% + 8px );
  left: 0;
  right: 0;
  z-index: 16;
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba( 19, 51, 63, 0.12 );
  border-radius: 14px;
  background: rgba( 255, 255, 255, 0.82 );
  box-shadow: 0 12px 24px rgba( 65, 108, 117, 0.08 );
}

.auth-suggestion-panel[hidden] {
  display: none !important;
}

.auth-form .auth-suggestion-option {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba( 19, 51, 63, 0.06 );
  color: var( --ink );
  text-align: left;
  background: transparent;
  box-shadow: none;
  transform: none;
  font-weight: 400;
  cursor: pointer;
}

.auth-form .auth-suggestion-option:last-child {
  border-bottom: 0;
}

.auth-form .auth-suggestion-option:hover {
  transform: none;
  background: rgba( 19, 51, 63, 0.04 );
}

.captcha-block {
  display: grid;
  gap: 10px;
}

.captcha-inline-row {
  display: grid;
  grid-template-columns: minmax( 0, 1fr ) 112px;
  gap: 10px;
  align-items: center;
}

.captcha-preview {
  width: 100%;
  height: 44px;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba( 19, 51, 63, 0.12 );
  background:
    linear-gradient( 135deg, rgba( 125, 200, 255, 0.14 ), rgba( 90, 200, 167, 0.16 ) ),
    rgba( 255, 255, 255, 0.92 );
  object-fit: cover;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.captcha-preview:hover {
  transform: translateY( -1px );
  box-shadow: 0 10px 24px rgba( 65, 108, 117, 0.12 );
}

.captcha-preview.is-loading {
  opacity: 0.66;
  pointer-events: none;
}

.captcha-tip {
  margin: 0;
  color: var( --muted );
  font-size: 12px;
  line-height: 1.5;
}

.auth-feedback {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba( 200, 82, 82, 0.18 );
  border-radius: 14px;
  color: #9d2f4f;
  background: rgba( 255, 143, 120, 0.12 );
  font-size: 13px;
  line-height: 1.5;
}

.dialog-tip {
  color: var( --muted );
  font-size: 12px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: rgba( 19, 51, 63, 0.92 );
  box-shadow: var( --shadow );
}

.empty {
  color: var( --muted );
  padding: 18px;
  border: 1px dashed var( --line );
  border-radius: 16px;
}

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

  .teacher-summary {
    display: grid;
    grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
    gap: 10px;
    min-height: 0;
    padding: 0;
  }

  .teacher-summary::before,
  .teacher-summary::after,
  .teacher-summary .stat-card::before {
    display: none;
  }

  .teacher-summary .stat-card {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    min-height: 0;
    padding: 14px 16px;
    gap: 6px;
    border: 1px solid rgba( 255, 255, 255, 0.72 );
    border-radius: 18px;
    background: rgba( 255, 255, 255, 0.8 );
    box-shadow: 0 14px 32px rgba( 65, 108, 117, 0.1 );
    transform: none;
  }

  .topbar,
  .hero-panel,
  .module-grid.three,
  .module-grid.lower,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

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

  .profile-overview-card {
    position: static;
  }

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

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

  .admin-toolbar .toolbar-actions {
    margin-left: 0;
  }

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

  .sim-library-head {
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .grid-form,
  .tool-grid,
  .stat-strip,
  .split-layout,
  .fun-grid {
    grid-template-columns: 1fr;
  }

  .panel-filter-row-inline {
    flex-wrap: wrap;
  }

  .panel-filter-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

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

  .chart-grid,
  .pie-chart-layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    align-self: stretch;
  }
}

@media ( max-width: 640px ) {
  .site-shell {
    width: min( 100% - 20px, var( --shell-max-width ) );
  }

  .topbar {
    border-radius: 24px;
  }

  .auth-area {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .auth-menu-panel {
    right: auto;
    left: 0;
  }

  .profile-form-grid,
  .profile-password-card .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .captcha-inline-row {
    grid-template-columns: minmax( 0, 1fr ) 104px;
  }

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

  .toolbar-actions {
    align-items: stretch;
  }

  .panel-filter-actions {
    justify-content: flex-start;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    align-items: stretch;
  }

  .simulation-library-grid {
    grid-template-columns: 1fr;
  }

  .simulation-index-frame {
    min-height: calc( 100vh - 104px );
    height: calc( 100vh - 104px );
  }
}
