@font-face {
  font-family: "Source Han Sans SC";
  src: url("/assets/fonts/SourceHanSansSC-VF.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --font-sans: "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
}

body {
  overflow: hidden;
}

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

code,
pre,
kbd,
samp {
  font-family: var(--font-sans);
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(46, 95, 135, 0.24);
  outline-offset: 2px;
}

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

.topbar {
  display: grid;
  align-items: center;
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-name {
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 3px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.role-option {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}

.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.service-state.is-error i {
  background: var(--red);
}

.workspace {
  height: calc(100vh - var(--topbar-height));
  display: grid;
}

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.sidebar h2,
.modal h2 {
  margin: 2px 0 0;
  line-height: 1.25;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}

.filter-row {
  display: flex;
}

.filter-chip {
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.requirement-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.requirement-item {
  width: 100%;
  display: block;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.requirement-item-top,
.requirement-item-meta,
.detail-heading-row,
.meta-row,
.action-row,
.review-meta,
.progress-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.requirement-item-top {
  justify-content: space-between;
}

.requirement-item-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirement-item-summary {
  height: 34px;
  margin: 7px 0 9px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 17px;
}

.requirement-item-meta {
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 10px;
}

.status-dot {
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
}

.status-dot.pending_review {
  background: var(--amber);
}

.status-dot.approved {
  background: var(--green);
}

.status-dot.changes_requested {
  background: var(--red);
}

.sidebar-foot {
  border-top: 1px solid var(--line);
}

.text-action {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.text-action:hover {
  text-decoration: underline;
}

.main-content {
  min-width: 0;
  overflow: hidden;
}

.loading-screen,
.empty-state {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
}

.loading-screen p,
.empty-state p {
  max-width: 480px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overview {
  height: 100%;
  overflow-y: auto;
}

.overview-inner {
  margin: 0 auto;
}

.overview h1,
.empty-state h1 {
  margin: 5px 0 10px;
  line-height: 1.25;
}

.overview-lead {
  margin: 0;
  color: var(--ink-soft);
}

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

.metric {
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
}

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

.detail-layout {
  height: 100%;
  display: grid;
}

.conversation-pane,
.spec-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.conversation-pane {
  border-right: 1px solid var(--line);
}

.detail-head {
  border-bottom: 1px solid var(--line);
}

.detail-heading-row {
  justify-content: space-between;
  align-items: flex-start;
}

.detail-head h1 {
  max-width: 620px;
  margin: 4px 0 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.meta-row {
  flex-wrap: wrap;
  font-size: 11px;
}

.meta-row span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-strong);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge.pending_review {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.approved {
  color: var(--green);
  background: var(--green-soft);
}

.status-badge.changes_requested {
  color: var(--red);
  background: var(--red-soft);
}

.conversation-scroll,
.spec-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.message.student {
  margin-left: auto;
}

.message-label {
  font-weight: 700;
}

.message.student .message-label {
  text-align: right;
}

.message-body {
  border: 1px solid var(--line);
  line-height: 1.7;
  white-space: pre-wrap;
}

.question-impact {
  margin: 4px 0 18px;
  border-left: 3px solid var(--blue);
  font-size: 11px;
  line-height: 1.6;
}

.composer,
.review-box,
.approval-box {
  border-top: 1px solid var(--line);
}

.composer textarea,
.review-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 74px;
  max-height: 190px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

.composer textarea:focus,
.review-box textarea:focus,
.field input:focus,
.field textarea:focus {
  outline: 0;
}

.composer-actions,
.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.composer-hint {
  color: var(--ink-soft);
  font-size: 10px;
}

.action-row {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.spec-head {
  border-bottom: 1px solid var(--line);
}

.progress-meta {
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-meta strong {
  font-size: 13px;
}

.progress-meta span {
  color: var(--ink-soft);
  font-size: 11px;
}

.progress-track {
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
}

.tabs {
  display: flex;
}

.tab-button {
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.spec-scroll {
  padding: 22px 24px 46px;
}

.spec-section {
  border-bottom: 1px solid var(--line);
}

.spec-section:last-child {
  border-bottom: 0;
}

.spec-section h3 {
  margin: 0 0 10px;
}

.spec-section p {
  margin: 0;
  color: #35413e;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

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

.spec-list li {
  position: relative;
  margin: 7px 0;
  padding-left: 15px;
  color: #35413e;
  font-size: 12px;
  line-height: 1.65;
}

.spec-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: 8px;
  left: 0;
}

.two-column-spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.fit-verdict {
  display: grid;
  gap: 12px;
  align-items: start;
}

.fit-verdict.is-caution {
  border-color: #e1c49b;
  background: var(--amber-soft);
}

.fit-symbol {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.fit-verdict.is-caution .fit-symbol {
  background: var(--amber);
}

.fit-verdict strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.fit-verdict p {
  font-size: 11px;
}

.diagram-wrap {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 22px;
}

.diagram-wrap svg {
  max-width: 100%;
  height: auto;
}

.diagram-source {
  margin-top: 12px;
}

.diagram-source summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.diagram-source pre {
  overflow-x: auto;
  padding: 13px;
  border: 1px solid var(--line);
  font: 11px/1.6 var(--font-sans);
  white-space: pre;
}

.review-box h3,
.approval-box h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.review-box p,
.approval-box p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.review-meta {
  margin-bottom: 10px;
}

.review-meta input {
  width: 170px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.notice {
  margin: 0 0 16px;
  padding: 11px 12px;
  border-left: 3px solid var(--amber);
  color: #68431c;
  background: var(--amber-soft);
  font-size: 11px;
  line-height: 1.6;
}

.notice.is-error {
  border-left-color: var(--red);
  color: #762f2b;
  background: var(--red-soft);
}

.notice.is-success {
  border-left-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font-weight: 400;
  line-height: 1.5;
}

.field textarea {
  resize: vertical;
}

.field small {
  color: var(--ink-soft);
  font-weight: 400;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.18s ease-out;
}

.toast.is-error {
  border-left: 4px solid var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 220px 1fr auto;
  }

  .service-state {
    display: none;
  }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .detail-layout {
    grid-template-columns: minmax(370px, 0.95fr) minmax(380px, 1.05fr);
  }

  .two-column-spec {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 840px) {
  body {
    overflow: auto;
  }

  .topbar-actions .button {
    min-height: 34px;
  }

  .brand-subtitle {
    display: none;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 116px);
    display: block;
  }

  .sidebar {
    height: 198px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-head {
    min-height: 64px;
    padding-top: 12px;
  }

  .requirement-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .requirement-item {
    width: 240px;
    flex: 0 0 240px;
  }

  .requirement-item-summary,
  .sidebar-foot {
    display: none;
  }

  .main-content {
    height: auto;
    min-height: calc(100vh - 314px);
  }

  .detail-layout {
    height: auto;
    display: block;
  }

  .conversation-pane {
    min-height: 650px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .spec-pane {
    min-height: 650px;
  }

  .metric-band {
    grid-template-columns: 1fr 1fr;
  }

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

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .overview {
    padding: 26px 18px 40px;
  }

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

  .field-wide {
    grid-column: auto;
  }

  .composer-actions,
  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-row {
    justify-content: stretch;
  }

  .action-row .button {
    flex: 1;
  }

  .modal-backdrop {
    padding: 8px;
  }
}

.quick-composer-actions,
.chat-home-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.teacher-result-overview {
  display: grid;
  gap: 10px;
}

.teacher-result-top {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(220px, 0.92fr);
  gap: 10px;
  align-items: stretch;
}

.result-definition {
  min-width: 0;
  padding: 11px 13px 12px;
  border-left: 3px solid #168368;
  background: #f0f3f1;
}

.result-definition > span {
  display: block;
  margin-bottom: 5px;
  color: #64706d;
  font-size: 9px;
  font-weight: 750;
}

.result-definition > p {
  margin: 0;
  color: #202526;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.teacher-result-top .fit-verdict {
  min-width: 0;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 7px;
}

.teacher-result-top .fit-symbol {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  font-size: 11px;
}

.teacher-result-top .fit-verdict strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.teacher-result-top .fit-verdict p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.result-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}

.result-card {
  min-width: 0;
  padding: 9px 1px 8px;
  border-top: 1px solid #d6d9d7;
}

.result-grid > .result-card + .result-card {
  padding-left: 14px;
  border-left: 1px solid #e0e2e0;
}

.result-card h3,
.result-flow h3,
.result-details h3 {
  margin: 0;
  color: #252a2b;
  font-size: 10px;
  font-weight: 750;
}

.result-card > p {
  margin: 5px 0 0;
  color: #626967;
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.result-card-input h3::before,
.result-card-output h3::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 2px;
  background: #747c79;
  vertical-align: 1px;
}

.result-card-output h3::before {
  background: #168368;
}

.result-list {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
  padding: 0;
  color: #626967;
  font-size: 10px;
  line-height: 1.45;
  list-style: none;
}

.result-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 6px;
  overflow-wrap: anywhere;
}

.result-list li::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: 5px;
  border-radius: 1px;
  background: #168368;
}

.result-flow {
  min-width: 0;
  padding: 9px 0 8px;
  border-top: 1px solid #cdd1ce;
  border-bottom: 1px solid #e1e3e1;
}

.result-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-flow-head span {
  color: #777e7c;
  font-size: 9px;
}

.result-flow ol {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--flow-columns), minmax(0, 1fr));
  gap: 9px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.result-flow li {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #4d5552;
  font-size: 9px;
  line-height: 1.35;
}

.result-flow li:not(:last-child)::after {
  content: "";
  width: 9px;
  height: 1px;
  position: absolute;
  right: -9px;
  top: 50%;
  background: #a9afac;
}

.result-flow li b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c1bd;
  border-radius: 50%;
  color: #14745b;
  background: #f5f8f6;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.result-flow li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-details {
  border-bottom: 1px solid #d9dcda;
}

.result-details > summary {
  padding: 9px 1px;
  color: #5f6764;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.result-details > section {
  padding: 9px 1px;
  border-top: 1px solid #e2e4e2;
}

.result-details > section > p {
  margin: 5px 0 0;
  color: #626967;
  font-size: 10px;
  line-height: 1.55;
}

.student-summary-result {
  padding: 15px 16px 18px;
}

.student-summary-result .student-summary-head {
  padding-bottom: 9px;
  border-bottom: 1px solid #d7dad8;
}

.student-summary-result .student-summary-head h2 {
  margin-top: 3px;
  font-size: 15px;
}

.student-summary-result .result-definition {
  margin-top: 9px;
}

.student-summary-result .student-summary-diagram {
  margin-top: 10px;
}

.student-detail .progress-flow {
  margin-top: 14px;
  padding: 14px 15px;
}

.student-detail .progress-flow ol {
  padding-top: 14px;
}

@media (max-width: 1180px) {
  .teacher-result-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .teacher-result-top {
    grid-template-columns: minmax(0, 1.08fr) minmax(220px, 0.92fr);
  }
}

@media (max-width: 620px) {
  .teacher-result-top,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-grid > .result-card + .result-card {
    padding-left: 1px;
    border-left: 0;
  }

  .result-flow ol {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .result-flow li:not(:last-child)::after {
    width: 1px;
    height: 7px;
    left: 11px;
    right: auto;
    top: 100%;
  }
}

.filter-row {
  flex-wrap: wrap;
  overflow-x: hidden;
}

.admin-panel .section-heading h1 {
  margin: 8px 0 12px;
  color: #17191a;
  font-size: 30px;
  font-weight: 650;
}

.workspace.is-admin-view {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.is-admin-view .main-content {
  width: 100%;
}

.admin-panel .section-heading p:not(.eyebrow) {
  margin: 0;
  color: #656b6b;
  font-size: 13px;
  line-height: 1.7;
}

.admin-create-form input,
.admin-create-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c5c9c6;
  border-radius: 6px;
  color: #202324;
  background: #ffffff;
  font-size: 12px;
}

.admin-create-form .button {
  min-width: 170px;
  grid-column: 1 / -1;
  justify-self: end;
}

.admin-user-table {
  border: 1px solid #d5d8d6;
  border-radius: 8px;
}

.admin-user-table table {
  min-width: 920px;
}

.admin-user-table th,
.admin-user-table td {
  padding: 13px 12px;
  border-bottom-color: #dfe1df;
  vertical-align: top;
}

.admin-user-table th {
  height: 44px;
  font-size: 11px;
  font-weight: 700;
}

.admin-user-table td:first-child input,
.admin-user-table td:nth-child(2) input,
.admin-user-table select {
  min-height: 34px;
  margin: 0 0 6px;
  padding: 6px 9px;
  border: 1px solid #c7cbc8;
  border-radius: 5px;
  color: #2b2f2f;
  background: #ffffff;
  font-size: 12px;
}

.admin-user-table td:first-child input:last-child,
.admin-user-table td:nth-child(2) input:last-child {
  margin-bottom: 0;
}

.admin-user-table .status-toggle {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.admin-user-table .mini-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #c5c9c6;
  border-radius: 5px;
  color: #333737;
  background: #ffffff;
  cursor: pointer;
  font-size: 11px;
}

.admin-user-table .mini-button:hover {
  border-color: #808684;
  background: #f0f1ef;
}

.admin-user-table .mini-button.danger {
  border-color: #e2b7b3;
  color: #a44540;
}

.role-switch {
  border: 1px solid #3a3a3a;
}

.service-state {
  color: rgba(255, 255, 255, 0.68);
}

.topbar .button-secondary {
  border-color: #444;
  color: #f7f7f4;
  background: #1c1c1c;
}

.topbar .button-secondary:hover:not(:disabled) {
  border-color: #72726c;
  background: #292929;
}

.workspace > .sidebar,
.workspace > .main-content {
  min-height: 0;
}

.sidebar h2,
.modal h2 {
  font-size: 18px;
  letter-spacing: -0.1px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 19px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-1px);
}

.filter-chip {
  padding: 0 11px;
}

.requirement-item-title {
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
}

.sidebar-foot {
  padding: 15px 20px;
}

.overview {
  padding: 46px 48px 62px;
}

.overview-inner {
  width: min(1120px, 100%);
}

.overview h1,
.empty-state h1 {
  margin-top: 10px;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 650;
  letter-spacing: -0.8px;
}

.overview-lead {
  max-width: 690px;
  font-size: 15px;
  line-height: 1.8;
}

.metric-band {
  margin-top: 38px;
  border-top: 1px solid #cfcfc8;
  border-bottom: 1px solid #cfcfc8;
}

.metric {
  min-height: 122px;
  padding: 24px 20px;
}

.metric strong {
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 560;
}

.metric span {
  color: #787871;
  font-size: 12px;
}

.overview-actions {
  margin-top: 30px;
}

.question-impact {
  border-left-width: 3px;
  border-radius: 0 10px 10px 0;
}

.composer textarea,
.review-box textarea,
.field input,
.field textarea,
.field select,
.field input[type="number"] {
  border-radius: 11px;
  border-color: #d4d4cd;
  background: #fbfbfa;
}

.composer textarea:focus,
.review-box textarea:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 138, 104, 0.14);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-danger {
  border-radius: 10px;
}

.progress-track {
  border-radius: 99px;
}

.progress-track i {
  border-radius: 99px;
}

.tabs {
  margin-top: 18px;
}

.tab-button {
  font-size: 12px;
}

.spec-scroll {
  padding-bottom: 26px;
}

.spec-section {
  margin: 18px 26px 0;
  padding: 18px 0 0;
  border-top-color: var(--line);
}

.diagram-wrap {
  border: 1px solid #e2e2dc;
}

.approval-box {
  border-top-color: var(--line);
  background: #fff;
}

.approval-box h3,
.review-box h3 {
  font-size: 14px;
}

.modal {
  max-width: 720px;
  border: 1px solid #e2e2dc;
}

.field span,
.field-set legend {
  font-size: 12px;
}

.field small,
.toggle-field small {
  color: #85857d;
}

@media (max-width: 840px) {
  .overview {
    padding: 34px 22px 48px;
  }
}

@media (max-width: 560px) {
  .overview h1,
  .empty-state h1 {
    font-size: 27px;
    letter-spacing: -0.4px;
  }

  .detail-head,
  .conversation-scroll,
  .spec-scroll {
    padding-left: 18px;
    padding-right: 18px;
  }

  .spec-section {
    margin-left: 18px;
    margin-right: 18px;
  }
}

.chat-home {
  min-height: 100%;
  display: flex;
  justify-content: center;
  overflow-y: auto;
}

.chat-home-shell {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.chat-home-header {
  display: flex;
  align-items: flex-start;
}

.assistant-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 17px;
}

.chat-home-header p:not(.eyebrow) {
  max-width: 600px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.chat-home-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-message {
  max-width: 680px;
  border: 1px solid var(--line);
  background: #fff;
}

.home-message-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 750;
}

.home-message p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
}

.starter-chip {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.quick-composer {
  border: 1px solid var(--line-strong);
  background: #fff;
}

.quick-composer textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  padding: 8px 4px;
  color: var(--ink);
  background: transparent;
  line-height: 1.65;
}

.quick-composer textarea:focus {
  outline: 0;
}

.quick-composer-actions,
.chat-home-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quick-composer-actions span {
  color: var(--ink-soft);
  font-size: 11px;
}

.teacher-home .chat-home-shell {
  max-width: 680px;
}

.teacher-home .chat-home-actions {
  justify-content: flex-start;
}

.diagram-wrap.is-interactive {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
}

.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px 0 14px;
  border-bottom: 1px solid var(--line);
}

.diagram-toolbar-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.diagram-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.diagram-tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.diagram-zoom {
  min-width: 38px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.diagram-viewport {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  cursor: grab;
  touch-action: none;
}

.diagram-viewport.is-dragging {
  cursor: grabbing;
}

.diagram-stage {
  width: 100%;
  display: grid;
  place-items: center;
  transform-origin: center center;
  will-change: transform;
}

.diagram-stage .mermaid {
  width: 100%;
  margin: 0;
}

.diagram-stage svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .quick-composer-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-composer-actions .button {
    width: 100%;
  }
}

@media (max-width: 840px) {
  .topbar {
    height: auto;
    min-height: 116px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 40px 40px;
    align-content: center;
    row-gap: 8px;
    padding: 10px 16px;
  }

  .topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }

  .role-switch {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 112px;
    grid-template-rows: 36px 36px;
    row-gap: 8px;
    padding: 10px 16px;
  }

  .brand-name {
    font-size: 16px;
  }

  .topbar-actions {
    min-width: 0;
  }

  .topbar-actions .button {
    max-width: 138px;
    min-height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions .button span {
    color: #f7f7f4;
  }
}

.result-media-showcase {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid #cfd3d0;
  border-radius: 8px;
  background: #f6f7f5;
}

.result-media-head {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-bottom: 1px solid #d8dbd8;
  background: #ffffff;
}

.result-media-head > div {
  min-width: 0;
}

.result-media-head span {
  display: block;
  margin-bottom: 2px;
  color: #168368;
  font-size: 8px;
  font-weight: 750;
}

.result-media-head h3 {
  margin: 0;
  color: #202323;
  font-size: 12px;
  line-height: 1.35;
}

.result-media-head b {
  flex: 0 0 auto;
  color: #69706d;
  font-size: 8px;
  font-weight: 650;
}

.result-media-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) 26px minmax(240px, 1.22fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px 8px;
}

.result-media-frame {
  min-width: 0;
  margin: 0;
}

.result-media-frame figcaption {
  margin-bottom: 5px;
  color: #5d6562;
  font-size: 8px;
  font-weight: 720;
}

.result-media-image {
  position: relative;
  height: 178px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #c6cac7;
  border-radius: 5px;
  background: #e7e8e5;
}

.result-media-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.result-media-frame.is-output .result-media-image {
  background: #dedfdd;
}

.result-media-arrow {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  align-self: center;
  margin-top: 16px;
  border: 1px solid #aeb5b1;
  border-radius: 50%;
  color: #116d55;
  background: #ffffff;
  font-size: 13px;
}

.result-media-data {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 12px;
  border-top: 1px solid #d7dad7;
  border-bottom: 1px solid #d7dad7;
}

.result-media-data > span {
  min-width: 0;
  padding: 7px 8px;
  border-right: 1px solid #d7dad7;
}

.result-media-data > span:last-child {
  border-right: 0;
}

.result-media-data small,
.result-media-data strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-media-data small {
  margin-bottom: 2px;
  color: #7a817e;
  font-size: 7px;
}

.result-media-data strong {
  color: #2b302e;
  font-size: 8px;
  font-weight: 700;
}

.result-media-showcase > p {
  margin: 0;
  padding: 8px 12px 10px;
  color: #5e6663;
  font-size: 9px;
  line-height: 1.55;
}

.result-media-showcase.is-compact .result-media-image {
  height: 154px;
}

@media (max-width: 620px) {
  .result-media-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

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

  .result-media-arrow {
    margin: 0 auto;
    transform: rotate(90deg);
  }

  .result-media-image,
  .result-media-showcase.is-compact .result-media-image {
    height: 220px;
  }

  .result-media-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-media-data > span {
    border-bottom: 1px solid #d7dad7;
  }
}

body.auth-locked > #app,
body.auth-locked > .app-shell {
  visibility: hidden;
  filter: none;
  pointer-events: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.login-screen[hidden] {
  display: none;
}

.login-mark {
  margin-bottom: 18px;
}

.login-form {
  display: grid;
}

.login-card .field {
  display: grid;
  margin: 0;
  font-weight: 650;
  line-height: 1.45;
}

.login-card .field > span {
  font-weight: 650;
  line-height: 1.45;
}

.login-card .field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd7dc;
  font-weight: 400;
  line-height: 1.45;
}

.login-card .field input:focus {
  outline: none;
}

.login-form .button {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin: 0;
  color: #b33a3a;
}

.role-label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #53616d;
  font-size: 13px;
}

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

#newRequirementButton[hidden],
#demoCaseButton[hidden] {
  display: none !important;
}

.progress-flow,
.student-boundary,
.teacher-construction,
.admin-panel {
  margin-top: 18px;
  border: 1px solid var(--line, #dfe6e9);
  border-radius: 12px;
  background: #fff;
}

.progress-flow-head,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.progress-flow-head span,
.section-kicker {
  color: #64727d;
  font-size: 13px;
}

.progress-flow ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  list-style: none;
  padding: 20px 0 0;
  margin: 0;
}

.progress-flow li {
  position: relative;
  display: grid;
  gap: 8px;
  color: #8a969d;
  font-size: 12px;
}

.progress-flow li::before {
  content: "";
  position: absolute;
  left: 10px;
  right: -8px;
  top: 6px;
  height: 1px;
  background: #dce3e6;
}

.progress-flow li:last-child::before {
  display: none;
}

.progress-flow li i {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid #cbd5d9;
  border-radius: 50%;
  background: #fff;
}

.progress-flow li.done,
.progress-flow li.active {
  color: #1f5d4c;
}

.progress-flow li.done i,
.progress-flow li.active i {
  border-color: #1f8a6b;
  background: #1f8a6b;
}

.student-progress-pane {
  min-width: 240px;
}

.student-boundary {
  padding: 18px;
  color: #5f6c78;
  line-height: 1.6;
}

.student-boundary strong {
  display: block;
  margin-bottom: 6px;
  color: #23333d;
}

.teacher-workspace {
  display: grid;
}

.construction-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  margin-top: 18px;
}

.construction-create {
  color: #55646c;
  line-height: 1.6;
}

.inline-build-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.inline-build-form select {
  min-width: 150px;
}

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

.construction-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7edef;
}

.construction-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.construction-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #77858c;
  font-size: 12px;
}

