:root {
  --ink: #142033;
  --ink-soft: #506078;
  --navy: #102b4e;
  --navy-deep: #091c33;
  --blue: #245f9e;
  --mint: #35ad83;
  --mint-dark: #19785b;
  --mint-pale: #e6f5ef;
  --paper: #f5f4ef;
  --surface: #ffffff;
  --line: #dfe4e8;
  --line-strong: #c7d0d8;
  --danger: #a53a3a;
  --warning: #9b6517;
  --shadow: 0 14px 40px rgba(16, 43, 78, 0.08);
  --shadow-small: 0 5px 18px rgba(16, 43, 78, 0.07);
  --radius: 16px;
  --radius-small: 10px;
  --header-height: 68px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
iframe:focus-visible {
  outline: 3px solid rgba(53, 173, 131, 0.42);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 {
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 4vw, 3.6rem);
  font-weight: 500;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.6rem 0.9rem;
  color: white;
  background: var(--navy);
  border-radius: 6px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  color: white;
  background: rgba(9, 28, 51, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  width: min(1440px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 0.68rem;
  align-items: center;
  color: white;
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover {
  color: white;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--navy-deep);
  background: var(--mint);
  border-radius: 9px 9px 9px 3px;
  font-family: Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.brand-mark-large {
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  border-radius: 13px 13px 13px 4px;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 3rem;
}

.main-nav a,
.account-menu a,
.account-menu .link-button {
  padding: 0.48rem 0.65rem;
  color: rgba(255, 255, 255, 0.76);
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 620;
  text-decoration: none;
}

.main-nav a:hover,
.account-menu a:hover,
.account-menu .link-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.account-menu {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
}

.account-menu form {
  margin: 0;
}

.account-name {
  max-width: 180px;
  margin-right: 0.45rem;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 3.6rem 0 6rem;
}

.narrow-page {
  width: min(720px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin-bottom: 0.55rem;
  color: var(--mint-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.muted,
.field-help,
.table-subtle,
.privacy-note {
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  transition: 130ms ease;
  transition-property: color, background, border-color, box-shadow, transform;
}

.button:hover {
  color: var(--navy);
  border-color: #aebbc6;
  box-shadow: 0 4px 12px rgba(16, 43, 78, 0.09);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.button-primary:hover {
  color: white;
  background: #173b68;
  border-color: #173b68;
}

.button-secondary {
  color: var(--navy);
  background: #f5f8fa;
  border-color: #cbd6df;
}

.button-ghost {
  background: transparent;
}

.button-small {
  min-height: 34px;
  padding: 0.48rem 0.7rem;
  font-size: 0.78rem;
}

.button-wide {
  width: 100%;
}

.button-disabled,
.button:disabled {
  color: #8793a2;
  background: #edf0f2;
  border-color: #e1e5e8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.link-button {
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.danger-link {
  color: var(--danger) !important;
}

.status-pill,
.term-chip,
.score-chip,
.availability,
.section-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill {
  padding: 0.3rem 0.58rem;
  color: #5e6a78;
  background: #eef1f3;
  border: 1px solid #e0e5e9;
}

.status-published,
.status-complete,
.status-released,
.status-open,
.status-submitted {
  color: #126446;
  background: var(--mint-pale);
  border-color: #c7eadc;
}

.status-draft,
.status-in_progress,
.status-active,
.status-finalizing,
.status-late {
  color: #7b5314;
  background: #fff4da;
  border-color: #f1dfb6;
}

.status-error,
.status-urgent,
.status-closed {
  color: #8a3030;
  background: #fbe7e7;
  border-color: #efcccc;
}

.practice-banner {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 1rem;
  color: #51370d;
  background: #fff4d8;
  border-bottom: 1px solid #e9d49f;
  font-size: 0.76rem;
  text-align: center;
}

.practice-banner strong {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flash-stack {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 18px;
  z-index: 300;
  display: grid;
  gap: 0.6rem;
  width: min(420px, calc(100% - 36px));
}

.flash {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.flash-success {
  border-left-color: var(--mint);
}

.flash-error {
  border-left-color: var(--danger);
}

.flash button {
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.dashboard-heading,
.module-hero,
.editor-heading {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.term-chip {
  padding: 0.45rem 0.8rem;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
}

.dashboard-section {
  margin-top: 3.2rem;
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.section-count {
  padding: 0.3rem 0.6rem;
  color: var(--ink-soft);
  background: #eef1f3;
}

.announcement-list {
  display: grid;
  gap: 0.75rem;
}

.announcement {
  padding: 1rem 1.15rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
}

.announcement-important {
  border-left-color: var(--warning);
}

.announcement-urgent {
  border-left-color: var(--danger);
}

.announcement > div:first-child {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.announcement p {
  margin: 0.45rem 0 0.3rem 1.18rem;
  color: var(--ink-soft);
}

.announcement time {
  margin-left: 1.18rem;
  color: #7b8794;
  font-size: 0.74rem;
}

.announcement footer {
  display: flex;
  justify-content: space-between;
  margin: 0.5rem 0 0 1.18rem;
}

.announcement footer time {
  margin: 0;
}

.status-dot,
.connection-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}

.announcement-important .status-dot {
  background: var(--warning);
}

.announcement-urgent .status-dot {
  background: var(--danger);
}

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

.module-card {
  display: flex;
  flex-direction: column;
  min-height: 315px;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.module-card-top,
.module-card-footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.module-number {
  color: #9ca7b2;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.module-card h3 {
  margin: 1.35rem 0 0.55rem;
  font-family: Georgia, serif;
  font-size: 1.42rem;
  font-weight: 500;
}

.module-card > p {
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 0.8rem 0;
  margin: 0 0 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.date-grid dt {
  color: #85909d;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-grid dd {
  margin: 0.22rem 0 0;
  font-size: 0.8rem;
  font-weight: 650;
}

.availability {
  color: var(--ink-soft);
  font-weight: 650;
}

.availability-late {
  color: var(--warning);
}

.score-chip {
  padding: 0.34rem 0.6rem;
  color: #126446;
  background: var(--mint-pale);
  font-size: 0.88rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem;
  color: var(--ink-soft);
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-state.compact {
  padding: 1.1rem;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.breadcrumb {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.breadcrumb a {
  font-weight: 650;
  text-decoration: none;
}

.detail-layout,
.assessment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1.25rem;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 1rem;
}

.content-section,
.form-surface,
.table-surface,
.assessment-card,
.signal-card {
  padding: 1.35rem;
}

.prose {
  color: #35445a;
  line-height: 1.7;
}

.document-list {
  display: grid;
  gap: 0.55rem;
}

.document-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  background: #fafbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.document-icon {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
  color: var(--navy);
  background: #e6edf4;
  border-radius: 7px 7px 7px 2px;
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.document-row strong,
.document-row span {
  display: block;
}

.document-row div > span {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.document-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.document-actions form {
  margin: 0;
}

.link-list {
  display: grid;
  gap: 0.55rem;
}

.link-list a {
  padding: 0.75rem;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 650;
  text-decoration: none;
}

.detail-sidebar,
.assessment-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: grid;
  gap: 1rem;
}

.schedule-card {
  padding: 1.35rem;
}

.schedule-card dl {
  margin: 1rem 0 1.25rem;
}

.schedule-card dl div {
  display: flex;
  justify-content: space-between;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
}

.schedule-card dt {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.schedule-card dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.privacy-note {
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  text-align: center;
}

.feedback-surface {
  border-left: 4px solid var(--mint);
}

.score-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.score-lockup strong {
  color: var(--mint-dark);
  font-family: Georgia, serif;
  font-size: 2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1rem 1.15rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stat-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
}

.stat-card .stat-word {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 750;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #6e7c8c;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.table-subtle {
  display: block;
  max-width: 260px;
  margin-top: 0.14rem;
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
}

.table-action {
  text-align: right;
}

.validation-note {
  display: block;
  margin-top: 0.28rem;
  color: var(--warning);
  font-size: 0.68rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.roster-create {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.36rem;
}

.field-group label,
.checkbox-row {
  color: #334359;
  font-size: 0.76rem;
  font-weight: 750;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 0.62rem 0.72rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  min-height: 100px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 95, 158, 0.1);
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled,
fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea {
  color: #4b596a;
  background: #f1f3f4;
  cursor: not-allowed;
}

fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

.field-help {
  font-size: 0.7rem;
}

.errorlist,
.form-errors {
  padding: 0;
  margin: 0.2rem 0 0;
  color: var(--danger);
  font-size: 0.74rem;
  list-style: none;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding-top: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

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

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

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.7rem 0;
}

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

.page-heading {
  margin-bottom: 2rem;
}

.login-page {
  color: white;
  background:
    radial-gradient(circle at 75% 15%, rgba(53, 173, 131, 0.2), transparent 32%),
    linear-gradient(145deg, #071a31 0%, #102f54 58%, #123a5b 100%);
}

.login-page .site-header {
  display: none;
}

.login-page .practice-banner {
  color: white;
  background: rgba(7, 26, 49, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.login-page .login-shell {
  min-height: calc(100vh - 42px);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 2rem;
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
  padding: 2.25rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: 0 35px 80px rgba(1, 12, 27, 0.32);
}

.login-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 800;
}

.login-card h1 {
  font-size: 2.45rem;
}

.login-card .lede {
  margin-bottom: 1.6rem;
  font-size: 0.94rem;
}

.login-help {
  margin: 1.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: center;
}

.error-page {
  width: min(700px, 100%);
  margin: 10vh auto;
  text-align: center;
}

.error-page p:not(.eyebrow) {
  color: var(--ink-soft);
}

/* Instructor editor */
.editor-page {
  width: 100%;
  padding: 0;
}

.editor-layout {
  display: grid;
  grid-template-columns: 220px minmax(580px, 1fr) minmax(340px, 420px);
  min-height: calc(100vh - var(--header-height));
}

.editor-nav {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 1.5rem 1rem;
  overflow-y: auto;
  background: #edf0ef;
  border-right: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.4rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.editor-nav nav {
  display: grid;
  gap: 0.25rem;
}

.editor-nav nav a {
  padding: 0.58rem 0.65rem;
  color: #526173;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
}

.editor-nav nav a:hover,
.editor-nav nav a.active {
  color: var(--navy);
  background: white;
}

.editor-nav nav a.active {
  box-shadow: inset 3px 0 var(--mint);
}

.editor-main {
  min-width: 0;
  padding: 2.3rem clamp(1.5rem, 3vw, 3.5rem) 7rem;
  background: #fafaf8;
}

.editor-heading h1 {
  margin-top: 0.45rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.editor-status-line,
.editor-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.editor-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(16, 43, 78, 0.05);
}

.editor-tabs a {
  padding: 0.5rem 0.7rem;
  color: var(--ink-soft);
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.editor-tabs a:hover {
  color: var(--navy);
  background: #eef3f5;
}

.validation-panel {
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  color: #775016;
  background: #fff5dd;
  border: 1px solid #edd9a9;
  border-radius: 10px;
}

.validation-panel ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
}

.editor-section {
  display: grid;
  grid-template-columns: 40px 160px minmax(0, 1fr);
  gap: 1.1rem;
  padding: 2rem 0;
  scroll-margin-top: calc(var(--header-height) + 75px);
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--mint-dark);
  background: var(--mint-pale);
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
}

.section-copy p {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.section-fields {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.subform {
  padding: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.override-panel {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  background: #f7f9f9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.override-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(3, minmax(130px, 0.9fr)) minmax(130px, auto) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.override-student {
  align-self: center;
}

.override-student strong,
.override-student span {
  display: block;
}

.override-student span {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.checkbox-row.compact {
  align-self: center;
  margin: 0;
  font-size: 0.68rem;
}

.upload-form {
  margin-top: 0.5rem;
}

.sticky-save {
  position: sticky;
  bottom: 1rem;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  margin: 1rem 0;
  color: white;
  background: rgba(9, 28, 51, 0.96);
  border-radius: 11px;
  box-shadow: 0 15px 35px rgba(9, 28, 51, 0.22);
  font-size: 0.75rem;
}

.sticky-save .button-primary {
  color: var(--navy);
  background: var(--mint);
  border-color: var(--mint);
}

.rubric-editor > h3 {
  margin: 1rem 0 0;
  color: var(--navy);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rubric-row {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 62px auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.65rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.rubric-new,
.objective-new {
  background: #f0f7f4;
  border-style: dashed;
  border-color: #b7d9cc;
}

.order-input,
.weight-input {
  min-width: 0 !important;
}

.objective-row {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.objective-meta {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(120px, 0.8fr) 105px 62px;
  gap: 0.45rem;
  align-items: center;
}

.objective-meta label {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.68rem;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
}

.test-panel {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 1.1rem;
  overflow: hidden;
  background: #e8eceb;
  border-left: 1px solid var(--line);
}

.test-panel-heading {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.test-panel-heading h2 {
  margin-bottom: 0.25rem;
}

.test-panel > p {
  margin-bottom: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.test-panel iframe {
  width: 100%;
  height: calc(100% - 110px);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: var(--shadow-small);
}

/* Chat */
.chat-page {
  width: 100%;
  height: calc(100vh - var(--header-height));
  padding: 0;
  overflow: hidden;
  background: #e9edec;
}

.is-embedded .chat-page {
  height: 100vh;
}

.chat-app {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 1rem;
}

.is-embedded .chat-app {
  padding: 0.65rem;
}

.chat-header {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.2rem 0 0.8rem;
}

.chat-header .back-link {
  margin-bottom: 0.4rem;
}

.chat-header .eyebrow {
  margin-bottom: 0.2rem;
}

.chat-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.is-embedded .chat-header h1 {
  font-size: 1.3rem;
}

.chat-status {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.32rem 0.55rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.connection-dot {
  background: var(--mint);
}

.chat-status.is-busy .connection-dot {
  background: var(--warning);
  animation: pulse 1s infinite alternate;
}

.chat-status.is-error .connection-dot {
  background: var(--danger);
}

@keyframes pulse {
  to { opacity: 0.35; }
}

.chat-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-small);
}

.chat-transcript {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.chat-message {
  width: fit-content;
  max-width: min(78%, 680px);
}

.message-user {
  align-self: flex-end;
}

.message-label {
  margin: 0 0 0.25rem 0.2rem;
  color: #778493;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-user .message-label {
  margin-right: 0.2rem;
  text-align: right;
}

.message-content {
  padding: 0.78rem 0.9rem;
  color: #26364a;
  background: #edf1f3;
  border-radius: 4px 13px 13px 13px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message-user .message-content {
  color: white;
  background: var(--navy);
  border-radius: 13px 4px 13px 13px;
}

.message-pending .message-content::after {
  display: inline-block;
  width: 5px;
  height: 1em;
  margin-left: 3px;
  background: currentcolor;
  content: "";
  animation: pulse 0.7s infinite alternate;
  vertical-align: text-bottom;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.75rem;
  background: #f7f8f8;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  max-height: 180px;
  min-height: 46px;
  padding: 0.68rem 0.78rem;
  background: white;
  border-radius: 10px;
}

.send-button {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 45px;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--navy);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.send-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-toolbar {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: white;
  border-top: 1px solid var(--line);
}

.chat-toolbar form {
  margin: 0;
}

.toolbar-note {
  flex: 1;
  color: #7c8896;
  font-size: 0.62rem;
  text-align: center;
}

.chat-read-only {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  color: var(--ink-soft);
  background: #f6f7f7;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.chat-notice {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  z-index: 20;
  padding: 0.6rem 0.8rem;
  color: white;
  background: rgba(9, 28, 51, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  transform: translateX(-50%);
}

.result-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 1.5rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(8, 25, 46, 0.3);
}

.result-dialog::backdrop {
  background: rgba(7, 20, 37, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-close {
  float: right;
  width: 32px;
  height: 32px;
  color: var(--ink-soft);
  background: #f0f2f3;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Assessment */
.assessment-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.transcript-review {
  padding: 1.35rem;
}

.review-message {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.review-message:last-child {
  border-bottom: 0;
}

.review-message > span {
  color: var(--mint-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-user > span {
  color: var(--blue);
}

.review-message p {
  margin: 0.35rem 0 0;
  color: #35445a;
  line-height: 1.65;
}

.score-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.score-comparison div {
  padding: 0.75rem;
  background: #f3f6f6;
  border-radius: 9px;
}

.score-comparison span,
.score-comparison strong {
  display: block;
}

.score-comparison span {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.score-comparison strong {
  margin-top: 0.2rem;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.signal-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.signal-row strong,
.signal-row div > span {
  display: block;
}

.signal-row div > span {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 190px minmax(560px, 1fr); }
  .test-panel { position: fixed; right: 0; bottom: 0; z-index: 80; width: min(410px, 90vw); box-shadow: -12px 0 35px rgba(16, 43, 78, 0.16); }
  .editor-main { padding-right: 2rem; }
  .override-row { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .override-student { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-height: 60px; }
  .header-inner { width: min(100% - 24px, 1440px); }
  .nav-toggle { display: inline-flex; margin-left: auto; padding: 0.45rem 0.65rem; color: white; background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 7px; }
  .main-nav { position: fixed; top: var(--header-height); right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; padding: 0.8rem 1rem; margin: 0; background: var(--navy-deep); }
  .main-nav.is-open { display: flex; }
  .account-name { display: none; }
  .account-menu a { display: none; }
  .page-shell { width: min(100% - 28px, 1240px); padding-top: 2.4rem; }
  .module-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .assessment-layout, .split-layout { grid-template-columns: 1fr; }
  .detail-sidebar, .assessment-sidebar, .roster-create { position: static; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-nav { display: none; }
  .editor-main { padding: 1.4rem 1rem 7rem; }
  .editor-section { grid-template-columns: 32px minmax(0, 1fr); }
  .section-copy { grid-column: 2; }
  .section-fields { grid-column: 1 / -1; }
  .override-row { grid-template-columns: 1fr 1fr; }
  .override-student { grid-column: 1 / -1; }
  .test-panel { width: min(380px, 94vw); }
}

@media (max-width: 600px) {
  .practice-banner { align-items: flex-start; flex-direction: column; gap: 0.1rem; text-align: left; }
  .page-shell { width: min(100% - 20px, 1240px); padding: 1.8rem 0 4rem; }
  .dashboard-heading, .module-hero, .editor-heading { flex-direction: column; gap: 1rem; margin-bottom: 1.7rem; }
  .module-grid, .stat-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 280px; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .override-row { grid-template-columns: 1fr; }
  .override-student { grid-column: auto; }
  .document-row { grid-template-columns: auto minmax(0, 1fr); }
  .document-actions { grid-column: 2; }
  .rubric-row { grid-template-columns: 1fr 70px auto; }
  .rubric-row input:nth-of-type(1), .rubric-row input:nth-of-type(2) { grid-column: 1 / -1; }
  .objective-meta { grid-template-columns: 1fr 1fr; }
  .chat-app { padding: 0.5rem; }
  .chat-header { padding: 0.1rem 0.3rem 0.55rem; }
  .chat-message { max-width: 90%; }
  .chat-transcript { padding: 0.9rem; }
  .chat-toolbar { flex-wrap: wrap; }
  .toolbar-note { order: 3; flex-basis: 100%; }
  .send-button span:first-child { display: none; }
  .login-shell { padding: 1rem; }
  .login-card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
