:root {
  color-scheme: light;

  /* Semantic design tokens: calm education workbench */
  --color-canvas: #f3f1e8;
  --color-surface: #fffdf7;
  --color-surface-elevated: #ffffff;
  --color-surface-tinted: #f7f4ea;
  --color-text-primary: #172321;
  --color-text-muted: #607069;
  --color-border: #deddd1;
  --color-border-strong: #c7cbbf;
  --color-primary: #1f6f62;
  --color-primary-hover: #17564d;
  --color-primary-ink: #0f2633;
  --color-success: #2f795c;
  --color-success-bg: #e4f1e8;
  --color-success-border: #b7d7c4;
  --color-attention: #f1b234;
  --color-attention-bg: #fff5de;
  --color-attention-border: #e6cc8f;
  --color-warning: #9b5f22;
  --color-warning-bg: #fff0df;
  --color-warning-border: #e1bea0;
  --color-disabled: #777970;
  --color-disabled-bg: #eeece3;
  --color-disabled-border: #dad7ca;
  --color-focus-ring: rgba(241, 178, 52, 0.58);

  --radius-small: 6px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(22, 35, 33, 0.04), 0 10px 24px rgba(22, 35, 33, 0.05);
  --shadow-lifted: 0 2px 5px rgba(22, 35, 33, 0.06), 0 14px 30px rgba(22, 35, 33, 0.08);
  --shadow-floating: 0 8px 22px rgba(22, 35, 33, 0.09), 0 22px 56px rgba(22, 35, 33, 0.08);

  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-medium: var(--motion-base);
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Legacy aliases used throughout the current static app. */
  --bg: var(--color-canvas);
  --panel: var(--color-surface-elevated);
  --panel-soft: var(--color-surface-tinted);
  --ink: var(--color-text-primary);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --accent: var(--color-primary);
  --accent-hover: var(--color-primary-hover);
  --accent-dark: var(--color-primary-ink);
  --accent-2: var(--color-attention);
  --accent-3: #3e7f86;
  --warning: var(--color-warning);
  --ok: var(--color-success);
  --ready-bg: var(--color-success-bg);
  --ready-line: var(--color-success-border);
  --warning-bg: var(--color-attention-bg);
  --warning-line: var(--color-attention-border);
  --draft-bg: #eaf1f2;
  --archived-bg: var(--color-disabled-bg);
  --shadow: var(--shadow-card);
  --shadow-lift: var(--shadow-lifted);
  --radius: var(--radius-medium);
  --radius-sm: var(--radius-small);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

html {
  background: var(--color-canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.78), rgba(243, 241, 232, 0.94) 240px),
    var(--color-canvas);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "brand mode mock nav profile";
  align-items: center;
  gap: 10px 16px;
  min-height: 64px;
  padding: 9px 24px;
  background: rgba(255, 253, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  max-width: 100vw;
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  text-decoration: none;
  max-width: 100%;
}

.brand-mark {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 31%, var(--accent-dark) 32% 35%, transparent 36% 64%, var(--accent-dark) 65% 68%, transparent 69%),
    linear-gradient(0deg, transparent 31%, var(--accent-dark) 32% 35%, transparent 36% 64%, var(--accent-dark) 65% 68%, transparent 69%),
    #fffdf6;
  border: 2px solid var(--accent-dark);
  box-shadow: inset -9px 0 0 rgba(245, 180, 50, 0.82);
  color: transparent;
  overflow: hidden;
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 25px;
  height: 25px;
  border-left: 4px solid var(--accent-3);
  border-bottom: 4px solid var(--accent-3);
  border-radius: 0 0 0 18px;
  transform: rotate(-34deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 16px -15px 0 var(--accent-3), 23px -25px 0 -2px var(--accent-2);
}

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

.brand strong {
  font-size: 0.96rem;
  line-height: 1.08;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.mode-switch {
  grid-area: mode;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--color-surface);
  min-width: 0;
}

.mode-switch a,
.student-mode-indicator {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-sm);
  min-height: 30px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.mode-switch a:hover {
  background: var(--color-surface-elevated);
  color: var(--ink);
  transform: translateY(-1px);
}

.mode-switch a.active,
.student-mode-indicator {
  background: var(--color-primary);
  color: #fff;
}

.student-mode-indicator {
  display: none;
}

.mock-educator-access {
  grid-area: mock;
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--color-attention-border);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--color-attention-bg);
  color: var(--color-warning);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
  max-width: 100%;
}

.mock-educator-access a {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  min-height: 30px;
  padding: 6px 9px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.mock-educator-access a:hover,
.mock-educator-access a:focus-visible {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

body.student-route .mock-educator-access {
  display: inline-flex;
}

.topnav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-2);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  border-radius: var(--radius);
  min-height: 32px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: normal;
  text-align: center;
  transition:
    background var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.topnav a.active {
  background: var(--color-success-bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 98, 0.08);
}

.topnav a:hover {
  background: var(--color-surface);
  color: var(--ink);
  transform: translateY(-1px);
}

.topnav a:active {
  transform: translateY(0);
}

body.student-route .topnav,
body[data-account-role="public"] .profile-menu {
  display: none;
}

body[data-has-educator-access="false"] .mode-switch a {
  display: none;
}

body[data-has-educator-access="false"] .student-mode-indicator {
  display: inline-flex;
}

body[data-account-role="public"] [data-auth-only],
body[data-account-role="public"] [data-teacher-only],
body[data-account-role="public"] [data-admin-only],
body[data-account-role="student"] [data-teacher-only],
body[data-account-role="student"] [data-admin-only],
body[data-account-role="educator"] [data-admin-only] {
  display: none;
}

.profile-menu {
  grid-area: profile;
  position: relative;
  justify-self: end;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.profile-menu summary {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 5px 9px 5px 6px;
  background: var(--color-surface);
  color: var(--ink);
  list-style: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

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

.profile-menu summary:hover,
.profile-menu[open] summary {
  border-color: var(--line-strong);
  background: var(--color-surface-elevated);
  transform: translateY(-1px);
}

.avatar {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
}

.profile-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.profile-copy strong {
  font-size: 0.86rem;
  line-height: 1.1;
}

.profile-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
}

.chevron {
  color: var(--muted);
  font-weight: 950;
}

.profile-menu div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-floating);
  transform-origin: top right;
}

.profile-menu[open] div {
  animation: menuReveal var(--motion-medium) var(--ease-out);
}

