:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --soft: #eef5f1;
  --ink: #17211d;
  --muted: #66736e;
  --line: #dce5e1;
  --green: #1f729d;
  --green-dark: #0b4a6b;
  --blue: #3f76d3;
  --amber: #9a6700;
  --shadow: 0 14px 34px rgba(20, 45, 35, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.lab-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 14px;
  padding: 14px;
}

.lab-sidebar,
.lab-aside,
.lab-panel,
.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.lab-sidebar,
.lab-aside {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  overflow: auto;
  padding: 16px;
}

.lab-main {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--c-surface-1);
  font-weight: 950;
}

.brand-title { font-weight: 950; }
.brand-subtitle,
.small-muted,
.topbar p,
.section-head p,
small {
  color: var(--muted);
}

.nav-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.nav-link {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 850;
}

.nav-link span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.nav-link.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--c-surface-1);
}

.nav-link.active span:last-child {
  color: rgba(var(--rgb-white-1), .82);
}

.alternative-candidate {
  position: relative;
  align-items: flex-start;
  padding: 8px 10px;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.28;
}

.alternative-candidate > span:first-child {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.28;
  font-weight: 700;
}

.alternative-candidate > span:last-child {
  flex: 0 0 auto;
  font-size: 11px;
}

.alternative-candidate .score,
.alternative-candidate .score-pill,
.alternative-candidate .score-badge {
  font-size: 11.5px;
  padding: 4px 8px;
  min-width: 44px;
}

.alternative-candidate.is-liked-candidate {
  border-color: rgba(var(--rgb-accent-1), .42);
  background: var(--c-surface-2);
}

.alternative-candidate.is-selected-candidate {
  box-shadow: inset 0 0 0 2px rgba(var(--rgb-accent-1), .35);
}

.liked-marker,
.selected-marker {
  display: inline-flex;
  margin: 0 5px 5px 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--c-surface-3);
  color: var(--green-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.selected-marker {
  background: var(--c-accent-1);
  color: var(--c-accent-2);
}

.topbar,
.lab-panel {
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.crumb {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 22px; line-height: 1.2; margin-bottom: 6px; font-weight: 850; }
h2 { font-size: 20px; margin-bottom: 7px; }
h3 { font-size: 15px; margin-bottom: 8px; }

.actions,
.section-head,
.chip-row,
.grid-2 {
  display: flex;
  gap: 10px;
}

.actions,
.chip-row {
  flex-wrap: wrap;
}

.section-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.selected-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.selected-stage3-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.selected-stage3-actions .selected-actions {
  margin-left: 0;
}

.like-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--c-surface-1);
  color: var(--green-dark);
  padding: 8px 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(var(--rgb-good-1), .06);
}

.like-toggle::before {
  content: "♡";
  margin-right: 5px;
}

.like-toggle.is-liked {
  border-color: rgba(var(--rgb-accent-1), .35);
  background: var(--c-surface-3);
}

.like-toggle.is-liked::before {
  content: "♥";
}

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

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

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

.generation-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(130px, 0.7fr));
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--c-good-1);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--c-surface-4), var(--c-surface-1));
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(var(--rgb-accent-2), 0.08);
}

.stage2-generation-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(120px, 0.7fr)) auto;
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--c-good-1);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--c-surface-4), var(--c-surface-1));
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(var(--rgb-accent-2), 0.08);
}

.stage2-generation-panel .btn {
  align-self: center;
  min-height: 48px;
}

.running-text {
  color: var(--green-dark);
}

.live-pulse,
.overview-metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--c-surface-1);
  padding: 12px;
  min-width: 0;
}

.live-pulse {
  display: flex;
  gap: 12px;
  align-items: center;
}

.live-pulse strong,
.overview-metric strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--green-dark);
}

.live-pulse span,
.overview-metric span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pulse-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(var(--rgb-accent-3), 0.14);
  animation: pulseLive 1.4s ease-in-out infinite;
  flex: 0 0 auto;
}

.pulse-dot.tiny {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 5px rgba(var(--rgb-accent-3), 0.12);
  display: inline-block;
  margin-right: 7px;
}

.running-project-list {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 32px;
  align-items: center;
}

.running-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-good-2);
  border-radius: 999px;
  background: var(--c-surface-5);
  color: var(--green-dark);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
}

@keyframes pulseLive {
  0%, 100% { transform: scale(0.92); opacity: 0.82; }
  50% { transform: scale(1.1); opacity: 1; }
}

.mini-card,
.task-card,
.reference-box,
.project-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--c-surface-1);
  padding: 14px;
  min-width: 0;
}

.mini-card.soft {
  background: var(--c-surface-6);
}

.task-card {
  margin-bottom: 10px;
}

.task-card,
.task-card * {
  min-width: 0;
}

.task-card p,
.task-card .small-muted,
.task-card .chip {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.reference-box {
  background: var(--c-surface-6);
  margin-top: 8px;
}

.project-card {
  background: var(--c-surface-1);
}

.project-card.is-running {
  border-color: var(--c-accent-3);
  box-shadow: 0 0 0 2px rgba(var(--rgb-accent-3), 0.16), 0 14px 28px rgba(var(--rgb-accent-2), 0.10);
  background: linear-gradient(180deg, var(--c-surface-1) 0%, var(--c-surface-7) 100%);
}

.running-chip {
  color: var(--c-accent-4);
  background: var(--c-good-3);
  border-color: var(--c-good-4);
  box-shadow: 0 0 0 4px rgba(var(--rgb-accent-3), 0.10);
}

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

.metric-row div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-6);
  padding: 10px;
}

.metric-row strong {
  display: block;
  font-size: 26px;
}

.metric-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.generation-state {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.generation-state div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-6);
  padding: 8px;
}

.generation-state strong,
.generation-state span {
  display: block;
}

.generation-state strong {
  font-size: 16px;
  line-height: 1.1;
}

.generation-state span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.candidate-mini-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.candidate-mini-list div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr) 54px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  font-size: 12px;
}

.candidate-mini-list span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.candidate-mini-list strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 750;
}

.candidate-mini-list em {
  font-style: normal;
  font-weight: 950;
  color: var(--green-dark);
}

.validation-gates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 12px;
}

.aside-module-block {
  margin-top: 14px;
}

.aside-module-block .validation-gates {
  grid-template-columns: 1fr;
}

.aside-module-block .validation-gate {
  padding: 9px;
}

.aside-module-block .validation-gate strong {
  font-size: 13px;
}

.validation-gate {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--c-surface-6);
}

.validation-gate strong,
.validation-gate small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gate-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(var(--rgb-warn-1), .12);
}

.gate-dot.good {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(var(--rgb-accent-4), .13);
}

.gate-dot.blue {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(var(--rgb-accent-5), .13);
}

.validation-run-block {
  margin-top: 22px;
}

.branch-setup-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(180deg, var(--c-surface-1), var(--c-surface-6));
}

.section-head.tight {
  margin-bottom: 12px;
}

.branch-form-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .7fr) repeat(3, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.stage3-target-grid {
  grid-template-columns: minmax(260px, 1.2fr) repeat(2, minmax(170px, .8fr));
}

.branch-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.branch-form-grid input,
.branch-form-grid select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  background: var(--c-surface-1);
}

.fixed-target-field {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  background: var(--c-surface-6);
  color: var(--ink);
  font-weight: 800;
}

.branch-actions {
  margin-top: 12px;
}

.validation-run-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.validation-run-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--c-surface-1);
  padding: 14px;
}

.compact-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.compact-metrics div {
  min-width: 0;
  padding: 10px;
}

.compact-metrics strong,
.compact-metrics span,
.mono-line {
  overflow-wrap: anywhere;
}

.target-validation-card .compact-metrics strong {
  font-size: 14px;
  line-height: 1.25;
}

.target-run-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.target-run-item {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(90px, .8fr);
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.target-run-item span {
  font-weight: 850;
}

.target-run-item strong {
  justify-self: end;
}

.target-run-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.target-result-card {
  padding: 16px;
}

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

.icon-btn.validation-card-remove {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(var(--rgb-ink-1), .14);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-1), .82), rgba(var(--rgb-white-2), .58));
  color: rgba(var(--rgb-ink-1), .62);
  font: 780 20px/1 var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .92), 0 8px 18px rgba(var(--rgb-ink-1), .05);
}

.icon-btn.validation-card-remove:hover {
  color: var(--ink);
  border-color: rgba(var(--rgb-ink-1), .24);
  transform: translateY(-1px);
}

.icon-btn.validation-card-remove:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.target-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.target-result-meta span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
}

.target-result-meta strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.target-result-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.target-result-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(88px, auto) minmax(96px, auto) minmax(220px, 1.2fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--c-surface-1);
}

.target-result-row:first-child {
  border-top: 0;
}

.target-result-row > div:first-child {
  min-width: 0;
}

.target-result-row strong {
  display: block;
  font-size: 15px;
}

.target-result-row span,
.target-result-row p {
  color: var(--muted);
  font-size: 13px;
}

.target-result-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.novelty-match-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.novelty-match-list b {
  color: var(--ink);
  font-size: 12px;
}

.novelty-match {
  display: block;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--c-surface-8);
  color: var(--ink);
  text-decoration: none;
}

.novelty-match:hover {
  border-color: rgba(var(--rgb-accent-6), 0.35);
  background: var(--c-surface-5);
}

.novelty-match strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.novelty-match span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

.novelty-detail-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-9);
}

.novelty-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.novelty-detail-head strong {
  display: block;
  font-size: 18px;
}

.novelty-detail-head .score {
  flex: 0 0 auto;
}

.novelty-interpretation {
  padding: 10px 12px;
  border: 1px solid rgba(var(--rgb-accent-6), 0.18);
  border-radius: 10px;
  background: var(--c-surface-5);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.novelty-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.novelty-kpi-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-1), .82), rgba(var(--rgb-white-3), .66)),
    radial-gradient(circle at 86% 12%, rgba(var(--rgb-ink-1), .045), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .82);
}