.construction-item b {
  color: #1f8a6b;
  font-size: 13px;
}

.construction-item a {
  color: #1f6d9a;
  font-size: 12px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.admin-create-form .button {
  align-self: stretch;
}

.admin-user-table {
  overflow-x: auto;
}

.admin-user-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-user-table th,
.admin-user-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e6edef;
  text-align: left;
  white-space: nowrap;
}

.admin-user-table td:first-child {
  white-space: normal;
}

.admin-user-table td:first-child input,
.admin-user-table td:nth-child(2) input {
  display: block;
  width: 150px;
  margin: 3px 0;
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

.admin-user-table td:nth-child(2) input {
  width: 130px;
}

.admin-user-table select {
  min-width: 92px;
}

.admin-user-table td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 210px;
}

.status-toggle {
  border: 0;
  background: transparent;
  color: #7b888f;
  cursor: pointer;
}

.status-toggle.is-active {
  color: #1f8a6b;
}

.mini-button.danger {
  color: #b33a3a;
}

.model-job-card {
  margin: 12px 22px 0;
  padding: 13px 14px;
  border: 1px solid #cfe4dc;
  color: #31574b;
}

.model-job-card.is-failed {
  border-color: #edc9c9;
  background: #fff7f7;
  color: #8f3838;
}