.profile-menu a {
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.profile-menu a:hover,
.profile-menu a.active {
  background: var(--color-success-bg);
  color: var(--ink);
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}

.teacher-shell .page-head {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.teacher-shell h1 {
  max-width: 760px;
  margin-bottom: 6px;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.teacher-shell .lede {
  max-width: 720px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.two {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.72fr);
}

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

.panel,
.tile,
.metric,
.rubric-preview,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: var(--space-5);
}

.panel,
.tile,
.metric,
.notice {
  transition:
    border-color var(--motion-medium) var(--ease-standard),
    box-shadow var(--motion-medium) var(--ease-standard),
    transform var(--motion-medium) var(--ease-standard);
}

.teacher-shell .panel,
.teacher-shell .tile,
.teacher-shell .metric,
.teacher-shell .rubric-preview,
.teacher-shell .notice {
  box-shadow: 0 1px 2px rgba(22, 35, 33, 0.035), 0 8px 20px rgba(22, 35, 33, 0.04);
}

.teacher-shell .panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-4);
}

.panel-head h2 {
  margin-bottom: 6px;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tile {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  padding: var(--space-4);
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  will-change: border-color, box-shadow, transform;
}

.tile:hover,
.btn:hover,
.button:hover,
.ghost:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.tile:hover {
  box-shadow: var(--shadow-lift);
}

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

.tile.disabled {
  background: var(--color-disabled-bg);
  color: var(--muted);
  box-shadow: none;
}

.tile.disabled:hover {
  border-color: var(--line);
  transform: none;
}

.tile-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: start;
  font-weight: 800;
  min-width: 0;
}

.tile-title strong,
.tile-title span:first-child {
  min-width: 0;
}

.tile p,
.muted {
  color: var(--muted);
}

.tile p {
  margin-bottom: 0;
  line-height: 1.5;
}

.project-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.project-groups-shell {
  display: grid;
  gap: 14px;
}

.project-groups-context {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.project-groups-context > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-groups-context strong {
  overflow-wrap: anywhere;
}

.project-groups-context span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.class-create-panel {
  padding: 0;
  overflow: hidden;
}

.class-create-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 52px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.class-create-panel summary::-webkit-details-marker {
  display: none;
}

.class-create-panel summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--color-primary);
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.class-create-panel[open] summary::after {
  content: "–";
  background: var(--color-surface-tinted);
}

.class-create-panel summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.class-create-panel summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.class-create-panel summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.class-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(110px, 0.6fr) repeat(3, minmax(130px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  background: var(--color-surface-tinted);
}

.class-create-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.class-create-form input,
.class-create-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  font-weight: 750;
}

.class-create-form input:focus-visible,
.class-create-form select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.class-create-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-success);
  font-size: 0.86rem;
  font-weight: 850;
}

.project-group-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(5, minmax(130px, 0.8fr));
  gap: 10px;
  align-items: end;
}

.project-group-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-group-filter-bar input,
.project-group-filter-bar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  font-weight: 750;
}

.project-group-card {
  align-content: start;
  border-radius: var(--radius-large);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 247, 0.86)),
    var(--color-surface-elevated);
}

.project-group-card--empty,
.project-group-card--hidden {
  background:
    linear-gradient(180deg, rgba(249, 248, 243, 0.9), rgba(245, 243, 236, 0.82)),
    var(--color-surface-tinted);
}

.project-group-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: start;
  min-width: 0;
}

.project-group-card .tile-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  gap: 8px;
  align-items: center;
}

.project-group-description,
.project-group-portal-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.project-group-portal-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--color-surface-tinted);
}

.project-group-card--visible .project-group-portal-note {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: #315f4a;
}

.project-group-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--color-disabled-border);
  border-radius: var(--radius-pill);
  min-height: 24px;
  padding: 4px 8px;
  background: var(--color-disabled-bg);
  color: var(--color-disabled);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: normal;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.project-group-status--visible {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.project-group-status--hidden {
  border-color: var(--color-disabled-border);
  background: var(--color-disabled-bg);
  color: var(--color-disabled);
}

.project-group-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.project-group-counts span {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.74);
}

.project-group-counts strong {
  color: var(--ink);
}

.project-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.portal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
  max-width: 100%;
}

.filter-chip {
  min-height: 28px;
  padding: 6px 9px;
  text-decoration: none;
  max-width: 100%;
}