.novelty-kpi-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.novelty-kpi-card strong {
  color: var(--ink);
  font-size: clamp(26px, 2.8vw, 42px);
  line-height: 1;
  font-weight: 760;
}

.novelty-kpi-card small {
  color: rgba(var(--rgb-ink-1), .62);
  font-size: 13px;
  line-height: 1.35;
}

.novelty-kpi-card.pass {
  border-color: rgba(var(--rgb-accent-7), .18);
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-4), .88), rgba(var(--rgb-white-5), .68)),
    radial-gradient(circle at 86% 12%, rgba(var(--rgb-accent-7), .08), transparent 34%);
}

.novelty-kpi-card.review {
  border-color: rgba(var(--rgb-warn-2), .22);
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-6), .9), rgba(var(--rgb-warn-3), .72)),
    radial-gradient(circle at 86% 12%, rgba(var(--rgb-warn-2), .1), transparent 34%);
}

.novelty-kpi-card.hold {
  border-color: rgba(var(--rgb-danger-1), .22);
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-7), .9), rgba(var(--rgb-warn-4), .72)),
    radial-gradient(circle at 86% 12%, rgba(var(--rgb-danger-1), .09), transparent 34%);
}

.novelty-detail-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
}

.novelty-detail-section > b {
  color: var(--ink);
  font-size: 13px;
}

.novelty-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.novelty-action-row .btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
}

.novelty-action-row .small-muted {
  min-width: 180px;
  flex: 1 1 220px;
}

.novelty-hit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.candidate-novelty-preview {
  margin-top: 16px;
}

.novelty-detail-grid,
.novelty-query-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.novelty-query-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-8);
  overflow: hidden;
}

.novelty-query-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--green-dark);
  font-weight: 950;
  list-style: none;
}

.novelty-query-details summary::-webkit-details-marker {
  display: none;
}

.novelty-query-grid {
  padding: 0 12px 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.novelty-hit-card,
.novelty-empty {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-8);
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.novelty-hit-card:hover {
  border-color: rgba(var(--rgb-accent-6), 0.4);
  background: var(--c-surface-5);
}

.novelty-hit-card strong {
  font-size: 13px;
  line-height: 1.3;
}

.novelty-hit-card span,
.novelty-hit-card code,
.novelty-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.novelty-hit-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: normal;
}

.novelty-hit-card em {
  color: var(--green-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.muted-value {
  color: var(--muted);
  font-weight: 850;
}

.mono-line {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

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

.project-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.project-form .wide {
  grid-column: 1 / -1;
}

.project-form input,
.project-form select,
.project-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

.project-form textarea {
  min-height: 88px;
}

.template-suggestions {
  margin: 8px 0 12px;
}

.suggestion-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-6);
  padding: 10px;
}

.suggestion-chip {
  min-height: 28px;
  cursor: pointer;
}

.reference-box p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--c-surface-1);
}

.btn.blue {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--c-surface-1);
}

.btn:disabled,
button:disabled {
  opacity: .55;
  cursor: progress;
}

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

.btn.compact {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--green-dark);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  margin: 2px 4px 2px 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.chip.good { background: var(--c-surface-10); color: var(--green-dark); }
.chip.blue { background: var(--c-accent-5); color: var(--c-accent-6); }
.chip.warn { background: var(--c-warn-1); color: var(--amber); }

.metric {
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 100%;
}

.table-footer-actions {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.generation-summary-card {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.generation-summary-card strong {
  line-height: 1.2;
}

.generation-summary-card p {
  min-height: 24px;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.generation-summary-card .chip-row {
  min-height: 30px;
  align-items: center;
}

.generation-summary-card.is-loading {
  opacity: .9;
}

.generation-summary-card.is-loading p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidate-count-chip {
  white-space: nowrap;
  font-weight: 950;
}

.generation-button {
  min-height: 38px;
  white-space: nowrap;
}

.protein-viewer {
  position: relative;
  width: 100%;
  height: 420px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-surface-6), var(--c-surface-11));
  display: block;
  color: var(--muted);
  font-weight: 900;
  overflow: hidden;
}

.protein-viewer > canvas,
.protein-viewer canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 12px;
  z-index: 1;
}

.engine-strip-panel {
  padding: 12px 14px;
}

.engine-strip-panel .section-head {
  margin-bottom: 8px;
}

.engine-strip-panel h2 {
  font-size: 15px;
  margin-bottom: 0;
}

.engine-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.engine-light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
}

.engine-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--c-line-1);
  box-shadow: 0 0 0 3px rgba(var(--rgb-white-8), .12);
}

.engine-dot.good {
  background: var(--c-accent-7);
  box-shadow: 0 0 0 3px rgba(var(--rgb-accent-4), .14), 0 0 10px rgba(var(--rgb-accent-4), .45);
}

.engine-dot.blue {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--rgb-accent-5), .13);
}

.engine-dot.warn {
  background: var(--c-warn-2);
  box-shadow: 0 0 0 3px rgba(var(--rgb-warn-5), .14);
}

.mini-loader {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 3px solid var(--c-surface-12);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-inline p {
  margin: 0;
}

.loading-skeleton {
  min-height: 220px;
}

.skeleton-line {
  width: 100%;
  height: 14px;
  margin: 12px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-surface-13) 0%, var(--c-surface-6) 45%, var(--c-surface-13) 90%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line.short {
  width: 28%;
}

.skeleton-line.title {
  width: 68%;
  height: 24px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

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

.af-sequence-panel {
  background: var(--c-surface-14);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.af-title {
  font-weight: 950;
  border-bottom: 1px solid var(--c-line-2);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.af-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--c-muted-1);
  line-height: 1.5;
}

.af-residue {
  position: relative;
  min-width: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 1px 2px;
  color: var(--c-muted-1);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
}

.af-residue:hover,
.af-residue.selected {
  background: var(--c-warn-3);
  color: var(--c-surface-1);
}

.af-index {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--c-warn-4);
  font-size: 10px;
  font-weight: 800;
}

.af-residue.selected .af-index,
.af-residue:hover .af-index {
  color: var(--c-surface-15);
}

.af-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(360px, 1fr) minmax(220px, 320px);
  gap: 16px;
  align-items: start;
}

.af-pae {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--c-surface-16);
}

.pae-panel {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto 24px;
  align-items: center;
  max-width: 390px;
  padding: 0;
}

.pae-axis {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pae-axis.y {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.pae-axis.x {
  grid-column: 2;
  grid-row: 2;
  text-align: center;
}

.pae-panel .af-pae {
  grid-column: 2;
  grid-row: 1;
}

.pae-legend {
  max-width: 360px;
  margin: 0 0 6px 24px;
}

.pae-gradient {
  display: block;
  height: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--c-accent-8) 0%, var(--c-accent-9) 48%, var(--c-surface-17) 100%);
}

.pae-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-top: 3px;
}

.af-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.af-confidence {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.af-confidence h3 {
  background: var(--c-accent-10);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.af-confidence div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-weight: 800;
}

.conf {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.conf.very-high { background: var(--c-accent-11); }
.conf.high { background: var(--c-accent-12); }
.conf.low { background: var(--c-warn-5); }
.conf.very-low { background: var(--c-warn-6); }

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  background: var(--c-surface-1);
  font-size: 13px;
}

.audit-table {
  min-width: 1080px;
  table-layout: fixed;
}

.audit-table th,
.audit-table td {
  vertical-align: top;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) { width: 118px; }

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) { width: 115px; }

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) { width: 96px; }

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) { width: 210px; }

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) { width: 130px; }

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) { width: 170px; }

.audit-table th:nth-child(7),
.audit-table td:nth-child(7),
.audit-table th:nth-child(8),
.audit-table td:nth-child(8) {
  width: 240px;
  overflow-wrap: anywhere;
}

.muted-mono {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

.admin-mode-link {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.identity-filter-list,
.excluded-list,
.admin-map-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.identity-filter-item,
.excluded-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--c-surface-8);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
}

.identity-filter-item small,
.excluded-item small {
  color: var(--muted);
  font-weight: 700;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-identity-form {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1.4fr) minmax(160px, 1fr) 110px 110px auto auto;
  gap: 10px;
  align-items: end;
}

.admin-identity-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.admin-identity-form input,
.admin-identity-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  min-width: 0;
}

.identity-name-cell {
  min-width: 150px;
}

.identity-name-cell strong {
  display: block;
  color: var(--text);
}

.identity-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.admin-live-map {
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--c-surface-18);
}

.admin-map-list {
  margin-top: 12px;
}

.admin-map-point {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 220px;
  background: var(--c-surface-1);
}

.admin-map-point strong {
  color: var(--text);
}

.admin-map-point span {
  color: var(--muted);
  font-size: 12px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--text);
}

