:root {
  --ivory: #f1ede2;
  --ivory-deep: #e6dece;
  --paper: #fffdf7;
  --paper-cool: #fbfcfa;
  --ink: #1e2422;
  --muted: #66706b;
  --line: #d6d0c3;
  --line-dark: #aaa79d;
  --navy: #19364a;
  --navy-deep: #102b3c;
  --navy-soft: #e6edf0;
  --green: #285b45;
  --green-soft: #e7f0e9;
  --red: #8a3431;
  --red-soft: #f5e8e4;
  --amber: #84621c;
  --amber-soft: #f4edda;
  --focus: #b78127;
  --shadow-paper: 0 8px 28px rgba(37, 41, 37, 0.08);
  --font-sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--font-sans);
  line-height: 1.5;
}

body.has-overlay {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="radio"],
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

img {
  max-width: 100%;
}

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

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 700;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.25;
}

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

h4 {
  margin-bottom: 0.35rem;
  color: var(--navy);
  font: 700 0.78rem/1.4 var(--font-sans);
  letter-spacing: 0.04em;
}

.is-hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  color: #fff;
  background: var(--red);
  transform: translateY(-150%);
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.masthead {
  color: #fffdf5;
  background: var(--navy-deep);
  border-bottom: 4px solid #9b7d45;
}

.masthead__inner {
  width: min(1580px, 100%);
  min-height: 112px;
  margin: 0 auto;
  padding: 24px 36px 21px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.masthead__note {
  margin: 7px 0 0;
  color: #ced9dc;
  font-size: 0.84rem;
}

.kicker {
  margin-bottom: 5px;
  color: #aebfc5;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.kicker--ink {
  color: #557077;
}

.kicker--paper {
  color: #cad8d8;
}

.edition-mark {
  display: inline-flex;
  min-height: 26px;
  padding: 3px 8px;
  align-items: center;
  color: #f0dfbd;
  border: 1px solid #a98e5a;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.edition-mark--ink {
  color: var(--navy);
  border-color: var(--line-dark);
  background: var(--paper);
}

.session-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.session-identity {
  padding-right: 18px;
  text-align: right;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.session-identity span,
.session-identity strong {
  display: block;
}

.session-identity__role {
  color: #aebfc5;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.session-identity strong {
  margin-top: 2px;
  font-size: 0.9rem;
}

.text-button {
  min-height: 40px;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-weight: 700;
}

.text-button--light {
  color: #e4ecec;
}

.primary-button,
.secondary-button,
.toolbar-button,
.icon-button,
.close-button {
  min-height: 42px;
  border-radius: 2px;
  font-weight: 750;
}

.primary-button {
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
}

.primary-button:hover:not(:disabled) {
  background: var(--navy-deep);
}

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

.primary-button--red:hover:not(:disabled) {
  background: #6d2927;
}

.secondary-button {
  padding: 10px 15px;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line-dark);
}

.secondary-button:hover:not(:disabled),
.toolbar-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: var(--navy-soft);
  border-color: #71858d;
}

