.workflow-main {
  display: grid;
  gap: 22px;
}

.workflow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 36px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(242, 184, 75, 0.24), transparent 22rem),
    linear-gradient(145deg, #111827, #304e7b);
  box-shadow: var(--shadow);
}

.workflow-hero h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.workflow-hero p:not(.eyebrow) {
  max-width: 800px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.workflow-status {
  display: grid;
  gap: 12px;
}

.workflow-status div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.1);
}

.workflow-status span,
.workflow-status strong {
  display: block;
}

.workflow-status span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.workflow-status strong {
  margin-top: 8px;
  font-size: 28px;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.lab-panel {
  min-height: 100%;
}

.lab-textarea {
  min-height: 250px;
  line-height: 1.85;
}

.lab-steps {
  display: grid;
  gap: 12px;
}

.lab-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(23, 32, 51, 0.09);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.54);
}

.lab-step span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  background: rgba(16, 32, 28, 0.08);
}

.lab-step strong {
  display: block;
  margin-bottom: 5px;
}

.lab-step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.lab-step.active {
  border-color: rgba(217, 130, 43, 0.4);
  background: rgba(242, 184, 75, 0.13);
  box-shadow: 0 14px 28px rgba(217, 130, 43, 0.11);
}

.lab-step.active span {
  color: #241606;
  background: linear-gradient(145deg, #f6c86f, #d9822b);
}

.lab-step.done span {
  color: #fff;
  background: var(--blue);
}

.lab-step.fail {
  border-color: rgba(199, 95, 75, 0.35);
  background: rgba(199, 95, 75, 0.09);
}

.lab-step.fail span {
  color: #fff;
  background: var(--red);
}

.lab-json {
  min-height: 360px;
  max-height: 520px;
}

.teacher-strip {
  display: grid;
  gap: 12px;
}

.teacher-pill {
  padding: 15px;
  border: 1px solid rgba(23, 32, 51, 0.09);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.58);
}

.teacher-pill strong,
.teacher-pill span {
  display: block;
}

.teacher-pill p {
  margin: 7px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.teacher-pill span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.match-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.match-summary.empty {
  display: block;
  padding: 18px;
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.58);
}

.match-summary div {
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(242, 184, 75, 0.18), transparent 9rem),
    linear-gradient(145deg, #111827, #304e7b);
}

.match-summary span,
.match-summary strong,
.match-summary p {
  display: block;
}

.match-summary span {
  color: rgba(255, 255, 255, 0.63);
  font-size: 12px;
  font-weight: 900;
}

.match-summary strong {
  margin: 8px 0 4px;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.match-summary p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.55;
}

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

.trace-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 26px;
  background: rgba(255, 250, 240, 0.64);
}

.trace-card.rejected {
  background: rgba(255, 250, 240, 0.5);
}

.trace-card header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.trace-card header .trace-state {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: var(--blue);
}

.trace-card.rejected header .trace-state {
  background: var(--red);
}

.trace-card header .truth-badge {
  margin: 0 0 8px 6px;
}

.trace-card h3,
.trace-card h4 {
  margin: 0;
}

.trace-card header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trace-card header > strong {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 22px;
  color: #22170b;
  font-size: 24px;
  background: linear-gradient(145deg, #f6c86f, #d9822b);
}

.trace-card section {
  display: grid;
  gap: 10px;
}

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

.mini-checks div {
  min-height: 100px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(48, 78, 123, 0.08);
}

.mini-checks div.bad {
  background: rgba(199, 95, 75, 0.11);
}

.mini-checks b,
.mini-checks span,
.mini-checks p {
  display: block;
}

.mini-checks span {
  margin: 5px 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.mini-checks .bad span {
  color: var(--red);
}

.mini-checks p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.score-list,
.reason-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.score-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(48, 78, 123, 0.08);
}

.score-list span,
.score-list b,
.score-list em {
  display: block;
}

.score-list b {
  color: var(--amber);
  text-align: right;
}

.score-list em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.reason-list li {
  padding: 10px;
  border-radius: 14px;
  color: var(--red);
  background: rgba(199, 95, 75, 0.09);
}

.trace-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.trace-card footer p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.trace-card footer a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  background: var(--blue);
}

@media (max-width: 1180px) {
  .workflow-hero,
  .lab-grid,
  .match-summary,
  .trace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workflow-hero {
    padding: 22px;
  }

  .trace-card header,
  .trace-card footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mini-checks {
    grid-template-columns: 1fr;
  }
}