@media (max-width: 1200px) {
  .admin-identity-form {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-login-page {
  min-height: 100vh;
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.admin-login-card h1 {
  margin: 24px 0 8px;
  font-size: 28px;
}

.admin-login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.admin-login-card label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-weight: 800;
}

.admin-login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  font: inherit;
  background: var(--c-surface-1);
}

.compact-brand {
  justify-content: flex-start;
}

.full-width {
  width: 100%;
  margin-top: 18px;
}

.form-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.candidate-table {
  table-layout: fixed;
}

.candidate-table th:nth-child(1),
.candidate-table td:nth-child(1) { width: 44px; }
.candidate-table th:nth-child(2),
.candidate-table td:nth-child(2) { width: 76px; }
.candidate-table th:nth-child(3),
.candidate-table td:nth-child(3) { width: 175px; }
.candidate-table th:nth-child(4),
.candidate-table td:nth-child(4) { width: 112px; }
.candidate-table th:nth-child(5),
.candidate-table td:nth-child(5) { width: 172px; }
.candidate-table th:nth-child(6),
.candidate-table td:nth-child(6) { width: 96px; }
.candidate-table th:nth-child(7),
.candidate-table td:nth-child(7) { width: 112px; }
.candidate-table th:nth-child(8),
.candidate-table td:nth-child(8) { width: 140px; }
.candidate-table th:nth-child(9),
.candidate-table td:nth-child(9) { width: 126px; }
.candidate-table th:nth-child(10),
.candidate-table td:nth-child(10) { width: 106px; }
.candidate-table th:nth-child(11),
.candidate-table td:nth-child(11) { width: 180px; }
.candidate-table th:nth-child(12),
.candidate-table td:nth-child(12) { width: 98px; }

.tox-test-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tox-test-cell .chip {
  width: max-content;
  max-width: 100%;
}

.tox-test-cell small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stage2-readiness-cell {
  display: grid;
  gap: 7px;
  align-items: center;
  justify-items: start;
  min-width: 0;
}

.stage2-readiness-cell small {
  display: none;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.stage2-precision-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 27px;
  padding: 5px 10px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.12);
  border-radius: 999px;
  background: rgba(var(--rgb-white-1), 0.74);
  color: rgba(var(--rgb-ink-2), 0.68);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
  text-align: center;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), 0.72), 0 8px 18px rgba(var(--rgb-ink-3), 0.04);
}

.stage2-readiness-cell .stage2-score-value {
  font-weight: 800;
  font-size: 15px;
}

.stage2-readiness-cell .score-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 4px 11px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.18);
  border-radius: 999px;
  background: rgba(var(--rgb-white-1), 0.92);
  color: rgba(var(--rgb-ink-2), 0.66);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.stage2-readiness-cell .score-detail-btn:hover,
.stage2-readiness-cell .score-detail-btn:focus-visible {
  border-color: rgba(var(--rgb-accent-8), 0.42);
  background: rgba(var(--rgb-white-9), 0.7);
  color: var(--c-accent-13);
  outline: none;
}

/* Stage 4 shortlist 상세 보기 */
.shortlist-detail-row > td {
  background: rgba(var(--rgb-white-10), 0.7);
  padding: 0;
}

.s4-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
  padding: 18px 20px 22px;
}

@media (max-width: 900px) {
  .s4-detail { grid-template-columns: minmax(0, 1fr); }
}

.s4-detail-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(var(--rgb-ink-2), 0.62);
  text-transform: uppercase;
}

.s4-detail-col h4:not(:first-child) { margin-top: 16px; }

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

.s4-score {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.09);
  border-radius: 10px;
  background: rgba(var(--rgb-white-1), 0.86);
}

.s4-score span { font-size: 11px; color: rgba(var(--rgb-ink-2), 0.55); font-weight: 650; }
.s4-score strong { font-size: 15px; font-weight: 800; color: rgba(var(--rgb-ink-2), 0.86); }

.s4-basis { display: flex; flex-direction: column; gap: 7px; }

.s4-basis > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
}

.s4-basis > div > span { color: rgba(var(--rgb-ink-2), 0.5); font-weight: 650; }
.s4-basis > div > strong { font-weight: 750; color: rgba(var(--rgb-ink-2), 0.85); overflow-wrap: anywhere; }

.s4-muts { display: flex; flex-wrap: wrap; gap: 5px; }

.s4-mut {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--rgb-accent-8), 0.1);
  color: var(--c-accent-13);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.s4-explain {
  padding: 12px 14px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.1);
  border-radius: 12px;
  background: rgba(var(--rgb-white-1), 0.9);
}

.s4-explain-text { margin: 0 0 10px; line-height: 1.55; }
.s4-explain-text:not(.small-muted) { color: rgba(var(--rgb-ink-2), 0.86); }

.s4-explain-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.s4-explain-engine { font-size: 11px; }

/* Stage 4 순위 리스트 (상위 20개 선택) */
.s4-rank-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}

.s4-rank-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 196px;
  max-width: 248px;
  padding: 8px 12px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.12);
  border-radius: 12px;
  background: rgba(var(--rgb-white-1), 0.9);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.s4-rank-item:hover { border-color: rgba(var(--rgb-accent-8), 0.4); }

.s4-rank-item.active {
  border-color: rgba(var(--rgb-accent-8), 0.6);
  background: rgba(var(--rgb-white-9), 0.75);
  box-shadow: 0 6px 16px rgba(var(--rgb-ink-3), 0.06);
}

.s4-rank-no {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(var(--rgb-ink-2), 0.08);
  font-weight: 800;
  font-size: 13px;
  color: rgba(var(--rgb-ink-2), 0.7);
}

.s4-rank-item.active .s4-rank-no { background: rgba(var(--rgb-accent-8), 0.16); color: var(--c-accent-13); }

.s4-rank-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.s4-rank-main strong { font-size: 13px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s4-rank-main small { font-size: 11px; color: rgba(var(--rgb-ink-2), 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.s4-rank-score { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 14px; }
.s4-rank-score em { font-style: normal; font-size: 10px; font-weight: 650; color: rgba(var(--rgb-ink-2), 0.45); }

.decision-basis-panel .s4-basis { margin-bottom: 12px; }
.decision-explain { margin-top: 4px; }

/* Longen AI 결과 요약 */
.ai-summary-card {
  padding: 16px 18px;
  border: 1px solid rgba(var(--rgb-ink-2), 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--rgb-white-11), 0.7), rgba(var(--rgb-white-1), 0.9));
}

.ai-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ai-summary-head strong { font-size: 15px; font-weight: 800; }
.ai-summary-engine { font-size: 11px; }

.ai-summary-text {
  margin: 0 0 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-summary-text:not(.small-muted) { color: rgba(var(--rgb-ink-2), 0.88); }
.ai-summary-foot { display: flex; align-items: center; gap: 10px; }

.stage2-precision-chip.is-good {
  border-color: rgba(var(--rgb-accent-8), 0.22);
  background: rgba(var(--rgb-white-9), 0.82);
  color: var(--c-accent-13);
}

.stage2-precision-chip.is-caution,
.stage2-precision-chip.is-warn {
  border-color: rgba(var(--rgb-warn-6), 0.24);
  background: rgba(var(--rgb-warn-3), 0.9);
  color: var(--c-warn-7);
}

.stage2-precision-chip.is-bad {
  border-color: rgba(var(--rgb-danger-2), 0.24);
  background: rgba(var(--rgb-warn-7), 0.9);
  color: var(--c-danger-1);
}

.stage2-precision-chip.is-pending {
  border-color: rgba(var(--rgb-accent-9), 0.22);
  background: rgba(var(--rgb-accent-10), 0.84);
  color: var(--c-accent-14);
}

.stage2-precision-chip.is-muted {
  color: rgba(var(--rgb-ink-2), 0.48);
}

body[data-page="stage2"] .lab-shell,
body[data-page="stage4"] .lab-shell {
  grid-template-columns: 230px minmax(0, 1fr);
}

body[data-page="stage2"] .lab-main,
body[data-page="stage4"] .lab-main {
  min-width: 0;
}

.shortlist-table {
  table-layout: fixed;
  min-width: 1280px;
}

.shortlist-table th:nth-child(1),
.shortlist-table td:nth-child(1) { width: 44px; }
.shortlist-table th:nth-child(2),
.shortlist-table td:nth-child(2) { width: 86px; }
.shortlist-table th:nth-child(3),
.shortlist-table td:nth-child(3) { width: 230px; }
.shortlist-table th:nth-child(4),
.shortlist-table td:nth-child(4) { width: 155px; }
.shortlist-table th:nth-child(5),
.shortlist-table td:nth-child(5) { width: 112px; }
.shortlist-table th:nth-child(6),
.shortlist-table td:nth-child(6) { width: 112px; }
.shortlist-table th:nth-child(7),
.shortlist-table td:nth-child(7) { width: 112px; }
.shortlist-table th:nth-child(8),
.shortlist-table td:nth-child(8) { width: 112px; }
.shortlist-table th:nth-child(9),
.shortlist-table td:nth-child(9) { width: 126px; }
.shortlist-table th:nth-child(10),
.shortlist-table td:nth-child(10) { width: 150px; }
.shortlist-table th:nth-child(11),
.shortlist-table td:nth-child(11) { width: 118px; }

.shortlist-table td {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.shortlist-table .score,
.shortlist-table .decision {
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
}

.shortlist-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  margin-left: 8px;
  overflow: hidden;
  border: 1px solid rgba(var(--rgb-ink-1), .13);
  border-radius: 50%;
  background: rgba(var(--rgb-white-1), .78);
  color: transparent !important;
  font-size: 0 !important;
  font-weight: 760;
  font-style: normal;
  line-height: 0 !important;
  letter-spacing: 0;
  text-decoration: none;
  text-indent: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .78), 0 4px 12px rgba(var(--rgb-ink-1), .06);
  z-index: 2;
}

.help-tip::before {
  content: "i";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(var(--rgb-ink-1), .58);
  font-size: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 820;
  line-height: 1;
  text-indent: 0;
}

.help-tip::after {
  content: none !important;
}

h1 > .help-tip,
h2 > .help-tip,
h3 > .help-tip {
  vertical-align: middle;
  transform: translateY(-0.18em);
}

.help-tip:hover,
.help-tip:focus-visible {
  border-color: rgba(var(--rgb-ink-1), .22);
  background: rgba(var(--rgb-white-1), .92);
  outline: none;
}

.help-tip:hover::before,
.help-tip:focus-visible::before {
  color: var(--ink);
}

.help-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.help-modal.open {
  display: block;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--rgb-ink-4), 0.36);
}

.help-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(900px, calc(100dvw - 40px));
  max-width: calc(100dvw - 40px);
  max-height: min(88dvh, 860px);
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(var(--rgb-white-1), .94), rgba(var(--rgb-white-12), .88)),
    radial-gradient(circle at 18% 0%, rgba(var(--rgb-white-1), .9), transparent 44%);
  padding: 24px;
  box-shadow: 0 22px 56px rgba(var(--rgb-ink-4), 0.22);
}