.auth-layout {
  width: min(1080px, calc(100% - 32px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 54px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  align-items: center;
  gap: 0;
}

.auth-sheet,
.auth-context {
  min-height: 560px;
  padding: clamp(30px, 5vw, 54px);
}

.auth-sheet {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-paper);
}

.auth-sheet__heading {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.auth-sheet__heading h2 {
  margin-bottom: 10px;
}

.lede {
  margin-bottom: 0;
  color: var(--muted);
}

.auth-form {
  padding-top: 26px;
}

.field {
  display: block;
  margin-bottom: 19px;
}

.field__label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
}

.field input,
.field select,
.compact-filter select {
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 2px;
}

.field small,
.field-help,
.decision-submit-bar small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

.auth-form .primary-button {
  width: 100%;
  min-height: 48px;
}

.form-error {
  margin: 12px 0;
  padding: 10px 12px;
  color: #642826;
  background: var(--red-soft);
  border-left: 4px solid var(--red);
  font-size: 0.8rem;
}

.notice {
  margin-top: 25px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
}

.notice strong {
  color: var(--green);
  font-size: 0.78rem;
}

.notice p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.auth-context {
  color: #f7f3e8;
  background: var(--navy);
  border-top: 6px solid #9b7d45;
}

.auth-context h2 {
  margin: 12px 0 32px;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.3;
}

.principle-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.principle-list li {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.principle-list span {
  color: #d1bd91;
  font: 700 1.1rem var(--font-serif);
}

.principle-list p {
  margin: 0;
  color: #e6eded;
}

.auth-context__boundary {
  margin: 34px 0 0;
  padding-top: 20px;
  color: #c7d6d8;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
}

.center-state {
  width: min(680px, calc(100% - 30px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 90px 30px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.loading-rule {
  width: 88px;
  height: 4px;
  margin-bottom: 24px;
  background: var(--navy);
  animation: loading-rule 1.2s ease-in-out infinite alternate;
}

@keyframes loading-rule {
  from { transform: scaleX(0.35); opacity: 0.45; }
  to { transform: scaleX(1); opacity: 1; }
}

.center-state p {
  color: var(--muted);
}

.completion-layout,
.teacher-home {
  width: min(980px, calc(100% - 32px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 58px 0;
}

.completion-layout {
  display: grid;
  place-items: center;
}

.completion-sheet {
  width: min(680px, 100%);
  padding: clamp(34px, 7vw, 68px);
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  box-shadow: var(--shadow-paper);
}

.completion-seal {
  width: 54px;
  height: 54px;
  margin: 18px auto 22px;
  display: grid;
  place-items: center;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 50%;
  font: 700 1.5rem var(--font-serif);
}

.completion-sheet h2 {
  font-size: clamp(1.45rem, 4vw, 2.15rem);
}

.completion-sheet > p:not(.kicker) {
  color: var(--muted);
}

.completion-status {
  margin: 26px 0;
  padding: 14px 16px;
  color: var(--navy);
  background: var(--navy-soft);
  border-left: 4px solid var(--navy);
  font-size: 0.82rem;
  text-align: left;
}

.completion-status.is-blocked {
  color: var(--red);
  background: var(--red-soft);
  border-left-color: var(--red);
}

.completion-status.is-complete {
  color: var(--green);
  background: var(--green-soft);
  border-left-color: var(--green);
}

.completion-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading,
.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.section-heading {
  margin-bottom: 24px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line-dark);
}

.section-heading p,
.admin-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.mode-sheet {
  min-height: 310px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--navy);
  box-shadow: var(--shadow-paper);
}

.mode-sheet--adjudicate {
  border-top-color: var(--red);
}

.mode-sheet__number {
  color: var(--navy);
  font: 700 2.1rem var(--font-serif);
}

.mode-sheet--adjudicate .mode-sheet__number {
  color: var(--red);
}

.mode-sheet h3 {
  margin: 10px 0;
  font-size: 1.45rem;
}

.mode-sheet p {
  color: var(--muted);
}

.mode-sheet .primary-button {
  width: 100%;
  margin-top: auto;
}

.queue-message {
  margin-top: 18px;
  padding: 14px 16px;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
}

.workbench {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.target-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 92px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fffdf5;
  background: var(--navy);
  border-bottom: 4px solid #9b7d45;
  box-shadow: 0 3px 14px rgba(18, 39, 52, 0.18);
}

.target-bar h2 {
  margin-bottom: 3px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.target-bar p:not(.kicker) {
  margin-bottom: 0;
  color: #cedadd;
  font-size: 0.78rem;
}

.target-bar__status {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  justify-items: end;
  color: #d9e3e4;
  font-size: 0.76rem;
  font-weight: 700;
}

.previous-review-button {
  min-height: 30px;
  padding: 5px 9px;
  color: #fffdf5;
  background: transparent;
  border: 1px solid rgba(255, 253, 245, 0.58);
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 750;
}

.previous-review-button:hover,
.previous-review-button:focus-visible {
  background: rgba(255, 253, 245, 0.12);
  border-color: #fffdf5;
}

.lease-status.is-warning {
  color: #f2d89f;
}

.lease-status.is-expired {
  color: #ffbbb4;
}

.adjudication-brief {
  margin-top: 16px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid #c9a5a0;
  border-top: 5px solid var(--red);
}

.adjudication-brief__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.adjudication-brief__heading > p {
  margin: 0;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
}

.review-comparison {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.review-summary-card,
.candidate-summary {
  padding: 13px 14px;
  background: var(--paper-cool);
  border: 1px solid var(--line);
}

.review-summary-card h3 {
  font: 800 0.75rem var(--font-sans);
  letter-spacing: 0.05em;
}

.review-summary-card dl,
.audit-definition-list {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: minmax(90px, 0.34fr) minmax(0, 1fr);
  gap: 6px 10px;
  font-size: 0.76rem;
}

.review-summary-card dt,
.audit-definition-list dt {
  color: var(--muted);
}

.review-summary-card dd,
.audit-definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.candidate-summary {
  margin-top: 10px;
  color: #622c29;
  background: var(--red-soft);
  border-color: #d4b3ae;
}

.candidate-summary strong {
  display: block;
  margin-bottom: 4px;
}

.workbench-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(360px, 0.82fr);
  align-items: start;
  gap: 16px;
}

.evidence-sheet,
.decision-sheet,
.admin-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-paper);
}

.evidence-sheet {
  padding: 22px;
}

.evidence-header,
.decision-header,
.subsection-heading,
.admin-sheet__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.evidence-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.task-meta {
  max-width: 62%;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.meta-token,
.state-badge,
.audit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 0.69rem;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.meta-token {
  color: #48534f;
  background: #f4f1e8;
}

.blind-review-note {
  margin: 14px 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  background: var(--navy-soft);
  border-left: 4px solid var(--navy);
  font-size: 0.76rem;
}

.blind-review-note p {
  margin: 0;
}

.blind-review-note__mark {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: var(--navy);
  border-radius: 50%;
}

.viewer {
  border: 1px solid var(--line-dark);
  background: #e7e4dc;
}

.viewer-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--paper);
  border-bottom: 1px solid var(--line-dark);
}

.viewer-tab {
  min-height: 48px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 4px solid transparent;
  font-weight: 800;
}

.viewer-tab + .viewer-tab {
  border-left: 1px solid var(--line);
}

.viewer-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.viewer-tab span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.viewer-toolbar,
.asset-modal__toolbar {
  min-height: 52px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f7f4ec;
  border-bottom: 1px solid var(--line);
}

.pager-controls,
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-button,
.toolbar-button {
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line-dark);
}

.icon-button {
  width: 42px;
  padding: 5px;
  font-size: 1.05rem;
}

.toolbar-button {
  padding: 6px 10px;
  font-size: 0.72rem;
}

.viewer-position,
.zoom-label {
  min-width: 68px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.zoom-label {
  min-width: 74px;
}

.viewer-canvas {
  position: relative;
  min-height: min(62vh, 620px);
  max-height: 68vh;
  overflow: auto;
  display: grid;
  place-items: start center;
  background: #dad7d0;
  scrollbar-color: #87918d #dad7d0;
}

.viewer-image-button {
  width: 100%;
  min-width: 100%;
  min-height: inherit;
  padding: 16px;
  display: grid;
  place-items: start center;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.viewer-image-button img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(24, 30, 27, 0.16);
}

.viewer-image-button img.zoom-scaled {
  width: var(--image-zoom-width);
  max-width: none;
}

.viewer-image-button img.zoom-original {
  width: auto;
  max-width: none;
}

.viewer-empty,
.viewer-error {
  width: min(440px, calc(100% - 32px));
  margin: auto;
  padding: 28px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}

.viewer-empty p,
.viewer-error p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.viewer-error {
  color: var(--red);
  border-color: #c79a95;
}

.viewer-caption {
  min-height: 35px;
  padding: 8px 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line-dark);
  font-size: 0.67rem;
}

.viewer-caption span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-answer-box {
  margin-top: 14px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: auto 52px 1fr;
  align-items: center;
  gap: 14px;
  color: var(--navy);
  background: var(--navy-soft);
  border-left: 4px solid var(--navy);
}

.official-answer-box span {
  font-size: 0.76rem;
  font-weight: 800;
}

.official-answer-box strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font: 700 1.2rem var(--font-serif);
}

.official-answer-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.evidence-excerpts,
.syllabus-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.subsection-heading h3 {
  margin-bottom: 0;
}

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

.excerpt-grid article {
  min-height: 120px;
  padding: 13px 14px;
  background: #f8f6ef;
  border: 1px solid var(--line);
}

.excerpt-grid p {
  margin: 0;
  color: #39423e;
  font: 0.77rem/1.65 var(--font-serif);
  white-space: pre-wrap;
}

.evidence-text-warning {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 3px solid var(--burgundy);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.evidence-text-warning strong {
  color: var(--ink);
}

.syllabus-reference {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.syllabus-reference-card {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  background: #f8f6ef;
  border: 1px solid var(--line);
}

.syllabus-reference-card__id {
  color: var(--navy);
  font: 700 1rem var(--font-serif);
}

.syllabus-reference-card strong {
  display: block;
  font-size: 0.78rem;
}

.syllabus-reference-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.source-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
}

.decision-sheet {
  position: sticky;
  top: 108px;
  overflow: hidden;
}

.decision-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-dark);
}