.student-facing-note {
  margin-top: 8px;
  border-left: 3px solid var(--color-attention-border);
  padding: 7px 10px;
  background: var(--color-attention-bg);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.tag,
.status,
.route-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  min-height: 20px;
  padding: 2px 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.status.published,
.tag.ok {
  border-color: var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
}

.status.draft {
  border-color: #c8d9de;
  background: var(--draft-bg);
  color: var(--accent-3);
}

.status.review {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.status.archived {
  border-color: var(--color-disabled-border);
  background: var(--archived-bg);
  color: var(--color-disabled);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  min-height: 24px;
  padding: 3px 7px;
  background: var(--color-surface-tinted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.status-badge-state {
  border-radius: var(--radius-small);
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.62);
  color: inherit;
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-badge--published,
.status-published {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.status-badge--published {
  animation: successSettle var(--motion-slow) var(--ease-out);
}

.status-badge--review,
.status-needs-review {
  border-color: var(--color-attention-border);
  background: var(--color-attention-bg);
  color: var(--color-warning);
}

.status-badge--draft,
.status-draft {
  border-color: #c8d9de;
  background: var(--draft-bg);
  color: var(--accent-3);
}

.status-badge--archived,
.status-archived {
  border-color: var(--color-disabled-border);
  background: var(--color-disabled-bg);
  color: var(--color-disabled);
}

.route-pill {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  min-height: 0;
  padding-top: 0;
  padding-left: 0;
  padding-bottom: 0;
}

.btn,
.button,
.ghost {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  box-shadow: 0 1px 1px rgba(15, 38, 51, 0.03);
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  will-change: background, border-color, box-shadow, transform;
}

.btn:hover,
.button:hover,
.ghost:hover {
  box-shadow: 0 2px 5px rgba(22, 35, 33, 0.08);
}

.btn:active,
.button:active,
.ghost:active {
  box-shadow: 0 1px 1px rgba(22, 35, 33, 0.04);
  transform: translateY(1px);
}

.btn:focus-visible,
.button:focus-visible,
.ghost:focus-visible,
.tile:focus-visible,
.filter-chip:focus-visible,
.topnav a:focus-visible,
.mode-switch a:focus-visible,
.mock-educator-access a:focus-visible,
.profile-menu a:focus-visible,
.profile-menu summary:focus-visible,
.workflow-chip[href]:focus-visible,
.project-actions-menu a:focus-visible,
.sidebar a:focus-visible,
.project-stepper a:focus-visible,
.project-actions-menu summary:focus-visible,
.segment:focus-visible,
.template-choice:focus-visible,
.template-builder-shell button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.btn-primary,
.button {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover,
.button:hover {
  background: var(--color-primary-hover);
}

.school-code-form {
  display: grid;
  gap: var(--space-3);
}

.field-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

.inline-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  font-weight: 800;
}

.form-message {
  margin: 0;
  color: var(--warning);
  font-weight: 800;
}

.btn:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  background: var(--color-disabled-bg);
  border-color: var(--color-disabled-border);
  color: var(--color-disabled);
  box-shadow: none;
  transform: none;
  will-change: auto;
}

.btn-secondary:disabled,
.btn-quiet:disabled,
.ghost:disabled,
.static-action {
  cursor: not-allowed;
  opacity: 0.74;
  box-shadow: none;
  transform: none;
}

.btn:disabled:hover,
.button:disabled:hover,
.static-action:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.btn-secondary:disabled:hover,
.btn-quiet:disabled:hover,
.ghost:disabled:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.btn-secondary,
.ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn-danger,
.danger-action {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.btn-danger:hover,
.danger-action:hover {
  border-color: var(--color-warning);
  background: #ffe9d4;
}

.teacher-shell .ghost {
  background: var(--color-surface);
}

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

.metric {
  display: grid;
  gap: 6px;
  position: relative;
  min-height: 78px;
  padding: 14px 16px;
  align-content: center;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent-2);
}

.metric strong {
  display: block;
  margin-bottom: 0;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.notice {
  display: grid;
  gap: 8px;
  padding: var(--space-4);
  background: #fffbf0;
}

.notice strong {
  color: var(--accent);
}

.quiet-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiet-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.quiet-list li:first-child {
  padding-top: 0;
}

.quiet-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rubric-preview {
  overflow: hidden;
  margin-top: 18px;
}

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

.student-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: white;
  color: var(--muted);
  font-weight: 800;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.student-step span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.student-step.active {
  border-color: #b8d1c5;
  background: #e7efe9;
  color: var(--ink);
}

.student-step.active span {
  background: var(--accent);
  color: white;
}

.student-rubric-shell {
  display: grid;
  gap: 18px;
}

.student-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.student-action-message {
  flex: 1 1 180px;
  min-width: min(100%, 180px);
  color: var(--color-success);
}

.student-action-message[data-tone="error"] {
  color: var(--warning);
}

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

.rubric-mode-head p {
  margin-bottom: 0;
}

.segmented-control {
  display: inline-flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px;
  background: #fbfcfa;
}

.segment {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.segment:hover {
  background: white;
  color: var(--ink);
}

.segment:active {
  transform: translateY(1px);
}

.segment.active {
  background: var(--accent);
  color: white;
}

.render-mode {
  display: none;
}

.render-mode.active {
  display: grid;
  gap: 14px;
}

.student-read-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fbfcfa;
}

.student-read-note span {
  color: var(--muted);
}

.print-action {
  min-height: 34px;
  padding: 7px 11px;
}

.rubric-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.rubric-toolbar p {
  margin-bottom: 0;
}

.rubric-table-wrap {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.rubric-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: white;
  table-layout: fixed;
}

.rubric-table th,
.rubric-table td {
  border: 1px solid var(--line);
  padding: 14px;
  vertical-align: top;
  break-inside: avoid;
}

.rubric-table th {
  background: #e7efe9;
  text-align: left;
  line-height: 1.25;
}

.rubric-table th.level {
  min-width: 150px;
  text-align: center;
}

.rubric-table .standard-cell {
  width: 240px;
  background: #fbfcfa;
}

.standard-code {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.descriptor {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.highlight-meeting {
  background: #fff8e7;
}

.mobile-rubric {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.mobile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 2px rgba(15, 38, 51, 0.03);
}

.mobile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: #e7efe9;
}

.mobile-card-head strong {
  display: block;
  max-width: 56ch;
  font-size: 1.08rem;
  line-height: 1.28;
}

.student-goal-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-standard-text {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.standard-details {
  border-top: 1px solid var(--line);
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.standard-details summary {
  width: fit-content;
  cursor: pointer;
  padding-top: 10px;
  color: var(--accent);
  font-weight: 900;
}

.standard-details p {
  margin-bottom: 0;
  line-height: 1.5;
}

.mobile-level {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.mobile-level.meeting {
  border-left: 5px solid var(--accent-2);
  background: #fff8e7;
}

.mobile-level strong {
  color: var(--accent);
}

.mobile-level-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.schema-block {
  overflow: auto;
  max-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #202822;
  color: #edf4ee;
  font-size: 0.8rem;
  line-height: 1.55;
}

.technical-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #fbfcfa;
}

.technical-details summary {
  cursor: pointer;
  padding: 13px 14px;
  color: var(--accent);
  font-weight: 900;
}

.technical-details p {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  line-height: 1.5;
}

.technical-details .schema-block {
  margin: 0 14px 14px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.timeline-dot {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}

.timeline-step p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.split-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.dashboard-actions {
  margin-bottom: var(--space-4);
}

.section-actions {
  margin-top: var(--space-4);
}

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

.focus-panel {
  background: rgba(255, 255, 255, 0.82);
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 6px;
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 1px 2px rgba(15, 38, 51, 0.04);
  backdrop-filter: blur(8px);
}

.sidebar a {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.sidebar a.active {
  border-color: var(--ready-line);
  background: #e7efe9;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 98, 0.08);
}

.sidebar a:hover {
  background: #fbfcfa;
  color: var(--ink);
  transform: translateX(2px);
}

.sidebar a:active {
  transform: translateX(0);
}

.context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.context-strip a {
  color: var(--accent);
  text-decoration: none;
}

.workspace-map {
  display: grid;
  grid-template-columns: minmax(230px, auto) auto minmax(104px, 0.9fr) auto minmax(104px, 0.9fr) auto minmax(104px, 0.9fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 255, 255, 0.66);
  transition:
    border-color var(--motion-medium) var(--ease-standard),
    box-shadow var(--motion-medium) var(--ease-standard);
}

.workspace-map:hover {
  border-color: var(--line-strong);
}

.workspace-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-right: 1px solid var(--line);
  padding-right: 8px;
}

.workspace-node {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.workspace-node:hover {
  border-color: var(--line-strong);
  background: white;
  color: var(--ink);
  transform: translateY(-1px);
}

.workspace-node.hub {
  min-height: 44px;
  color: var(--ink);
  font-weight: 900;
}

.workspace-node.input {
  background: rgba(248, 246, 238, 0.74);
}

.workspace-node.active {
  border-color: var(--ready-line);
  background: #e7efe9;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 98, 0.08);
}

.workspace-node:active {
  transform: translateY(0);
}

.workspace-map-arrow {
  color: var(--line-strong);
  font-weight: 900;
  text-align: center;
  transition: color var(--motion-medium) var(--ease-standard), transform var(--motion-medium) var(--ease-standard);
}

.workspace-map:hover .workspace-map-arrow {
  color: var(--accent);
  transform: translateX(1px);
}

.project-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.project-stepper a {
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 7px 9px;
  font-size: 0.82rem;
  text-decoration: none;
}

.workflow-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 12px;
  background: transparent;
}

.workflow-current {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workflow-current strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.workflow-guide strong,
.workflow-guide p {
  margin: 0;
}

.workflow-guide p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-guide .button {
  white-space: nowrap;
}

.quiet-details {
  color: var(--muted);
  font-size: 0.82rem;
}

.quiet-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
  transition: color var(--motion-fast) var(--ease-standard);
}

.quiet-details summary:hover {
  color: var(--accent-dark);
}

.quiet-details p {
  margin-top: 7px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quiet-details[open] p {
  animation: disclosureReveal var(--motion-medium) var(--ease-out);
}

.page-context {
  margin-top: 8px;
}

.teacher-preview-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #d8c187;
  border-radius: var(--radius);
  padding: 14px;
  background: #fff8e7;
}

.teacher-preview-banner div:first-child {
  display: grid;
  gap: 3px;
}

.teacher-preview-banner span {
  color: var(--muted);
}

.student-preview-frame {
  display: grid;
  gap: 18px;
}

.preview-confidence {
  border-color: var(--ready-line);
  background: #fbfefb;
}

.inline-route {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: var(--radius-large);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 247, 0.84)),
    var(--color-surface-elevated);
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.teacher-shell .project-row {
  grid-template-columns: minmax(0, 1fr) minmax(188px, auto);
  gap: 20px;
}

.project-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lifted);
}

.project-row--published {
  border-left-color: var(--color-success-border);
}

.project-row--review {
  border-left-color: var(--color-attention);
}

.project-row--draft {
  border-left-color: #b7ccd1;
}

.project-row--archived {
  border-color: var(--color-disabled-border);
  border-left-color: var(--color-disabled);
  background:
    linear-gradient(180deg, rgba(249, 248, 243, 0.88), rgba(238, 236, 227, 0.7)),
    var(--color-disabled-bg);
  box-shadow: none;
}

.project-row--archived:hover {
  box-shadow: 0 1px 2px rgba(22, 35, 33, 0.04);
}

.project-row:first-child {
  padding-top: 16px;
}

.project-row:last-child {
  padding-bottom: 16px;
}

.project-row p {
  margin-bottom: 0;
  max-width: 72ch;
  line-height: 1.45;
}

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

.project-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 0.75fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.project-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-filter-bar input,
.project-filter-bar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  font-weight: 750;
}

.project-results-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.project-empty-state {
  min-height: 110px;
  align-content: center;
}

.standards-browser {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.standards-set-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.standards-context-card {
  display: grid;
  gap: 3px;
  border: 1px solid var(--ready-line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--ready-bg);
  color: var(--ink);
}

.standards-context-card strong {
  overflow-wrap: anywhere;
}

.standards-context-card span:last-child,
.standard-set-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.standards-set-head,
.standards-list-head,
.standard-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.standards-set-head h2,
.standards-list-head h2,
.standard-detail-head h2 {
  margin: 0;
}

.standards-list-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.standard-set-list {
  display: grid;
  gap: 8px;
}

.standard-set-button,
.standard-family-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.standard-set-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
}

.standard-set-button > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.standard-set-button small {
  color: var(--muted);
  font-weight: 750;
}

.standard-set-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: end;
}

.standard-set-button:hover,
.standard-family-row:hover {
  border-color: var(--line-strong);
  background: #fbfcfa;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.standard-set-button.active,
.standard-family-row.active {
  border-color: var(--ready-line);
  background: #edf6ef;
  box-shadow: inset 3px 0 0 var(--accent);
}

.standard-set-button:focus-visible,
.standard-family-row:focus-visible,
.standard-variant-tabs button:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.standards-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.standards-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.standards-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.standards-filter-bar input,
.standards-filter-bar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--color-surface-elevated);
  color: var(--ink);
  font-weight: 750;
}

.standards-content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.standards-list-panel,
.standard-detail-panel {
  min-width: 0;
}

.standard-family-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.standard-family-row {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.standard-family-row-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.standard-family-row-main strong,
.standard-detail-head h2,
.standard-schema-map dd {
  overflow-wrap: anywhere;
}

.standard-family-row-main span,
.standard-row-preview {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.standard-row-preview {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.standard-detail-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.standard-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.standard-variant-tabs button {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  min-height: 34px;
  padding: 7px 11px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.standard-variant-tabs button.active {
  border-color: var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
}

.standard-detail-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfa;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.standard-schema-map {
  display: grid;
  gap: 8px;
  margin: 0;
}

.standard-schema-map div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.standard-schema-map dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.standard-schema-map dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.project-card-main {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.project-card-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
}

.project-card-title-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.25;
}

.project-row-title strong {
  font-size: 1.08rem;
  letter-spacing: 0;
}

.project-state-note {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.project-card-description {
  color: var(--ink);
  font-size: 0.94rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-row--archived .project-card-description,
.project-row--archived .project-state-note {
  color: #676961;
}

.project-meta,
.project-meta-line,
.metadata-group {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.5;
}

.metadata-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-bottom: 0;
}

.metadata-item {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
}

.metadata-item + .metadata-item::before {
  content: "·";
  margin: 0 8px;
  color: var(--line-strong);
}

.metadata-item dt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.metadata-item dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-status-text {
  color: var(--muted);
}

.project-status-text.published {
  color: var(--ok);
}

.project-status-text.review {
  color: var(--warning);
}

.project-status-text.draft {
  color: var(--accent-3);
}

.project-status-text.archived {
  color: #61615f;
}

.project-meta-separator {
  margin: 0 7px;
  color: var(--line-strong);
}

.project-card-workflow {
  display: grid;
  gap: 0;
  margin-top: 2px;
}

.project-card-section-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.project-flow-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 520px;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.workflow-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  min-height: 26px;
  padding: 3px 7px;
  background: var(--color-surface);
  color: var(--muted);
  line-height: 1.15;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.workflow-chip[href]:hover,
a.workflow-chip:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(22, 35, 33, 0.05);
  color: var(--ink);
  transform: translateY(-1px);
}

.workflow-chip[href]:active,
a.workflow-chip:active {
  transform: translateY(0);
}

.workflow-chip-state {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  min-height: 16px;
  border-radius: var(--radius-pill);
  padding: 0 3px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.workflow-chip-label {
  white-space: normal;
  overflow-wrap: anywhere;
}

.workflow-chip--complete,
.workflow-chip.workflow-complete {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.workflow-chip--complete .workflow-chip-state,
.workflow-chip.workflow-complete .workflow-chip-state {
  animation: successSettle var(--motion-slow) var(--ease-out);
}

.workflow-chip--current,
.workflow-chip.workflow-current {
  border-color: var(--color-attention-border);
  background: var(--color-attention-bg);
  color: var(--color-warning);
  box-shadow: inset 0 0 0 1px rgba(241, 178, 52, 0.16);
}

.workflow-chip--available,
.workflow-chip.workflow-available {
  border-color: var(--line);
  background: var(--color-surface);
  color: var(--ink);
}

.workflow-chip--locked,
.workflow-chip.workflow-locked,
.workflow-chip--disabled,
.workflow-chip.workflow-disabled {
  border-color: var(--color-disabled-border);
  background: var(--color-disabled-bg);
  color: var(--color-disabled);
}


.project-row > .button-row {
  align-items: flex-start;
  justify-content: flex-end;
  align-self: center;
}

.project-row > .button-row .ghost,
.project-row > .button-row .button {
  min-width: 72px;
}

.project-action-cluster {
  display: grid;
  justify-items: end;
  justify-content: end;
  gap: 8px;
  align-items: center;
  align-content: center;
  align-self: stretch;
  min-width: 188px;
  max-width: 100%;
}

.project-primary-action {
  width: 100%;
  min-width: 176px;
  max-width: 210px;
  text-align: center;
}

.project-actions-menu {
  position: relative;
  width: 100%;
  max-width: 210px;
}

.project-actions-menu summary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--color-surface);
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
  list-style: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.project-actions-menu summary:hover {
  border-color: var(--line-strong);
  background: white;
  box-shadow: 0 2px 5px rgba(15, 38, 51, 0.06);
  transform: translateY(-1px);
}

.project-actions-menu summary:active {
  transform: translateY(0);
}

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

.project-actions-menu div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  display: grid;
  gap: 2px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: white;
  box-shadow: var(--shadow);
  transform-origin: top right;
}

.project-actions-menu[open] div {
  animation: menuReveal var(--motion-medium) var(--ease-out);
}

.project-actions-menu a {
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.project-actions-menu a:hover {
  background: #f3f8f4;
  color: var(--accent);
  transform: translateX(1px);
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 246, 238, 0.8)),
    #fbfcfa;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.overview-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: rgba(255, 255, 255, 0.68);
  transition:
    border-color var(--motion-medium) var(--ease-standard),
    box-shadow var(--motion-medium) var(--ease-standard);
}

.overview-disclosure summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.overview-disclosure summary:hover {
  background: rgba(251, 252, 250, 0.8);
  color: var(--accent);
}

.overview-disclosure summary::-webkit-details-marker {
  display: none;
}

.overview-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.overview-disclosure[open] > .grid,
.overview-disclosure[open] > .quiet-list,
.overview-disclosure[open] > .panel {
  animation: disclosureReveal var(--motion-medium) var(--ease-out);
}

.overview-disclosure > .grid,
.overview-disclosure > .quiet-list,
.overview-disclosure > .panel {
  margin: 12px;
}

.section-block {
  margin-top: var(--space-4);
}

.setup-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.setup-summary > div,
.field-readout,
.standard-quote {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fbfcfa;
}

.field-label-small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-readout p,
.standard-quote,
.anchor-editor textarea {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.field-editor {
  display: grid;
  gap: 7px;
}

.field-editor input,
.field-editor select,
.field-editor textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.field-editor input:hover,
.field-editor select:hover,
.field-editor textarea:hover {
  border-color: #aebcaf;
}

.field-editor input:focus,
.field-editor select:focus,
.field-editor textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 98, 0.08);
}

.field-editor textarea {
  resize: vertical;
}

.field-editor.meeting-editor textarea {
  border: 2px solid #d8c187;
  background: #fff8e7;
}

.alignment-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: white;
}

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

.alignment-head h3 {
  margin-bottom: 0;
}

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

.editable-grid {
  align-items: start;
}

.anchor-editor {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.anchor-editor textarea {
  width: 100%;
  border: 2px solid #d8c187;
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff8e7;
  resize: vertical;
}

.standards-mini-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.available-standard {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fbfcfa;
}

.available-standard p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.add-standard-button {
  min-height: 0;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.danger-action {
  border-color: #e3c5bb;
  color: #8b3f2a;
}

.readiness-list {
  display: grid;
  gap: 10px;
}

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

.check-meter {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: rgba(255, 255, 255, 0.74);
}

.check-meter div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.check-meter strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.check-meter span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.meter-track {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.visual-rule-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.student-surface-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.student-surface-map span {
  position: relative;
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfa;
  color: var(--ink);
  font-weight: 900;
}

.student-surface-map span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  z-index: 2;
  width: 12px;
  height: 2px;
  background: var(--line-strong);
}

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fbfcfa;
  transition:
    border-color var(--motion-medium) var(--ease-standard),
    background var(--motion-medium) var(--ease-standard);
}

.readiness-item span {
  width: fit-content;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.readiness-item.ready span {
  border: 1px solid var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
  animation: successSettle var(--motion-slow) var(--ease-out);
}

.readiness-item.blocked span {
  border: 1px solid var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.descriptor-review-list {
  display: grid;
  gap: 16px;
}

.descriptor-review-card,
.generated-level {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: white;
}

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

.generated-level-list {
  display: grid;
  gap: 12px;
}

.generated-level {
  background: #fbfcfa;
}

.generated-level.missing {
  border-style: dashed;
}

.generated-level-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.quality-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quality-flag {
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  background: #f4e7d2;
  color: var(--warning);
  font-size: 0.76rem;
  font-weight: 900;
}

.quality-flag.ok {
  background: #dceddf;
  color: var(--ok);
}

.descriptor-editor textarea {
  min-height: 112px;
  background: white;
}

.descriptor-actions,
.flag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quality-flag-list {
  display: grid;
  gap: 10px;
}

.quality-flag-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--warning-bg);
}

.quality-flag-card.resolved {
  border-color: var(--ready-line);
  background: #f3f8f4;
}

.quality-flag-card.dismissed {
  border-color: var(--line);
  background: #f5f6f3;
  opacity: 0.82;
}

.quality-flag-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

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

.live-blockers {
  border-color: #e2c892;
}

.publish-blocker-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--warning);
  font-weight: 800;
}

.publish-gate-details {
  margin-bottom: 14px;
}

.publish-ready-note {
  margin-bottom: 14px;
  background: #f3f8f4;
}

.template-mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.template-choice {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 12px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.template-choice:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.template-choice:active {
  transform: translateY(0);
}

.template-choice span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.template-choice.active {
  border-color: var(--ready-line);
  background: #e7efe9;
  color: var(--ink);
}

.template-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfa;
  font-weight: 800;
}

.template-workbench {
  overflow: hidden;
}

.template-canvas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.template-canvas-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #f7f8f4;
}

.boundary-toggle:has(input:disabled) {
  opacity: 0.62;
}

.layout-lock {
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfa;
}

.visual-rubric-builder {
  overflow: auto;
  border: 0;
  border-radius: var(--radius-sm);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.canvas-corner-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.canvas-corner-note strong {
  color: var(--ink);
}

.visual-rubric-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.74fr) repeat(var(--level-count), minmax(140px, 1fr));
  min-width: max(760px, var(--visual-width));
}