@media (max-width: 640px) {
  .help-modal-card {
    top: auto;
    bottom: 12px;
    width: calc(100dvw - 28px);
    max-width: calc(100dvw - 28px);
    max-height: calc(100dvh - 44px);
    transform: translateX(-50%);
    padding: 16px;
    border-radius: 22px;
  }

  .help-modal-body {
    gap: 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .help-section {
    padding: 12px;
    border-radius: 16px;
  }
}

.help-modal-card .section-head {
  margin-bottom: 10px;
}

.help-modal-card h2 {
  margin: 0;
}

.help-modal-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  color: rgba(var(--rgb-ink-1), .72);
  line-height: 1.65;
  font-size: 15px;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.help-modal-body p {
  margin: 0;
}

.help-section {
  min-width: 0;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 18px;
  background: rgba(var(--rgb-white-13), .7);
}

.help-section h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
}

.help-list {
  margin: 0;
  padding-left: 18px;
}

.help-list li + li {
  margin-top: 6px;
}

.long-value-card {
  width: min(960px, calc(100vw - 36px));
}

.long-value-card code {
  display: block;
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-6);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.loading-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
}

.loading-modal.open {
  display: block;
}

.loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--rgb-white-14), 0.72);
  backdrop-filter: blur(2px);
}

.loading-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(460px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--c-surface-1);
  padding: 18px;
  box-shadow: 0 24px 60px rgba(var(--rgb-ink-4), 0.18);
}

.loading-card h2,
.loading-card p {
  margin: 0;
}

.loading-card p {
  margin-top: 4px;
  line-height: 1.45;
}

.candidate-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
}

.candidate-viewer-modal.open {
  display: block;
}

.candidate-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--rgb-ink-4), 0.42);
}

.candidate-viewer-card {
  position: absolute;
  inset: 18px;
  overflow: auto;
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--c-surface-1);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(var(--rgb-ink-4), 0.24);
}

.candidate-viewer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.viewer-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--c-surface-6);
  padding: 12px;
  min-width: 0;
}

.viewer-block.wide {
  grid-column: 1 / -1;
}

.viewer-block h3 {
  margin: 0 0 10px;
}

.viewer-block .subsection-title {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.viewer-block code {
  display: block;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  padding: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 120px;
  overflow: auto;
}

#candidate-2d-canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
}

.candidate-2d-svg {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  color: var(--muted);
}

.candidate-2d-svg svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.candidate-3d-viewer,
.candidate-af-viewer {
  width: 100%;
  height: clamp(220px, 30vh, 320px);
  max-height: 320px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  overflow: hidden;
  position: relative;
  contain: layout paint size;
}

.candidate-pdb-card {
  margin-top: 12px;
}

.candidate-pdb-viewer {
  height: clamp(260px, 34vh, 390px);
  max-height: 390px;
}

.candidate-residue-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-6);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.stage3-candidate-residue {
  cursor: pointer;
}

.stage3-support-details {
  padding: 0;
  overflow: hidden;
}

.stage3-support-details summary {
  cursor: pointer;
  padding: 16px 18px;
  color: var(--green-dark);
  font-weight: 950;
  list-style: none;
}

.stage3-support-details summary::-webkit-details-marker {
  display: none;
}

.stage3-support-details summary::after {
  content: "열기";
  float: right;
  color: var(--muted);
  font-size: 12px;
}

.stage3-support-details[open] summary::after {
  content: "접기";
}

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

.stage3-support-grid .wide {
  grid-column: 1 / -1;
}

.target-viewer-body[hidden] {
  display: none;
}

.target-viewer-body {
  display: grid;
  gap: 14px;
}

.stage3-validation-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#candidate-structure-preview,
#candidate-risk-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  align-items: stretch;
}

#candidate-structure-preview .task-card,
#candidate-risk-preview .task-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  justify-content: flex-start;
  min-width: 0;
}

#candidate-structure-preview .task-card .chip,
#candidate-risk-preview .task-card .chip {
  align-self: flex-start;
  margin-top: auto;
}

#candidate-structure-preview .task-card p,
#candidate-risk-preview .task-card p {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

#candidate-structure-preview .task-card p.long-detail {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 6.8em;
  opacity: .86;
}

.metric-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  line-height: 1.35;
}

.metric-stack .score,
.metric-stack .score-button {
  align-self: start;
  justify-self: start;
  margin: 0;
}

.metric-stack + .chip {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.candidate-3d-viewer canvas,
.candidate-af-viewer canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.candidate-af-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1fr);
  gap: 12px;
}

.candidate-af-sequence {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--c-surface-1);
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#candidate-af-pae {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--c-surface-16);
}

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

th {
  color: var(--muted);
  background: var(--c-surface-6);
  font-size: 12px;
  white-space: normal;
  line-height: 1.2;
}

.sequence-cell {
  max-width: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.candidate-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.candidate-cell strong {
  line-height: 1.25;
}

.candidate-cell small {
  display: block;
  line-height: 1.35;
}

.compact-cell {
  max-width: 100%;
  min-width: 0;
}

.compact-cell.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compact-cell.stacked {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 0;
}

.compact-cell.inline code {
  flex: 1 1 auto;
  min-width: 0;
}

.inline-link {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  padding: 2px 0;
  white-space: nowrap;
}

.inline-link:hover {
  text-decoration: underline;
}

.compact-cell summary {
  display: grid;
  align-items: start;
  gap: 2px;
  max-width: 100%;
  cursor: pointer;
  list-style: none;
}

.compact-cell summary::-webkit-details-marker {
  display: none;
}

.compact-cell summary code,
.compact-cell > code {
  display: block;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--c-surface-6);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-cell > code {
  margin-top: 6px;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compact-cell summary span:last-child {
  color: var(--green-dark);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
}

.compact-cell.text summary span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compact-cell.text small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.score,
.decision {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 950;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}

.score {
  border: 1px solid rgba(var(--rgb-ink-1), .12);
  background: rgba(var(--rgb-white-15), .78);
  color: rgba(var(--rgb-ink-1), .86);
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .82);
}
.score-button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.score-button:hover {
  box-shadow: 0 0 0 2px rgba(var(--rgb-accent-5), .16);
}

.metric .score-button {
  font-size: inherit;
  line-height: 1;
}

.score-modal-card {
  max-width: 920px;
}

.score-factor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.score-factor-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 18px;
  background: rgba(var(--rgb-white-1), .68);
}

.score-factor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.score-factor-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  word-break: keep-all;
}

.score-factor-head span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 999px;
  background: rgba(var(--rgb-white-16), .75);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
}

.score-factor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-factor-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 999px;
  color: rgba(var(--rgb-ink-1), .72);
  font-size: 12px;
}

.score-factor-meta em {
  color: var(--muted);
  font-style: normal;
}

.score-factor-meta b {
  font-weight: 760;
}

.score-factor-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: keep-all;
}

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

.compact-score-table {
  max-height: 360px;
  overflow: auto;
}

.compact-score-table table {
  min-width: 680px;
}

.compact-score-table th,
.compact-score-table td {
  font-size: 12px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.score-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 12px 0 8px;
  font-weight: 900;
}

.score-total-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--c-surface-19);
}
.decision { background: var(--c-surface-11); color: var(--green-dark); }
.decision.exploratory_seed { background: var(--c-warn-1); color: var(--amber); }

.fatal-error {
  margin: 14px;
  padding: 14px;
  background: var(--c-surface-20);
  border: 1px solid var(--c-warn-8);
  color: var(--c-danger-2);
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .lab-shell {
    grid-template-columns: 1fr;
  }
  .lab-sidebar,
  .lab-aside {
    position: static;
    height: auto;
  }
  .program-grid,
  .project-grid,
  .project-form,
  .grid-2,
  .generation-overview,
  .stage2-generation-panel,
  .af-workbench,
  .branch-form-grid,
  .validation-run-grid,
  .stage3-support-grid,
  .novelty-detail-grid,
  .novelty-query-grid {
    grid-template-columns: 1fr;
  }
  .stage3-support-grid .wide {
    grid-column: auto;
  }
  .target-result-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .target-result-row > div:nth-child(2),
  .target-result-row > div:nth-child(3) {
    justify-self: start;
  }
  .af-confidence {
    border-left: 0;
    padding-left: 0;
  }
}