.form-status {
  padding: 5px 7px;
  color: var(--muted);
  background: #f4f1e8;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.form-status.is-ready {
  color: var(--green);
  background: var(--green-soft);
  border-color: #a5bfad;
}

.form-status.is-error {
  color: var(--red);
  background: var(--red-soft);
  border-color: #d3a9a4;
}

.decision-group {
  margin: 0;
  padding: 17px 18px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.decision-group legend {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.decision-group legend > span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--navy);
  background: var(--navy-soft);
  border: 1px solid #b9c9cd;
  font-size: 0.66rem;
}

.decision-group legend strong {
  font-size: 0.84rem;
}

.field-help {
  margin: 6px 0 11px;
}

.choice-grid {
  display: grid;
  gap: 7px;
}

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

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

.choice-card {
  position: relative;
}

.choice-card input,
.line-choice input,
.node-option input,
.tag-option input,
.rubric-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card > span {
  min-height: 62px;
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #43504a;
  background: #fff;
  border: 1px solid var(--line-dark);
}

.choice-card strong {
  font-size: 0.78rem;
}

.choice-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.3;
}

.choice-card input:checked + span {
  color: var(--navy);
  background: var(--navy-soft);
  border: 2px solid var(--navy);
  padding: 8px 7px;
}

.choice-card--danger input:checked + span,
.choice-card.result-blocked input:checked + span {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red);
}