.visual-axis-cell,
.visual-level-header,
.visual-standard-cell,
.visual-descriptor-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.visual-axis-cell,
.visual-level-header {
  background: #f5f8f4;
}

.visual-axis-cell {
  display: grid;
  gap: 4px;
  align-content: start;
}

.visual-axis-cell p,
.visual-standard-cell p,
.visual-descriptor-cell p,
.hidden-level-tray p,
.regeneration-row p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.visual-level-header {
  display: grid;
  gap: 7px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.visual-level-header.meeting {
  background: #fff8e7;
}

.level-header-display {
  display: grid;
  gap: 4px;
}

.level-header-display strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.level-pill {
  width: fit-content;
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.level-pill.meeting {
  background: var(--ready-bg);
  color: var(--ok);
}

.level-title-editor,
.level-boundary-editor {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.level-title-editor input,
.level-boundary-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 30px;
  padding: 6px 8px;
  background: white;
}

.level-title-editor input {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.level-boundary-editor input,
.level-boundary-muted {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.level-edit-panel {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.level-edit-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  list-style: none;
  transition: color var(--motion-fast) var(--ease-standard);
}

.level-edit-panel summary:hover {
  color: var(--accent-dark);
}

.level-edit-panel summary::-webkit-details-marker {
  display: none;
}

.level-edit-panel[open] {
  display: grid;
  gap: 7px;
  animation: disclosureReveal var(--motion-medium) var(--ease-out);
}

.level-header-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.level-visibility-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 30px;
  padding: 5px 8px;
  background: white;
  font-size: 0.76rem;
  font-weight: 850;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.level-visibility-chip:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(15, 38, 51, 0.05);
}

.visual-standard-cell {
  display: grid;
  gap: 6px;
  background: #fbfcfa;
}

.visual-standard-cell strong {
  line-height: 1.25;
}

.visual-descriptor-cell {
  display: grid;
  align-content: start;
  min-height: 104px;
  background: white;
}

.visual-standard-cell p,
.visual-descriptor-cell p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.visual-standard-cell p {
  -webkit-line-clamp: 4;
}

.visual-descriptor-cell p {
  -webkit-line-clamp: 6;
}

.visual-descriptor-cell.meeting {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.hidden-level-tray {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 14px;
  padding: 12px;
  background: #fbfcfa;
}

.hidden-level-chip {
  gap: 7px;
}

.template-save-row {
  margin-top: 14px;
}

.template-advanced-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  transition:
    border-color var(--motion-medium) var(--ease-standard),
    box-shadow var(--motion-medium) var(--ease-standard);
}

.template-advanced-panel {
  margin-top: 14px;
}

.template-advanced-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 12px;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.template-advanced-panel summary:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
}

.template-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.template-advanced-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.template-advanced-panel[open] .template-advanced-grid {
  animation: disclosureReveal var(--motion-medium) var(--ease-out);
}

.template-advanced-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto) minmax(180px, auto);
  gap: 12px;
  padding: 12px;
}