/* v1.1 visual refresh: quieter, denser, less "system generated". */
:root {
  --bg: #f6f7f5;
  --panel: rgba(255, 255, 253, .92);
  --soft: #f2f4f1;
  --ink: #101411;
  --muted: #6a716c;
  --line: #e0e5df;
  --green: #1f6a8f;
  --green-dark: #0f674f;
  --blue: #1d4f91;
  --amber: #8a650a;
  --shadow: 0 18px 46px rgba(22, 28, 24, .06);
  --shadow-tight: 0 8px 22px rgba(22, 28, 24, .045);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* ==== 변수화된 색상 팔레트(값 보존) — 역할별로 묶음. 재테마 시 여기만 수정 ==== */
  --rgb-accent-1: 32, 113, 158;
  --rgb-accent-10: 236, 243, 255;
  --rgb-accent-2: 30, 78, 109;
  --rgb-accent-3: 32, 113, 163;
  --rgb-accent-4: 31, 114, 157;
  --rgb-accent-5: 63, 118, 211;
  --rgb-accent-6: 37, 113, 160;
  --rgb-accent-7: 11, 78, 115;
  --rgb-accent-8: 17, 86, 130;
  --rgb-accent-9: 74, 112, 168;
  --rgb-danger-1: 166, 43, 43;
  --rgb-danger-2: 187, 62, 62;
  --rgb-danger-3: 154, 50, 50;
  --rgb-good-1: 20, 45, 35;
  --rgb-ink-1: 16, 20, 17;
  --rgb-ink-2: 17, 24, 20;
  --rgb-ink-3: 20, 30, 24;
  --rgb-ink-4: 18, 31, 27;
  --rgb-warn-1: 154, 103, 0;
  --rgb-warn-10: 190, 104, 39;
  --rgb-warn-11: 255, 236, 220;
  --rgb-warn-12: 255, 225, 225;
  --rgb-warn-13: 255, 249, 232;
  --rgb-warn-14: 157, 111, 20;
  --rgb-warn-2: 183, 132, 23;
  --rgb-warn-3: 255, 248, 226;
  --rgb-warn-4: 255, 235, 235;
  --rgb-warn-5: 217, 144, 0;
  --rgb-warn-6: 173, 119, 10;
  --rgb-warn-7: 255, 239, 236;
  --rgb-warn-8: 180, 138, 36;
  --rgb-warn-9: 255, 247, 224;
  --rgb-white-1: 255, 255, 255;
  --rgb-white-10: 246, 249, 247;
  --rgb-white-11: 240, 248, 244;
  --rgb-white-12: 248, 250, 247;
  --rgb-white-13: 255, 255, 253;
  --rgb-white-14: 248, 251, 249;
  --rgb-white-15: 248, 249, 247;
  --rgb-white-16: 246, 248, 245;
  --rgb-white-17: 242, 245, 241;
  --rgb-white-18: 247, 247, 242;
  --rgb-white-19: 245, 247, 244;
  --rgb-white-2: 247, 249, 247;
  --rgb-white-20: 250, 251, 248;
  --rgb-white-21: 247, 248, 245;
  --rgb-white-22: 240, 250, 244;
  --rgb-white-23: 255, 239, 239;
  --rgb-white-24: 243, 246, 242;
  --rgb-white-25: 247, 249, 248;
  --rgb-white-3: 247, 249, 246;
  --rgb-white-4: 249, 253, 250;
  --rgb-white-5: 239, 249, 244;
  --rgb-white-6: 255, 253, 246;
  --rgb-white-7: 255, 250, 250;
  --rgb-white-8: 154, 165, 160;
  --rgb-white-9: 231, 248, 240;
  --c-accent-1: #eaf2ff;
  --c-accent-10: #bcd8f2;
  --c-accent-11: #0d4fd7;
  --c-accent-12: #5ec4ea;
  --c-accent-13: #0d4a6f;
  --c-accent-14: #375f9a;
  --c-accent-15: #171f2a;
  --c-accent-16: #25364a;
  --c-accent-17: #0b4a6b;
  --c-accent-2: #275fb8;
  --c-accent-3: #689ec4;
  --c-accent-4: #0c4c6f;
  --c-accent-5: #eaf3ff;
  --c-accent-6: #2557a8;
  --c-accent-7: #1f729d;
  --c-accent-8: #00366b;
  --c-accent-9: #445cb8;
  --c-danger-1: #a43a32;
  --c-danger-2: #9a1f1f;
  --c-good-1: #acd9c6;
  --c-good-2: #bfe0d1;
  --c-good-3: #dff6ea;
  --c-good-4: #b5e1cb;
  --c-ink-1: #111512;
  --c-ink-2: #26312b;
  --c-line-1: #9aa5a0;
  --c-line-2: #bfc8c3;
  --c-line-3: #8a908d;
  --c-muted-1: #686c68;
  --c-muted-2: #7a817c;
  --c-muted-3: #5e6761;
  --c-muted-4: #66736e;
  --c-surface-1: #ffffff;
  --c-surface-10: #e6f7ef;
  --c-surface-11: #eef5f1;
  --c-surface-12: #dce5e1;
  --c-surface-13: #edf4f0;
  --c-surface-14: #f3f4f3;
  --c-surface-15: #fff2f8;
  --c-surface-16: #f4fbf4;
  --c-surface-17: #edf7eb;
  --c-surface-18: #edf3f0;
  --c-surface-19: #f7faf9;
  --c-surface-2: #f3fbf7;
  --c-surface-20: #fff6f6;
  --c-surface-21: #fafaf8;
  --c-surface-22: #f1f3f0;
  --c-surface-23: #f8f8f4;
  --c-surface-24: #f7f7f2;
  --c-surface-25: #f1f4f7;
  --c-surface-26: #fbfbf8;
  --c-surface-27: #eef1ed;
  --c-surface-28: #f3f5f2;
  --c-surface-29: #f7f8f5;
  --c-surface-3: #e9f6ef;
  --c-surface-4: #f2fbf7;
  --c-surface-5: #eef8f3;
  --c-surface-6: #f8fbf9;
  --c-surface-7: #f5fbf8;
  --c-surface-8: #f8fbfa;
  --c-surface-9: #fbfdfc;
  --c-warn-1: #fff8e5;
  --c-warn-10: #7b5a08;
  --c-warn-11: #9a6700;
  --c-warn-2: #d99000;
  --c-warn-3: #ff5aa5;
  --c-warn-4: #d39673;
  --c-warn-5: #ffd91f;
  --c-warn-6: #ff7545;
  --c-warn-7: #8a5e08;
  --c-warn-8: #f3b6b6;
  --c-warn-9: #fbf5e5;
}

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(var(--rgb-ink-1), .045), transparent 30%),
    linear-gradient(180deg, var(--c-surface-21) 0%, var(--bg) 44%, var(--c-surface-22) 100%);
  letter-spacing: 0;
}

.lab-shell {
  gap: 16px;
  padding: 16px;
}

.lab-sidebar,
.lab-aside,
.lab-panel,
.topbar {
  background: var(--panel);
  border-color: rgba(var(--rgb-ink-1), .11);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.lab-sidebar,
.lab-aside {
  padding: 18px;
}

.lab-aside {
  background:
    radial-gradient(circle at 15% 0%, rgba(var(--rgb-white-1), .82), rgba(var(--rgb-white-1), .28) 34%, transparent 58%),
    linear-gradient(160deg, rgba(var(--rgb-white-1), .58), rgba(var(--rgb-white-17), .34));
}

.lab-aside h2 {
  margin-bottom: 18px;
}

.lab-aside #alternative-list {
  display: grid;
  gap: 12px;
}

.topbar,
.lab-panel {
  padding: 20px;
}

.brand-mark {
  border-radius: 14px;
  background: var(--c-ink-1);
  color: var(--c-surface-23);
  box-shadow: inset 0 0 0 1px rgba(var(--rgb-white-1), .08), 0 10px 22px rgba(var(--rgb-ink-1), .14);
}

.brand-title {
  letter-spacing: 0;
  font-weight: 920;
}

.brand-subtitle,
.crumb {
  color: var(--c-muted-2);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: 0;
  font-weight: 880;
}

h2 {
  font-size: clamp(19px, 1.6vw, 25px);
  letter-spacing: 0;
  font-weight: 860;
}

h3 {
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 820;
}

.small-muted,
.section-head p,
.topbar p,
small {
  color: var(--muted);
}

.nav-link {
  min-height: 44px;
  border-color: rgba(var(--rgb-ink-1), .1);
  border-radius: 14px;
  background: rgba(var(--rgb-white-13), .62);
  padding: 11px 13px;
  color: var(--ink);
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.nav-link:hover {
  border-color: rgba(var(--rgb-ink-1), .22);
  background: var(--c-surface-1);
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--c-ink-1);
  border-color: var(--c-ink-1);
  color: var(--c-surface-24);
  box-shadow: 0 12px 30px rgba(var(--rgb-ink-1), .14);
}

.nav-link.active span:last-child {
  color: rgba(var(--rgb-white-18), .72);
}

.task-card,
.mini-card,
.project-card,
.portfolio-card,
.metric-row div,
.reference-box,
.modal-card,
.branch-setup-panel,
.validation-run-card,
.candidate-novelty-preview,
.novelty-detail-card {
  border-color: rgba(var(--rgb-ink-1), .1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tight);
}

.mini-card.soft,
.task-card {
  background: rgba(var(--rgb-white-13), .72);
}

.btn,
button {
  min-height: 40px;
  border-color: rgba(var(--rgb-ink-1), .14);
  border-radius: 999px;
  background: rgba(var(--rgb-white-13), .76);
  color: var(--c-ink-1);
  padding: 9px 16px;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 8px 20px rgba(var(--rgb-ink-1), .045);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn:hover,
button:hover {
  border-color: rgba(var(--rgb-ink-1), .28);
  background: var(--c-surface-1);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(var(--rgb-ink-1), .075);
}

.btn.primary,
button.primary {
  background: var(--c-ink-1);
  border-color: var(--c-ink-1);
  color: var(--c-surface-24);
}

.btn.blue {
  background: var(--c-accent-15);
  border-color: var(--c-accent-15);
  color: var(--c-surface-24);
}

.btn.compact {
  min-height: 34px;
  padding: 6px 12px;
}

.chip,
.chip.good,
.chip.blue,
.chip.warn,
.decision,
.liked-marker,
.selected-marker {
  border-color: rgba(var(--rgb-ink-1), .11);
  background: rgba(var(--rgb-white-16), .92);
  color: var(--c-ink-2);
  box-shadow: none;
  letter-spacing: 0;
}

.chip.good {
  color: var(--green-dark);
}

.chip.warn {
  background: var(--c-warn-9);
  color: var(--c-warn-10);
}

.selected-marker,
.chip.blue {
  background: var(--c-surface-25);
  color: var(--c-accent-16);
}

.score,
.alternative-candidate .score,
.alternative-candidate .score-pill,
.alternative-candidate .score-badge {
  border: 1px solid rgba(var(--rgb-ink-1), .13);
  background: linear-gradient(180deg, var(--c-surface-26), var(--c-surface-27));
  color: var(--c-ink-1);
  box-shadow: none;
  letter-spacing: 0;
}

.score-button {
  background: linear-gradient(180deg, var(--c-surface-26), var(--c-surface-27));
}

.score-button:hover {
  box-shadow: 0 0 0 3px rgba(var(--rgb-ink-1), .08);
}

.metric {
  color: var(--c-ink-1);
  font-weight: 900;
  letter-spacing: 0;
}

.metric .score,
.metric .score-button {
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--c-surface-22);
  color: var(--c-ink-1);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
}