.choice-stack,
.node-options {
  display: grid;
  gap: 6px;
}

.line-choice > span,
.node-option > span,
.tag-option > span,
.rubric-check > span {
  min-height: 42px;
  padding: 9px 11px 9px 38px;
  display: flex;
  align-items: center;
  position: relative;
  color: #3f4945;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.74rem;
}

.line-choice > span::before,
.node-option > span::before,
.tag-option > span::before,
.rubric-check > span::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid var(--line-dark);
}

.line-choice > span::before {
  border-radius: 50%;
}

.line-choice input:checked + span,
.node-option input:checked + span,
.tag-option input:checked + span,
.rubric-check input:checked + span {
  color: var(--navy);
  background: var(--navy-soft);
  border-color: #78909a;
}

.line-choice input:checked + span::before {
  background: var(--navy);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--navy);
}

.node-option input:checked + span::before,
.tag-option input:checked + span::before,
.rubric-check input:checked + span::before {
  content: "✓";
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  font-size: 0.64rem;
  font-weight: 900;
}

.node-option > span {
  min-height: 57px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-content: center;
  gap: 2px 8px;
}

.node-option__id {
  grid-row: span 2;
  color: var(--navy);
  font: 700 0.9rem var(--font-serif);
}

.node-option strong {
  font-size: 0.72rem;
}

.node-option small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.field--compact {
  margin: 0;
}

.field--compact select {
  min-height: 43px;
  font-size: 0.76rem;
}

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

.tag-option > span {
  min-height: 48px;
  font-size: 0.68rem;
  line-height: 1.3;
}

.decision-group--rubric {
  background: #faf6ec;
}

.rubric-check > span {
  min-height: 62px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
}

.rubric-check strong,
.rubric-check small {
  display: block;
}

.rubric-check strong {
  color: var(--red);
  font-size: 0.75rem;
}

.rubric-check small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.decision-sheet .form-error {
  margin: 14px 18px 0;
}

.decision-submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-top: 2px solid var(--navy);
  box-shadow: 0 -5px 14px rgba(30, 36, 34, 0.07);
}

.decision-submit-bar span {
  display: block;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 750;
}

.decision-submit-bar small {
  margin-top: 2px;
  font-size: 0.62rem;
}

.decision-submit-bar .primary-button {
  min-width: 116px;
}

.admin-layout {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 28px 28px 58px;
}