.model-job-card.is-cancelled {
  border-color: #d9e0e3;
  background: #f7f9f9;
  color: #65737a;
}

.model-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.model-job-head span {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: #6d7c82;
  font-size: 11px;
}

.model-job-track {
  height: 5px;
  overflow: hidden;
  margin: 10px 0 8px;
  border-radius: 99px;
}

.model-job-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.model-job-card.is-failed .model-job-track i {
  background: #c35b5b;
}

.model-job-card.is-cancelled .model-job-track i {
  background: #9ba8ad;
}

.model-job-card:not(.is-failed):not(.is-cancelled) .model-job-track i {
  animation: model-job-pulse 1.8s ease-in-out infinite;
}

.model-job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6c7b7d;
  font-size: 11px;
  line-height: 1.5;
}

.model-job-meta > span {
  min-width: 0;
}

.model-job-cancel {
  color: #9b4b4b;
}

.selection-loading {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--ink-soft, #65737a);
  font-size: 13px;
}

@keyframes model-job-pulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .model-job-card {
    margin-left: 16px;
    margin-right: 16px;
  }

  .model-job-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 900px) {
  .construction-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-create-form .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .login-card {
    padding: 26px 20px;
  }

  .progress-flow ol {
    grid-template-columns: 1fr 1fr;
    gap: 14px 8px;
  }

  .progress-flow li::before {
    display: none;
  }

  .construction-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .construction-item a {
    grid-column: 1 / -1;
  }

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

  .admin-create-form .button {
    grid-column: auto;
  }
}