.help-tip {
  background: var(--c-surface-28);
  border-color: rgba(var(--rgb-ink-1), .11);
  box-shadow: none;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  letter-spacing: 0;
  text-decoration: none;
}

.table-wrap {
  border-color: rgba(var(--rgb-ink-1), .1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tight);
}

table th {
  position: relative;
  padding-right: 30px;
  color: var(--c-muted-3);
  background: var(--c-surface-29);
}

table th .help-tip {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

.task-card {
  position: relative;
}

.task-card > strong {
  display: block;
  padding-right: 34px;
}

.task-card > strong .help-tip {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.task-card > .card-info-tip {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.molecule-fallback {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.molecule-fallback small {
  display: block;
  max-width: 100%;
  color: rgba(var(--rgb-ink-1), .52);
  overflow-wrap: break-word;
  word-break: break-word;
}

.long-detail,
.mono,
code,
.smiles-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

table td {
  border-color: rgba(var(--rgb-ink-1), .08);
}

.inline-link {
  color: var(--c-ink-1);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.alternative-candidate {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 86px;
  align-items: center;
  border: 1px solid rgba(var(--rgb-white-1), .62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 8%, rgba(var(--rgb-white-1), .86), rgba(var(--rgb-white-1), .24) 34%, transparent 58%),
    linear-gradient(145deg, rgba(var(--rgb-white-1), .55), rgba(var(--rgb-white-19), .24));
  box-shadow:
    inset 0 1px 0 rgba(var(--rgb-white-1), .92),
    inset 0 -1px 0 rgba(var(--rgb-ink-1), .055),
    0 14px 34px rgba(var(--rgb-ink-1), .065);
  backdrop-filter: blur(22px) saturate(1.18);
}

.alternative-candidate.is-liked-candidate,
.alternative-candidate.is-selected-candidate {
  background:
    radial-gradient(circle at 20% 4%, rgba(var(--rgb-white-1), .96), rgba(var(--rgb-white-1), .28) 35%, transparent 60%),
    linear-gradient(145deg, rgba(var(--rgb-white-1), .68), rgba(var(--rgb-white-16), .32));
  border-color: rgba(var(--rgb-ink-1), .16);
  box-shadow:
    inset 1px 1px 0 rgba(var(--rgb-white-1), .95),
    inset -1px -1px 0 rgba(var(--rgb-ink-1), .06),
    0 18px 44px rgba(var(--rgb-ink-1), .11);
}

.alternative-candidate::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 18px;
  background:
    radial-gradient(circle at 76% 34%, rgba(var(--rgb-white-1), .72), rgba(var(--rgb-white-1), 0) 28%),
    linear-gradient(115deg, rgba(var(--rgb-white-1), .34), rgba(var(--rgb-white-1), 0) 46%);
  pointer-events: none;
}

.alternative-candidate::after {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: rgba(var(--rgb-ink-1), .18);
  opacity: 0;
}

.alternative-candidate.is-selected-candidate::after {
  opacity: 1;
}

.alternative-candidate > span:first-child {
  color: rgba(var(--rgb-ink-1), .92);
  line-height: 1.34;
}

.alternative-candidate > span:last-child {
  align-self: center;
}

.alternative-candidate .score,
.alternative-candidate .score-button {
  min-width: 58px;
  min-height: 58px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border-color: rgba(var(--rgb-ink-1), .12);
  background:
    radial-gradient(circle at 34% 24%, rgba(var(--rgb-white-1), .88), transparent 42%),
    rgba(var(--rgb-white-20), .52);
  box-shadow:
    inset 0 1px 0 rgba(var(--rgb-white-1), .9),
    0 8px 18px rgba(var(--rgb-ink-1), .055);
  color: rgba(var(--rgb-ink-1), .86);
}

.alternative-candidate .selected-marker,
.alternative-candidate .liked-marker {
  background: rgba(var(--rgb-white-16), .68);
  border: 1px solid rgba(var(--rgb-ink-1), .07);
  color: rgba(var(--rgb-ink-1), .72);
}

.selected-stage3-actions .chip.good,
#readiness-chip {
  background: rgba(var(--rgb-white-13), .82);
  color: var(--c-ink-1);
  border-color: rgba(var(--rgb-ink-1), .12);
  padding: 9px 12px;
}

#candidate-decision strong,
#candidate-validation-status {
  text-transform: none;
}

.stage3-validation-layout {
  align-items: start;
}

.candidate-novelty-preview {
  width: 100%;
}

.novelty-detail-grid {
  align-items: start;
}

.novelty-query-grid,
.novelty-links-grid,
.novelty-result-grid {
  width: 100%;
}

@media (max-width: 1180px) {
  .lab-shell {
    gap: 12px;
    padding: 12px;
  }

  .topbar,
  .lab-panel {
    padding: 16px;
  }
}

@media (max-width: 760px) {
  .lab-shell {
    padding: 10px;
  }

  .topbar,
  .section-head,
  .selected-stage3-actions {
    align-items: stretch;
  }

  .actions,
  .selected-stage3-actions,
  .inline-action-row,
  .branch-actions {
    width: 100%;
  }

  .actions .btn,
  .selected-stage3-actions > *,
  .inline-action-row .btn,
  .branch-actions .btn {
    width: 100%;
  }

  .metric .score,
  .metric .score-button {
    font-size: 30px;
  }
}

/* Refinement pass: reduce visual shouting and give selected context a lens-like surface. */
.brand-title {
  font-weight: 820;
}

.brand-subtitle,
.crumb {
  font-weight: 640;
}

h1 {
  font-weight: 780;
}

h2 {
  font-weight: 760;
}

h3 {
  font-weight: 720;
}

.nav-link {
  font-weight: 720;
}

.nav-link span:last-child {
  font-weight: 650;
}

.btn,
button,
.chip,
.decision,
.score {
  font-weight: 720;
}

.metric {
  font-weight: 780;
}

.task-card strong,
.mini-card strong,
.overview-metric strong,
.live-pulse strong,
.candidate-cell strong,
.novelty-hit-card strong,
.novelty-match strong {
  font-weight: 760;
}

.lab-sidebar .task-card,
.lab-aside .task-card {
  margin-top: 22px;
}

.current-candidate-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 128px;
  padding: 20px;
  border: 1px solid rgba(var(--rgb-white-1), .72);
  background:
    radial-gradient(circle at 24% 12%, rgba(var(--rgb-white-1), .82), rgba(var(--rgb-white-1), .2) 34%, transparent 56%),
    linear-gradient(145deg, rgba(var(--rgb-white-1), .58), rgba(var(--rgb-white-19), .28));
  box-shadow:
    inset 0 1px 0 rgba(var(--rgb-white-1), .9),
    inset 0 -1px 0 rgba(var(--rgb-ink-1), .045),
    0 22px 52px rgba(var(--rgb-ink-1), .1);
  backdrop-filter: blur(22px) saturate(1.22);
}

.current-candidate-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border-radius: calc(var(--radius-lg) - 6px);
  background:
    radial-gradient(circle at 72% 34%, rgba(var(--rgb-white-1), .78), rgba(var(--rgb-white-1), 0) 30%),
    radial-gradient(circle at 30% 76%, rgba(var(--rgb-ink-1), .055), rgba(var(--rgb-ink-1), 0) 42%);
  filter: blur(.2px);
}

.current-candidate-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -38px;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 999px;
  background: rgba(var(--rgb-white-1), .32);
  box-shadow: inset 0 0 30px rgba(var(--rgb-white-1), .52);
}

.current-candidate-card strong {
  display: block;
  margin-bottom: 8px;
  color: rgba(var(--rgb-ink-1), .78);
  font-size: 13px;
  font-weight: 700;
}

.current-candidate-card #selected-mini {
  position: relative;
  max-width: 94%;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.28;
  font-weight: 520;
}

#candidate-decision {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

#candidate-decision strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(var(--rgb-ink-1), .11);
  border-radius: 999px;
  background: rgba(var(--rgb-white-16), .82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 690;
  line-height: 1;
}

#candidate-decision small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--c-muted-2);
  font-size: 13px;
  line-height: 1.2;
}

#candidate-score.metric,
.mini-card .metric {
  display: flex;
  align-items: flex-start;
}

#candidate-score .score,
#candidate-score .score-button {
  margin: 0;
}

.selected-stage3-actions {
  gap: 10px;
}

.selected-stage3-actions .like-toggle,
.selected-stage3-actions .chip.good,
#readiness-chip {
  min-height: 44px;
}

.alternative-candidate {
  gap: 12px;
  padding: 13px 14px;
  font-weight: 660;
}

.alternative-candidate > span:first-child {
  font-weight: 660;
}

.alternative-candidate .score,
.alternative-candidate .score-button {
  font-weight: 720;
}

.section-head {
  gap: 18px;
}

.section-head p {
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .lab-sidebar .task-card,
  .lab-aside .task-card {
    margin-top: 14px;
  }
}

.stage3-decision-grid,
.stage3-sequence-risk-panel,
.stage3-invitro-gate-panel {
  margin-top: 18px;
}

.stage3-analysis-card {
  position: relative;
  width: 100%;
  padding: 22px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(var(--rgb-white-1), .86), rgba(var(--rgb-white-12), .72)),
    radial-gradient(circle at 18% 0%, rgba(var(--rgb-white-1), .85), transparent 38%);
  box-shadow: 0 18px 48px rgba(var(--rgb-ink-1), .06), inset 0 1px 0 rgba(var(--rgb-white-1), .9);
}