.admin-heading {
  padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.poll-indicator {
  margin-right: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.poll-indicator i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: var(--green);
  border-radius: 50%;
}

.readiness-strip {
  margin-top: 16px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  color: var(--navy);
  background: var(--navy-soft);
  border: 1px solid #aebfc4;
  border-left: 5px solid var(--navy);
}

.readiness-strip.is-complete {
  color: var(--green);
  background: var(--green-soft);
  border-color: #a7beae;
  border-left-color: var(--green);
}

.readiness-strip.is-blocked {
  color: var(--red);
  background: var(--red-soft);
  border-color: #cfaaa5;
  border-left-color: var(--red);
}

.readiness-strip strong {
  font-family: var(--font-serif);
}

.readiness-strip p {
  margin: 0;
  color: currentColor;
  font-size: 0.76rem;
}

.readiness-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-badge {
  color: var(--navy);
  background: var(--paper);
  border-color: #aebfc4;
}

.audit-badge.is-true {
  color: var(--green);
  border-color: #9fb9a7;
}

.audit-badge.is-false {
  color: var(--red);
  border-color: #cfa6a1;
}

.metric-ledger {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--paper);
  border: 1px solid var(--line-dark);
}

.metric-item {
  min-height: 92px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-item:nth-child(6n) {
  border-right: 0;
}

.metric-item strong,
.metric-item span {
  display: block;
}

.metric-item strong {
  color: var(--navy);
  font: 700 1.65rem/1.1 var(--font-serif);
}

.metric-item span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.69rem;
}

.metric-item.is-good strong {
  color: var(--green);
}

.metric-item.is-alert strong {
  color: var(--red);
}

.metric-item.is-warn strong {
  color: var(--amber);
}

.admin-grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.admin-grid--people {
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
}

.admin-grid--activity {
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1.62fr);
  align-items: start;
}

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

.admin-sheet__heading {
  min-height: 54px;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line-dark);
}

.admin-sheet__heading h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.admin-sheet__heading span {
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-sheet__heading--tasks {
  align-items: flex-end;
}

.admin-task-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.69rem;
}

.compact-filter select,
.compact-filter input {
  width: auto;
  min-width: 150px;
  min-height: 36px;
  padding: 5px 8px;
}

.compact-filter input {
  min-width: 190px;
}

.table-scroll {
  width: 100%;
  max-height: 292px;
  overflow: auto;
}

.table-scroll--tasks {
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

th,
td {
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--navy);
  background: #f5f1e7;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

td {
  color: #39423e;
}

tbody tr:hover {
  background: #faf7ee;
}

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

.state-badge {
  color: var(--navy);
  background: var(--navy-soft);
  border-color: #b5c5c9;
  white-space: nowrap;
}

.state-badge.is-good {
  color: var(--green);
  background: var(--green-soft);
  border-color: #aec2b4;
}

.state-badge.is-alert {
  color: var(--red);
  background: var(--red-soft);
  border-color: #d1aaa5;
}

.state-badge.is-warn {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #d1c29b;
}

.detail-button {
  min-height: 32px;
  padding: 4px 8px;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  font-size: 0.67rem;
  font-weight: 750;
}

.event-list {
  max-height: 520px;
  margin: 0;
  padding: 0 16px;
  overflow: auto;
  list-style: none;
}

.event-item {
  position: relative;
  padding: 13px 0 13px 18px;
  border-bottom: 1px solid var(--line);
}

.event-item::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--navy);
  border-radius: 50%;
}

.event-item strong,
.event-item span {
  display: block;
}

.event-item strong {
  font-size: 0.73rem;
}

.event-item p {
  margin: 3px 0;
  color: #46504b;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.event-item span {
  color: var(--muted);
  font-size: 0.64rem;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer__backdrop,
.asset-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 24, 29, 0.74);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(800px, 94vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 4px solid var(--navy);
  box-shadow: -12px 0 38px rgba(13, 28, 34, 0.24);
}

.drawer__header,
.asset-modal__header {
  padding: 18px 20px 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-dark);
}

.drawer__header p,
.asset-modal__header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.close-button {
  width: 42px;
  flex: 0 0 42px;
  padding: 0;
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line-dark);
  font-size: 1.45rem;
}

.drawer__content {
  flex: 1;
  padding: 18px 20px 38px;
  overflow: auto;
}

.drawer-section {
  margin-bottom: 16px;
  padding: 15px;
  background: #faf7ef;
  border: 1px solid var(--line);
}

.drawer-section h3 {
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
}

