:root {
  --ink: #1a1411;
  --ink-soft: #2e2621;
  --paper: #f4eee4;
  --paper-deep: #ebe3d4;
  --rule: #c9bba8;
  --wine: #7a2e3a;
  --wine-deep: #5c222c;
  --cream: #fffaf2;
  --shadow: 0 18px 40px rgba(36, 28, 24, 0.08);
  --btn-face: linear-gradient(180deg, #fffdf8 0%, #f3ebe0 100%);
  --btn-face-primary: linear-gradient(180deg, #9a3d4a 0%, #7a2e3a 55%, #5c222c 100%);
  --btn-edge: rgba(36, 28, 24, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Tahoma", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, #fffdf8 0, transparent 42%),
    linear-gradient(180deg, #f7f1e6 0%, #efe6d6 100%);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}

.teacher-profile-bar {
  max-width: 280px;
  text-align: right;
}

.teacher-profile-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.teacher-profile-select {
  font: inherit;
  padding: 6px 8px;
  min-width: 180px;
}

.teacher-profile-note {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted, #555);
}

.work-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.work-tab-active {
  outline: 2px solid var(--ink);
  font-weight: 700;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.work-title-input,
.work-variant-count {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 8px;
  font: inherit;
}

.asm-legacy {
  margin-top: 16px;
}

.asm-mode-cards {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
}

.asm-mode-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #9a8f7a;
  background: #f7f4ec;
  cursor: pointer;
  color: var(--ink);
}

.asm-mode-card:has(input:checked) {
  border-color: #3d5a3d;
  background: #eef5ee;
  box-shadow: inset 3px 0 0 #3d5a3d;
}

.asm-mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.asm-mode-card-title {
  font-weight: 700;
  font-size: 1.02rem;
}

.asm-mode-card-sub {
  font-size: 0.92rem;
  line-height: 1.35;
  color: #4a4336;
}

.asm-cap-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  min-width: 0;
}

.auto-check-badge {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 2px 7px;
  border: 1px solid #8a9a8a;
  white-space: nowrap;
}

.auto-check-badge--ok {
  border-color: #5a7a5a;
  color: #243824;
  background: #e8f0e8;
}

.auto-check-badge--teacher {
  border-color: #9a8a6a;
  color: #4a3c20;
  background: #f3ebe0;
}

.tech-access-gate {
  margin-top: 28px;
  max-width: 36rem;
  color: #5a5346;
  font-size: 0.9rem;
}

.tech-access-gate summary {
  cursor: pointer;
}

.student-link-base-box {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border: 1px solid #9a8f7a;
  background: #f4f0e6;
}

.student-link-base-title {
  margin: 0 0 6px;
  font-weight: 600;
}

.student-link-base-input {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 28rem;
  font: inherit;
  padding: 8px 10px;
  box-sizing: border-box;
}

.assign-panel {
  margin-top: 16px;
}

.assign-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #9a8f7a;
  background: #f4f0e6;
  color: #2a2418;
  font-size: 0.95rem;
  line-height: 1.35;
}

.student-link-box {
  margin: 10px 0 14px;
}

.student-link-field {
  display: block;
  width: 100%;
  max-width: 720px;
  font: inherit;
  padding: 8px 10px;
  box-sizing: border-box;
}

.teacher-profile-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
}

.teacher-profile-label input.teacher-access-code {
  display: block;
  min-width: 140px;
  font: inherit;
  padding: 6px 8px;
  margin-top: 4px;
}

.assign-issued-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.assign-issued-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-panel {
  margin-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 12px;
}

.check-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.check-item {
  margin: 14px 0;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.check-item-label {
  font-weight: 600;
}

.check-prompt {
  white-space: pre-wrap;
  margin: 6px 0;
}

.check-answer-input,
.check-notes {
  display: block;
  width: 100%;
  max-width: 560px;
  font: inherit;
  padding: 8px;
  margin: 6px 0;
}

.check-auto-ok {
  color: #1b5e20;
}

.check-auto-fail {
  color: #8b1a1a;
}

.check-auto-teacher {
  color: #6a4c00;
}

.check-verdict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.check-verdict-done {
  margin-top: 10px;
  font-weight: 600;
}

.assign-kind-row,
.assign-mode-row,
.assign-quick-row,
.assign-actions-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  align-items: center;
}

.assign-select,
.assign-paste,
.assign-quick-row input {
  font: inherit;
  padding: 8px;
  min-width: 180px;
}

.assign-paste {
  width: 100%;
  max-width: 560px;
  display: block;
  margin: 8px 0;
}

.assign-plan-table {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assign-plan-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
}

.assign-plan-row input {
  width: 72px;
  font: inherit;
  padding: 6px;
}

.assign-roster-tools {
  margin-top: 16px;
}

.assign-roster-dir {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ccc);
  background: var(--panel-soft, #f7f5f1);
}

.assign-roster-ok {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #6a8f6a;
  background: #eef6ee;
  font-weight: 600;
}

.assign-roster-subh {
  margin: 12px 0 6px;
  font-size: 0.95rem;
}

.assign-student-list,
.assign-group-list,
.assign-group-members {
  margin: 0 0 8px;
  padding-left: 0;
  list-style: none;
}

.assign-student-list li,
.assign-group-list > li {
  margin: 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.assign-group-members {
  width: 100%;
  padding-left: 1rem;
  margin-top: 4px;
  list-style: disc;
}

.assign-pick-active {
  outline: 2px solid var(--ink, #222);
  font-weight: 700;
}

.assign-recipient-block {
  margin: 16px 0;
}

.assign-recipient-summary {
  margin: 8px 0;
  font-weight: 600;
}

.assign-preview-table {
  width: 100%;
  max-width: 640px;
  border-collapse: collapse;
  margin: 10px 0;
  font: inherit;
}

.assign-preview-table th,
.assign-preview-table td {
  border: 1px solid var(--line, #ccc);
  padding: 6px 8px;
  text-align: left;
}

.assign-roster-add {
  margin-top: 12px;
}

.assign-roster-paste {
  margin-top: 10px;
}

.results-panel {
  margin-top: 8px;
}

.results-counts {
  font-weight: 600;
  margin: 8px 0 12px;
}

.results-summary-table {
  width: 100%;
  border-collapse: collapse;
  font: inherit;
  margin: 8px 0 12px;
  overflow-x: auto;
  display: block;
}

.results-summary-table thead,
.results-summary-table tbody,
.results-summary-table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.results-summary-table th,
.results-summary-table td {
  border: 1px solid var(--line, #ccc);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
}

.results-row-attention {
  background: #f8efe0;
}

.results-row-pending {
  background: #f4f4f4;
}

.asm-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 14px;
}

.asm-manual-bank {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.asm-manual-cap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.asm-manual-preview {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line, #ccc);
  background: #fff;
}

.asm-manual-prompt {
  white-space: pre-wrap;
  margin: 8px 0;
}

.asm-manual-picks {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.asm-manual-picks li {
  margin: 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.work-compose-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  margin: 6px 0;
}

.work-compose-edit-label {
  min-width: 0;
  line-height: 1.35;
  word-break: break-word;
}

.work-compose-edit-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 2px solid var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.brand-name {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 26px;
  letter-spacing: 0.08em;
}

.brand-affiliation {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted, #555);
}

.examiner-home,
.examiner-sub {
  max-width: 720px;
}

.work-stage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.work-stage-tab.work-stage-active {
  outline: 2px solid var(--ink);
  font-weight: 700;
}

.work-stage-hint {
  margin: 0 0 12px;
}

.work-stage-body {
  margin-top: 12px;
}

.work-compose-body {
  padding: 12px 14px;
  border: 1px solid var(--line, #ccc);
  background: var(--panel-soft, #f7f5f1);
}

.work-compose-lead {
  margin: 0 0 12px;
  font-weight: 600;
}

.work-compose-h {
  margin: 14px 0 6px;
  font-size: 1rem;
}

.work-compose-slots,
.work-compose-variants,
.work-compose-items {
  margin: 0 0 8px;
  padding-left: 1.25rem;
}

.work-compose-active-variant {
  font-weight: 700;
}

.tech-archive {
  margin-top: 20px;
}

.tech-archive summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}

.examiner-lead {
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 18px;
  color: var(--ink);
}

.examiner-auth {
  margin: 0 0 20px;
  padding: 14px 16px;
}

.examiner-auth-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.examiner-session-ok {
  margin: 0;
  font-weight: 600;
}

.examiner-actions .choice-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.examiner-gate-note {
  margin-top: 14px;
}

.teacher-profile-status {
  margin: 0;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 700;
}

.brand-place,
.role-label {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.brand-place {
  max-width: 42em;
}

.role-label {
  flex-shrink: 0;
  text-align: right;
  max-width: 160px;
}

.crumbs {
  margin: 18px 0 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.crumbs button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--wine);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
}

.crumbs .current {
  color: var(--ink);
}

.screen {
  min-height: 420px;
  margin-top: 28px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--wine);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
}

.lead {
  max-width: 42em;
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.choice-list {
  display: grid;
  gap: 14px;
}

.choice {
  display: block;
  position: relative;
  width: 100%;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--btn-face);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transform: translateY(0);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.choice-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 8px;
  border: 1px solid var(--wine);
  color: var(--wine-deep);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--wine);
  outline: 2px solid rgba(122, 46, 58, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(36, 28, 24, 0.14);
}

.choice:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
  box-shadow: inset 0 2px 4px var(--btn-edge);
}

@media (prefers-reduced-motion: reduce) {
  .choice,
  .topic-row,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    transition: none;
  }

  .choice:hover,
  .choice:focus-visible,
  .topic-row:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}

.choice h2 {
  margin: 0 0 6px;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.choice p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.topic-search {
  display: block;
  margin: 0 0 16px;
}

.topic-search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

.topic-search input {
  width: 100%;
  max-width: 28rem;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  font: inherit;
}

.topic-search input:focus-visible {
  outline: 2px solid rgba(122, 46, 58, 0.25);
  border-color: var(--wine);
}

.topic-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.topic-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.topic-row:hover,
.topic-row:focus-visible {
  background: var(--btn-face);
  border-color: var(--rule);
  box-shadow: 0 4px 0 var(--btn-edge);
  outline: none;
  transform: translateY(-1px);
}

.topic-row:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px var(--btn-edge);
}

.topic-row-title {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

.topic-row-status {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: right;
}

.topic-row-status.is-connected {
  color: var(--wine-deep);
}

.topic-empty {
  margin: 16px 0 0;
  color: var(--ink-soft);
}

.sources-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 14px;
}

.workspace-head {
  margin-bottom: 22px;
}

.versions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  min-height: 0;
  padding: 22px;
  border: 1px solid var(--rule);
  background: var(--cream);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.panel p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.panel.student {
  background: var(--paper-deep);
}

.banner {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--wine);
  background: #fff6f4;
  color: var(--wine-deep);
  font-size: 14px;
  line-height: 1.4;
}

.banner-muted {
  border-color: var(--rule);
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.source-card {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  background: var(--cream);
}

.source-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0;
}

.facts dt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.facts dd {
  margin: 2px 0 0;
  font-size: 15px;
}

.scope {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.stats-single {
  grid-template-columns: 1fr;
  max-width: 280px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--cream);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-n {
  display: block;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 28px;
}

.stat-l {
  color: var(--ink-soft);
  font-size: 13px;
}

.next-stage {
  margin-bottom: 14px;
}

.checklist,
#skills-list {
  margin: 8px 0 10px;
  padding-left: 1.2em;
  color: var(--ink);
  line-height: 1.45;
}

.note {
  margin-top: 8px !important;
  font-size: 13px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-block;
  padding: 11px 16px;
  border: 1px solid var(--wine);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--btn-face-primary);
  color: #fffaf2;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-secondary {
  background: var(--btn-face);
  color: var(--wine-deep);
  border-color: var(--rule);
}

.btn-danger {
  background: var(--btn-face);
  color: var(--wine-deep);
  border-color: var(--wine);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
  box-shadow: inset 0 2px 4px var(--btn-edge);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.draft-create p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.assembly-form {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, var(--wine) 8%);
}

.assembly-form h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.asm-mode-row,
.asm-opts,
.asm-actions,
.asm-session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin: 12px 0;
}

.asm-radio,
.asm-check,
.asm-field,
.asm-count-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 0.98rem;
}

.asm-counts {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}

.asm-count-row {
  justify-content: space-between;
  max-width: 520px;
  align-items: flex-start;
}

.asm-count-row .asm-cap-meta {
  flex: 1;
  min-width: 0;
}

.asm-count-row input,
.asm-n {
  width: 4.5rem;
  padding: 6px 8px;
  font-size: 1rem;
}

.asm-session-bar {
  margin: 8px 0 14px;
}

.ctor-pick-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ctor-pick-item {
  text-align: left;
  justify-content: flex-start;
  width: 100%;
}

.assign-students {
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px dashed var(--rule);
  border-radius: 6px;
}

.assign-students summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.draft-error {
  color: var(--wine-deep) !important;
}

.draft-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.ctor-start-row {
  margin: 12px 0 16px;
}

.ctor-start-row .btn-primary {
  font-size: 16px;
  padding: 12px 18px;
}

.ctor-topic-line {
  margin: 0 0 12px !important;
  font-size: 15px;
  color: var(--ink-soft);
}

.ctor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 800px) {
  .ctor-layout {
    grid-template-columns: 1fr;
  }
}