.analysis-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.analysis-card-head h3 {
  padding-right: 32px;
}

.analysis-card-head h3 .help-tip {
  position: absolute;
  top: 22px;
  right: 22px;
  margin: 0;
}

.analysis-card-head h3 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: 0;
}

.analysis-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.analysis-status,
.decision-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid rgba(var(--rgb-ink-1), .12);
  border-radius: 999px;
  background: rgba(var(--rgb-white-1), .62);
  color: rgba(var(--rgb-ink-1), .76);
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.analysis-card-head .analysis-status,
.analysis-card-head .decision-pill {
  margin-right: 34px;
}

.interaction-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.interaction-metrics div,
.decision-metric,
.decision-panel,
.decision-hero {
  position: relative;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 20px;
  background: rgba(var(--rgb-white-1), .58);
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .78);
}

.interaction-metrics div {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 116px;
}

.interaction-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 760;
}

.interaction-metrics span,
.decision-metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.interaction-metrics div > span {
  display: block;
  padding-right: 26px;
}

.interaction-metrics .help-tip,
.invitro-gate-row .help-tip {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  padding: 0;
  transform: none;
  margin-left: 0;
}

.target-branch-interaction {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(var(--rgb-white-1), .78), rgba(var(--rgb-white-3), .54)),
    radial-gradient(circle at 20% 0%, rgba(var(--rgb-white-1), .86), transparent 42%);
}

.branch-interaction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.branch-interaction-head strong,
.branch-interaction-head span {
  display: block;
}

.branch-interaction-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
}

.branch-interaction-head > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.interaction-metrics.branch-metrics {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.interaction-metrics.branch-metrics div {
  min-height: 94px;
  padding: 16px;
  border-radius: 18px;
}

.interaction-metrics.branch-metrics strong {
  font-size: 24px;
}

.invitro-gate-row span {
  display: block;
  padding-right: 26px;
}

.contact-residue-strip,
.risk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.contact-residue-strip span,
.risk-legend span {
  padding: 6px 10px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 999px;
  background: rgba(var(--rgb-white-16), .72);
  color: rgba(var(--rgb-ink-1), .74);
  font-size: 13px;
}

.muted-value {
  color: var(--muted) !important;
}

.analysis-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.sequence-risk-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-residue {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 50px;
  border: 1px solid rgba(var(--rgb-ink-1), .12);
  border-radius: 15px;
  background: rgba(var(--rgb-white-21), .76);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.risk-residue em {
  position: absolute;
  top: 5px;
  left: 7px;
  color: rgba(var(--rgb-ink-1), .5);
  font-size: 10px;
  font-style: normal;
  font-weight: 690;
}

.risk-residue.clean {
  background: rgba(var(--rgb-white-21), .82);
}

.risk-residue.low {
  border-color: rgba(var(--rgb-warn-8), .28);
  background: rgba(var(--rgb-warn-9), .88);
}

.risk-residue.medium {
  border-color: rgba(var(--rgb-warn-10), .34);
  background: rgba(var(--rgb-warn-11), .9);
}

.risk-residue.high {
  border-color: rgba(var(--rgb-danger-1), .34);
  background: rgba(var(--rgb-warn-12), .92);
}

.invitro-gate-grid,
.decision-gate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.invitro-gate-row,
.decision-gate-row {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid rgba(var(--rgb-ink-1), .1);
  border-radius: 18px;
  background: rgba(var(--rgb-white-1), .54);
}

.invitro-gate-row span,
.decision-gate-row span {
  color: var(--muted);
  font-size: 13px;
}

.interaction-metrics .help-tip,
.invitro-gate-row > .help-tip,
.decision-gate-row > .help-tip {
  display: inline-flex;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0;
  color: transparent !important;
  font-size: 0 !important;
}

.invitro-gate-row b,
.decision-gate-row b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 720;
}

.invitro-gate-row em,
.decision-gate-row em {
  color: rgba(var(--rgb-ink-1), .64);
  font-size: 13px;
  font-style: normal;
}

.invitro-gate-row small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.invitro-gate-row.pass,
.decision-gate-row.pass,
.decision-pill.pass,
.decision-metric.pass {
  border-color: rgba(var(--rgb-accent-7), .18);
  background: rgba(var(--rgb-white-22), .72);
}

.invitro-gate-row.review,
.decision-gate-row.review,
.decision-pill.review,
.decision-metric.review {
  border-color: rgba(var(--rgb-warn-2), .22);
  background: rgba(var(--rgb-warn-13), .78);
}

.invitro-gate-row.hold,
.decision-gate-row.hold,
.decision-metric.hold {
  border-color: rgba(var(--rgb-danger-1), .22);
  background: rgba(var(--rgb-white-23), .78);
}

.decision-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 16px;
}

.decision-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(var(--rgb-white-1), .78), rgba(var(--rgb-white-24), .68)),
    radial-gradient(circle at 88% 8%, rgba(var(--rgb-ink-1), .06), transparent 32%);
}

.decision-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

.decision-hero h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
}

.decision-hero p {
  max-width: 880px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.decision-score-stack {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.decision-score-stack .score,
.decision-score-stack .score-button {
  font-size: 40px;
  min-width: 112px;
}

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

.decision-metric {
  padding: 18px;
}

.decision-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
  font-weight: 760;
}

.decision-metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.decision-panel {
  padding: 20px;
}

.decision-panel h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.decision-bar-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.decision-bar-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.decision-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--rgb-ink-1), .08);
}

.decision-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(var(--rgb-ink-1), .76);
}

.decision-bar-row.review .decision-bar i {
  background: rgba(var(--rgb-warn-14), .82);
}

.decision-bar-row.hold .decision-bar i {
  background: rgba(var(--rgb-danger-3), .82);
}

.decision-summary-panel {
  grid-column: 1 / -1;
}

.decision-summary-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .novelty-kpi-grid,
  .interaction-metrics,
  .invitro-gate-grid,
  .decision-gate-grid,
  .decision-dashboard-grid,
  .decision-reason-grid {
    grid-template-columns: 1fr;
  }

  .decision-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .decision-score-stack {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .stage3-analysis-card,
  .decision-panel,
  .decision-hero {
    padding: 16px;
    border-radius: 18px;
  }

  .analysis-card-head {
    display: grid;
  }

  .risk-residue {
    width: 38px;
    height: 46px;
  }
}

/* Final info-control normalization: keep every help control as one clean "i". */
.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0 !important;
  margin-left: 8px;
  overflow: hidden;
  border: 1px solid rgba(var(--rgb-ink-1), .13);
  border-radius: 50%;
  background: rgba(var(--rgb-white-1), .84);
  color: transparent !important;
  font-size: 0 !important;
  font-weight: 800;
  line-height: 0 !important;
  letter-spacing: 0;
  text-indent: -999px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(var(--rgb-white-1), .8), 0 5px 14px rgba(var(--rgb-ink-1), .06);
}

.help-tip > * {
  display: none !important;
}

.help-tip::before {
  content: "i";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(var(--rgb-ink-1), .58);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-indent: 0;
}

.help-tip::after {
  content: none !important;
}

.task-card > .card-info-tip,
.interaction-metrics .help-tip,
.invitro-gate-row > .help-tip,
.decision-gate-row > .help-tip {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}

