.seq-cal-page-actions {
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seq-cal-import-example {
  font-size: 0.78rem;
  max-height: 180px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.seq-cal-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.seq-cal-set-card {
  text-align: left;
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border-soft, #d7e0e3);
  border-left: 5px solid var(--app-primary, #07554f);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.06);
  padding: 16px 16px 14px;
  cursor: pointer;
}

.seq-cal-set-card.has-curve {
  border-left-color: #079455;
}

.seq-cal-set-card.missing-curve {
  border-left-color: #d92d20;
  background: #fffafa;
  box-shadow: 0 3px 10px rgba(217, 45, 32, 0.08);
}

.seq-cal-set-card.missing-curve.is-active {
  border-color: #d92d20;
  background: #fef3f2;
}

.seq-cal-set-curve-status {
  margin: 0 0 8px;
}

.seq-cal-curve-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
}

.seq-cal-curve-badge-ready {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.seq-cal-curve-badge-ready::before {
  content: "✓";
  font-weight: 700;
}

.seq-cal-curve-badge-missing {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.seq-cal-curve-badge-missing::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.seq-cal-set-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--app-text, #102d35);
}

.seq-cal-set-card.is-active {
  border-color: var(--app-primary, #07554f);
  background: var(--app-surface-soft, #f0f4f3);
}

.seq-cal-set-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--app-text-muted, #566c74);
  font-size: 0.86rem;
}

.seq-cal-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.seq-cal-detail-header h3 {
  margin: 0;
}

.seq-cal-table th {
  color: var(--app-text-secondary, #354f58);
  font-weight: 650;
}

.seq-cal-selected-row {
  background: rgba(7, 85, 79, 0.08);
}

.seq-cal-missing-row td {
  color: #b42318;
}

.seq-cal-results-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.seq-cal-results-sidebar h3,
.seq-cal-results-sidebar h4,
.seq-cal-results-main h3 {
  margin-top: 0;
}

.seq-cal-advice {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--app-border-soft, #d7e0e3);
}

.seq-cal-advice h5 {
  margin: 0 0 6px;
}

.seq-cal-advice p {
  margin: 0 0 8px;
  color: var(--app-text-secondary, #354f58);
}

.seq-cal-advice ul {
  margin: 0;
  padding-left: 18px;
}

.seq-cal-advice-check span {
  display: block;
  font-size: 0.88rem;
  color: var(--app-text-muted, #566c74);
}

.seq-cal-advice-apply {
  background: #ecfdf3;
  border-color: #86efac;
}

.seq-cal-advice-caution {
  background: #fffaeb;
  border-color: #fcd34d;
}

.seq-cal-advice-avoid {
  background: #fef3f2;
  border-color: #fca5a5;
}

.seq-cal-advice-check.is-pass strong::before {
  content: "✓ ";
  color: #067647;
}

.seq-cal-advice-check.is-caution strong::before,
.seq-cal-advice-check.is-unknown strong::before {
  content: "? ";
  color: #b54708;
}

.seq-cal-advice-check.is-fail strong::before {
  content: "× ";
  color: #b42318;
}

@media (max-width: 980px) {
  .seq-cal-results-layout {
    grid-template-columns: 1fr;
  }
}

.seq-cal-kind-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.seq-cal-kind-calibrator {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.seq-cal-kind-sample {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.seq-cal-row-calibrator td {
  background: #eef6ff;
}

.seq-cal-row-calibrator td:first-child {
  box-shadow: inset 4px 0 0 #2563eb;
}

.seq-cal-row-sample td {
  background: #f9fafb;
}

.seq-cal-row-sample td:first-child {
  box-shadow: inset 4px 0 0 #9ca3af;
}

.seq-cal-kind-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 14px;
}

.seq-cal-kind-legend-text {
  color: #667085;
  font-size: 0.82rem;
  margin-right: 10px;
}

.seq-cal-sample-name-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.seq-cal-member-label {
  color: #475467;
  font-size: 0.82rem;
  font-weight: 500;
}

.seq-cal-collapsible {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: var(--app-surface, #fff);
  margin-bottom: 18px;
  overflow: hidden;
}

.seq-cal-collapsible:last-child {
  margin-bottom: 0;
}

.seq-cal-collapsible-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  background: #ffffff;
}

.seq-cal-section-heading {
  margin: 0;
  color: var(--app-text, #102d35);
  font-size: 32px;
  font-weight: 750;
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
}

.seq-cal-section-title {
  display: block;
}

.seq-cal-section-subtitle {
  display: block;
  width: 100%;
  margin-top: 4px;
  color: #667085;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.seq-cal-section-emphasis {
  font-weight: 700;
  text-decoration: underline;
}

.seq-cal-collapsible-count {
  color: #667085;
  font-size: 24px;
  font-weight: 500;
}

.seq-cal-collapsible-summary::-webkit-details-marker {
  display: none;
}

.seq-cal-collapsible-summary::before {
  content: "▸";
  color: #667085;
  font-size: 6rem;
  line-height: 1;
  flex-shrink: 0;
  align-self: center;
  transition: transform 0.15s ease;
}

.seq-cal-collapsible[open] > .seq-cal-collapsible-summary::before {
  transform: rotate(90deg);
}

.seq-cal-collapsible-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--app-border-soft, #e4e7ec);
}

.seq-cal-set-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seq-cal-set-manage-btn,
.seq-cal-set-curve-btn,
.seq-cal-set-delete-btn {
  pointer-events: auto;
}

.modal:has(.seq-cal-curve-compute-modal) .modal-dialog {
  width: min(96vw, 1280px);
  max-width: min(96vw, 1280px);
  margin: 1.25rem auto;
}

.modal:has(.seq-cal-curve-compute-modal) .modal-content,
.modal:has(.seq-cal-detail-modal) .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2.5rem);
  overflow: hidden;
}

.modal:has(.seq-cal-curve-compute-modal) .modal-header,
.modal:has(.seq-cal-detail-modal) .modal-header,
.modal:has(.seq-cal-curve-compute-modal) .modal-footer,
.modal:has(.seq-cal-detail-modal) .modal-footer {
  flex: 0 0 auto;
}

.modal:has(.seq-cal-curve-compute-modal) .modal-footer,
.modal:has(.seq-cal-detail-modal) .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal:has(.seq-cal-curve-compute-modal) .modal-body,
.modal:has(.seq-cal-detail-modal) .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.seq-cal-curve-compute-modal {
  max-height: none;
  overflow: visible;
}

.seq-cal-modal-close-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.seq-cal-curve-compute-actions {
  margin: 8px 0 14px;
}

.seq-cal-curve-compute-preview {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border-soft, #e4e7ec);
}

.seq-cal-curve-compute-modal .seq-cal-detail-plot {
  width: 100%;
  max-width: none;
}

.seq-cal-curve-actions {
  width: 48px;
  text-align: right;
  white-space: nowrap;
}

.seq-cal-curve-row {
  cursor: pointer;
}

.seq-cal-curve-row:hover {
  background: rgba(7, 85, 79, 0.06);
}

.seq-cal-curve-row-active {
  background: rgba(7, 85, 79, 0.08);
}

.seq-cal-curve-row-active:hover {
  background: rgba(7, 85, 79, 0.12);
}

.seq-cal-active-curve-note {
  margin: 0 0 10px;
}

.seq-cal-curve-badge-active {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.seq-cal-curve-badge-inactive {
  color: #475467;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
}

.modal:has(.seq-cal-detail-modal) .modal-dialog {
  width: min(96vw, 1600px);
  max-width: min(96vw, 1600px);
  margin: 1.25rem auto;
}

.seq-cal-detail-modal {
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

.seq-cal-detail-modal .seq-cal-detail-plot {
  width: 100%;
  max-width: none;
}

.seq-cal-detail-modal-header {
  margin-bottom: 12px;
}

.seq-cal-detail-sample-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(7, 85, 79, 0.06);
  border: 1px solid rgba(7, 85, 79, 0.14);
}

.seq-cal-detail-kv th {
  width: 160px;
  color: var(--app-text-secondary, #354f58);
  font-weight: 600;
}

.seq-cal-detail-truth-block {
  margin: 14px 0 18px;
}

.seq-cal-detail-truth-block h5 {
  margin: 0 0 8px;
}

.seq-cal-detail-curve-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
}

.seq-cal-detail-plot {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: 12px 0 18px;
  border: 1px solid var(--app-border-soft, #e4e7ec);
  border-radius: 10px;
  background: #fff;
}

.modal-dialog.modal-lg .seq-cal-detail-modal .seq-metric-cards,
.seq-cal-detail-modal .seq-metric-cards {
  margin-bottom: 12px;
}