.ctor-card,
.ctor-done {
  padding: 16px;
  border: 1px solid var(--rule);
  background: #fff;
}

.ctor-card-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.ctor-step {
  margin: 0;
  font-size: 13px;
  color: var(--wine-deep);
  font-weight: 600;
}

.ctor-cap {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.ctor-prompt,
.ctor-answer {
  margin-top: 14px;
}

.ctor-prompt-text,
.ctor-answer-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.ctor-answer {
  padding: 10px 12px;
  background: var(--paper-deep);
  border-left: 3px solid var(--wine);
}

.ctor-actions,
.ctor-global-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.my-kit {
  padding: 12px;
  border: 1px solid var(--rule);
  background: var(--cream);
  position: sticky;
  top: 12px;
}

.my-kit h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.my-kit-hint {
  margin: 0 0 8px !important;
  font-size: 12px !important;
}

.my-kit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-kit-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}

.my-kit-list li:first-child {
  border-top: 0;
}

.my-kit-list li.is-active .btn-kit-open {
  font-weight: 600;
  color: var(--wine-deep);
}

.btn-kit-open {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-kit-open:hover {
  color: var(--wine-deep);
}

.btn-kit-replace,
.btn-kit-remove {
  flex-shrink: 0;
  border: 0;
  background: none;
  color: var(--wine-deep);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}

.btn-kit-replace:disabled,
.btn-kit-remove:disabled {
  opacity: 0.45;
  cursor: default;
}

.ctor-review-banner {
  margin: 0 0 10px !important;
}

.draft-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mark {
  padding: 4px 8px;
  border: 1px solid var(--wine);
  color: var(--wine-deep);
  font-size: 12px;
}

.mark-no-student {
  border-color: var(--rule);
  color: var(--ink-soft);
}

.draft-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}