.template-advanced-panel .hidden-level-tray {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  margin: 0;
}

.template-advanced-panel .technical-details {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.template-builder-shell {
  display: grid;
  gap: 16px;
}

.template-builder-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.template-name-field {
  display: block;
  margin-top: 6px;
}

.template-name-field input {
  width: 100%;
  max-width: 560px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font-weight: 850;
}

.template-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
  align-items: center;
  max-width: min(100%, 620px);
}

.template-save-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: right;
}

.template-library-menu {
  position: relative;
}

.template-library-menu summary {
  list-style: none;
}

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

.template-library-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 25;
  display: grid;
  gap: 10px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(72vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-floating);
}

.template-library-menu .tile {
  gap: 8px;
  padding: 12px;
}

.template-library-menu .btn {
  width: fit-content;
}

.template-save-state {
  border: 1px solid var(--ready-line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--ready-bg);
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 900;
  animation: successSettle var(--motion-slow) var(--ease-out);
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.template-save-state.unsaved {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
  animation: none;
}

.template-builder-shell .segmented-control {
  width: 100%;
}

.template-builder-shell .segmented-control button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 34px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.template-builder-shell .segmented-control button {
  flex: 1;
}

.template-builder-shell .segmented-control button:hover {
  background: white;
  color: var(--ink);
}

.template-builder-shell .segmented-control button:active {
  transform: translateY(1px);
}

.template-builder-shell .segmented-control button.active {
  background: var(--accent);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.template-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

.template-note {
  margin: 0;
}

.template-preview-panel {
  min-width: 0;
  overflow: hidden;
}

.template-skeleton-preview {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbf8;
}

.template-skeleton-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) repeat(var(--template-column-count), minmax(130px, 1fr));
  min-width: max(720px, calc(180px + var(--template-column-count) * 138px));
}