.main-content {
  overflow-x: hidden;
  overflow-y: auto;
}

.teacher-workspace {
  min-height: 100%;
  height: auto;
  padding-bottom: 48px;
}

.teacher-workspace > .detail-layout {
  height: min(860px, calc(100vh - var(--topbar-height) - 24px));
  min-height: 560px;
}

.spec-pane .spec-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.student-progress-pane {
  min-height: 0;
  overflow-y: auto;
}

.student-summary {
  margin-top: 18px;
  padding: 20px 18px 22px;
  border: 1px solid var(--line, #e2e2dc);
  border-radius: 12px;
}

.student-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
}

.student-summary-head h2 {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.student-summary-state {
  flex: 0 0 auto;
  color: var(--ink-soft, #6b6b66);
  font-size: 11px;
}

.student-summary-empty {
  margin: 14px 0 0;
  color: var(--ink-soft, #6b6b66);
  font-size: 12px;
  line-height: 1.7;
}

.student-summary-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e2e2dc);
}

.student-summary-section h3 {
  margin: 0 0 7px;
  color: var(--ink, #171717);
  font-size: 12px;
  font-weight: 720;
}

.student-summary-section p {
  margin: 0;
  color: var(--ink-soft, #6b6b66);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.student-summary-section .spec-list {
  margin: 0;
  color: var(--ink-soft, #6b6b66);
  font-size: 12px;
}

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

.student-summary-columns .student-summary-section {
  min-width: 0;
}

.student-summary-diagram .diagram-wrap {
  margin-top: 8px;
}

.student-boundary {
  margin-bottom: 0;
}

@media (max-width: 840px) {
  .main-content {
    overflow: visible;
  }

  .teacher-workspace {
    min-height: 0;
    padding-bottom: 24px;
  }

  .teacher-workspace > .detail-layout {
    height: auto;
    min-height: 0;
  }

  .spec-pane .spec-content {
    overflow: visible;
  }

  .student-progress-pane {
    overflow: visible;
    padding: 0 16px 28px;
  }
}

@media (max-width: 560px) {
  .student-summary-columns {
    grid-template-columns: 1fr;
  }

  .student-summary {
    padding-left: 16px;
    padding-right: 16px;
  }
}

:root {
  --bg: #e9eae8;
  --surface: #ffffff;
  --surface-muted: #f3f4f2;
  --ink: #141617;
  --ink-soft: #656b6b;
  --line: #d7d9d7;
  --line-strong: #b9bcba;
  --graphite: #111315;
  --graphite-soft: #1a1d1f;
  --titanium: #aeb2b4;
  --titanium-bright: #eef0ef;
  --green: #168368;
  --green-dark: #0d6650;
  --green-soft: #e5f1ec;
  --blue: #506f80;
  --blue-soft: #e8eef1;
  --amber: #9a691f;
  --amber-soft: #f5eddf;
  --red: #a84a45;
  --red-soft: #f5e8e6;
  --shadow: 0 24px 70px rgba(13, 16, 17, 0.18);
  --topbar-height: 72px;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
}

* {
  letter-spacing: 0;
}

body {
  background: var(--bg);
}

.topbar {
  height: var(--topbar-height);
  grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid #303336;
  color: #f4f5f4;
  background: linear-gradient(105deg, #0d0f10 0%, #181a1c 48%, #101214 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(13, 15, 16, 0.14);
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  position: relative;
  border: 1px solid #73777a;
  border-radius: 8px;
  color: #111315;
  background: linear-gradient(
    135deg,
    #f2f3f2 0%,
    #8f9497 38%,
    #d8dad9 68%,
    #707579 100%
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    inset 0 -1px rgba(0, 0, 0, 0.28);
  font-size: 0;
}

.brand-mark span {
  width: 13px;
  height: 13px;
  position: relative;
  display: block;
  border: 2px solid #17191a;
  transform: rotate(45deg);
}

.brand-mark span::after {
  content: "";
  width: 3px;
  height: 3px;
  position: absolute;
  inset: 3px;
  margin: auto;
  border-radius: 50%;
  background: #17191a;
}

.brand-name {
  color: #f5f6f5;
  font-size: 15px;
  font-weight: 680;
}

.brand-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #929799;
  font-size: 10px;
}

.brand-module {
  padding-right: 8px;
  border-right: 1px solid #484c4e;
  color: #d8dad9;
  font-weight: 650;
}

.role-switch {
  width: 240px;
  height: 38px;
  padding: 3px;
  border-color: #393d40;
  border-radius: 7px;
  background: #1b1e20;
}

.role-option {
  border-radius: 5px;
  color: #929799;
  font-size: 12px;
}

.role-option.is-active {
  color: #111315;
  background: linear-gradient(180deg, #f0f1f0, #c9cccb);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9);
}

.topbar-actions {
  gap: 12px;
}

.service-state,
.topbar .role-label {
  color: #9da1a3;
}

.service-state i {
  background: #9b762f;
}

.service-state.is-online i {
  background: #45c99a;
  box-shadow: 0 0 0 3px rgba(69, 201, 154, 0.13);
}

.topbar .button,
.topbar .icon-button {
  min-height: 34px;
  border-radius: 6px;
}

.topbar .button-secondary,
.topbar .icon-button {
  border-color: #3b3f42;
  color: #e4e6e5;
  background: #191b1d;
}

.topbar .button-secondary:hover:not(:disabled),
.topbar .icon-button:hover {
  border-color: #777b7e;
  color: #ffffff;
  background: #242729;
}

.workspace {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid #303336;
  color: #eef0ef;
  background: #151719;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.02);
}

.sidebar-head {
  min-height: 98px;
  padding: 20px 18px 14px;
}

.sidebar h2 {
  color: #f2f3f2;
  font-size: 17px;
  font-weight: 650;
}

.sidebar .eyebrow {
  color: #7f8587;
}

.sidebar .icon-button {
  border-color: #424649;
  color: #f2f3f2;
  background: #222527;
}

.sidebar .icon-button:hover {
  border-color: #8f9496;
  color: #ffffff;
  background: #2b2e30;
}

.filter-row {
  gap: 7px;
  padding: 0 18px 14px;
}

.filter-chip {
  min-height: 28px;
  border-color: #34383a;
  border-radius: 6px;
  color: #979c9e;
  background: transparent;
}

.filter-chip:hover {
  border-color: #5b6062;
  color: #e9eae9;
}

.filter-chip.is-active {
  border-color: #d7d9d8;
  color: #151719;
  background: #d7d9d8;
}

.requirement-list {
  padding: 0 11px 16px;
}

.requirement-item {
  margin-bottom: 5px;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #eef0ef;
}

.requirement-item:hover {
  border-color: #35393b;
  background: #1c1f21;
}

.requirement-item.is-active {
  border-color: #484c4f;
  background: #242729;
  box-shadow: inset 3px 0 #d4d7d6;
}

.requirement-item-title {
  color: #f2f3f2;
  font-weight: 650;
}

.requirement-item-summary,
.requirement-item-meta,
.empty-list {
  color: #93999a;
}

.status-dot {
  box-shadow: 0 0 0 3px rgba(80, 111, 128, 0.13);
}

.status-dot.pending_review {
  box-shadow: 0 0 0 3px rgba(154, 105, 31, 0.13);
}

.status-dot.approved {
  box-shadow: 0 0 0 3px rgba(22, 131, 104, 0.14);
}

.sidebar-foot {
  border-top-color: #303336;
  background: #121416;
}

.sidebar .text-action {
  color: #c5c9c8;
}

.main-content {
  background: var(--bg);
}

.detail-layout {
  grid-template-columns: minmax(430px, 0.96fr) minmax(470px, 1.04fr);
}

.conversation-pane,
.spec-pane {
  background: #ffffff;
}

.conversation-pane {
  border-right-color: var(--line);
}

.detail-head {
  min-height: 116px;
  padding: 20px 26px 18px;
  border-bottom-color: var(--line);
  background: #ffffff;
}

.detail-head h1 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 680;
}

.eyebrow {
  color: #7c8282;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.meta-row {
  color: #7b8181;
}

.status-badge {
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid #dce6e2;
  border-radius: 999px;
}

.conversation-scroll {
  padding: 24px 26px 28px;
  background: #f4f5f3;
}

.message {
  width: min(86%, 640px);
  margin-bottom: 20px;
}

.message-label {
  margin-bottom: 7px;
  color: #777d7d;
  font-size: 10px;
}

.message-body {
  padding: 13px 15px;
  border-color: #d8dad8;
  border-radius: 8px 8px 8px 3px;
  color: #252829;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(19, 22, 23, 0.035);
  font-size: 13px;
}

.message.student .message-body {
  border-color: #202325;
  border-radius: 8px 8px 3px 8px;
  color: #f5f6f5;
  background: #202325;
  box-shadow: none;
}

.message.teacher .message-body {
  border-color: #e3c7c3;
  background: #f7ecea;
}

.question-impact {
  padding: 11px 13px;
  border-left-color: #71858f;
  color: #596467;
  background: #e9edef;
}

.composer,
.review-box,
.approval-box {
  padding: 18px 24px;
  border-top-color: var(--line);
  background: #ffffff;
  box-shadow: 0 -8px 26px rgba(17, 20, 21, 0.035);
}

.composer textarea,
.review-box textarea,
.field input,
.field textarea,
.field select,
.admin-create-form input,
.admin-create-form select,
.inline-build-form select {
  border-color: #c9ccca;
  border-radius: 6px;
  color: var(--ink);
  background: #fbfbfa;
}

.composer textarea:focus,
.review-box textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.admin-create-form input:focus,
.admin-create-form select:focus,
.inline-build-form select:focus {
  border-color: #5d7770;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 131, 104, 0.11);
}

.button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 680;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.button-primary {
  border-color: #151719;
  color: #ffffff;
  background: #151719;
}

.button-primary:hover:not(:disabled) {
  border-color: #34383a;
  background: #34383a;
}

.button-secondary {
  border-color: #c8cbc9;
  color: #242728;
  background: #ffffff;
}

.button-secondary:hover:not(:disabled) {
  border-color: #8d9290;
  background: #f1f2f0;
}

.button-danger {
  border-color: #d9a6a1;
  color: #9f403c;
  background: #ffffff;
}

.spec-pane {
  background: #fbfbfa;
}

.spec-head {
  padding: 19px 26px 0;
  border-bottom-color: var(--line);
  background: #ffffff;
}

.progress-track {
  height: 5px;
  background: #e1e3e1;
}

.progress-track i {
  background: #168368;
}

.tabs {
  gap: 26px;
}

.tab-button {
  min-height: 42px;
  color: #747a79;
}

.tab-button.is-active {
  border-bottom-color: #17191a;
  color: #17191a;
}

.spec-scroll,
.spec-content {
  padding: 24px 26px 48px;
}

.spec-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.spec-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom-color: var(--line);
}

.spec-section h3 {
  color: #242728;
  font-size: 12px;
  font-weight: 700;
}

.spec-section p,
.spec-list li {
  color: #545b5a;
}

.spec-list li::before {
  border-radius: 1px;
  background: #168368;
}

.fit-verdict {
  grid-template-columns: auto 1fr;
  padding: 14px;
  border: 1px solid #d5dfdb;
  border-radius: 8px;
  background: #eef3f0;
}

.fit-symbol {
  border-radius: 6px;
  background: #168368;
}

.diagram-wrap {
  min-height: 360px;
  border-color: #d2d5d3;
  border-radius: 8px;
  background: #f4f5f3;
}

.diagram-toolbar {
  min-height: 44px;
  border-bottom-color: #d7d9d7;
  background: #eef0ee;
}

.diagram-tool {
  border-color: #c3c7c4;
  border-radius: 6px;
  background: #fafbfa;
}

.diagram-tool:hover {
  border-color: #697572;
  color: #151719;
  background: #ffffff;
}

.diagram-viewport {
  min-height: 390px;
  background: #f7f8f6;
}

.diagram-source pre {
  border-radius: 6px;
  background: #222527;
  color: #dfe3e1;
}

.notice {
  border-radius: 0 6px 6px 0;
}

.modal-backdrop {
  background: rgba(12, 14, 15, 0.66);
  backdrop-filter: blur(8px);
}

.modal {
  border-color: #65696b;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 22px 24px;
  background: #f4f5f3;
}

.form-stack {
  padding: 24px;
}

.toast {
  border-color: #8f9492;
  border-radius: 7px;
  color: #eef0ef;
  background: #1b1e20;
  box-shadow: 0 16px 40px rgba(13, 16, 17, 0.24);
}

.chat-home {
  padding: 8vh 34px 64px;
  background: #eff0ee;
}

.chat-home-shell {
  width: min(820px, 100%);
  gap: 24px;
}

.chat-home-header {
  gap: 16px;
}

.assistant-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid #8b9092;
  border-radius: 8px;
  color: #151719;
  background: linear-gradient(
    135deg,
    #f2f3f2,
    #929799 46%,
    #d8dad9 72%,
    #767b7e
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.75);
}

.chat-home-header h1 {
  margin: 6px 0 8px;
  color: #151719;
  font-size: 36px;
  font-weight: 650;
  letter-spacing: 0;
}

.home-message {
  padding: 15px 17px;
  border-radius: 8px 8px 8px 3px;
  border-color: #d3d6d3;
  box-shadow: none;
}

.home-message-label {
  color: #168368;
}

.starter-chip {
  border-color: #c6cac7;
  color: #5f6665;
  background: rgba(255, 255, 255, 0.7);
}

.starter-chip:hover {
  border-color: #5d7770;
  color: #244c41;
  background: #edf3f0;
}

.quick-composer {
  padding: 14px;
  border-color: #aeb3b0;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(16, 19, 20, 0.1);
}

.quick-composer textarea {
  min-height: 104px;
  font-size: 14px;
}

.progress-flow,
.student-summary,
.student-boundary {
  border-color: #ced1cf;
  border-radius: 8px;
  box-shadow: none;
}

.student-progress-pane {
  padding: 0 20px 34px;
  background: #e9eae8;
}

.progress-flow {
  padding: 18px;
  background: #f8f9f7;
}

.progress-flow li.done,
.progress-flow li.active {
  color: #145e4b;
}

.progress-flow li.done i,
.progress-flow li.active i {
  border-color: #168368;
  background: #168368;
}

.student-summary {
  background: #ffffff;
}

.student-boundary {
  background: #f1f2f0;
}

.teacher-workspace {
  gap: 20px;
}

.teacher-construction {
  margin: 0 24px;
  padding: 24px;
  border: 1px solid #34383a;
  border-radius: 8px;
  color: #eef0ef;
  background: #151719;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.teacher-construction h2 {
  color: #ffffff;
}

.teacher-construction .eyebrow,
.teacher-construction .section-kicker,
.teacher-construction .construction-create,
.teacher-construction .construction-item span,
.teacher-construction .muted,
.teacher-construction .empty-list {
  color: #979c9e;
}

.construction-grid {
  gap: 24px;
}

.construction-create {
  padding: 0 24px 0 0;
  border-right: 1px solid #34383a;
  border-radius: 0;
  background: transparent;
}

.construction-item {
  border-bottom-color: #303436;
}

.construction-item strong {
  color: #f0f2f1;
}

.construction-item b,
.construction-item a {
  color: #53c49b;
}

.teacher-construction .button-primary {
  border-color: #e3e5e4;
  color: #151719;
  background: #e3e5e4;
}

.teacher-construction select {
  border-color: #484d4f;
  color: #eef0ef;
  background: #222527;
}

.admin-panel {
  margin: 24px;
  padding: 28px;
  border: 1px solid #d1d4d2;
  border-radius: 8px;
  background: #ffffff;
}

.admin-create-form {
  padding: 18px;
  border: 1px solid #d7d9d7;
  border-radius: 8px;
  background: #f4f5f3;
}

.admin-user-table th {
  color: #717776;
  background: #f2f3f1;
}

.model-job-card {
  border-color: #c9d8d2;
  border-radius: 8px;
  background: #edf4f1;
}

.model-job-track {
  background: #d8e5df;
}

.model-job-track i {
  background: #168368;
}

.login-screen {
  padding: 24px;
  background: #0e1011;
}

.login-shell {
  width: min(1160px, 100%);
  height: min(720px, calc(100vh - 48px));
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  overflow: hidden;
  border: 1px solid #414548;
  border-radius: 8px;
  background: #eef0ee;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.42);
}

.login-visual {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 42px 38px;
  overflow: hidden;
  color: #f4f5f4;
  background: linear-gradient(135deg, #111315 0%, #1d2022 58%, #111315 100%);
  box-shadow:
    inset -1px 0 #3c4042,
    inset 0 1px rgba(255, 255, 255, 0.08);
}

.login-visual::after {
  content: "";
  width: 48%;
  height: 1px;
  position: absolute;
  right: -4%;
  top: 28%;
  background: #747a7d;
  transform: rotate(-32deg);
  transform-origin: right center;
  opacity: 0.42;
}

.login-brand,
.login-card-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand > span {
  color: #a9adae;
  font-size: 10px;
  font-weight: 650;
}

.login-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 510px;
  margin: auto 0;
}

.login-visual-copy > p {
  margin: 0 0 20px;
  color: #adb1b2;
  font-size: 11px;
  font-weight: 700;
}

.login-visual-copy h2 {
  margin: 0;
  color: #f6f7f6;
  font-size: 48px;
  font-weight: 590;
  line-height: 1.24;
  letter-spacing: 0;
}

.login-visual-copy > span {
  display: block;
  max-width: 430px;
  margin-top: 24px;
  color: #9da2a3;
  font-size: 14px;
  line-height: 1.8;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid #3c4042;
  list-style: none;
}

.login-flow li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 16px;
  color: #dfe1e0;
}

.login-flow li span {
  color: #717779;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.login-flow li strong {
  font-size: 12px;
  font-weight: 620;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 44px;
  background: #f0f1ef;
}

.login-card {
  width: min(390px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-card-brand {
  margin-bottom: 58px;
  color: #272a2b;
  font-size: 13px;
  font-weight: 680;
}

.login-card-brand .brand-mark {
  width: 34px;
  height: 34px;
}

.login-card .eyebrow {
  color: #6e7474;
}

.login-card h1 {
  margin: 10px 0 12px;
  color: #151719;
  font-size: 32px;
  font-weight: 650;
}

.login-copy {
  margin: 0;
  color: #6a7070;
  font-size: 13px;
  line-height: 1.7;
}

.login-form {
  gap: 17px;
  margin-top: 30px;
}

.login-card .field {
  gap: 8px;
  color: #4e5454;
  font-size: 12px;
}

.login-card .field > span {
  color: #4e5454;
  font-size: 12px;
}

.login-card .field input {
  min-height: 48px;
  padding: 11px 13px;
  border-color: #bdc1bf;
  border-radius: 6px;
  color: #17191a;
  background: #fafbfa;
  font-size: 14px;
}

.login-card .field input:focus {
  border-color: #536c65;
  box-shadow: 0 0 0 3px rgba(22, 131, 104, 0.1);
}

.login-form .button {
  min-height: 48px;
  margin-top: 2px;
  border-color: #151719;
  background: #151719;
}

.login-error {
  min-height: 18px;
  font-size: 12px;
}

.login-foot {
  margin: 24px 0 0;
  color: #858b89;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 236px 1fr auto;
  }

  .brand-subtitle > span:last-child,
  .service-state {
    display: none;
  }

  .brand-module {
    padding-right: 0;
    border-right: 0;
  }

  .workspace {
    grid-template-columns: 272px minmax(0, 1fr);
  }

  .detail-layout {
    grid-template-columns: minmax(390px, 0.95fr) minmax(400px, 1.05fr);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    min-height: 68px;
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
  }

  .topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .role-switch {
    width: 100%;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 116px);
    display: block;
  }

  .sidebar {
    height: 208px;
    border-right: 0;
    border-bottom: 1px solid #303336;
  }

  .sidebar-head {
    min-height: 66px;
    padding-top: 12px;
  }

  .requirement-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .requirement-item {
    width: 258px;
    flex: 0 0 258px;
  }

  .main-content {
    height: auto;
  }

  .detail-layout {
    height: auto;
    display: block;
  }

  .conversation-pane,
  .spec-pane {
    min-height: 640px;
  }

  .conversation-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .teacher-construction {
    margin: 0 16px;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .login-visual {
    padding: 34px;
  }

  .login-visual-copy h2 {
    font-size: 38px;
  }

  .login-panel {
    padding: 34px;
  }
}

@media (max-width: 760px) {
  .login-screen {
    padding: 16px;
    background: #151719;
  }

  .login-shell {
    width: min(500px, 100%);
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 34px);
    padding: 30px 26px;
  }

  .login-card-brand {
    margin-bottom: 46px;
  }
}

@media (max-width: 560px) {
  .topbar-actions #builderLink,
  .topbar-actions .role-label {
    display: none;
  }

  .topbar-actions .button {
    width: auto;
    padding: 0 10px;
    color: #e4e6e5;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .chat-home {
    padding: 32px 16px 44px;
  }

  .chat-home-header h1 {
    font-size: 28px;
  }

  .quick-composer-actions,
  .composer-actions,
  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-head,
  .conversation-scroll,
  .spec-scroll,
  .spec-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer,
  .review-box,
  .approval-box {
    padding-left: 16px;
    padding-right: 16px;
  }

  .teacher-construction {
    padding: 20px 16px;
  }

  .construction-create {
    padding: 0 0 20px;
    border-right: 0;
    border-bottom: 1px solid #34383a;
  }

  .admin-panel {
    margin: 12px;
    padding: 18px 14px;
  }

  .diagram-viewport {
    min-height: 330px;
  }
}
