:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --line: #c9d2df;
  --line-dark: #9aa8ba;
  --ink: #16202c;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --danger: #b42318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.is-processing,
html.is-processing * {
  cursor: progress !important;
}

html.is-processing::after {
  content: '';
  position: fixed;
  z-index: 2147483647;
  left: calc(var(--processing-cursor-x, -100px) + 14px);
  top: calc(var(--processing-cursor-y, -100px) + 14px);
  width: 16px;
  height: 16px;
  border: 3px solid rgba(15, 118, 110, .24);
  border-top-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: processing-cursor-spin .7s linear infinite;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8);
}

@keyframes processing-cursor-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.is-processing::after { animation: none; }
}

button, input, select, textarea {
  font: inherit;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
button {
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
  background: linear-gradient(#ffffff, #edf2f7);
}
button:hover, button.active { border-color: var(--accent); color: var(--accent); }
button[type="submit"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.secondary { background: #fff; color: var(--ink); }
input, select { min-height: 30px; padding: 0 8px; min-width: 0; }
textarea { min-height: 54px; padding: 6px 8px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
h1, h2, p { margin: 0; }
h1 { font-size: 18px; }
h2 { font-size: 14px; }
label { display: grid; gap: 4px; font-weight: 600; min-width: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: 48px 1fr; }
.app-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.app-titlebar div { display: flex; align-items: baseline; gap: 12px; }
.app-titlebar span { color: var(--muted); }
.title-actions { align-items: center !important; }
.language-switcher { display: inline-flex !important; gap: 3px !important; align-items: center !important; }
.language-switcher[hidden] { display: none !important; }
.language-switcher button {
  width: 40px;
  min-height: 28px;
  padding: 2px 3px;
  border-color: transparent;
  background: transparent;
  filter: grayscale(.25);
}
.language-switcher svg { display: block; width: 32px; height: 21px; border: 1px solid #cbd5e1; }
.language-switcher button:hover, .language-switcher button.active {
  border-color: var(--accent);
  background: #eef8f7;
  filter: none;
}

.login-panel { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.login-insecure { margin: 10px 0 0; padding: 8px 10px; border: 1px solid #c98a00; border-radius: 4px; background: #fff7df; color: #5a3d00; font-size: 12px; line-height: 1.5; }
.login-box {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#loginMessage { color: var(--danger); min-height: 18px; }

.main-window {
  display: grid;
  /* 왼쪽 레일은 시안(sidebarNavigation.png)의 단추를 읽을 수 있는 크기로 담아야 한다: 글자가 이름의
     길이만큼 들어가고 조각된 아이콘이 뭉개지지 않는 너비다 (2026-11-23에 130px에서 넓혔다). */
  grid-template-columns: 196px clamp(340px, 24vw, 400px) minmax(500px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "nav db work"
    "log log work";
  gap: 10px;
  padding: 10px;
  height: calc(100vh - 48px);
  min-height: 0;
}
.right-dock { display: grid; gap: 8px; align-content: start; }

/* ---- 왼쪽 단추: 겉모습은 시안(sidebarNavigation.png)에서 떼어 낸 그림이다.
   scripts/build_sidebar_art.py가 판(아이콘까지 구운 것)·선택된 판·아이콘 모양과 자리를 만들어
   nav-art/nav-art.css에 적는다. 그림을 CSS로 흉내 내지 않는다.
   이름만 HTML의 글자다 — 읽기 도구·검색·글자 크기 설정이 닿아야 하고, 번역도 글자에 붙는다.
   칸의 비율(--nav-ratio)은 하나다. 시안의 판은 높이가 조금씩 다르지만 레일의 단추는 모두 같은
   크기여야 하고, 판이 칸에서 차지하는 비율은 어느 단추나 같아서 늘려도 판의 크기가 고르다. */
.module-buttons {
  grid-area: nav;
  display: grid;
  /* 레일 자신의 값에는 cqw를 쓰지 않는다 — 컨테이너 단위는 자손에게만 제 너비로 풀린다. */
  gap: 6px;
  align-content: start;
  padding: 10px 9px 12px;
  border-radius: 10px;
  /* 바탕은 시안의 바탕색이다. 판 그림의 반투명한 그림자가 이 위에 얹힌다. */
  background: linear-gradient(170deg, #f0dcfa, #e7d6f5);
  container-type: inline-size;
}
.module-buttons button {
  position: relative;
  width: 100%;
  aspect-ratio: var(--nav-ratio);
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--label-pad-top, 0) 3.5% var(--label-pad-bottom, 0) var(--label-x, 37%);
  border: 0;
  border-radius: 0;
  background: var(--nav-art) center / 100% 100% no-repeat;
  color: #2b0c40;
  font-size: var(--label-size);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-align: left;
  text-shadow: 0 1px 0 #ffffff80;
  transition: filter 140ms ease;
  /* 이름은 한 줄이다. 자리를 넘는 이름은 app.js의 fitNavLabels가 글자 크기를 줄여 맞춘다. */
  white-space: nowrap;
}
/* 아이콘은 보통 상태에서는 판 그림 안에 있다. 선택되면 판이 보라색 그림으로 바뀌므로, 그때만
   아이콘의 모양(알파)을 상아색으로 칠해 그 자리에 얹는다 — 시안의 선택된 아이콘이 상아색이다. */
.module-buttons button::before {
  content: "";
  position: absolute;
  left: var(--icon-x); top: var(--icon-y); width: var(--icon-w); height: var(--icon-h);
  background: linear-gradient(165deg, #ffffff, #f4ecfc 70%, #e7dbf7);
  -webkit-mask: var(--nav-icon) center / 100% 100% no-repeat;
  mask: var(--nav-icon) center / 100% 100% no-repeat;
  filter: drop-shadow(0.4cqw 0.7cqw 0.5cqw #2a0b4e66);
  opacity: 0;
  pointer-events: none;
}
/* 시안이 선택된 모습으로만 그린 단추는 평소의 연보라 판이 없다. 그 단추(nav-art.css가
   --nav-icon-normal을 1로 둔다)는 빈 판 위에 아이콘을 라벤더 금속빛으로 세운다. */
.module-buttons button:not(.active)::before {
  opacity: var(--nav-icon-normal, 0);
  background: linear-gradient(160deg, #e3d2f3 12%, #a287c4 52%, #6d5396);
  filter: drop-shadow(-0.12cqw -0.12cqw 0 #ffffffc0) drop-shadow(0.26cqw 0.46cqw 0.4cqw #4a2f6366);
}
.module-buttons button.active {
  background-image: var(--nav-art-active);
  color: #ffffff;
  text-shadow: 0 0.25cqw 0.4cqw #2d0b5099;
}
.module-buttons button.active::before { opacity: 1; }
.module-buttons button:hover { filter: brightness(1.04) saturate(1.06); }
.module-buttons button:active { filter: brightness(0.97) saturate(1.04); }
.module-buttons button:focus-visible { outline: 2px solid #4e176f; outline-offset: -3px; }
/* 바탕의 단추는 기본 단추 색을 쓰지 않는다 (button.secondary, button.active의 윤곽선도). */
.module-buttons button.secondary { background-color: transparent; }
.module-buttons button:hover, .module-buttons button.active { border-color: transparent; }

.nav-separator { border-top: 1px solid #c6a9dc; margin: 3px 3% 1px; }
#userManagementButton { margin-top: auto; }

.user-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.user-create-form .span-all { grid-column: 1 / -1; margin: 0; min-height: 18px; color: var(--danger); }
.user-management-actions { display: flex; align-items: center; gap: 10px; }

/* The wrapper that sizes a control (the stylesheets set widths through it). The "?" sits on the control's
   label, so the wrapper is one column; a control with no label keeps the button beside itself (.has-help-button). */
.field-with-help { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; min-width: 0; }
.field-with-help.has-help-button { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.field-with-help > input, .field-with-help > select, .field-with-help > textarea { width: 100%; box-sizing: border-box; }
.field-with-help > input[type="checkbox"], .field-with-help > input[type="radio"] { width: auto; align-self: center; justify-self: start; }
/* ── 도움말 "?" — 화면 어디서나 같은 원 (2026-11-24, 사용자 요청) ──────────────────────────────
   세 가지가 같은 모양이다: 입력 칸의 도움말(.field-help-button), 표 머리글의 도움말(.column-help-button),
   실행 중에 그리는 항목의 도움말(.help-dot). 크기와 둥근 정도는 !important다: 버튼의 일반 규칙
   (min-height 30px, padding 0 10px)이나 어느 폼의 버튼 규칙이 이기면 원이 타원이 되기 때문이다.
   자리는 항목 이름의 바로 오른쪽이고, 그 자리는 HelpCatalog.seat이 잡는다(public/help-catalog.js). */
:is(.field-help-button, .column-help-button, .help-dot) {
  box-sizing: border-box !important; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 16px !important; align-self: center;
  width: 16px !important; height: 16px !important;
  min-width: 16px !important; min-height: 16px !important; max-width: 16px !important; max-height: 16px !important;
  margin: 0 0 0 4px; padding: 0 !important;
  border: 1px solid var(--line-dark); border-radius: 50% !important;
  background: #fff; color: var(--accent);
  font-size: 11px; font-weight: 700; line-height: 1; text-indent: 0; letter-spacing: 0;
  vertical-align: middle; cursor: help; position: relative; white-space: nowrap;
}
/* 16px is small to hit; the touch target is grown without moving the circle (PR1 §15.3). Only the dot: it stands
   beside wording. A button beside an input would take clicks meant for the input's edge. */
.help-dot::after { content: ''; position: absolute; inset: -8px; }
:is(.field-help-button, .column-help-button, .help-dot):is(:hover, :focus-visible) { border-color: var(--accent); background: #e8f2ff; color: var(--accent); }
/* 라벨 글과 그 "?"의 한 덩어리: 글(.label-words)과 버튼이 나란한 한 줄 상자다. 글이 두 줄이 되어도 버튼은
   글의 오른쪽에 남는다. */
.label-head { display: flex; align-items: center; min-width: 0; }
.label-head > .label-words { min-width: 0; }
.field-help-dialog form { display: grid; }
.field-help-dialog header, .field-help-dialog footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.field-help-dialog header { border-bottom: 1px solid var(--line); }
.field-help-dialog footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.field-help-content { display: grid; gap: 14px; padding: 18px 16px; line-height: 1.55; }
.field-help-content dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.field-help-content dt { color: var(--muted); font-weight: 700; }
.field-help-content dd { margin: 0; overflow-wrap: anywhere; }

.audit-log-dialog > section { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; }
.audit-log-dialog header, .audit-log-dialog footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.audit-log-dialog header { border-bottom: 1px solid var(--line); }
.audit-log-dialog header div { display: grid; gap: 3px; }
.audit-log-dialog header span, #auditLogSummary { color: var(--muted); font-size: 12px; }
.audit-log-dialog footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.audit-log-toolbar { display: flex; align-items: end; gap: 10px; padding: 10px 16px; }
.audit-log-toolbar label { width: min(280px, 45vw); }
.audit-log-table-wrap { min-height: 0; margin: 0 16px 12px; }
#auditLogTable { width: 100%; border-collapse: collapse; }
#auditLogTable th, #auditLogTable td { padding: 7px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
#auditLogTable th { position: sticky; top: 0; background: #eef4f7; z-index: 1; }
#auditLogTable .audit-failed { color: var(--danger); font-weight: 700; }

.work-area { grid-area: work; min-width: 0; min-height: 0; height: 100%; }
.dialog, .dock-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.dialog { display: none; height: 100%; min-height: 0; }
.dialog.active { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; align-content: start; }
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.dialog-head span { color: var(--muted); }

.qt-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
}
.qt-form fieldset {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
}
.qt-form legend { color: var(--muted); padding: 0 4px; }
.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  min-width: 0;
}
.action-row button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}
.check input { min-height: auto; }
.rtlamp-review { margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.rtlamp-sequence { display: flex; min-width: 0; overflow: hidden; border: 1px solid var(--line); margin: 8px 0; }
.rtlamp-review details code { display: block; overflow-wrap: anywhere; padding: 8px; color: #0f766e; }
.rtlamp-review table { width: 100%; }

.gpu-blast-only-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.gpu-blast-only-form > label { font-weight: 600; }
#gpuBlastOnlySequences {
  width: 100%;
  min-height: 150px;
  max-height: 38vh;
  overflow-y: scroll;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.gpu-blast-only-form .action-row { justify-content: flex-end; }

.dkl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dkl-grid fieldset, .dkl-results {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: #fff;
}
.dkl-grid fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dkl-grid fieldset:first-child { grid-column: 1 / -1; }
.dkl-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dkl-results label { font-weight: 600; }
.dkl-results textarea { background: #f8fafc; }

.right-dock { grid-area: db; min-width: 0; height: 100%; }
.dock-panel { display: grid; gap: 8px; }
.path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.button-row { display: flex; gap: 6px; flex-wrap: wrap; }
.blast-db-tree {
  width: 100%;
  min-height: 230px;
  height: clamp(230px, 34vh, 390px);
  max-height: 390px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
}
.blast-db-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}
.blast-db-row.active { background: #e8f2ff; }
.blast-db-row input { min-height: auto; }
.db-rel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-status {
  color: var(--muted);
  font-size: 11px;
}
.db-status.ready { color: var(--accent); }
.db-status.warn { color: var(--danger); }
.empty-db { color: var(--muted); padding: 8px 4px; }
.progress-wrap {
  position: relative;
  width: 100%;
  display: grid;
  gap: 3px;
}
#sysProgress { width: 100%; height: 18px; }
#sysProgress.indeterminate {
  appearance: none;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0%, transparent 30%, #248cff 50%, transparent 70%, transparent 100%),
    #eef2f7;
  background-size: 220% 100%, 100% 100%;
  animation: progress-slide 1s linear infinite;
}
@keyframes progress-slide {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}
#sysProgressText {
  min-height: 13px;
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
}
.log-panel textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0f172a;
  color: #d1fadf;
}
.log-panel {
  grid-area: log;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 260px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 12px;
}
th, td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #e5eaf1;
  padding: 5px 7px;
  text-align: left;
  white-space: nowrap;
}
th { position: sticky; top: 0; background: #f1f5f9; z-index: 1; }
td.sequence { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.target-tree-row .tree-indent {
  display: inline-block;
  width: calc(var(--depth, 0) * 18px);
}
.target-tree-row.taxon-row td {
  background: #f8fafc;
  color: #1f2937;
}
.target-tree-row.leaf-row td:first-child,
.target-tree-row.leaf-row td:nth-child(2) {
  color: var(--muted);
}
.tree-toggle {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
}
.tree-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.alignment-cell {
  min-width: 300px;
  white-space: normal;
}
.alignment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.45;
}
.alignment-line code {
  white-space: pre;
  display: block;
}
.mismatch-base {
  color: #d11124;
  font-weight: 800;
  background: #ffe8ea;
}
/* A position where one side is a code that covers the other. The search counts it as a match, so it must not
   wear the mismatch colour - but it is not a plain reading either, so it is marked rather than left bare. */
.code-base {
  color: #8a4b10;
  font-weight: 700;
  background: #fdf3e3;
  border-bottom: 1px dotted #b7791f;
}
.gpu-mm-cell {
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 600;
}
.gpu-mm-cell:hover { background: #e8f2ff; text-decoration: underline; }

.sequence-with-structure {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  min-width: max-content;
}
.structure-2d-button {
  min-width: 34px;
  min-height: 24px;
  height: 24px;
  padding: 0 6px;
  border-color: var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
}
.structure-2d-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: .62;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
}
dialog::backdrop { background: rgba(15, 23, 42, .34); }

.secondary-structure-dialog {
  overflow: hidden;
}
.secondary-structure-box {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}
.secondary-structure-box > header,
.secondary-structure-box > footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.secondary-structure-box > header {
  border-bottom: 1px solid var(--line);
}
.secondary-structure-box > header > div {
  display: grid;
  gap: 3px;
}
.secondary-structure-box > header span,
.secondary-structure-box > footer span {
  color: var(--muted);
  font-size: 12px;
}
.secondary-structure-box > footer {
  border-top: 1px solid var(--line);
}
.secondary-structure-sequence {
  padding: 10px 16px 6px;
  color: #263746;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.secondary-structure-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 10px;
}
.secondary-structure-tabs,
.secondary-structure-zoom {
  display: flex;
  align-items: center;
  gap: 5px;
}
.secondary-structure-tabs button {
  min-width: 92px;
}
.secondary-structure-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.secondary-structure-tab-detail {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}
.secondary-structure-zoom button {
  min-width: 38px;
}
.secondary-structure-formula {
  margin: 0 16px 9px;
  padding: 7px 10px;
  border: 1px solid #d7e0e8;
  border-radius: 4px;
  background: #f7fafc;
  color: #344754;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.secondary-structure-formula strong {
  color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-right: 8px;
}
.secondary-structure-canvas {
  min-height: 0;
  margin: 0 16px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(#f8fafc 1px, transparent 1px),
    linear-gradient(90deg, #f8fafc 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}
.secondary-structure-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 520px;
  min-height: 420px;
  transform-origin: top left;
}
.secondary-structure-svg .backbone {
  stroke: #88939d;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.secondary-structure-svg .base-pair {
  stroke: #0f9f94;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.secondary-structure-svg .base-node {
  stroke: #2d76b8;
  stroke-width: 1.5;
}
.secondary-structure-svg .base-label,
.secondary-structure-svg .terminal-label,
.secondary-structure-svg .position-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.secondary-structure-svg .base-label {
  fill: #18212a;
  font-size: 10px;
  font-weight: 800;
}
.secondary-structure-svg .terminal-label {
  fill: #153e63;
  font-size: 12px;
  font-weight: 800;
}
.secondary-structure-svg .position-label {
  fill: #75818c;
  font-size: 9px;
}

.multi-oligo-dialog.active {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.multi-oligo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.multi-oligo-input {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.multi-oligo-input-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.multi-oligo-input-head span {
  color: var(--muted);
  font-size: 11px;
}
.multi-oligo-input-head button {
  margin-left: auto;
  min-height: 27px;
  padding: 3px 9px;
}
.multi-oligo-input-table-wrap {
  max-height: 190px;
  overflow: auto;
}
#multiOligoInputTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
#multiOligoInputTable th,
#multiOligoInputTable td {
  padding: 3px 5px;
  border: 1px solid var(--line);
  text-align: left;
}
#multiOligoInputTable th {
  background: #eef4f7;
  font-size: 11px;
}
#multiOligoInputTable th:first-child { width: 16%; }
#multiOligoInputTable th:nth-child(3) { width: 18%; }
#multiOligoInputTable th:last-child { width: 38px; }
#multiOligoInputTable input {
  width: 100%;
  min-height: 29px;
  padding: 3px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: none;
}
#multiOligoInputTable [data-oligo-field="sequence"] {
  text-transform: uppercase;
}
#multiOligoInputTable .multi-oligo-remove {
  width: 27px;
  min-height: 27px;
  padding: 0;
  color: var(--danger);
}
.multi-oligo-run-controls {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 6px;
  align-items: end;
}
.multi-oligo-run-controls label {
  font-size: 11px;
}
.multi-oligo-results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  gap: 8px;
}
.multi-oligo-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}
.multi-oligo-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 9px;
}
.multi-oligo-tabs,
.multi-oligo-3d-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 5px;
}
.multi-oligo-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.multi-oligo-3d-controls label {
  width: 78px;
  font-size: 11px;
}
.multi-oligo-3d-controls input { width: 100%; }
#multiOligo3dRun { white-space: nowrap; }
.multi-oligo-view-zoom {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 3px;
}
.multi-oligo-view-zoom button {
  min-width: 30px;
  min-height: 29px;
  padding: 3px 7px;
}
.multi-oligo-view-zoom span {
  min-width: 42px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.multi-oligo-result-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--multi-oligo-graph-width, 3fr)) 12px minmax(0, var(--multi-oligo-table-width, 2fr));
  gap: 0;
  min-width: 0;
  min-height: 0;
}
.multi-oligo-splitter {
  position: relative;
  cursor: col-resize;
  touch-action: none;
  border-radius: 4px;
}
.multi-oligo-splitter::before {
  content: '';
  position: absolute;
  inset: 0 4px;
  border-radius: 4px;
  background: var(--line);
}
.multi-oligo-splitter:hover::before,
.multi-oligo-splitter:focus-visible::before,
.multi-oligo-result-grid.resizing .multi-oligo-splitter::before { background: var(--accent); }
.multi-oligo-splitter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.multi-oligo-result-grid.resizing,
.multi-oligo-result-grid.resizing * { cursor: col-resize !important; user-select: none; }
.multi-oligo-visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfe;
  overscroll-behavior: contain;
}
.multi-oligo-visual.zoomed { cursor: grab; }
.multi-oligo-visual #multiOligo3dCanvas { cursor: grab; }
.multi-oligo-visual #multiOligo3dCanvas:active { cursor: grabbing; }
.multi-oligo-visual.panning {
  cursor: grabbing;
  user-select: none;
}
.multi-oligo-visual svg,
.multi-oligo-visual canvas {
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  aspect-ratio: 900 / 620;
}
.multi-oligo-network-edge { stroke: #d06c32; stroke-linecap: round; }
.multi-oligo-network-node { stroke-width: 2.5; }
.multi-oligo-network-label {
  fill: #17202a;
  font: 700 13px system-ui, sans-serif;
  text-anchor: middle;
}
.multi-oligo-network-value {
  fill: #52616b;
  font: 11px system-ui, sans-serif;
  text-anchor: middle;
}
.multi-oligo-complex-table-wrap {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
#multiOligoComplexTable {
  width: 100%;
  border-collapse: collapse;
}
#multiOligoComplexTable th,
#multiOligoComplexTable td {
  padding: 6px 7px;
  border: 1px solid var(--line);
  text-align: left;
}
#multiOligoComplexTable th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f7;
}
#multiOligoComplexTable tbody tr { cursor: pointer; }
#multiOligoComplexTable tbody tr:hover { background: #e8f4f2; }
#multiOligoComplexTable tbody tr.selected {
  background: #0f766e;
  color: #fff;
}
#multiOligoComplexTable tbody tr.selected td { border-color: #0b5e58; }
#multiOligoComplexTable .structure { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.multi-oligo-detail {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.analysis-progress-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 8px; }
.analysis-progress-box { display: grid; gap: 0; }
.analysis-progress-box header { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.analysis-progress-content { display: grid; gap: 12px; padding: 20px 18px; }
.analysis-progress-content p { margin: 0; font-weight: 600; }
.analysis-progress-content progress { width: 100%; height: 18px; }
.analysis-progress-content div { color: var(--muted); font-size: 13px; }
.analysis-progress-box footer { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.weight-item-table { width: 100%; border-collapse: collapse; }
.weight-item-table th, .weight-item-table td { padding: 5px 7px; border: 1px solid var(--line); text-align: left; }
.weight-item-table input { width: 90px; }
.browser { padding: 12px; display: grid; gap: 10px; }
.browser header { display: flex; justify-content: space-between; align-items: center; }
.browser-path { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.browser-list {
  display: grid;
  gap: 3px;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px;
}
.browser-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  border: 0;
  background: #fff;
  text-align: left;
}
.browser-entry:hover { background: #eef6f5; }
.browser-entry span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
#gpuBlastDetailDialog {
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}
#gpuBlastDetailDialog .detail-dialog {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
}
#gpuBlastDetailDialog header {
  cursor: default;
  user-select: none;
}
.detail-meta { color: var(--muted); }
.detail-table-wrap {
  max-height: none;
  max-width: 100%;
  min-height: 0;
  overflow: auto;
}
.standalone-detail-table {
  min-width: 900px;
  table-layout: fixed;
}
.standalone-detail-table th:nth-child(1) { width: 52px; }
.standalone-detail-table th:nth-child(2) { width: 110px; }
.standalone-detail-table th:nth-child(3) { width: 105px; }
.standalone-detail-table th:nth-child(4) { width: 145px; }
.standalone-detail-table th:nth-child(5) { width: 42%; }
.standalone-detail-table th:nth-child(6) { width: 28%; }
.standalone-query-cell {
  min-width: 0;
  max-width: none;
  overflow: hidden;
}
.standalone-query-cell .alignment-line,
.standalone-query-cell .alignment-line code {
  min-width: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.standalone-title-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}
.config-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 64px);
  padding: 12px;
  gap: 10px;
}
.config-form header,
.config-form footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.weight-file-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.weight-file-actions #weightProfileName { width: 190px; min-height: 30px; font-weight: 600; }
.config-file-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.config-file-actions #p3ProfileName { width: 180px; min-height: 30px; font-weight: 600; }
.config-form footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}
.config-grid fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: #fff;
}
.config-grid legend {
  color: var(--muted);
  padding: 0 4px;
}
.config-grid .span-all {
  grid-column: 1 / -1;
}
.p3-config-layout {
  display: grid;
  grid-template-columns: minmax(620px, 2fr) minmax(300px, 1fr);
  gap: 10px;
  overflow: auto;
  align-items: start;
}
.p3-config-layout fieldset { border: 1px solid var(--line); border-radius: 5px; padding: 8px; background: #fff; }
.p3-config-layout legend { color: var(--muted); padding: 0 4px; }
.p3-config-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.p3-config-table th, .p3-config-table td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.p3-config-table thead th { background: #eef4f7; }
.p3-config-table th:first-child { width: 31%; text-align: left; }
.p3-config-table th:nth-child(2) { width: 11%; }
.p3-config-table input { width: 100%; min-width: 0; text-align: right; }
.p3-config-table .not-applicable { color: var(--muted); background: #f7f9fa; }
.p3-side-panels { display: grid; gap: 10px; }
.p3-side-panels fieldset { display: grid; gap: 7px; }
.p3-side-panels label { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(100px, .8fr); gap: 7px; align-items: center; }
.p3-side-panels label span:nth-child(2) { color: var(--muted); text-align: center; font-size: 12px; }
.weight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
}
.weight-grid .weight-summary-panel {
  order: 1;
  min-height: 112px;
}
.weight-grid .specificity-weight-panel { order: 10; }
.weight-grid .primer-weight-panel { order: 11; }
.weight-grid .secondary-weight-panel { order: 12; }
.weight-grid .weight-detail-panel {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  overflow: auto;
}
.weight-grid .weight-summary-panel:first-child {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.weight-policy-note { padding: 10px; background: #eef7f6; border: 1px solid var(--line); border-radius: 5px; }
.weight-grid p { margin: 4px 0; line-height: 1.5; grid-column: 1 / -1; }
.weight-grid .weight-hp-panel { grid-template-columns: 1fr; }
.weight-grid .weight-fixed-panel { order: 20; }
.weight-fixed-panel ul { margin: 0; padding-left: 22px; line-height: 1.55; }
.weight-fixed-panel li + li { margin-top: 6px; }
.weight-diagnostics { order: 30; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.weight-diagnostics summary { cursor: pointer; font-weight: 600; }
.weight-grid .primer-weight-panel { grid-column: span 2; }
.weight-grid .weight-item-table td:nth-child(3) { min-width: 130px; }
.weight-grid .weight-item-table th:nth-child(3) { width: 140px; }
.weight-grid .weight-item-table td:last-child { white-space: normal; overflow-wrap: anywhere; }
.weight-grid .field-with-help > input { width: 100%; min-width: 0; }
#weightConfigForm[data-module="rpa"] .primer-weight-panel { grid-column: 1 / -1; }
#weightConfigForm footer, #weightConfigForm .weight-file-actions { flex-wrap: wrap; }
#weightConfigError { color: #a51d27; font-weight: 600; }
#weightHpPreview { font-variant-numeric: tabular-nums; color: var(--muted); }
.mmx-weight-table input {
  width: 58px;
  min-height: 26px;
}
.mmx-weight-table th,
.mmx-weight-table td {
  text-align: center;
}

@media (max-width: 1100px) {
  .main-window {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "db"
      "log"
      "work";
    height: auto;
    min-height: calc(100vh - 48px);
  }
  .module-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .right-dock { grid-template-columns: 1fr; }
  .blast-db-tree {
    height: clamp(230px, 32vh, 340px);
    max-height: 340px;
  }
  .dialog { min-height: auto; }
  .log-panel textarea { min-height: 260px; }
  .multi-oligo-result-grid { grid-template-columns: 1fr; gap: 8px; }
  .multi-oligo-splitter { display: none; }
  .multi-oligo-visual { height: clamp(360px, 65vh, 720px); }
  .multi-oligo-form { grid-template-columns: 1fr 1fr; }
  .multi-oligo-input { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .weight-grid { grid-template-columns: 1fr; }
  .weight-grid .primer-weight-panel { grid-column: 1; }
  .weight-grid .weight-summary-panel { min-height: 0; }
  .p3-config-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .qt-form, .qt-form fieldset, .dkl-grid, .dkl-grid fieldset, .dkl-results, .row, .browser-path {
    grid-template-columns: 1fr;
  }
  .span-2, .span-4 { grid-column: auto; }
}

/* Failed specificity screens remain visible for diagnosis, after passing rows. */
#realtimeTable tr.ranking-excluded, #rpaTable tr.ranking-excluded, #lampTable tr.ranking-excluded { background: #fff0ed; color: #8b1d13; }

/* Each diagnostic method has its own target tabs. */
.dialog.has-target-tabs.active { grid-template-rows: auto auto auto minmax(0, 1fr); }
.target-workspace-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.target-tabs { display: flex; flex: 1 1 260px; gap: 4px; min-width: 0; overflow-x: auto; padding: 2px; }
.target-tabs button { flex: 0 0 auto; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-tabs button[aria-selected="true"] { background: #0f766e; color: #fff; border-color: #0f766e; font-weight: 700; }
.target-tab-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.target-notice { flex: 1 0 100%; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.target-notice:empty { display: none; }
[data-fluorophore] { color: var(--fluorophore-color, inherit); }
select[data-target-fluorophore] { font-weight: 700; }
.target-tabs button[data-fluorophore] { color: var(--fluorophore-color); background: #fff; }
.target-tabs button[data-fluorophore][aria-selected="true"] {
  border-color: var(--fluorophore-color); box-shadow: inset 0 -2px 0 var(--fluorophore-color);
  background: #f1f5f9; color: var(--fluorophore-color); font-weight: 700;
}
.order-fluorophore { display: inline-block; font-weight: 700; padding: 5px 6px; }
.target-notice.stale { color: #9a3412; font-weight: 600; }
#dklDialog.has-target-tabs .dkl-grid { max-height: 48vh; overflow: auto; }

/* Design-rule catalogue keeps long evidence readable without widening results. */
#designRulesDialog {   padding: 16px; border: 1px solid #a9bacd; border-radius: 8px; }
#designRulesDialog > header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.design-rule-controls { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:12px 0; }
.design-rule-controls label { display:flex; flex-direction:column; gap:4px; }
.design-rules-scroll { max-height:55vh; overflow:auto; }
#designRulesDialog table { width:100%; table-layout:auto; }
#designRulesDialog th { position:sticky; top:0; background:#edf3f8; }
#designRulesDialog td { white-space:pre-line; vertical-align:top; min-width:70px; }
#designRulesDialog td:nth-child(4) { min-width:280px; }
#designRulesDialog td:nth-child(5) { min-width:170px; }
#designRuleEvidence { max-height:15vh; overflow:auto; background:#f0f6f6; }
#designRuleEvidence p { margin:6px; }

/* One vertical scroll per design view (view-folds.js).
 *
 * The work area is a fixed-height pane, so something inside it has to scroll. Several things used to: the LAMP
 * settings region capped itself at 55% of the pane and the consensus panel's body at 62vh, which read a
 * 14,000px report through an 1,150px window inside a 970px window. Two scrollbars is one too many - the reader
 * loses the place in both and neither one says how much is left.
 *
 * So the view itself is the only box that scrolls, and every block inside it folds. The one scrollbar then
 * measures exactly what is open, and folding is how the page gets shorter.
 *
 * The rule for anything added to these views: no descendant caps its own height. The exceptions are marked
 * where they are declared - a taxonomy tree and a gene list keep an inner scroll the way a <select> does,
 * because they are controls with unbounded content, not content to read.
 */
#realtimeDialog.active, #rpaDialog.active, #lampDialog.active, #findConsensusDialog.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  overscroll-behavior-y: contain;
}
#realtimeDialog.active > *, #rpaDialog.active > *, #lampDialog.active > *, #findConsensusDialog.active > * {
  flex: 0 0 auto;
  min-width: 0;
}
/* The controls that fold the view stay reachable while reading the bottom of it. */
.fold-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f7;
}
.fold-bar > span:first-child { color: var(--muted); font-weight: 700; }
.fold-bar .fold-count { margin-left: auto; color: var(--muted); font-size: 12px; }
/* A block says what it holds from wherever the reader has scrolled to. */
details.view-fold { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
details.view-fold > summary {
  position: sticky;
  top: 40px;
  z-index: 3;
  cursor: pointer;
  padding: 7px 10px;
  font-weight: 700;
  background: #f1f5f9;
  border-radius: 5px;
}
details.view-fold[open] > summary { border-bottom: 1px solid var(--line); border-radius: 5px 5px 0 0; }
details.view-fold[open] { padding-bottom: 8px; }
details.view-fold > :not(summary) { margin: 8px 10px 0; }
/* Only the block's own header rides along; a block inside a block would stack headers over the content. */
details.view-fold details.view-fold > summary { position: static; }
#lampDialog > .dialog-head { flex-wrap: wrap; }
#lampDialog > .dialog-head span { overflow-wrap: anywhere; }
.lamp-goal-results { min-height: 0; max-height: 220px; margin-top: 8px; }
.lamp-goal-results[hidden] { display: none; }
.lamp-goal-picker { max-width: 100%; }
.lamp-goal-picker > :is(.lamp-goal-search-row, .lamp-goal-search-results, .lamp-goal-selected, p) { max-width: 1100px; }
.lamp-goal-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.lamp-goal-search-row input { flex: 1 1 280px; min-width: 120px; }
.lamp-goal-picker p { color: var(--muted); font-size: 12px; margin: 6px 0; }
.lamp-goal-search-results { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.lamp-taxonomy-toolbar { position: sticky; top: 0; z-index: 1; padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.lamp-taxonomy-toolbar button + button { margin-left: 6px; }
.lamp-taxonomy-toolbar p { margin-bottom: 0; }
.lamp-taxonomy-tree, .lamp-taxonomy-tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.lamp-taxonomy-tree { padding: 6px; }
.lamp-taxonomy-tree ul { margin-left: 11px; border-left: 1px solid var(--line); }
.lamp-taxonomy-row { display: flex; align-items: start; gap: 4px; padding: 4px; border-radius: 4px; }
.lamp-taxonomy-row.search-match { background: #f1f5f9; }
.lamp-taxonomy-row.selected { background: #d9efeb; box-shadow: inset 3px 0 #0f766e; }
.lamp-taxonomy-toggle, .lamp-taxonomy-leaf { flex: 0 0 24px; width: 24px; min-height: 24px; }
.lamp-taxonomy-toggle { padding: 0; color: var(--accent); background: white; border-color: var(--line); }
.lamp-taxonomy-label { display: flex; align-items: start; gap: 8px; min-width: 0; flex: 1; cursor: pointer; }
.lamp-taxonomy-label input[type=checkbox] { flex: 0 0 auto; width: auto; margin: 4px 0 0; }
.lamp-taxonomy-label > span { min-width: 0; overflow-wrap: anywhere; }
.lamp-taxonomy-label small { display: block; color: #52647a; font-weight: normal; }
.lamp-goal-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lamp-goal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #a3cfca; border-radius: 5px; background: #eef8f6; overflow-wrap: anywhere; }
.lamp-goal-chip button { flex: 0 0 auto; padding: 0 5px; }
.lamp-goal-chip .lamp-goal-target-name { flex: 1 1 auto; min-width: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; background: transparent; border: none; color: #164e48; }
.lamp-goal-browse { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: start; max-width: 1500px; }
.lamp-goal-browse:has(.lamp-goal-search-results[hidden]) { grid-template-columns: minmax(0,740px); }
@media (max-width: 1100px) { .lamp-goal-browse { grid-template-columns: minmax(0,1fr); } }
#lampGoalTable :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
#lampForm { max-height: none; overflow: visible; }
.lamp-settings summary { cursor: pointer; padding: 5px 0; font-weight: 600; }
.lamp-note { margin: 0; color: #8a4b10; }
#lampTable tr.selected { background: #0f766e; color: white; }
/* Candidate report (candidateReportRule.md): one dialog, ten fixed sections, for every design method. */
#candidateReportDialog { border: 1px solid #a9bacd; border-radius: 8px; }
#candidateReportDialog .report-toolbar { flex-wrap: wrap; gap: 8px; padding: 6px 16px; }
#candidateReportDialog .report-toolbar > label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#candidateReportDialog .report-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
#candidateReportDialog .report-nav button { padding: 2px 8px; font-size: 12px; background: #fff; color: var(--ink); }
#candidateReportBody { padding: 0 16px 16px; }
#candidateReportBody h3 { margin: 20px 0 6px; padding-bottom: 3px; font-size: 15px; border-bottom: 1px solid var(--line); }
#candidateReportBody h4 { margin: 12px 0 4px; font-size: 13px; color: #334155; }
#candidateReportBody .table-wrap { min-height: 0; margin: 6px 0; }
#candidateReportBody p { margin: 6px 0; }
#candidateReportBody td { white-space: pre-line; overflow-wrap: anywhere; max-width: 600px; vertical-align: top; }
#candidateReportBody th { text-align: center; }
#candidateReportBody .report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
#candidateReportBody .report-summary div { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-weight: 600; overflow-wrap: anywhere; }
#candidateReportBody .report-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
#candidateReportBody .report-fail { color: #8b1d13; }
#candidateReportBody .report-legacy { color: #92400e; }
#candidateReportBody .mm-bars { display: flex; gap: 8px; align-items: flex-end; height: 128px; margin: 6px 0; }
#candidateReportBody .mm-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 64px; height: 100%; font-size: 12px; }
#candidateReportBody .mm-bar { width: 36px; background: #2f6f8f; border-radius: 3px 3px 0 0; }
#candidateReportBody .structure-2d-button { padding: 1px 6px; }
/* One summary table for the three methods, so a failed gate reads red in all three. */
:is(#realtimeTable, #rpaTable, #lampTable) td.report-fail { color: #8b1d13; }

/* Compact design results: declared columns, centered labels, right-aligned values.
   The three design methods render the same summary table (public/candidate-report.js), which ships a
   <colgroup> of per-column widths and a min-width of their sum. Positional widths are deliberately absent
   here: a nth-child width outlives the column order it was written for, and one left on the 4th column kept
   pinning 280 px to whatever landed there - ID, after the panel column arrived. Width belongs next to the
   column's own definition; this file only says how a cell behaves at the width it is given. */
#realtimeTable, #rpaTable, #lampTable { table-layout: fixed; }
/* Korean breaks at spaces, not between syllables: "표적 서열 커버리지" over two lines reads as
   "표적 서열 / 커버리지", never "표적 서열 커 / 버리지". break-word stays as the escape hatch for a token
   with no space in it at all, which would otherwise run out of its column. */
:is(#realtimeTable, #rpaTable, #lampTable) :is(th, td) {
  padding: 4px 5px; white-space: normal; word-break: keep-all; overflow-wrap: break-word;
  vertical-align: middle; line-height: 1.4;
}
:is(#realtimeTable, #rpaTable, #lampTable) th { text-align: center; }
:is(#realtimeTable, #rpaTable, #lampTable) td { text-align: right; font-variant-numeric: tabular-nums; }
/* A phrase is not a measurement: it wraps and reads from the left edge. */
:is(#realtimeTable, #rpaTable, #lampTable) td.cell-text { text-align: left; }
:is(#realtimeTable, #rpaTable, #lampTable) button { white-space: nowrap; }
:is(#realtimeTable, #rpaTable) .compact-cell-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; white-space: normal;
  line-height: 1.25; max-height: 2.5em; min-width: 0;
}
:is(#realtimeTable, #rpaTable, #lampTable) .rule-finding button { width: 100%; min-width: 0; padding: 3px 4px; text-align: right; }
:is(#realtimeTable, #rpaTable) .sequence-with-structure { display: flex; min-width: 0; width: 100%; align-items: center; justify-content: flex-end; gap: 4px; }
:is(#realtimeTable, #rpaTable) .sequence-with-structure .compact-cell-text { flex: 1; }
:is(#realtimeTable, #rpaTable) .structure-2d-button { flex-shrink: 0; }

#runLogDialog {  border: 1px solid var(--line); border-radius: 6px; }
#runLogDialog > form { display:flex; justify-content:space-between; margin-bottom:10px; }
#runLogSelect { min-width:0; flex:1; }
#runLogText { width:100%; height:65vh; resize:vertical; font-family:monospace; white-space:pre; }
#runLogNote { margin:8px 0; }

/* Primer binding maps: proportional overview and readable base-level detail. */
#primerReviewDialog {    padding: 16px; overflow: auto; }
.binding-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 12px; }
.binding-toolbar form { margin: 0; }
.binding-toolbar > button:last-child { margin-left: auto; }
.binding-toolbar label { display: flex; align-items: center; gap: 8px; }
.binding-toolbar input[type="range"] { width: 130px; }
.binding-intro { font-size: 13px; line-height: 1.6; }
.binding-overview { border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.binding-overview svg { display: block; width: 100%; min-width: 650px; }
.binding-overview { overflow-x: auto; }
.binding-overview [data-binding-site]:hover rect, .binding-overview [data-binding-site]:focus rect { stroke: #0f172a; stroke-width: 2; }
.binding-note { padding: 8px 12px; background: #f1f5f9; border-left: 3px solid #0f766e; font-size: 12px; line-height: 1.6; }
.binding-assembly { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px; margin: 8px 0; border: 1px solid #cbd5e1; }
.binding-assembly span { padding: 4px 8px; background: #eef2ff; overflow-wrap: anywhere; }
.binding-assembly code { display: block; font-size: 13px; }
.binding-scroll { overflow-x: auto; max-width: 100%; background: #fff; }
#primerReviewSequence { display: flex; align-items: flex-start; min-width: 0; border: 1px solid #cbd5e1; margin: 16px 0; }
.binding-fixed-labels { flex: 0 0 180px; width: 180px; background: #fff; border-right: 1px solid #e2e8f0; }
.binding-sequence-scroll { flex: 1 1 0; min-width: 0; }
#primerReviewSequence svg { display: block; max-width: none; }
.binding-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 570px), 1fr)); gap: 12px; }
.binding-card { min-width: 0; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.binding-card h3 { margin: 0 0 8px; font-size: 15px; }
.binding-card p { font-size: 12px; }
.binding-copy { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.binding-copy code { overflow-wrap: anywhere; font-size: 13px; }
.binding-mismatch { color: #b91c1c; background: #fee2e2; }

.lamp-fold-review { margin: 18px 0; padding: 14px; border: 1px solid #99c8c1; border-radius: 8px; background: #f8fbfb; }
.lamp-fold-review h3 { margin: 0 0 10px; }
.lamp-fold-review p { line-height: 1.6; font-size: 12px; }
.lamp-fold-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lamp-fold-steps button[aria-pressed="true"] { background: #0f766e; color: #fff; border-color: #0f766e; }
.lamp-fold-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,570px),1fr)); gap: 12px; }
.lamp-fold-cards article { min-width: 0; padding: 12px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; }
.lamp-fold-cards h4 { margin: 0 0 8px; font-size: 14px; }
.lamp-fold-cards details { margin: 10px 0; }
.lamp-fold-cards code { display: block; overflow-wrap: anywhere; margin: 10px 0; }
.lamp-fold-graphic svg { display: block; max-width: none; }
.lamp-fold-source { margin-bottom: 0; }

.lamp-fold-graphic[data-stage="folded"] svg { max-width: 100%; height: auto; }

/* Shared modal geometry, except compact progress and contextual help dialogs:
   border box occupies 95% of the browser viewport.
   Keep this after per-dialog and responsive styles so old pixel caps cannot win. */
dialog[id]:not(#analysisProgressDialog):not(.field-help-dialog) {
  box-sizing: border-box;
  position: fixed;
  inset: 2.5vh auto auto 2.5vw;
  inset-block-start: 2.5dvh;
  margin: 0;
  width: 95vw;
  height: 95vh;
  height: 95dvh;
  min-width: 0;
  min-height: 0;
  max-width: 95vw;
  max-height: 95vh;
  max-height: 95dvh;
  resize: none;
  overflow: auto;
}

/* Fill the available height while keeping headers and close actions accessible. */
dialog > .config-form {
  box-sizing: border-box;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
}
dialog > .config-form > .config-grid { align-content: start; }
#serverBrowser > .browser {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
}
#serverBrowser .browser-list { max-height: none; min-height: 0; align-content: start; }
/* All field help shares this dialog: size to its content, with a readable cap.
   Scroll only the explanation so both close actions remain visible. */
dialog.field-help-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: max-content;
  height: fit-content;
  min-width: 0;
  min-height: 0;
  max-width: min(38rem, calc(100vw - 32px));
  max-height: 80vh;
  max-height: 80dvh;
  resize: none;
  overflow: hidden;
}
.field-help-dialog > form {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: inherit;
  min-height: 0;
  overflow: hidden;
}
.field-help-dialog :is(header, footer) { flex: 0 0 auto; gap: 12px; }
.field-help-dialog header strong { min-width: 0; overflow-wrap: anywhere; }
.field-help-dialog header button { flex-shrink: 0; }
.field-help-dialog .field-help-content {
  flex: 0 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overflow-wrap: anywhere;
}
.field-help-dialog .field-help-content p { margin: 0; }
@media (max-width: 400px) {
  .field-help-content dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .field-help-content dd + dt { margin-top: 6px; }
}
#fieldHelpDialog .field-help-content,
#analysisProgressDialog .analysis-progress-content { overflow: auto; align-content: start; }
#analysisProgressContext, #analysisProgressDownload, #lampGoalFeedbackMessage { white-space: pre-line; overflow-wrap: anywhere; }
#analysisProgressDownload { margin: 6px 0; padding: 6px 8px; border-left: 3px solid #1f6feb; background: rgba(31,111,235,.07); }
:is(#primerReviewDialog, #candidateReportDialog, #lampMultiplexDetailDialog, #runLogDialog, #designRulesDialog)[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
:is(#primerReviewDialog, #candidateReportDialog, #lampMultiplexDetailDialog, #runLogDialog, #designRulesDialog) > * { flex-shrink: 0; }
#primerReviewBody, #candidateReportBody, #lampMultiplexDetails,
#designRulesDialog .design-rules-scroll {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  max-height: none;
  overflow: auto;
}
#runLogText { flex: 1 1 0; min-height: 0; height: auto; resize: none; }
dialog#lampMultiplexDetailDialog[open] { overflow: hidden; }
#lampMultiplexDetailDialog > form { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#lampMultiplexDetails { padding: 12px 16px; }
#lampMultiplexDetails > :is(p, h2) { margin: 0 0 12px; overflow-wrap: anywhere; }
#lampMultiplexDetails table { margin-bottom: 16px; }
#lampMultiplexDetails th { background: #eef4f7; }
#lampMultiplexDetails td { white-space: normal; overflow-wrap: anywhere; }

/* Candidate order action remains accessible at the right edge of wide tables. */
:is(#realtimeTable, #rpaTable, #lampTable) .order-cell {
  position: sticky; right: 0; background: var(--panel); z-index: 2; text-align: center;
  box-shadow: -1px 0 var(--line); min-width: 64px;
}
:is(#realtimeTable, #rpaTable, #lampTable) th.order-cell { z-index: 4; background: #eef4f7; }
#oligoOrderDialog { padding: 16px; }
#oligoOrderDialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#oligoOrderDialog > * { flex-shrink: 0; }
#oligoOrderMode[hidden] { display: none; }
.order-table-wrap { flex: 1 1 0; min-height: 0; overflow: auto; border: 1px solid var(--line); }
.order-table-wrap table { width: 100%; border-collapse: collapse; }
.order-table-wrap th { position: sticky; top: 0; background: #eef4f7; z-index: 1; }
.order-table-wrap th, .order-table-wrap td { padding: 7px; border: 1px solid var(--line); vertical-align: top; }
.order-table-wrap input:not([type="checkbox"]), .order-table-wrap select { width: 125px; }
.order-table-wrap td:nth-child(2) input { width: 200px; }
.order-table-wrap .order-sequence { min-width: 260px; max-width: 450px; white-space: normal; overflow-wrap: anywhere; }
.order-table-wrap td:last-child { min-width: 160px; white-space: normal; }
#oligoOrderVariants { max-height: 34vh; overflow: auto; border-top: 2px solid var(--line); margin-top: 10px; }
#oligoOrderVariants[hidden] { display: none; }
.order-variants h4 { margin: 10px 0 6px; }
.order-variant-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.order-variant-table caption { text-align: left; font-weight: 700; padding: 4px 0; }
.order-variant-table th { position: sticky; top: 0; background: #eef4f7; z-index: 1; }
.order-variant-table th, .order-variant-table td { padding: 6px 7px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.order-variant-table .order-sequence { min-width: 180px; white-space: normal; overflow-wrap: anywhere; }
.order-variant-note { margin: 4px 0 10px; }
.order-plan { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.order-plan label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.order-plan input { margin: 0; }
.order-variant-line { display: flex; align-items: baseline; gap: 8px; padding: 1px 0; }
.order-variant-line code { overflow-wrap: anywhere; }
.order-variant-tag { color: var(--muted); white-space: nowrap; }
.order-variant-table button.link { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; cursor: pointer; }
/* Red plus weight, so the mark does not rest on colour alone. */
.order-iupac { color: var(--danger); font-weight: 700; }
#oligoOrderNotes { max-height: 20vh; overflow: auto; }
#oligoOrderNotes p { margin: 6px 0; }

#experimentPlanDialog { padding: 16px; }
#experimentPlanDialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#experimentPlanDialog > * { flex-shrink: 0; }
#experimentPlanDialog > .plan-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
#experimentPlanContext { flex: 1 1 320px; }
#experimentPlanBody h2 { font-size: 17px; margin: 20px 0 10px; }
#experimentPlanBody h3 { font-size: 14px; margin: 12px 0; }
.plan-status { border: 1px solid #84b6aa; border-left: 4px solid #0f766e; border-radius: 5px; padding: 10px 14px; background: #f0fdfa; }
.plan-pending { background: #fff7ed; border-color: #d5a87e; border-left-color: #b45309; }
.plan-status ul { margin: 8px 0 0; padding-left: 20px; }
.plan-target { border: 1px solid var(--line); padding: 12px; border-radius: 5px; margin: 12px 0; }
.plan-table-wrap { overflow: auto; margin: 10px 0; }
.plan-table-wrap table { width: 100%; min-width: 780px; table-layout: fixed; }
.plan-table-wrap th { text-align: center; }
.plan-table-wrap td { vertical-align: top; text-align: right; overflow-wrap: anywhere; }
.plan-table-wrap td:first-child { text-align: left; }
.plan-table-wrap input { width: 100%; min-width: 70px; }
.plan-table-wrap label { display: grid; gap: 3px; font-size: 11px; }
.plan-sequence { font-family: monospace; overflow-wrap: anywhere; }
.plan-invalid { color: #b91c1c; font-weight: 700; }
#experimentPlanSteps { padding-left: 24px; }
#experimentPlanSteps li { margin-bottom: 12px; line-height: 1.6; }
.plan-sources { line-height: 1.8; font-size: 12px; }

/* Input space follows the value being entered, rather than the window width.
   Result tables and the 95% review dialogs keep their available viewing area. */
.compact-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  align-content: start;
  gap: 10px 16px;
  min-width: 0;
}
.compact-fields > label,
.compact-fields > .field-short { flex-basis: 140px; width: 140px; }
.compact-fields > .field-medium { flex-basis: 220px; width: 220px; }
.compact-fields > .field-wide { flex-basis: 320px; width: 320px; }
.compact-fields > .field-sequence { flex: 1 1 420px; max-width: 720px; }
.compact-fields > :is(.span-4, .form-section, .form-notes) { flex: 0 0 100%; width: 100%; }
.compact-fields > .check { flex: 0 1 auto; width: auto; }
.compact-fields label { overflow-wrap: anywhere; }
.compact-fields :is(input, select, textarea) { max-width: 100%; }
.compact-fields input[type="number"] { font-variant-numeric: tabular-nums; }
.design-form { max-width: 1280px; }
.design-form > .form-section {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 9px 12px 12px;
  background: #f8fafc;
}
.design-form .form-section legend { color: #34465a; font-weight: 700; }
.design-form .form-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.form-file-row > input[type="file"],
.form-file-row > .field-with-help { flex: 0 1 560px; width: min(560px, 100%); }
.form-file-row input[type="file"] { padding: 3px 6px; }
.form-file-row > label { flex: 0 0 auto; }
.design-form .form-notes { color: var(--muted); font-size: 12px; }
.form-notes summary { cursor: pointer; font-weight: 600; padding: 4px 0; color: #34465a; }
.form-notes p + p { margin-top: 6px; }
.form-notes[open] { padding-bottom: 6px; }
.design-form .lamp-note { font-size: 12px; line-height: 1.5; }
.design-form .lamp-settings { border-top: 1px solid var(--line); padding-top: 2px; }
.design-form .lamp-settings .compact-fields { padding: 6px 0; }
#lampForm { padding-right: 4px; }
#lampDialog > .action-row { flex-wrap: wrap; gap: 6px 12px; overflow: visible; }
#lampDialog > .action-row > label { display: flex; align-items: center; gap: 8px; }
#lampDialog > .action-row > span { color: var(--muted); font-size: 12px; }
#lampPrimerMode { max-width: 260px; }

/* Sequence editors retain enough width for an oligo and wrap longer inputs. */
#dklForm { max-width: 1640px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
#dklForm fieldset { display: flex; flex-wrap: wrap; align-content: start; gap: 10px 12px; min-width: 0; margin: 0; }
#dklForm fieldset:first-child { grid-column: auto; }
#dklForm fieldset > label { flex: 1 1 200px; max-width: 360px; }
#dklForm fieldset > .field-short { flex: 0 1 140px; }
#dklForm textarea { width: 100%; overflow-wrap: anywhere; font-size: 12px; }
#dklForm > .row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
#targetSearchForm { max-width: 720px; }
#targetSearchForm > label { flex: 1 1 400px; max-width: 560px; }
#gpuBlastOnlyForm { justify-items: start; }   /* 폭을 묶지 않는다 (2026-11-25): 서열 칸이 창의 폭을 다 쓴다 */
#gpuBlastOnlyForm > :is(input, .field-with-help) { width: min(380px, 100%); }
#gpuBlastOnlyForm > textarea { width: 100%; }
#gpuBlastOnlyForm .action-row { justify-content: start; }
.multi-oligo-form { display: flex; flex-wrap: wrap; }
.multi-oligo-input { flex: 1 1 600px; }
.multi-oligo-input-table-wrap { min-height: 0; }
.multi-oligo-run-controls { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 6px; }
.multi-oligo-run-controls > label { width: 112px; }
.multi-oligo-run-controls > button { width: 88px; }
#multiOligoInputTable th:first-child { width: 150px; }
#multiOligoInputTable th:nth-child(3) { width: 150px; }
#multiOligoInputTable { min-width: 520px; }

/* Settings windows: compact numeric editors, readable explanations. */
#lampWeightDialog, #lampMultiplexDialog { padding: 14px 16px; }
#lampWeightDialog > :is(p, fieldset, details, .action-row),
#lampMultiplexDialog > :is(p, #lampMultiplexControls) { max-width: 1440px; }
#lampWeightDialog > fieldset { min-width: 0; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; }
#lampWeightDialog legend { font-weight: 700; color: #34465a; }
#lampWeightDialog .qt-form { display: flex; flex-wrap: wrap; align-items: start; gap: 12px 20px; }
#lampWeightDialog .qt-form > label { flex: 0 1 260px; width: 260px; max-width: 100%; }
#lampWeightDialog label > :is(input[type="number"], .field-with-help),
#weightConfigForm label > .field-with-help { width: 140px; max-width: 100%; }
#lampWeightDialog label > input[type="number"] { width: 108px; }
#lampWeightDialog label small { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.5; }
#lampWeightDialog p { margin-top: 7px; line-height: 1.5; }
#lampMultiplexControls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin: 12px 0; }
#lampMultiplexControls label { flex: 0 1 190px; width: 190px; max-width: 100%; }
#lampMultiplexControls label:has(select) { flex-basis: 260px; width: 260px; }
#lampMultiplexControls label:has(input[type="number"]) > .field-with-help { width: 140px; max-width: 100%; }
#weightConfigForm .weight-grid { max-width: 1600px; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#weightConfigForm .weight-summary-panel { display: flex; flex-wrap: wrap; align-content: start; min-height: 0; }
#weightConfigForm .weight-summary-panel > label { flex: 0 1 170px; max-width: 100%; }
#weightConfigForm .weight-summary-panel > :is(p, output) { flex-basis: 100%; }
#weightConfigForm .weight-item-table .field-with-help { width: 126px; max-width: 100%; }
#weightConfigForm .mmx-weight-table { width: min(900px, 100%); }
#weightConfigForm .mmx-weight-table .field-with-help { width: 96px; max-width: 100%; }
.p3-config-layout { max-width: 1460px; width: 100%; grid-template-columns: minmax(0, 760px) minmax(300px, 440px); }
.p3-config-table .field-with-help { max-width: 130px; margin-inline: auto; }
.p3-side-panels label { grid-template-columns: minmax(0, 1fr) 44px 132px; }
.p3-config-layout fieldset { min-width: 0; margin: 0; }
.config-file-actions { flex-wrap: wrap; }

@media (max-width: 1200px) {
  #weightConfigForm .weight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #weightConfigForm .primer-weight-panel { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .p3-config-layout { grid-template-columns: minmax(0, 1fr); }
  .p3-side-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
  #weightConfigForm .weight-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .compact-fields { gap: 10px; }
  .compact-fields > label { max-width: 100%; }
  .compact-fields > .field-short { flex-basis: 140px; }
  .design-form .form-file-row > input[type="file"] { flex-basis: 100%; }
  #lampDialog > .action-row > label { flex-wrap: wrap; }
  #lampWeightDialog, #lampMultiplexDialog { padding: 10px; }
  .p3-config-table th, .p3-config-table td { padding: 3px; }
  .p3-config-table th:first-child { width: 25%; }
  .p3-config-table th:nth-child(2) { width: 9%; }
  .p3-config-table input { padding-inline: 3px; }
}

/* Evidence tables keep long annotations readable inside the settings scroller. */
.lamp-region-review { margin:12px 0; padding:12px; border:1px solid var(--border,#cbd5e1); border-radius:6px; background:#f8fafc; }
.lamp-region-review h3 { font-size:14px; margin:8px 0; }
.lamp-region-review p { white-space:normal; overflow-wrap:anywhere; margin:6px 0; }
.lamp-review-table { max-height:340px; overflow:auto; margin:8px 0 14px; }
.lamp-review-table table { width:100%; min-width:950px; table-layout:auto; }
.lamp-review-table th { text-align:center; position:sticky; top:0; background:#eaf0f6; z-index:1; }
.lamp-review-table td,.lamp-review-table th { white-space:pre-line; overflow-wrap:anywhere; padding:7px; max-width:340px; }
.lamp-review-table td { text-align:right; vertical-align:top; }
.lamp-review-table input[type=checkbox] { width:auto; }

#lampTaxidWorkflow[hidden],#lampFastaFile[hidden] { display:none!important; }
.lamp-gene-picker { background:#f8fafc; border:1px solid #cbd5e1; border-radius:5px; padding:10px; min-width:0; }
.lamp-gene-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)); gap:6px; max-height:280px; overflow:auto; }
.lamp-gene-list label { display:flex; align-items:flex-start; gap:8px; padding:8px; border:1px solid #cbd5e1; border-radius:4px; white-space:normal; overflow-wrap:anywhere; }
.lamp-gene-list label:has(input:checked) { background:#d8efeb; border-color:#0f766e; }
.lamp-gene-list input[type=checkbox] { width:auto; flex-shrink:0; }
.lamp-gene-list small { display:block; }

.lamp-gene-census { display:grid; gap:6px; padding:8px; margin-top:8px; border-top:1px solid var(--line); background:#eef8f6; overflow-wrap:anywhere; }

/* Column help: a small "?" right of every result-table header (public/column-help.js). */
.th-with-help { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.th-with-help > span { min-width: 0; }
:is(#realtimeTable, #rpaTable) .th-with-help > .compact-cell-text { flex: 1; }
.order-variant-cov { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Folded condition groups ─────────────────────────────────────────────────
   A design run takes about fifty inputs and the operator decides about eight. The conditions fold away so the
   decisions are what the screen shows; the badge on a folded group says how many of its values differ from the
   shipped default, because a collapsed group that hides an edit makes the run unreproducible from the screen. */
details.form-advanced {
  grid-column: 1 / -1; margin: 6px 0 2px; padding: 0 0 0 10px;
  border-left: 3px solid var(--line); background: transparent;
}
details.form-advanced > summary {
  cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 3px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
details.form-advanced[open] > summary { color: inherit; }
details.form-advanced.has-changes { border-left-color: var(--accent); }
.form-tier-badge {
  font-weight: 500; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; white-space: nowrap;
}
.form-tier-badge.changed { color: var(--accent); border-color: var(--accent); font-weight: 700; }
/* The edited field itself, so opening the group shows at a glance which value is not the default. */
[data-tier-changed] { position: relative; }
[data-tier-changed] > input, [data-tier-changed] > select, [data-tier-changed] > textarea {
  border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent);
}

/* ── Panel cards: the comparison a result exists to support ──────────────────
   One card per panel, in the terms a panel is chosen on - coverage, the subtype it is worst at, how many
   components and how many tubes that is. Nothing here is new measurement; it is the information needed before
   deciding which table to read. The same card shape carries the collected population, because the floors are
   chosen against it. */
.panel-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.panel-card {
  flex: 1 1 260px; min-width: 240px; max-width: 420px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfdff;
}
.panel-card.chosen { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.panel-card h4 { margin: 0 0 6px; font-size: 13px; }
.panel-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.panel-card dl > div { display: contents; }
.panel-card dt { color: var(--muted); font-size: 11px; align-self: center; }
.panel-card dd { margin: 0; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel-card-note { margin: 8px 0 0; font-size: 11px; color: var(--muted); line-height: 1.45; }
.population-card .panel-card { background: #fcfcf7; }

/* ── The triage at the top of a result ───────────────────────────────────────
   Everything that changes what the operator does next, raised once instead of spread over a dozen tables. */
.consensus-issue-box > summary { font-weight: 700; }
.consensus-issue-box.issue-blocked > summary { color: #8b1d13; }
.consensus-issues { margin: 6px 0 0; padding-left: 18px; }
.consensus-issues li { margin: 3px 0; line-height: 1.5; }
.consensus-issues li.issue-blocked { color: #8b1d13; font-weight: 600; }
.consensus-issues li.issue-info { color: var(--muted); }

/* ── Procedure 1: consensus 추출 ──────────────────────────────────────────────
   One input and one button, on one line at desk width and stacked on a narrow one. The screen
   asks for the disease because that is what the person knows; everything the run needs after
   that - the taxon, the genes, the scope - the procedure derives and then shows for approval. */
.procedure-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 14px 0 0;   /* 폭 제한을 두지 않는다: 입력 칸이 작업 칸의 남는 폭을 쓴다. */
}
.procedure-form label { font-weight: 600; white-space: nowrap; }
.procedure-form input { flex: 1 1 320px; min-width: 240px; }
.procedure-form button { white-space: nowrap; }
.procedure-status { margin: 10px 0 0; color: var(--muted); min-height: 1.2em; }
.procedure-status.failed { color: #8b1d13; }
/* 결과 영역은 작업 칸의 폭을 그대로 쓴다. 넓은 표(단계별 후보 수 등)가 고정 폭에 갇혀 가로로
   스크롤되지 않게 하고, 긴 설명 문단만 읽기 좋은 폭으로 둔다. */
#procedure1Result { margin-top: 14px; max-width: none; min-width: 0; }
#procedure1Result table { border-collapse: collapse; width: auto; font-size: 12px; }
#procedure1Result th, #procedure1Result td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
#procedure1Result th { background: #f4f7fb; font-weight: 600; }
#procedure1Result .procedure-note { color: var(--muted); line-height: 1.5; margin: 8px 0 0; max-width: 160ch; }
#procedure1Result .procedure-rejected td { color: #8b1d13; }
#procedure1Result .procedure-note.failed { color: #8b1d13; }
/* 실행 버튼 바로 아래의 안내: 범위를 승인하는 동안과, 승인이 실패해 실행을 시작하지 못했을 때. */
#procedure1AutoNote { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
#procedure1AutoNote.failed { color: #8b1d13; font-weight: 600; }

/* The candidate list: every hit the name matched, one radio each. The recommended row is
   tinted rather than moved on its own, so the list still reads in search order. */
#procedure1Result table.procedure-targets { width: 100%; }
#procedure1Result tr.procedure-recommended td { background: #f2f8f5; }
#procedure1Result tr.procedure-recommended td:last-child { color: var(--accent); font-weight: 600; }
.procedure-pick { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
.procedure-pick input { margin: 0; }

/* The scope of the chosen target: what S1 will collect, before it collects it. */
.procedure-scope { margin-top: 18px; }
.procedure-scope h3 { margin: 0 0 10px; font-size: 14px; }
.procedure-scope fieldset {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px;
}
.procedure-scope legend { font-weight: 600; padding: 0 6px; }
.procedure-choices {
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 260px; overflow-y: auto;
}
.procedure-choices .check { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* PR2 target range: the inputs a chosen target and a chosen specimen already determine. */
.procedure-scope h3 small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.procedure-range { margin-top: 18px; }
.procedure-goals { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.procedure-goals label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.procedure-goals input, .procedure-goals select { width: 120px; }

/* PR1 §17 범위별 자동 실행: 단위별 요약 목록과 선택 표. */
.procedure-auto { margin-top: 12px; }
.procedure-auto-units { margin: 8px 0; padding-left: 18px; }
.procedure-auto-units li { margin: 4px 0; }
.procedure-auto-units .failed { color: #8b1d13; }

/* 선택지로 고르는 화면 (2026-11-21): 실행 방식, 빠른 연도 선택, 함께 넣을 표기, 실행 요약과 알림. */
.procedure-mode { display: grid; gap: 6px; margin: 4px 0 10px; }
.procedure-mode label.check { display: flex; align-items: flex-start; gap: 8px; }
.procedure-mode label.check input { margin-top: 3px; }
.procedure-mode small { display: block; color: var(--muted); font-size: 12px; font-weight: normal; }
.procedure-option { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.procedure-chip {
  min-height: 0; padding: 1px 8px; margin-left: 4px; font-size: 12px; border-radius: 10px;
  border: 1px solid var(--line, #c9d1dc); background: transparent; color: inherit; cursor: pointer;
}
.procedure-chip:hover { background: rgba(0, 0, 0, 0.06); }
.procedure-quick { margin: 0 6px; }
.procedure-extras { margin: 6px 0 0; font-size: 13px; }
.procedure-extras label.check { margin-left: 8px; }
.procedure-range-details { margin: 8px 0; }
.procedure-range-details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.procedure-range-details > summary small { font-weight: normal; color: var(--muted); margin-left: 6px; }
.procedure-choices label.check[hidden] { display: none; }
.procedure-summary { margin: 12px 0 4px; font-weight: 600; }
.procedure-warnings { margin: 0 0 8px; padding-left: 18px; color: #8b1d13; font-size: 13px; }
.procedure-warnings:empty { display: none; }

/* PR3_2 §7 candidate derivation. A checkbox belongs beside its words, so these labels opt out
   of the column layout the goal fields use. The run button is disabled while no gene is
   checked: refusing the press says why, where a press that quietly returns does not. */
.procedure-goals label.procedure-inline {
  flex-direction: row; align-items: center; gap: 5px; white-space: nowrap;
}
.procedure-goals label.procedure-inline input { width: auto; min-height: 0; }
#procedure1AssayConfigs { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.procedure-run { align-self: center; }
.procedure-run:disabled, .procedure-run:disabled:hover {
  cursor: not-allowed; opacity: 0.55; background: #f2f4f7;
  color: var(--muted); border-color: var(--line);
}
.procedure-advanced { margin-top: 10px; }
.procedure-advanced summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.procedure-advanced > .procedure-goals { margin-top: 8px; }
/* 서열을 직접 넣는 갈래: 서열 칸이 작업 칸의 폭을 다 쓰고, 파일·taxid·비우기는 그 아래 한 줄이다.
   (전에는 .procedure-goals의 120px 칸이어서 FASTA가 몇 글자만 보이고 파일 이름이 잘렸다.) */
.procedure-fasta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.procedure-fasta label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.procedure-fasta textarea {
  width: 100%; box-sizing: border-box; min-height: 220px;
  font-size: 13px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere;
}
.procedure-fasta-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.procedure-fasta-row input[type="file"] { width: 420px; max-width: 100%; }
.procedure-fasta-row #procedure1FastaTaxid { width: 160px; }
#procedure1FastaBlock > summary { font-size: 13px; font-weight: 600; color: var(--ink); }
#procedure1FastaBlock > summary small { font-weight: 400; color: var(--muted); margin-left: 6px; }
#procedure1FastaBlock .procedure-note { color: var(--muted); line-height: 1.5; margin: 8px 0 0; }
#procedure1FastaBlock #procedure1FastaNote:empty { display: none; }
@media (max-width: 640px) { .procedure-fasta-row input[type="file"] { width: 100%; } }
.procedure-exclusion { margin: 0 0 12px; }
.procedure-exclusion h4 { margin: 0 0 6px; font-size: 12px; }
.procedure-exclusion h4 span {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px;
  background: #eef2f7; color: var(--muted); font-weight: 400;
}

/* The annotated regions are shown, not offered for ticking: PR1 §5.2 puts them all in and R1
   ranks them from the records (INV-9). The ranked table below is where unchecking happens. */
.procedure-regions { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.procedure-regions span {
  padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: #f7f9fc; font-size: 12px;
}
#procedure1Ranking tr.procedure-unchecked td { color: var(--muted); }

/* The ranked table's sort key, called out: the column beside it (raw window count) is not the
   order, and a reader who assumes it is reads the table as unsorted. */
#procedure1Ranking th.procedure-sortkey { background: #e8f1ec; }
#procedure1Ranking td.procedure-sortkey { font-weight: 700; font-variant-numeric: tabular-nums; }
.procedure-pending { opacity: 0.75; }
.procedure-scope legend small { font-weight: 400; color: var(--muted); margin-left: 4px; }

/* S0a: the counts before the collection. The bars are there so "how much of this is recent"
   is one glance rather than an arithmetic exercise. */
.procedure-total { margin: 0 0 8px; font-size: 13px; }
.procedure-total span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.procedure-bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin: 0 0 10px; }
.procedure-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.procedure-bar span { display: block; width: 14px; background: var(--accent); border-radius: 2px 2px 0 0; }
.procedure-bar em { font-size: 10px; color: var(--muted); font-style: normal; margin-top: 2px; }

/* The year range: a blue start and a red end, dragged along the bars they select. Triangles
   rather than knobs because each one points at the bar it has landed on, so the eye can check
   the selection against the histogram without reading the numbers. */
.procedure-chart { position: relative; margin: 0 0 6px; display: inline-block; }
.procedure-bars { margin-bottom: 0; }
.procedure-bar.procedure-outside span { background: #cfd8e3; }
.procedure-bar.procedure-outside em { opacity: 0.45; }
.procedure-track { position: relative; height: 16px; margin-top: 2px; cursor: pointer; }
.procedure-handle {
  position: absolute; top: 0; width: 0; height: 0; margin-left: -6px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 10px solid var(--accent); cursor: ew-resize; touch-action: none;
}
.procedure-handle[data-handle="lo"] { border-bottom-color: #1f6feb; }
.procedure-handle[data-handle="hi"] { border-bottom-color: #c0392b; }
.procedure-handle:focus-visible { outline: 2px solid #1f6feb; outline-offset: 3px; }
.procedure-handle.dragging { filter: brightness(1.25); }
.procedure-range-label { margin: 2px 0 8px; font-size: 12px; }
.procedure-range-label b { font-variant-numeric: tabular-nums; }
.procedure-range-label .procedure-note { display: inline; margin-left: 8px; }

/* The two figures the scope decides: how much the run is built from, and how much still has to
   be fetched. Side by side because the second is the one that costs time. */
.procedure-two { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 2px 0 10px; }
.procedure-figure { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.procedure-figure b { font-size: 15px; color: var(--ink, #222); font-variant-numeric: tabular-nums; }
.procedure-figure em { font-style: normal; font-size: 11px; line-height: 1.4; }

/* PR1 §15.3 — the `?` beside an item's title. Click or Enter/Space, never hover: a touch screen
   has no hover, and a table header is narrow enough to open one by accident. */
/* 모양은 위의 공통 규칙(도움말 "?")이다. 여기는 열려 있을 때의 표시만. */
.help-dot[aria-expanded="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.help-popover {
  position: absolute; z-index: 60; width: 360px; max-width: calc(100vw - 16px);
  max-height: 60vh; overflow-y: auto; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); font-size: 12px; line-height: 1.55;
}
.help-popover h4 { margin: 0 0 6px; font-size: 13px; }
.help-popover .help-summary { margin: 0 0 6px; font-weight: 700; }
.help-popover .help-detail { margin: 0 0 8px; color: #333; }
.help-popover .help-row { margin: 4px 0; color: var(--muted); }
.help-popover .help-row b { color: #333; margin-right: 4px; }
.help-popover .help-caution b { color: #8b1d13; }
.help-popover .help-todo { color: #8b1d13; }

/* PR3_2_guideline_LAMP.md 20절 — 실시간 조건 조정.
 *
 * 한 줄에 "설정 이름 · 입력 · 단위 · 상속 상태"가 보이게 둔다. 20.3절이 단계 행에서 적용값과
 * 공통 상속/재정의를 함께 표시하라고 했으므로 상속 상태는 접힌 자리에 숨기지 않는다. 색만으로
 * 상태를 전하지 않으려고 글자를 함께 둔다 (20.10절). */
#lampLive .lamp-live-top { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
#lampLive h4 { margin: 14px 0 6px; font-size: 13px; }
#lampLive .lamp-live-fields {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 4px 14px;
}
#lampLive .lamp-live-field {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px;
  padding: 2px 4px; border-radius: 3px;
}
#lampLive .lamp-live-field.failed { background: #fdf0ee; }
#lampLive .lamp-live-field-name { flex: 0 0 210px; color: var(--muted); font-family: ui-monospace, monospace; }
#lampLive .lamp-live-field input[type=number] { width: 78px; }
#lampLive .lamp-live-field input[type=text] { width: 150px; }
#lampLive .lamp-live-field select { max-width: 150px; }
#lampLive .lamp-live-unit { color: var(--muted); min-width: 40px; }
#lampLive .lamp-live-source { color: var(--muted); font-size: 11px; }
#lampLive .lamp-live-fixed { color: #8b1d13; font-size: 11px; }
#lampLive .lamp-live-error { color: #8b1d13; font-size: 11px; flex: 1 1 100%; }
#lampLive table.procedure-targets { width: 100%; }
#lampLive tr.chosen > td { background: #eef5ff; }
#lampLive tr.lamp-live-stage.open > td { background: #f6f7f9; font-weight: 600; }
#lampLive tr.lamp-live-stage-detail > td { background: #fbfbfc; }
/* 20.2절의 단계 행: 왼쪽 단계명, 가운데 후보 수, 오른쪽 조건 입력창. 조건 칸이 가장 넓고
 * 숫자 칸은 위쪽 정렬이라 여러 줄이어도 행이 어긋나지 않는다. */
#lampLive table.lamp-live-stages > tbody > tr > td { vertical-align: top; }
#lampLive table.lamp-live-stages .lamp-live-stage-name { white-space: nowrap; font-weight: 600; width: 1%; }
#lampLive table.lamp-live-stages .lamp-live-counts { min-width: 180px; width: 22%; }
/* 후보 수는 단위 이름과 숫자를 붙여 세로로 쌓는다. 단위가 다른 수를 한 줄에 합쳐 읽히지
 * 않게 하려는 것이다 (20.1절 (3)). */
#lampLive .lamp-live-count { display: block; font-size: 11px; color: var(--muted); }
#lampLive .lamp-live-count b { font-size: 13px; color: var(--fg, #1a1a1a); margin-left: 4px; }
#lampLive .lamp-live-mark { display: inline-block; margin-top: 2px; font-size: 11px; color: #8a5a00; }
#lampLive .lamp-live-unknown { color: var(--muted); }
#lampLive table.lamp-live-stages .lamp-live-stage-fields { width: 60%; }
#lampLive table.lamp-live-stages .lamp-live-stage-fields .lamp-live-fields {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 10px;
}
#lampLive table.lamp-live-stages .lamp-live-field-name { flex: 0 0 auto; min-width: 86px; font-size: 11px; }
#lampLive .lamp-live-row-actions { display: flex; gap: 6px; margin-top: 3px; }
#lampLive .lamp-live-row-actions button { font-size: 11px; padding: 1px 6px; }
#lampLive .lamp-live-extra { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 4px; }
/* 좁은 화면에서는 조건 칸을 같은 행의 아래쪽으로 접어 내린다. 소유 단계는 그대로다. */
@media (max-width: 1280px) {
  #lampLive table.lamp-live-stages > tbody > tr.lamp-live-stage { display: block; border-top: 1px solid var(--line); }
  #lampLive table.lamp-live-stages > tbody > tr.lamp-live-stage > td { display: block; border: 0; width: auto; }
  #lampLive table.lamp-live-stages > thead { display: none; }
}
/* 20.2절의 단계별 후보 수. 단위 이름과 숫자를 붙여 세로로 쌓아, 단위가 다른 수가 한 줄로
 * 읽히지 않게 한다. 일회성 실행 결과와 조건 조정 패널이 같은 모양을 쓴다. */
.procedure-count { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.procedure-count b { font-size: 13px; color: var(--fg, #1a1a1a); margin-left: 4px; }
/* 유전자를 열로 세운 표. 유전자가 많으면 가로로 스크롤하고 왼쪽 두 칸은 그대로 둔다. */
.procedure-wide { overflow-x: auto; }
table.procedure-stage-matrix { min-width: 100%; }
table.procedure-stage-matrix th { white-space: nowrap; }
table.procedure-stage-matrix th .procedure-gene-length { font-weight: 400; color: #5f6b7a; }
table.procedure-stage-matrix td.procedure-stage-id { font-weight: 600; white-space: nowrap; }
table.procedure-stage-matrix td.procedure-num { vertical-align: top; }
table.procedure-stage-matrix td.procedure-num.failed { background: #fdf0ee; }
#lampLive .lamp-live-log { margin: 4px 0 0; padding-left: 18px; font-size: 11px; color: var(--muted); max-height: 180px; overflow: auto; }
#lampLive #lampLiveDraft { font-weight: 600; }