.skeleton-header,
.skeleton-standard-cell,
.skeleton-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.skeleton-header {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 82px;
  border-top: 0;
  border-left: 0;
  background: #f3f6f1;
  color: var(--ink);
  text-align: left;
}

button.skeleton-header {
  width: 100%;
  cursor: pointer;
  font: inherit;
  transition:
    background var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

button.skeleton-header:hover {
  background: #edf4ef;
  box-shadow: inset 0 -2px 0 rgba(31, 111, 98, 0.16);
}

.skeleton-header span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skeleton-header strong {
  font-size: 1rem;
  line-height: 1.2;
}

.skeleton-header.meeting,
.skeleton-cell.meeting {
  background: #fff8e7;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.skeleton-header.insufficient,
.skeleton-cell.insufficient {
  background: #f4f4f0;
  color: var(--muted);
}

.skeleton-standard-cell,
.skeleton-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  background: white;
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition:
    background var(--motion-fast) var(--ease-standard),
    outline-color var(--motion-fast) var(--ease-standard);
}

.skeleton-standard-cell {
  background: #fbfcfa;
}

.skeleton-standard-cell:hover,
.skeleton-standard-cell:focus-within,
.skeleton-cell:hover,
.skeleton-cell:focus-within {
  outline-color: rgba(31, 111, 98, 0.24);
}

.skeleton-standard-cell:focus-visible,
.skeleton-cell:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: -3px;
}

