:root {
  --lab-blue: #315efb;
  --lab-blue-dark: #1f3fae;
  --lab-ink: #17213d;
  --lab-muted: #69738b;
  --lab-line: #dfe4f0;
  --lab-soft: #f1f4ff;
  --lab-success: #16825d;
  --lab-warn: #c56a21;
  --lab-danger: #c64756;
}

.evaluation-page {
  background: #f8f9fd;
  color: var(--lab-ink);
}

.evaluation-page .site-header {
  background: rgba(248, 249, 253, .94);
  --ink: var(--lab-ink);
  --muted: var(--lab-muted);
  --line: var(--lab-line);
}

.evaluation-page .brand { color: var(--lab-ink); }
.evaluation-page .brand b { background: var(--lab-blue); color: #fff; }
.evaluation-page .status { color: var(--lab-blue); }
.evaluation-page .status::before { background: #4a6cf7; }
.evaluation-page nav a.active,
.evaluation-page nav a:hover { color: var(--lab-ink); border-color: var(--lab-blue); }
.evaluation-page .language { background: #fff; color: var(--lab-ink); border-color: var(--lab-line); }
.evaluation-page .language i { color: var(--lab-blue); }

.lab-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 76px 28px 110px;
}

.lab-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 70px;
  align-items: end;
  padding-bottom: 55px;
}

.lab-intro .kicker { color: var(--lab-blue); margin-bottom: 18px; }
.lab-intro h1 {
  margin: 0;
  font: 600 clamp(44px, 5.2vw, 72px)/1 Outfit, 'Noto Sans SC', sans-serif;
  letter-spacing: 0;
}
.lab-intro h1 span { color: var(--lab-blue); }
.lab-intro > p {
  margin: 0 0 4px;
  color: var(--lab-muted);
  font-size: 15px;
  line-height: 1.9;
}

.lab-principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--lab-line);
  border-bottom: 1px solid var(--lab-line);
  margin-bottom: 36px;
}