.drawer-section--alert {
  background: var(--red-soft);
  border-color: #d0aaa5;
}

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

.drawer-asset-button {
  min-height: 46px;
  padding: 8px 10px;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  font-size: 0.7rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 23px;
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line-dark);
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 1px;
  z-index: 1;
  width: 9px;
  height: 9px;
  background: var(--navy);
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline strong {
  font-size: 0.73rem;
}

.timeline p {
  margin: 3px 0;
  color: #48514d;
  font-size: 0.7rem;
}

.timeline span {
  color: var(--muted);
  font-size: 0.63rem;
}

.asset-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  padding: 18px;
  display: grid;
  place-items: center;
}

.asset-modal__panel {
  position: relative;
  width: min(1380px, 100%);
  height: min(94vh, 1000px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  box-shadow: 0 22px 80px rgba(10, 21, 26, 0.42);
}

.asset-modal__toolbar {
  justify-content: center;
  flex-wrap: wrap;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  margin: 0 5px;
  background: var(--line-dark);
}

.asset-modal__canvas {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  place-items: start center;
  background: #d8d5cd;
}

.asset-modal__canvas img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 3px 14px rgba(20, 25, 23, 0.22);
}

.asset-modal__canvas img.zoom-scaled {
  width: var(--modal-image-width);
  max-width: none;
}

.asset-modal__canvas img.zoom-original {
  width: auto;
  max-width: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(520px, calc(100% - 28px));
  padding: 11px 15px;
  color: #fff;
  background: var(--navy-deep);
  border: 1px solid #627983;
  box-shadow: 0 8px 28px rgba(15, 32, 41, 0.25);
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.local-home {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 44px 24px 72px;
}

.local-home__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 28px;
  align-items: end;
  padding-bottom: 26px;
  border-bottom: 2px solid var(--navy);
}

.local-home__intro h2 {
  max-width: 820px;
  margin: 8px 0 12px;
  font: 700 clamp(1.9rem, 4vw, 3.5rem)/1.08 var(--font-serif);
}

.local-home__intro p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.local-home__status {
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--green);
}

.local-home__status strong,
.local-home__status span {
  display: block;
}

.local-home__status span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.role-entry-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.role-entry {
  min-height: 150px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-left: 5px solid var(--navy);
}

.role-entry:hover,
.role-entry:focus-visible {
  border-color: var(--navy);
  background: #fbfaf5;
}

.role-entry strong {
  font: 700 1.25rem var(--font-serif);
}

.role-entry p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.role-entry span {
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 750;
}

.local-home__boundary {
  margin-top: 22px;
  padding: 16px 18px;
  color: var(--muted);
  background: #f7f2e8;
  border-left: 4px solid var(--burgundy);
  font-size: 0.76rem;
  line-height: 1.7;
}

.local-home__boundary strong {
  color: var(--ink);
}

@media (max-width: 1240px) {
  .workbench-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.8fr);
  }

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

  .metric-item:nth-child(6n) {
    border-right: 1px solid var(--line);
  }

  .metric-item:nth-child(4n) {
    border-right: 0;
  }

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

  .event-list {
    max-height: 310px;
  }
}