.placeholder-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: white;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.placeholder-pill.required {
  border-color: var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
}

.placeholder-pill.soft {
  background: var(--panel-soft);
  color: var(--muted);
}

.placeholder-pill.muted {
  border-style: dashed;
  color: var(--muted);
}

.template-format-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 14px 16px;
}

.template-format-strip > div {
  display: grid;
  gap: 7px;
}

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

.template-canvas-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.canvas-toolbar-controls {
  display: grid;
  grid-template-columns: minmax(240px, auto) 220px;
  gap: 8px;
  align-items: center;
  justify-content: end;
  min-width: min(100%, 480px);
}

.canvas-column-control {
  display: inline-flex;
  justify-content: space-between;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 7px 5px 10px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  min-height: 38px;
}

.canvas-column-control button,
.canvas-insufficient-toggle,
.inline-bullet-row button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 28px;
  padding: 5px 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.canvas-column-control button:hover,
.canvas-insufficient-toggle:hover,
.inline-bullet-row button:hover {
  border-color: var(--line-strong);
  background: #fbfcfa;
  transform: translateY(-1px);
}

.canvas-insufficient-toggle {
  border-radius: 999px;
  min-height: 36px;
  padding-inline: 12px;
  color: var(--accent);
  width: 220px;
  justify-content: center;
  text-align: center;
}

.canvas-insufficient-toggle.active {
  border-color: var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
}

.canvas-column-control button:disabled,
.canvas-insufficient-toggle:disabled,
.inline-bullet-row button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.canvas-column-control strong {
  min-width: 20px;
  color: var(--ink);
  text-align: center;
}

.template-skeleton-grid {
  grid-template-columns: minmax(190px, 0.64fr) repeat(var(--template-column-count), minmax(168px, 1fr));
  min-width: max(900px, calc(210px + var(--template-column-count) * 174px));
}

.skeleton-header,
.skeleton-standard-cell,
.skeleton-cell {
  position: relative;
}

.skeleton-header {
  min-height: 118px;
  padding: 14px;
}

.performance-header {
  padding: 0;
}

.column-meeting-target {
  display: grid;
  gap: 5px;
  align-content: start;
  width: 100%;
  height: 100%;
  min-height: 118px;
  border: 0;
  padding: 14px;
  padding-bottom: 42px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.column-meeting-target:hover {
  background: rgba(255, 255, 255, 0.42);
}

.column-hover-controls,
.standard-label-controls,
.cell-control-layer {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.column-hover-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  transform: translateY(2px);
}

.column-hover-controls span {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: none;
  pointer-events: none;
}

.skeleton-header:hover .column-hover-controls,
.skeleton-header:focus-within .column-hover-controls {
  opacity: 1;
  pointer-events: none;
  visibility: visible;
  transform: translateY(0);
}

.skeleton-standard-cell:hover .standard-label-controls,
.skeleton-standard-cell:focus-within .standard-label-controls,
.skeleton-cell:hover .cell-control-layer,
.skeleton-cell:focus-within .cell-control-layer {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.skeleton-standard-cell {
  min-height: 190px;
  padding-bottom: 12px;
}

.standard-label-controls {
  position: static;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px;
  background: var(--color-surface-tinted);
  box-shadow: none;
  min-height: 86px;
  margin-top: auto;
}

.standard-label-controls > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.standard-label-controls div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.standard-label-controls label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 27px;
  padding: 4px 7px;
  background: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.standard-label-controls label.selected {
  border-color: var(--ready-line);
  background: var(--ready-bg);
  color: var(--ok);
}

.skeleton-cell {
  min-height: 190px;
  padding-bottom: 12px;
}

.cell-default-layer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.skeleton-cell:hover .cell-default-layer,
.skeleton-cell:focus-within .cell-default-layer {
  opacity: 1;
}

.cell-control-layer {
  position: static;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px;
  background: var(--color-surface-tinted);
  box-shadow: none;
  min-height: 124px;
  margin-top: auto;
}

.cell-control-layer small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.inline-bullet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.inline-bullet-row strong {
  min-width: 18px;
  text-align: center;
}

.regeneration-panel {
  border-color: var(--warning-line);
  background: #fffdf8;
}

.regeneration-row-list {
  display: grid;
  gap: 10px;
}

.regeneration-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--warning-bg);
}

.service-map,
.service-contract-list {
  display: grid;
  gap: 12px;
}

.service-map-link {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fbfcfa;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.service-map-link:hover {
  border-color: var(--line-strong);
  background: white;
  transform: translateY(-1px);
}

.service-map-link span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.service-contract-card {
  scroll-margin-top: 96px;
}

.contract-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.contract-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fbfcfa;
}

.contract-list-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.contract-list h3 {
  margin-bottom: 0;
}