.draft-title-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 220px;
  font-size: 13px;
  color: var(--ink-soft);
}

.draft-title-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.draft-meta {
  margin: 0 0 16px !important;
  font-size: 13px;
}

.draft-item {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--rule);
  background: #fff;
}

.draft-item.is-excluded {
  background: var(--paper-deep);
  opacity: 0.9;
}

.draft-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.draft-item-head h3 {
  margin: 0;
  font-size: 18px;
}

.review-status {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.review-status.is-warn {
  color: var(--wine-deep);
  font-weight: 600;
}

.item-type-line {
  margin: 0 0 4px;
  color: var(--wine-deep);
  font-size: 13px;
  font-weight: 600;
}

.skill-line {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.field {
  display: block;
  margin: 0 0 10px;
}

.field span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.notation-box {
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed var(--rule);
  background: #fff;
}

.notation-cap,
.notation-ver {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.notation-img {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--rule);
}

.notation-fail {
  color: var(--wine-deep);
}

.provenance {
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

.provenance summary {
  cursor: pointer;
  color: var(--wine-deep);
  font-size: 14px;
}

.service-details {
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px dashed var(--rule);
  background: var(--paper-deep);
}

.service-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
}

.service-subhead {
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.assignment-card {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--rule);
  background: var(--cream);
}

.assignment-card h3,
.draft-summary h3,
.draft-list-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.assign-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.assign-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

.assign-grid input {
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.draft-summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: #fff;
}

.summary-list {
  margin: 6px 0 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.draft-list-card {
  margin: 0 0 16px;
  padding: 12px 0;
}

.draft-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.draft-list-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.draft-list-row:hover,
.draft-list-row:focus-visible {
  background: var(--btn-face);
  border-color: var(--rule);
  box-shadow: 0 3px 0 var(--btn-edge);
  outline: none;
}

.draft-list-row:active {
  box-shadow: inset 0 2px 3px var(--btn-edge);
}

.dl-title {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
}

.dl-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .assign-grid {
    grid-template-columns: 1fr;
  }
}

.prov-list {
  margin: 10px 0 0;
}

.prov-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.prov-row dt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.prov-row dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.replace-locked {
  font-size: 13px;
  color: var(--ink-soft);
}

.excluded-note {
  margin: 0 0 10px;
  color: var(--ink-soft);
}

.colophon {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 13px;
}

.error {
  padding: 20px;
  border: 1px solid var(--wine);
  background: #fff6f4;
}

@media (max-width: 800px) {
  .masthead,
  .versions,
  .facts,
  .stats {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topic-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .topic-row-status {
    text-align: left;
  }

  .masthead {
    display: grid;
  }

  .role-label {
    text-align: left;
  }

  h1 {
    font-size: 28px;
  }
}