@media (max-width: 980px) {
  .masthead__inner {
    padding: 20px 22px 18px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    padding: 30px 0;
  }

  .auth-sheet,
  .auth-context {
    min-height: 0;
  }

  .auth-context {
    border-top-width: 4px;
  }

  .workbench {
    padding: 12px 12px 36px;
  }

  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .decision-sheet {
    position: static;
  }

  .decision-submit-bar {
    position: sticky;
    bottom: 0;
  }

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

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .local-home__intro,
  .role-entry-grid {
    grid-template-columns: 1fr;
  }

  .local-home {
    padding: 28px 14px 48px;
  }

  .admin-task-filters,
  .compact-filter {
    width: 100%;
  }

  .compact-filter select,
  .compact-filter input {
    flex: 1;
    min-width: 0;
  }

  .masthead__inner {
    min-height: 94px;
    padding: 16px 15px 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .masthead__note,
  #environment-badge {
    display: none;
  }

  .session-tools {
    width: 100%;
    justify-content: space-between;
  }

  .session-identity {
    padding: 0;
    text-align: left;
    border: 0;
  }

  .auth-layout,
  .completion-layout,
  .teacher-home {
    width: calc(100% - 20px);
    min-height: auto;
    padding: 18px 0 28px;
  }

  .auth-sheet,
  .auth-context {
    padding: 26px 22px;
  }

  .auth-context h2 {
    margin-bottom: 20px;
  }

  .principle-list li {
    padding: 12px 0;
  }

  .completion-sheet {
    padding: 34px 22px;
  }

  .completion-actions,
  .completion-actions > button {
    width: 100%;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-sheet {
    min-height: 260px;
    padding: 24px 20px;
  }

  .workbench {
    padding: 0 0 calc(32px + env(safe-area-inset-bottom));
  }

  .target-bar {
    min-height: 82px;
    padding: 12px 13px;
    align-items: flex-start;
    gap: 10px;
  }

  .target-bar__main {
    min-width: 0;
  }

  .target-bar h2 {
    overflow-wrap: anywhere;
  }

  .target-bar p:not(.kicker) {
    max-width: 240px;
    font-size: 0.68rem;
  }

  .target-bar__status {
    font-size: 0.65rem;
  }

  .adjudication-brief,
  .evidence-sheet {
    margin: 10px;
    padding: 14px;
  }

  .adjudication-brief__heading,
  .evidence-header,
  .syllabus-section__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-comparison {
    grid-template-columns: 1fr;
  }

  .workbench-grid {
    margin-top: 0;
    gap: 0;
  }

  .evidence-header {
    gap: 8px;
  }

  .task-meta {
    max-width: none;
    justify-content: flex-start;
  }

  .viewer-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pager-controls,
  .zoom-controls {
    justify-content: center;
  }

  .viewer-canvas {
    min-height: 46vh;
    max-height: 60vh;
  }

  .viewer-image-button {
    padding: 8px;
  }

  .viewer-caption span:last-child {
    display: none;
  }

  .official-answer-box {
    grid-template-columns: 1fr 42px;
  }

  .official-answer-box p {
    grid-column: span 2;
  }

  .excerpt-grid {
    grid-template-columns: 1fr;
  }

  .decision-sheet {
    margin: 10px;
  }

  .choice-grid--result {
    grid-template-columns: 1fr;
  }

  .choice-grid--result .choice-card > span {
    min-height: 50px;
    align-items: flex-start;
    padding-left: 14px;
    text-align: left;
  }

  .choice-grid--result .choice-card input:checked + span {
    padding-left: 13px;
  }

  .tag-options {
    grid-template-columns: 1fr;
  }

  .decision-submit-bar {
    bottom: 0;
    grid-template-columns: 1fr auto;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .decision-submit-bar > div {
    display: none;
  }

  .decision-submit-bar .primary-button {
    width: 100%;
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .admin-layout {
    padding: 20px 10px 42px;
  }

  .admin-actions {
    width: 100%;
  }

  .poll-indicator {
    width: 100%;
  }

  .admin-actions button {
    flex: 1;
  }

  .readiness-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .readiness-flags {
    justify-content: flex-start;
  }

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

  .metric-item:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .metric-item:nth-child(2n) {
    border-right: 0;
  }

  .admin-sheet__heading--tasks {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-filter,
  .compact-filter select {
    width: 100%;
  }

  .drawer__panel {
    width: 100%;
    border-left: 0;
    border-top: 4px solid var(--navy);
  }

  .drawer__header,
  .asset-modal__header {
    padding: 14px;
  }

  .drawer__content {
    padding: 12px 12px 28px;
  }

  .drawer-assets {
    grid-template-columns: 1fr;
  }

  .asset-modal {
    padding: 0;
  }

  .asset-modal__panel {
    width: 100%;
    height: 100%;
    border: 0;
  }

  .asset-modal__toolbar {
    padding: 6px;
  }

  .asset-modal__toolbar .toolbar-divider {
    display: none;
  }

  .asset-modal__canvas {
    padding: 8px;
  }
}

@media (max-width: 420px) {
  .brand-line h1 {
    font-size: 1.35rem;
  }

  .choice-grid--two {
    grid-template-columns: 1fr;
  }

  .zoom-controls .toolbar-button:first-of-type {
    display: none;
  }

  .asset-modal__toolbar {
    justify-content: space-between;
    gap: 4px;
  }

  .asset-modal__toolbar .toolbar-button {
    padding: 5px 7px;
  }

  .review-summary-card dl,
  .audit-definition-list {
    grid-template-columns: 1fr;
  }
}

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