table th .help-tip {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

h1 > .help-tip,
h2 > .help-tip,
h3 > .help-tip {
  vertical-align: middle;
  transform: translateY(-0.1em);
}

.task-card > strong {
  padding-right: 38px;
}

.smiles-text,
.mono,
code,
.long-detail {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.custom-candidates-panel {
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  background: linear-gradient(135deg, rgba(var(--rgb-white-1), .92), rgba(var(--rgb-white-25), .84));
}

.custom-candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.custom-candidate-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(var(--rgb-ink-1), .10);
  border-radius: 22px;
  background: rgba(var(--rgb-white-1), .78);
  box-shadow: 0 16px 42px rgba(var(--rgb-ink-1), .06);
}

.custom-candidate-main h3 {
  margin: 8px 0 6px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
}

.custom-candidate-main p {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.custom-candidate-main small {
  display: block;
  color: rgba(var(--rgb-ink-1), .58);
  line-height: 1.45;
}

.custom-marker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 999px;
  background: rgba(var(--rgb-ink-1), .055);
  color: rgba(var(--rgb-ink-1), .72);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.custom-candidate-actions {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 10px;
  min-width: 120px;
}

.custom-candidate-form-card {
  max-width: 820px;
}

.custom-candidate-form {
  display: grid;
  gap: 14px;
}

.custom-candidate-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.custom-candidate-form label {
  display: grid;
  gap: 7px;
  color: rgba(var(--rgb-ink-1), .72);
  font-weight: 750;
}

.custom-candidate-form input,
.custom-candidate-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(var(--rgb-ink-1), .12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(var(--rgb-white-1), .84);
  color: inherit;
  font: inherit;
}

.custom-candidate-form textarea {
  min-height: 92px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.custom-candidate-help {
  padding: 16px;
  border: 1px solid rgba(var(--rgb-ink-1), .08);
  border-radius: 18px;
  background: rgba(var(--rgb-ink-1), .035);
}

.custom-candidate-help p {
  margin: 8px 0 0;
  color: rgba(var(--rgb-ink-1), .62);
  line-height: 1.55;
}

.alternative-candidate .custom-marker {
  margin-right: 6px;
}

@media (max-width: 760px) {
  .custom-candidate-card {
    flex-direction: column;
  }

  .custom-candidate-actions {
    min-width: 0;
    justify-items: start;
  }

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

/* v4 peptide 외부 근거 패널 (Open Targets · HPA · Europe PMC) */
.ext-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;}
.ext-list{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:6px;}
.ext-list li{display:flex;justify-content:space-between;gap:10px;align-items:baseline;border-top:1px solid rgba(var(--rgb-ink-2), .06);padding-top:6px;font-size:13px;}
.ext-list li:first-child{border-top:none;}
.ext-list li strong{overflow-wrap:anywhere;}
.ext-list li span{color:var(--c-muted-4);font-size:11px;white-space:nowrap;flex:0 0 auto;}
.prov{display:inline-flex;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:750;vertical-align:middle;}
.prov-predicted{background:rgba(var(--rgb-accent-4), .14);color:var(--c-accent-17);}
.prov-proxy{background:rgba(var(--rgb-warn-1), .14);color:var(--c-warn-11);}
.prov-missing{background:rgba(var(--rgb-ink-2), .07);color:var(--c-line-3);}
.prov-measured{background:rgba(var(--rgb-accent-4), .24);color:var(--c-accent-17);}

/* ===== 가로 오버플로 방지 + 모바일 반응형 (사이드바 레이아웃: stage2/3/4) ===== */
.lab-main { min-width: 0; max-width: 100%; }
.lab-main > *,
.lab-panel { min-width: 0; }
.s4-rank-strip,
.table-wrap { max-width: 100%; }

/* 좁은 화면: 사이드바를 위로 스택, 본문 1단 — 가로 스크롤 없이 세로로 */
@media (max-width: 860px) {
  .lab-shell,
  body[data-page="stage2"] .lab-shell,
  body[data-page="stage3"] .lab-shell,
  body[data-page="stage4"] .lab-shell {
    grid-template-columns: 1fr;
  }
  .lab-sidebar,
  .lab-aside {
    position: static;
    top: auto;
    height: auto;
    max-height: none;
  }
  /* 사이드바 네비게이션은 가로로 접히게(공간 절약) */
  .lab-sidebar .nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .lab-sidebar .nav-link {
    flex: 1 1 auto;
  }
}

/* ================= 다이아몬드 테마 (admin 선택: html[data-theme="diamond"]) ================= */
html[data-theme="diamond"] {
  --bg: #060b0a;
  --panel: #0d1512;
  --soft: #0a100e;
  --ink: #eaf2ee;
  --muted: #8ea79b;
  --line: rgba(255,255,255,.12);
  --green: #9fd6ff;
  --green-dark: #6fb2e6;
  --blue: #8fc9ff;
  --amber: #e0a44a;
  --shadow: 0 18px 46px rgba(0,0,0,.45);
  --shadow-tight: 0 8px 22px rgba(0,0,0,.32);
  /* 세분 팔레트(역할별) — 다크 스왑: 흰배경 rgba는 다크로, 어두운 테두리 rgba는 밝게 */
  --c-accent-1: #bfe4ff;
  --c-accent-10: #bfe4ff;
  --c-accent-11: #bfe4ff;
  --c-accent-12: #bfe4ff;
  --c-accent-13: #bfe4ff;
  --c-accent-14: #bfe4ff;
  --c-accent-15: #bfe4ff;
  --c-accent-16: #bfe4ff;
  --c-accent-17: #bfe4ff;
  --c-accent-2: #bfe4ff;
  --c-accent-3: #bfe4ff;
  --c-accent-4: #bfe4ff;
  --c-accent-5: #bfe4ff;
  --c-accent-6: #bfe4ff;
  --c-accent-7: #bfe4ff;
  --c-accent-8: #bfe4ff;
  --c-accent-9: #bfe4ff;
  --c-danger-1: #ff8b8b;
  --c-danger-2: #ff8b8b;
  --c-good-1: #9fd6ff;
  --c-good-2: #9fd6ff;
  --c-good-3: #9fd6ff;
  --c-good-4: #9fd6ff;
  --c-ink-1: #eaf2ee;
  --c-ink-2: #eaf2ee;
  --c-line-1: rgba(255,255,255,.10);
  --c-line-2: rgba(255,255,255,.10);
  --c-line-3: rgba(255,255,255,.10);
  --c-muted-1: #8ea79b;
  --c-muted-2: #8ea79b;
  --c-muted-3: #8ea79b;
  --c-muted-4: #8ea79b;
  --c-surface-1: #121815;
  --c-surface-10: #121815;
  --c-surface-11: #121815;
  --c-surface-12: #121815;
  --c-surface-13: #121815;
  --c-surface-14: #121815;
  --c-surface-15: #121815;
  --c-surface-16: #121815;
  --c-surface-17: #121815;
  --c-surface-18: #121815;
  --c-surface-19: #121815;
  --c-surface-2: #121815;
  --c-surface-20: #121815;
  --c-surface-21: #121815;
  --c-surface-22: #121815;
  --c-surface-23: #121815;
  --c-surface-24: #121815;
  --c-surface-25: #121815;
  --c-surface-26: #121815;
  --c-surface-27: #121815;
  --c-surface-28: #121815;
  --c-surface-29: #121815;
  --c-surface-3: #121815;
  --c-surface-4: #121815;
  --c-surface-5: #121815;
  --c-surface-6: #121815;
  --c-surface-7: #121815;
  --c-surface-8: #121815;
  --c-surface-9: #121815;
  --c-warn-1: #3a2c14;
  --c-warn-10: #e6b56a;
  --c-warn-11: #e6b56a;
  --c-warn-2: #3a2c14;
  --c-warn-3: #3a2c14;
  --c-warn-4: #e6b56a;
  --c-warn-5: #3a2c14;
  --c-warn-6: #3a2c14;
  --c-warn-7: #e6b56a;
  --c-warn-8: #e6b56a;
  --c-warn-9: #3a2c14;
  --rgb-accent-1: 143, 201, 255;
  --rgb-accent-10: 143, 201, 255;
  --rgb-accent-2: 143, 201, 255;
  --rgb-accent-3: 143, 201, 255;
  --rgb-accent-4: 143, 201, 255;
  --rgb-accent-5: 143, 201, 255;
  --rgb-accent-6: 143, 201, 255;
  --rgb-accent-7: 143, 201, 255;
  --rgb-accent-8: 143, 201, 255;
  --rgb-accent-9: 143, 201, 255;
  --rgb-danger-1: 255, 139, 139;
  --rgb-danger-2: 255, 139, 139;
  --rgb-danger-3: 255, 139, 139;
  --rgb-good-1: 159, 214, 255;
  --rgb-ink-1: 234, 242, 238;
  --rgb-ink-2: 234, 242, 238;
  --rgb-ink-3: 234, 242, 238;
  --rgb-ink-4: 234, 242, 238;
  --rgb-warn-1: 224, 164, 74;
  --rgb-warn-10: 224, 164, 74;
  --rgb-warn-11: 58, 44, 20;
  --rgb-warn-12: 58, 44, 20;
  --rgb-warn-13: 58, 44, 20;
  --rgb-warn-14: 58, 44, 20;
  --rgb-warn-2: 224, 164, 74;
  --rgb-warn-3: 58, 44, 20;
  --rgb-warn-4: 224, 164, 74;
  --rgb-warn-5: 224, 164, 74;
  --rgb-warn-6: 224, 164, 74;
  --rgb-warn-7: 58, 44, 20;
  --rgb-warn-8: 224, 164, 74;
  --rgb-warn-9: 58, 44, 20;
  --rgb-white-1: 18, 24, 21;
  --rgb-white-10: 18, 24, 21;
  --rgb-white-11: 18, 24, 21;
  --rgb-white-12: 18, 24, 21;
  --rgb-white-13: 18, 24, 21;
  --rgb-white-14: 18, 24, 21;
  --rgb-white-15: 18, 24, 21;
  --rgb-white-16: 18, 24, 21;
  --rgb-white-17: 18, 24, 21;
  --rgb-white-18: 18, 24, 21;
  --rgb-white-19: 18, 24, 21;
  --rgb-white-2: 18, 24, 21;
  --rgb-white-20: 18, 24, 21;
  --rgb-white-21: 18, 24, 21;
  --rgb-white-22: 18, 24, 21;
  --rgb-white-23: 18, 24, 21;
  --rgb-white-24: 18, 24, 21;
  --rgb-white-25: 18, 24, 21;
  --rgb-white-3: 18, 24, 21;
  --rgb-white-4: 18, 24, 21;
  --rgb-white-5: 18, 24, 21;
  --rgb-white-6: 18, 24, 21;
  --rgb-white-7: 18, 24, 21;
  --rgb-white-8: 18, 24, 21;
  --rgb-white-9: 18, 24, 21;
}
/* intro와 동일한 근-검정(그린틱) 배경 — 파란 네이비 제거 */
html[data-theme="diamond"] body {
  background:
    radial-gradient(1200px 760px at 50% -10%, rgba(143,201,255,.05), transparent 60%),
    linear-gradient(180deg, #0a100e 0%, #070c0a 55%, #000 100%) fixed;
  color: var(--ink);
}
html[data-theme="diamond"] .btn, html[data-theme="diamond"] .nav-link { color: var(--ink); }

/* 흰 배경으로 남던 컴포넌트(밝은 --c-ink-1을 배경으로 쓰던 것) 다크/아이스 톤 교체 */
html[data-theme="diamond"] .brand-mark {
  background: linear-gradient(140deg, rgba(255,255,255,.16), rgba(159,214,255,.10) 60%, rgba(255,255,255,.05));
  color: #eaf6ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px rgba(92,176,236,.16);
}
html[data-theme="diamond"] .nav-link.active {
  background: linear-gradient(140deg, rgba(234,246,255,.14), rgba(143,201,255,.10) 55%, rgba(255,255,255,.04));
  border-color: rgba(200,232,255,.34);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 22px rgba(143,201,255,.14);
}
html[data-theme="diamond"] .nav-link.active span:last-child { color: var(--muted); }
html[data-theme="diamond"] .btn.primary,
html[data-theme="diamond"] button.primary {
  background: linear-gradient(140deg, #eaf6ff, #bfe4ff 55%, #8fc9ff);
  border-color: rgba(200,232,255,.5);
  color: #0a0f14;
}