.contract-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.level-active-toggle {
  display: grid;
  gap: 6px;
  justify-items: start;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.regeneration-note {
  margin-bottom: 14px;
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.snapshot-summary {
  display: grid;
  gap: 12px;
}

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

.version-node {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfa;
}

.version-node + .version-node {
  position: relative;
}

.version-node + .version-node::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 22px;
  width: 2px;
  height: 12px;
  background: var(--line-strong);
}

.empty-node {
  border-style: dashed;
}

@keyframes menuReveal {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes disclosureReveal {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes successSettle {
  from {
    transform: scale(0.97);
  }

  to {
    transform: scale(1);
  }
}

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

  .tile:hover,
  .btn:hover,
  .button:hover,
  .ghost:hover,
  .topnav a:hover,
  .dev-mode-switch summary:hover,
  .sidebar a:hover,
  .workspace-node:hover,
  .workspace-map:hover .workspace-map-arrow,
  .project-stepper a:hover,
  .workflow-chip[href]:hover,
  .project-actions-menu summary:hover,
  .project-actions-menu a:hover,
  .template-choice:hover,
  .service-map-link:hover {
    transform: none;
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand mode nav profile";
    gap: 8px 12px;
    min-height: 58px;
    padding: 8px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-small);
  }

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

  .topnav a {
    flex: 0 0 auto;
  }

  .mock-educator-access {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

@media (max-width: 920px) {
  .topbar,
  .page-head,
  .two,
  .three,
  .metric-grid,
  .split-shell,
  .student-steps {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand mode profile"
      "nav nav nav";
    align-items: center;
    gap: 7px 10px;
    min-height: 0;
    padding: 8px 12px;
  }

  .topnav {
    justify-content: flex-start;
    margin-top: -1px;
    padding-bottom: 1px;
  }

  body.student-route .topbar {
    grid-template-areas: "brand mode mock";
  }

  body.student-route .mock-educator-access {
    justify-self: end;
    max-width: 100%;
  }

  .workflow-guide {
    grid-template-columns: 1fr;
  }

  .workflow-guide .button {
    width: fit-content;
  }

  .project-group-grid {
    grid-template-columns: 1fr;
  }

  .project-group-card-head {
    display: grid;
  }

  .workspace-map,
  .qa-overview {
    grid-template-columns: 1fr;
  }

  .workspace-map-arrow {
    display: none;
  }

  .workspace-inputs {
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 8px;
  }

  .sidebar,
  .project-stepper {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    position: static;
  }

  .sidebar a,
  .project-stepper a {
    flex: 0 0 auto;
  }

  .page-head {
    display: grid;
  }

	  .alignment-grid,
	  .setup-summary,
	  .descriptor-compare-grid,
	  .flag-detail-grid,
	  .template-advanced-grid,
	  .template-builder-header,
	  .contract-summary-grid,
	  .contract-lists {
	    grid-template-columns: 1fr;
	  }

  .template-header-actions {
    justify-content: start;
  }

  .template-save-note {
    text-align: left;
  }

  .template-library-menu > div {
    right: auto;
    left: 0;
  }

  .template-canvas-head {
    display: grid;
  }

  .canvas-toolbar-controls {
    justify-content: start;
    min-width: 0;
    width: 100%;
  }

  .alignment-head,
  .generated-level-head,
  .quality-flag-card-head,
  .hidden-level-tray,
  .regeneration-row,
  .teacher-shell .project-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-action-cluster {
    justify-content: start;
    justify-items: start;
    min-width: 0;
    width: 100%;
  }

  .project-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .class-create-form .btn {
    justify-self: start;
  }

  .project-group-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .standards-browser,
  .standards-content-grid {
    grid-template-columns: 1fr;
  }

  .standards-set-panel,
  .standard-detail-panel {
    position: static;
  }

  .standards-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-primary-action,
  .project-actions-menu {
    max-width: 260px;
  }

  .hidden-level-tray {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100vw - 20px, 1240px);
    padding-top: 14px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand profile"
      "mode mode"
      "nav nav";
    padding: 7px 10px;
  }

  .brand {
    max-width: 52px;
  }

  .brand span:last-child,
  .profile-copy {
    display: none;
  }

  .mode-switch {
    width: 100%;
    justify-content: stretch;
  }

  .mode-switch a,
  .student-mode-indicator {
    flex: 1 1 0;
  }

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

  .inline-form .button,
  .inline-form .btn {
    width: 100%;
  }

  .project-filter-bar {
    grid-template-columns: 1fr;
  }

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

  .class-create-form .btn {
    width: 100%;
  }

  .project-group-filter-bar {
    grid-template-columns: 1fr;
  }

  .standards-filter-bar {
    grid-template-columns: 1fr;
  }

  .standard-schema-map div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .template-header-actions,
  .template-library-menu {
    width: 100%;
  }

  .template-library-menu summary,
  .template-library-menu .btn {
    width: 100%;
  }

  .template-library-menu > div {
    width: min(100%, calc(100vw - 20px));
  }

  .canvas-toolbar-controls {
    grid-template-columns: 1fr;
  }

  .canvas-column-control,
  .canvas-insufficient-toggle {
    width: 100%;
  }

  body.student-route .topbar {
    grid-template-areas:
      "brand mock"
      "mode mode";
  }

  body.student-route .mock-educator-access {
    justify-self: end;
  }

  body.student-route .mock-educator-access span {
    display: none;
  }

  .profile-menu summary {
    padding-right: 7px;
  }

  .profile-menu div {
    right: 0;
    width: min(230px, calc(100vw - 20px));
  }

  .dev-mode-switch {
    width: 100%;
  }

  .dev-mode-switch div {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .panel {
    padding: 16px;
  }

  .project-row,
  .project-action-cluster,
  .quiet-list li,
  .rubric-mode-head,
  .student-read-note,
  .panel-head,
  .project-group-card-head,
  .teacher-preview-banner {
    grid-template-columns: 1fr;
    display: grid;
  }
  .segmented-control {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .project-primary-action,
  .project-actions-menu,
  .project-actions-menu summary,
  .project-group-actions .btn,
  .student-action-row .btn {
    width: 100%;
  }

  .student-action-row {
    align-items: stretch;
  }

  .student-surface-map {
    grid-template-columns: 1fr;
  }

  .student-surface-map span:not(:last-child)::after {
    display: none;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.45in;
  }

  body {
    background: white;
  }

  .topbar,
  .dev-mode-switch,
  .student-steps,
  .student-action-row,
  .button-row,
  .segmented-control,
  .render-mode[data-render-mode="mobile"],
  .student-read-note,
  .teacher-preview-banner,
  .context-strip,
  .project-stepper,
  .sidebar,
  .workflow-guide,
  .technical-details {
    display: none !important;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .page-head,
  .panel,
  .student-rubric-shell,
  .rubric-table-wrap {
    display: block;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .render-mode[data-render-mode="print"] {
    display: block !important;
  }

  h1 {
    font-size: 28px;
  }

  .rubric-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 9.5px;
    line-height: 1.28;
  }

  .rubric-table thead {
    display: table-header-group;
  }

  .rubric-table th,
  .rubric-table td {
    padding: 7px;
  }

  .rubric-table th {
    background: #edf3ec !important;
    color: #182323;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .rubric-table th.level {
    min-width: 0;
  }

  .rubric-table .standard-cell {
    width: 22%;
  }

  .highlight-meeting {
    background: #fff5d7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .descriptor {
    font-size: 9.5px;
    line-height: 1.3;
  }

  .mobile-card,
  .rubric-table tr,
  .alignment-card,
  .descriptor-review-card,
  .version-node {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