.lab-principles article {
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-content: center;
  gap: 3px 12px;
  padding: 18px 20px;
  border-right: 1px solid var(--lab-line);
}
.lab-principles article:last-child { border-right: 0; }
.lab-principles span { grid-row: 1 / 3; color: var(--lab-blue); font: 500 11px 'DM Mono', monospace; padding-top: 3px; }
.lab-principles b { font: 600 17px Outfit, sans-serif; }
.lab-principles small { color: var(--lab-muted); line-height: 1.4; }
.lab-principles .yield-principle { background: var(--lab-blue); color: #fff; }
.lab-principles .yield-principle span,
.lab-principles .yield-principle small { color: #dbe3ff; }

.lab-tool {
  background: #fff;
  border: 1px solid var(--lab-line);
  border-radius: 6px;
  box-shadow: 0 22px 70px rgba(35, 55, 105, .08);
  overflow: hidden;
}

.lab-steps {
  height: 70px;
  padding: 0 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fbfcff;
  border-bottom: 1px solid var(--lab-line);
}

.lab-steps button {
  position: relative;
  border: 0;
  background: transparent;
  color: #96a0b5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: default;
}
.lab-steps button::after {
  content: '';
  position: absolute;
  left: 50%;
  right: -50%;
  top: 34px;
  height: 1px;
  background: var(--lab-line);
  z-index: 0;
}
.lab-steps button:last-child::after { display: none; }
.lab-steps span,
.lab-steps b { position: relative; z-index: 1; background: #fbfcff; }
.lab-steps span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--lab-line); border-radius: 50%; font: 500 9px 'DM Mono', monospace; }
.lab-steps b { padding-right: 8px; font-size: 12px; font-weight: 600; }
.lab-steps button.active { color: var(--lab-blue); }
.lab-steps button.active span,
.lab-steps button.complete span { background: var(--lab-blue); border-color: var(--lab-blue); color: #fff; }
.lab-steps button.complete { color: var(--lab-ink); }
.lab-steps button.complete::after { background: #91a6ed; }

.lab-stage { padding: 40px 42px 44px; }
.lab-stage[hidden] { display: none; }
.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--lab-line);
}
.stage-heading > div > span {
  display: block;
  color: var(--lab-blue);
  font: 500 10px 'DM Mono', monospace;
  margin-bottom: 9px;
}
.stage-heading h2 { margin: 0; font: 600 25px Outfit, 'Noto Sans SC', sans-serif; }
.quiet-button {
  border: 1px solid var(--lab-line);
  background: #fff;
  color: var(--lab-ink);
  border-radius: 4px;
  min-height: 38px;
  padding: 0 14px;
  font: 600 12px inherit;
  cursor: pointer;
}
.quiet-button:hover { border-color: #a7b4da; color: var(--lab-blue); }

#evaluation-form { padding-top: 30px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.field { display: flex; flex-direction: column; position: relative; }
.field > span:first-child { margin-bottom: 9px; font-weight: 600; font-size: 12px; }
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #ccd4e7;
  border-radius: 4px;
  background: #fff;
  color: var(--lab-ink);
  outline: 0;
  font: 14px 'Noto Sans SC', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.field input,
.field select { height: 48px; padding: 0 14px; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #75819b 50%), linear-gradient(135deg, #75819b 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 38px;
}
.field textarea { min-height: 150px; resize: vertical; padding: 14px 16px 32px; line-height: 1.7; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--lab-blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .08); }
.field small { margin-top: 7px; color: #8590a8; font-size: 10px; line-height: 1.5; }
.project-field { grid-column: 1 / -1; }
.field-top { min-height: 28px; margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field-top > span { font-weight: 600; font-size: 12px; }
.ai-improve {
  height: 28px;
  border: 1px solid #bfcaf0;
  border-radius: 4px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f7f9ff;
  color: var(--lab-blue);
  font: 600 10px 'Noto Sans SC', sans-serif;
  cursor: pointer;
}
.ai-improve:hover { border-color: var(--lab-blue); background: #eef2ff; }
.ai-improve:disabled { color: #8c96ad; border-color: #d7ddea; background: #f5f6f9; cursor: wait; }
.ai-improve i { font-style: normal; font-size: 13px; }
.counter { position: absolute; right: 12px; bottom: 12px; color: #9aa4b7; font: 10px 'DM Mono', monospace; }
.counter b { font-weight: 500; }
.secret-field { position: relative; display: block; }
.secret-field input { padding-right: 66px; }
.secret-field button { position: absolute; right: 7px; top: 7px; height: 34px; border: 0; background: var(--lab-soft); color: var(--lab-blue); border-radius: 3px; padding: 0 10px; font: 600 10px inherit; cursor: pointer; }
.connection-note {
  margin-top: 23px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f5f7ff;
  border-left: 3px solid var(--lab-blue);
}
.privacy-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--lab-success); box-shadow: 0 0 0 4px rgba(22, 130, 93, .09); flex: none; }
.connection-note p { margin: 0; color: var(--lab-muted); font-size: 11px; line-height: 1.7; }
.connection-note strong { color: var(--lab-ink); }
.form-actions,
.protocol-actions,
.report-actions { margin-top: 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
#form-error { margin: 0; color: var(--lab-danger); font-size: 11px; }
.lab-primary {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  padding: 0 17px;
  background: var(--lab-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 32px;
  font: 600 12px inherit;
  cursor: pointer;
}
.lab-primary:hover { background: var(--lab-blue-dark); }
.lab-primary:disabled { background: #bac4dd; cursor: not-allowed; }
.lab-primary b { font-size: 17px; font-weight: 400; }

.protocol-layout {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 32px;
  padding-top: 30px;
}
.protocol-brief { padding: 25px; background: var(--lab-soft); border-radius: 5px; }
.protocol-brief > span,
.criteria-head span { color: var(--lab-blue); font: 500 10px 'DM Mono', monospace; }
.protocol-brief h3 { margin: 12px 0 9px; font: 600 24px Outfit, 'Noto Sans SC', sans-serif; }
.protocol-brief > p { color: var(--lab-muted); line-height: 1.7; min-height: 48px; margin: 0 0 22px; }
.protocol-brief dl,
.recommendation dl { margin: 0; }
.protocol-brief dl div,
.recommendation dl div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-top: 1px solid #dbe1f0; }
.protocol-brief dt,
.recommendation dt { color: var(--lab-muted); font-size: 10px; }
.protocol-brief dd,
.recommendation dd { margin: 0; text-align: right; font: 500 10px 'DM Mono', monospace; overflow-wrap: anywhere; }
.criteria-panel { border: 1px solid var(--lab-line); border-radius: 5px; padding: 24px 26px; }
.criteria-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 17px; border-bottom: 1px solid var(--lab-line); }
.criteria-head small { color: var(--lab-muted); }
#criteria-list { list-style: none; counter-reset: criteria; margin: 0; padding: 0; }
#criteria-list li { counter-increment: criteria; min-height: 56px; display: grid; grid-template-columns: 32px 1fr; align-items: center; border-bottom: 1px solid var(--lab-line); color: #46516c; line-height: 1.5; }
#criteria-list li:last-child { border-bottom: 0; }
#criteria-list li::before { content: counter(criteria, decimal-leading-zero); color: var(--lab-blue); font: 500 9px 'DM Mono', monospace; }
.protocol-actions { border-top: 1px solid var(--lab-line); padding-top: 22px; }
.protocol-actions label { color: var(--lab-muted); font-size: 11px; }
.protocol-actions input { accent-color: var(--lab-blue); vertical-align: middle; }

.run-state { border: 1px solid #cfe2d9; border-radius: 20px; padding: 8px 13px; color: var(--lab-success); font-size: 11px; background: #f5fbf8; display: flex; align-items: center; gap: 8px; }
.run-state i { width: 7px; height: 7px; background: var(--lab-success); border-radius: 50%; animation: pulse 1.3s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.live-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 25px 0 18px;
  border: 1px solid var(--lab-line);
  border-radius: 4px;
}
.live-metrics div { padding: 14px 16px; border-right: 1px solid var(--lab-line); }
.live-metrics div:last-child { border-right: 0; }
.live-metrics span { color: var(--lab-muted); font: 500 8px 'DM Mono', monospace; display: block; margin-bottom: 7px; }
.live-metrics b { font: 600 16px Outfit, sans-serif; }
.terminal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.terminal-panel { min-width: 0; border-radius: 5px; overflow: hidden; background: #10131b; color: #e6eaf3; box-shadow: 0 10px 30px rgba(11, 16, 31, .12); }
.terminal-panel header { height: 42px; background: #191e29; padding: 0 13px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #292f3c; }
.terminal-panel header > div { display: flex; gap: 5px; }
.terminal-panel header i { width: 7px; height: 7px; background: #ff655e; border-radius: 50%; }
.terminal-panel header i:nth-child(2) { background: #ffbd44; }
.terminal-panel header i:nth-child(3) { background: #00ca4e; }
.terminal-panel header span { color: #aeb8cd; font: 500 8px 'DM Mono', monospace; }
.terminal-panel header small { margin-left: auto; max-width: 40%; color: #778199; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 8px 'DM Mono', monospace; }
.terminal-body { height: 430px; overflow: auto; padding: 17px 18px 26px; font: 10px/1.72 'DM Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-color: #3c455a #151923; }
.terminal-line { margin: 0 0 9px; }
.terminal-line.muted { color: #7f899f; }
.terminal-line.command { color: #94a9ff; }
.terminal-line.success { color: #67d6a9; }
.terminal-line.output { color: #dbe1ee; }
.terminal-line.warning { color: #f0b36f; }
.terminal-cursor::after { content: '▋'; color: #6f8cff; animation: blink .8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.run-progress { height: 4px; background: #e7eaf3; margin-top: 18px; overflow: hidden; }
.run-progress i { display: block; width: 0; height: 100%; background: var(--lab-blue); transition: width .4s ease; }
.run-caption { color: var(--lab-muted); font-size: 10px; line-height: 1.6; margin: 11px 0 0; }

.report-id { text-align: right; }
.report-id span { margin: 0 0 5px !important; color: var(--lab-muted) !important; }
.report-id b { font: 500 10px 'DM Mono', monospace; }
.fit-summary { margin-top: 28px; padding: 27px 30px; background: var(--lab-soft); display: grid; grid-template-columns: 160px 1fr; gap: 26px; align-items: center; border-left: 4px solid var(--lab-blue); }
.fit-score { position: relative; }
.fit-score span { display: block; color: var(--lab-blue); font: 500 9px 'DM Mono', monospace; margin-bottom: 3px; }
.fit-score strong { font: 600 68px Outfit, sans-serif; letter-spacing: 0; }
.fit-score small { color: var(--lab-muted); }
.fit-copy > span { color: var(--lab-success); font: 500 9px 'DM Mono', monospace; }
.fit-copy h3 { margin: 7px 0 5px; font: 600 23px Outfit, 'Noto Sans SC', sans-serif; }
.fit-copy p { margin: 0; color: var(--lab-muted); line-height: 1.7; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; border: 1px solid var(--lab-line); }
.score-grid article { min-height: 230px; padding: 23px; border-right: 1px solid var(--lab-line); }
.score-grid article:last-child { border-right: 0; }
.score-grid article > span { color: var(--lab-blue); font: 500 9px 'DM Mono', monospace; }
.score-grid h3 { margin: 34px 0 7px; font: 600 19px Outfit, sans-serif; }
.score-grid strong { font: 600 38px Outfit, sans-serif; }
.score-grid i { display: block; height: 5px; background: #e4e8f2; margin: 14px 0; }
.score-grid i b { display: block; width: 0; height: 100%; background: var(--lab-blue); transition: width .7s ease; }
.score-grid p { margin: 0; color: var(--lab-muted); font-size: 10px; line-height: 1.6; }
.score-grid .yield-score { background: var(--lab-blue); color: #fff; }
.score-grid .yield-score > span,
.score-grid .yield-score p { color: #dbe3ff; }
.score-grid .yield-score i { background: rgba(255, 255, 255, .2); }
.score-grid .yield-score i b { background: #fff; }
.report-detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 18px; }
.criteria-results,
.recommendation { border: 1px solid var(--lab-line); border-radius: 5px; padding: 23px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--lab-line); }
.detail-heading h3 { margin: 0; font: 600 17px Outfit, 'Noto Sans SC', sans-serif; }
.detail-heading span { color: var(--lab-muted); font: 500 8px 'DM Mono', monospace; }
.criterion-result { min-height: 53px; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--lab-line); }
.criterion-result:last-child { border-bottom: 0; }
.criterion-result i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #e8f7f1; color: var(--lab-success); font: normal 600 9px sans-serif; }
.criterion-result.partial i { background: #fff2e5; color: var(--lab-warn); }
.criterion-result span { font-size: 11px; line-height: 1.4; }
.criterion-result b { color: var(--lab-muted); font: 500 9px 'DM Mono', monospace; }
.recommend-model { padding: 20px 0; }
.recommend-model > span { color: var(--lab-blue); font: 500 8px 'DM Mono', monospace; }
.recommend-model h4 { margin: 8px 0 7px; font: 600 24px Outfit, sans-serif; }
.recommend-model p { margin: 0; color: var(--lab-muted); font-size: 11px; line-height: 1.6; }
.recommendation dd.positive { color: var(--lab-success); }
.recommendation dd.negative { color: var(--lab-danger); }
.provider-link { margin-top: 19px; min-height: 43px; padding: 0 13px; display: flex; justify-content: space-between; align-items: center; color: #fff; background: var(--lab-ink); text-decoration: none; border-radius: 4px; font-size: 11px; }
.provider-link b { font-size: 16px; }
.report-actions { border-top: 1px solid var(--lab-line); padding-top: 22px; }

.local-history { margin-top: 80px; display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: end; }
.local-history .kicker { color: var(--lab-blue); margin-bottom: 14px; }
.local-history h2 { margin: 0; font: 600 31px Outfit, 'Noto Sans SC', sans-serif; }
.local-history > p { color: var(--lab-muted); line-height: 1.7; margin: 0; }
#history-list { grid-column: 1 / -1; border-top: 1px solid var(--lab-line); }
.history-empty { color: var(--lab-muted); padding: 28px 0; }
.history-row { min-height: 66px; display: grid; grid-template-columns: 135px 1fr 170px 80px 28px; gap: 14px; align-items: center; border-bottom: 1px solid var(--lab-line); }
.history-row time,
.history-row small { color: var(--lab-muted); font: 500 9px 'DM Mono', monospace; }
.history-row b { font-size: 12px; }
.history-row strong { font: 600 20px Outfit, sans-serif; text-align: right; }
.history-row button { border: 0; background: transparent; color: var(--lab-blue); cursor: pointer; font-size: 17px; }

.evaluation-page footer { border-top: 1px solid var(--lab-line); color: #77829b; }
.evaluation-page footer .brand { color: var(--lab-ink); }

@media (max-width: 900px) {
  .lab-intro { grid-template-columns: 1fr; gap: 24px; }
  .lab-principles { grid-template-columns: 1fr 1fr; }
  .lab-principles article:nth-child(2) { border-right: 0; }
  .lab-principles article:nth-child(-n+2) { border-bottom: 1px solid var(--lab-line); }
  .terminal-grid,
  .protocol-layout,
  .report-detail-grid { grid-template-columns: 1fr; }
  .terminal-body { height: 350px; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .score-grid article:nth-child(2) { border-right: 0; }
  .score-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--lab-line); }
}

@media (max-width: 760px) {
  .evaluation-page .site-header { height: 108px; align-items: flex-start; padding-top: 14px; }
  .evaluation-page .site-header nav { display: flex; position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 52px; padding: 0 14px; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--lab-line); z-index: 40; justify-content: space-around; gap: 0; }
  .evaluation-page .site-header nav a { height: 100%; padding: 0 9px; font-size: 11px; }
  .lab-main { padding: 52px 18px 80px; }
  .lab-intro h1 { font-size: 43px; }
  .lab-principles article { padding: 14px 12px; min-height: 82px; grid-template-columns: 26px 1fr; }
  .lab-principles small { font-size: 9px; }
  .lab-tool { margin-left: -6px; margin-right: -6px; }
  .lab-steps { height: 62px; padding: 0 7px; }
  .lab-steps button { gap: 4px; }
  .lab-steps b { display: none; }
  .lab-steps span { background: #fbfcff; }
  .lab-stage { padding: 28px 17px 32px; }
  .stage-heading { align-items: flex-start; }
  .stage-heading h2 { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; gap: 19px; }
  .project-field { grid-column: auto; max-width: none; }
  .form-actions,
  .protocol-actions { align-items: stretch; flex-direction: column; }
  .form-actions .lab-primary,
  .protocol-actions .lab-primary { width: 100%; justify-content: space-between; }
  .protocol-brief { padding: 20px; }
  .criteria-panel { padding: 20px; }
  .live-metrics { grid-template-columns: 1fr 1fr; }
  .live-metrics div:nth-child(2) { border-right: 0; }
  .live-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--lab-line); }
  .terminal-body { height: 320px; }
  .fit-summary { grid-template-columns: 1fr; padding: 24px; }
  .score-grid { grid-template-columns: 1fr; }
  .score-grid article { min-height: 195px; border-right: 0; border-bottom: 1px solid var(--lab-line); }
  .score-grid article:last-child { border-bottom: 0; }
  .local-history { grid-template-columns: 1fr; gap: 14px; }
  .history-row { grid-template-columns: 96px 1fr 54px 24px; }
  .history-row small { display: none; }
  .history-row time { font-size: 8px; }
}
