:root {
  --bg: #e79f31;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #faf7ec;
  --stroke: rgba(0, 0, 0, 0.08);
  --stroke-strong: rgba(0, 0, 0, 0.14);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #d98b19;
  --accent-deep: #b5720f;
  --bright: #fdb73e;
  --warn: #c79769;
  --bad: #c55f5f;
  --good: #d98b19;
  --shadow: 0 18px 48px rgba(60, 45, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(253, 212, 139, 0.55), transparent 42%),
    radial-gradient(circle at bottom right, rgba(217, 139, 25, 0.4), transparent 40%),
    linear-gradient(180deg, #ecaa45, #e79f31 55%, #db8f23);
  background-attachment: fixed;
}

.app-shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
}

.hero,
.timeline,
.panel,
.history-item,
.empty-state,
.lookup-card,
.metric-card,
.recommendation-card {
  border: 1px solid var(--stroke);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  align-items: center;
  gap: 1.4rem;
  border-radius: 24px;
  padding: 1.8rem 2rem;
}

.eyebrow,
.tiny-label,
.metric-label,
.timeline-copy,
.panel-copy,
.history-meta,
.status,
label {
  color: var(--muted);
}

.panel-copy {
  margin-top: 0.35rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.06rem;
}

.hero-copy {
  display: grid;
  gap: 0.9rem;
}

.hero-visual {
  display: grid;
  gap: 0.9rem;
  justify-items: center;
}

.brand-mark-shell {
  width: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  border-radius: 24px;
  background: #f3f0e6;
}

.brand-mark {
  width: min(100%, 520px);
  height: auto;
  display: block;
}

.hero-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hero-stat {
  border-radius: 18px;
  padding: 1rem;
  background: #ffffff;
}

.hero-stat-value {
  margin-top: 0.25rem;
  font-size: 1.8rem;
  color: #1d1d1f;
}

.hero-stat-copy {
  color: var(--muted);
  line-height: 1.65;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.auth-hero {
  min-height: 430px;
}

.login-card {
  display: grid;
  gap: 0.9rem;
  width: min(100%, 430px);
  justify-self: center;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 1.2rem;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.onboarding-shell {
  min-height: 640px;
}

.onboarding-card {
  display: grid;
  gap: 1rem;
  width: min(100%, 860px);
}

.onboarding-fields {
  background: rgba(250, 247, 236, 0.8);
}

.onboarding-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
}

.onboarding-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.onboarding-tag-active {
  background: rgba(217, 139, 25, 0.18);
  border: 1px solid rgba(217, 139, 25, 0.22);
}

.auth-error {
  margin: 0;
  color: var(--bad);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 1rem;
  margin-top: 1rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  border-radius: 20px;
  padding: 0.9rem;
}

.timeline-item {
  border-radius: 16px;
  padding: 0.9rem;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
}

.timeline-active {
  border-color: rgba(253, 183, 62, 0.42);
}

.timeline-complete {
  border-color: rgba(217, 139, 25, 0.35);
  background: rgba(250, 247, 236, 0.95);
}

.timeline-locked {
  opacity: 0.68;
}

.timeline-number,
.panel-index {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(217, 139, 25, 0.08);
  color: #1d1d1f;
  border: 1px solid rgba(217, 139, 25, 0.22);
}

.timeline-title {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  color: var(--text);
}

.timeline-copy {
  margin-top: 0.45rem;
  line-height: 1.45;
  font-size: 0.76rem;
}

.panel {
  border-radius: 22px;
  padding: 1.2rem;
}

.panel-active {
  border-color: var(--stroke-strong);
}

.panel-complete {
  border-color: rgba(253, 183, 62, 0.28);
}

.panel-locked {
  opacity: 0.86;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.grid,
.metric-grid,
.recommendation-grid,
.entry-card-grid,
.field-group-grid {
  display: grid;
  gap: 0.8rem;
}

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

.stage-one-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.optional-evidence-grid,
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

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

.predictive-workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.predictive-workflow-card {
  align-content: start;
}

.predictive-workflow-card strong {
  display: block;
  margin: 0.2rem 0 0.65rem;
  color: var(--text);
  line-height: 1.45;
}

.experiment-log-column {
  align-content: start;
}

.experiment-log-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}

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

.entry-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

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

.field-group {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(250, 247, 236, 0.74);
}

.field-group-header {
  margin-bottom: 0.8rem;
}

.field-group-header h3 {
  font-size: 1rem;
}

.field-group-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.86rem;
}

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

.stage-chip {
  display: inline-flex;
  margin-top: 0.65rem;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.74rem;
}

.stage-open {
  background: rgba(247, 199, 104, 0.12);
  color: var(--warn);
}

.stage-done {
  background: rgba(253, 183, 62, 0.12);
  color: var(--good);
}

.stage-waiting {
  background: rgba(143, 156, 171, 0.12);
  color: var(--muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="file"] {
  width: 100%;
  overflow: hidden;
  padding: 0.65rem 0.75rem;
}

input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(217, 139, 25, 0.08);
  color: #1d1d1f;
  cursor: pointer;
}

input,
select,
textarea {
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 0.82rem 0.9rem;
  background: #ffffff;
  color: var(--text);
}

select {
  background: #ffffff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid rgba(217, 139, 25, 0.35);
  border-color: rgba(217, 139, 25, 0.35);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.strategy-action-stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.8rem;
  margin-bottom: 1rem;
}

.strategy-button-row {
  margin-top: 0;
}

.strategy-status {
  margin: 0;
  line-height: 1.45;
}

.strategy-intro-card {
  margin-top: 0;
}

.button {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: linear-gradient(180deg, rgba(217, 139, 25, 0.92), rgba(181, 114, 15, 0.96));
  border-color: rgba(217, 139, 25, 0.3);
}

.button-secondary {
  background: rgba(217, 139, 25, 0.08);
  color: #1d1d1f;
}

.upload-card,
.lookup-card,
.plan-card,
.empty-state,
.locked-state,
.history-item,
.recommendation-card,
.metric-card {
  border-radius: 18px;
  padding: 1rem;
  background: var(--panel-strong);
}

.upload-card {
  border: 1px dashed rgba(217, 139, 25, 0.26);
}

.preview {
  display: block;
  margin-top: 0.8rem;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #ffffff;
}

.preview-mini {
  max-height: 180px;
}

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

.optional-evidence-grid-compact {
  grid-template-columns: 1fr;
}

.optional-evidence-grid-compact .upload-card {
  min-height: 100%;
}

.metric-value {
  margin: 0.3rem 0 0;
  color: #1d1d1f;
  font-size: 1.08rem;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  margin-top: 0.75rem;
  font-size: 0.76rem;
}

.score-good {
  background: rgba(217, 139, 25, 0.12);
  color: var(--good);
}

.score-warn {
  background: rgba(215, 163, 115, 0.16);
  color: var(--warn);
}

.score-bad {
  background: rgba(239, 108, 108, 0.12);
  color: var(--bad);
}

.recommendation-card ul,
.lookup-card ul {
  margin: 0.7rem 0 0;
  padding-left: 1rem;
  line-height: 1.65;
}

.mono-copy {
  font-family: Arial, Helvetica, sans-serif;
}

.lookup-summary {
  margin-top: 0.35rem;
  line-height: 1.7;
}

.intel-card {
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--stroke);
  background: rgba(250, 247, 236, 0.95);
}

.plan-card {
  border: 1px solid var(--stroke);
}

.intel-results ul {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  line-height: 1.6;
}

.protein-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.evidence-card {
  min-height: 100%;
}

.evidence-card strong {
  display: block;
  margin-top: 0.15rem;
}

.evidence-card-wide {
  grid-column: span 2;
}

.comparison-card-wide {
  grid-column: span 2;
}

.field-group-full {
  width: 100%;
}

.field-group-full textarea {
  min-height: 160px;
}

.field-group-notes textarea {
  min-height: 380px;
}

.field-group-evidence .field-group-grid {
  grid-template-columns: 1fr;
}

.field-group-evidence .upload-card {
  min-height: 240px;
}

.field-group-evidence input[type="file"] {
  font-size: 0.86rem;
}

.field-group-evidence label {
  width: 100%;
}

.grid-span-2 {
  grid-column: span 2;
}

.history-stack {
  display: grid;
  gap: 0.9rem;
}

.pilot-testing-stack {
  display: grid;
  gap: 1rem;
}

.pilot-support-copy {
  margin: 0.55rem 0 0;
}

.pilot-feedback-textarea {
  min-height: 220px;
}

.admin-review-stack {
  gap: 0.85rem;
}

.admin-review-card {
  display: grid;
  gap: 0.8rem;
}

.admin-review-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.virtual-assistant-stack {
  display: grid;
  gap: 1.1rem;
}

.assistant-upload-card,
.assistant-context-card,
.assistant-input-grid,
.assistant-comparison-grid {
  margin: 0;
}

.assistant-button-row {
  margin-top: 0;
}

.chat-stack {
  max-height: 420px;
  overflow: auto;
}

.chat-user {
  background: rgba(255, 255, 255, 0.94);
}

.chat-assistant {
  background: rgba(250, 247, 236, 0.98);
}

.compact-doc {
  padding: 0.8rem;
}

.ai-card ul,
.chat-assistant ul {
  margin: 0.7rem 0 0;
  padding-left: 1rem;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.tag {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(217, 139, 25, 0.1);
  color: #1d1d1f;
  font-size: 0.74rem;
}

.guided-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

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

.guided-step-card {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(250, 247, 236, 0.86);
}

.guided-step-card strong {
  display: block;
  margin-top: 0.15rem;
}

.guided-step-card .status {
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.flow-chart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.flow-chart-compact {
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.flow-chart-compact .flow-node {
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.5rem 0.65rem;
}

.flow-chart-compact .flow-node-index {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  line-height: 1.1;
}

.flow-chart-compact .flow-node-text {
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: nowrap;
}

.flow-node {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(250, 247, 236, 0.88);
  max-width: 100%;
}

.flow-node-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(217, 139, 25, 0.12);
  color: #1d1d1f;
  font-size: 0.72rem;
  font-weight: 600;
}

.flow-node-text {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.25;
}

.flow-arrow {
  color: #1d1d1f;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

@media (max-width: 1180px) {
  .hero,
  .layout,
  .hero-grid,
  .timeline,
  .stage-one-layout,
  .guided-steps,
  .flow-chart,
  .experiment-log-columns,
  .experiment-log-bottom,
  .entry-card-grid,
  .field-group-grid,
  .optional-evidence-grid,
  .optional-evidence-grid-wide,
  .optional-evidence-grid-compact,
  .predictive-workflow-grid,
  .comparison-grid,
  .grid,
  .metric-grid,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .grid-span-2 {
    grid-column: span 1;
  }

  .comparison-card-wide {
    grid-column: span 1;
  }

  .flow-arrow {
    display: none;
  }
}

/* ============================================================
   Guided troubleshooting decision tree — Apple-style surface
   ============================================================ */
.dtree {
  --dtree-accent: #d98b19;
  --dtree-ink: #1d1d1f;
  --dtree-muted: #6e6e73;
  --dtree-line: rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  border: 1px solid var(--dtree-line);
  border-radius: 22px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 50px rgba(60, 45, 0, 0.10);
  color: var(--dtree-ink);
  -webkit-font-smoothing: antialiased;
}

.dtree-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d1d1f;
}

.dtree-title {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.021em;
  color: var(--dtree-ink);
}

.dtree-sub {
  margin: 0 0 1.5rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--dtree-muted);
  max-width: 60ch;
}

/* Symptom picker */
.dtree-symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.dtree-symptom-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  padding: 1.35rem 1.3rem;
  border: 1px solid var(--dtree-line);
  border-radius: 18px;
  background: #fbfbfd;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dtree-symptom-card:hover {
  transform: translateY(-3px);
  background: #ffffff;
  border-color: rgba(217, 139, 25, 0.35);
  box-shadow: 0 12px 30px rgba(60, 45, 0, 0.14);
}

.dtree-symptom-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: #1d1d1f;
}

.dtree-symptom-label {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dtree-symptom-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.dtree-symptom-arrow {
  font-size: 1.4rem;
  color: var(--dtree-muted);
  transition: transform 0.16s ease, color 0.16s ease;
}

.dtree-symptom-card:hover .dtree-symptom-arrow {
  color: #1d1d1f;
  transform: translateX(3px);
}

/* Blot scanner */
.blot-scanner {
  margin-bottom: 1.2rem;
}

.blot-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  padding: 1.2rem;
  border: 1.5px dashed rgba(217, 139, 25, 0.4);
  border-radius: 16px;
  background: #fbfbfd;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.blot-drop:hover {
  background: #ffffff;
  border-color: #1d1d1f;
}

.blot-drop input[type="file"] {
  display: none;
}

.blot-drop-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.blot-preview {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 1rem auto 0;
  border-radius: 12px;
  border: 1px solid var(--dtree-line);
}

.blot-suggestion {
  margin: 1rem 0 0;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: rgba(217, 139, 25, 0.08);
  color: var(--dtree-ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Image-read card — matches the grey-green suggestion box, not the green panel */
.ai-scan-card {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: rgba(217, 139, 25, 0.08);
  border: 1px solid var(--dtree-line);
  color: var(--dtree-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.ai-scan-summary {
  margin: 0.25rem 0 0.9rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--dtree-ink);
}

.ai-scan-label {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dtree-muted);
}

.ai-scan-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--dtree-ink);
}

.ai-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.ai-flag {
  display: inline-block;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(217, 139, 25, 0.14);
  color: #1d1d1f;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Flowchart-style trail of choices */
.dtree-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}

.dtree-trail-chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(217, 139, 25, 0.08);
  border: 1px solid var(--dtree-line);
  color: var(--dtree-ink);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dtree-trail-sep {
  color: var(--dtree-muted);
  font-size: 0.9rem;
}

/* Step-by-step / Flowchart view toggle */
.dtree-viewtoggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
}

.dtree-vt {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  color: var(--dtree-muted);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.dtree-vt-on {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Progressive flowchart trail — a vertical path that grows as you choose */
.flow-trail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 720px;
  margin: 0.4rem auto 0;
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.flow-step-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dtree-muted);
}

.flow-step-box {
  text-align: left;
  border: 1px solid var(--dtree-line);
  background: #fbfbfd;
  color: var(--dtree-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.flow-step-box:hover {
  border-color: rgba(217, 139, 25, 0.4);
  background: #ffffff;
}

.flow-step-current {
  background: #ffffff;
  border-color: #1d1d1f;
  box-shadow: 0 0 0 2px rgba(217, 139, 25, 0.22);
  cursor: default;
}

.flow-step-outcome {
  background: rgba(217, 139, 25, 0.1);
}

.flow-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
}

.flow-link::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--dtree-accent);
  transform: translateX(-50%);
}

.flow-link-chip {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid var(--dtree-line);
  color: #1d1d1f;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.flow-choose {
  position: relative;
  padding-top: 1.3rem;
  margin-top: 0.5rem;
}

.flow-choose::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 18px;
  background: var(--dtree-accent);
  transform: translateX(-50%);
}

.flow-choose-why {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--dtree-muted);
}

.flow-branches {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.flow-branch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  border: 1px solid var(--dtree-line);
  background: #fbfbfd;
  color: var(--dtree-ink);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.95rem 1.2rem;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.flow-branch:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(217, 139, 25, 0.45);
  box-shadow: 0 10px 24px rgba(60, 45, 0, 0.12);
}

.flow-branch-arrow {
  color: var(--dtree-muted);
  font-size: 1.1rem;
  transition: transform 0.16s ease, color 0.16s ease;
}

.flow-branch:hover .flow-branch-arrow {
  color: #1d1d1f;
  transform: translateX(3px);
}

.flow-conclusion {
  position: relative;
  padding-top: 1.3rem;
  margin-top: 0.5rem;
}

.flow-conclusion::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 18px;
  background: var(--dtree-accent);
  transform: translateX(-50%);
}

.flow-restart-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.3rem;
}

/* Step 1 — "What this means for your blot" inline learning layer */
.intel-why {
  margin-top: 1.1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--dtree-line, rgba(0,0,0,0.08));
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(60, 45, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.intel-why-kicker {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d1d1f;
}

.intel-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}

.intel-why-card {
  padding: 0.95rem 1.05rem;
  border-radius: 14px;
  background: rgba(217, 139, 25, 0.06);
  border: 1px solid rgba(217, 139, 25, 0.12);
}

.intel-why-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.intel-why-label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.intel-why-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1d1d1f;
  white-space: nowrap;
}

.intel-why-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #44524b;
}

/* ============================================================
   Stage 1 — unified Apple card styling
   ============================================================ */
.stage-one-layout {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.stage-one-layout .plan-card,
.stage-one-layout .intel-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 44px rgba(60, 45, 0, 0.08);
}

.stage-one-layout .field-group,
.intel-results .evidence-card,
.intel-results .lookup-card {
  background: #fbfbfd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: none;
}

.intel-apple-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(60, 45, 0, 0.08);
  padding: 1.2rem 1.3rem;
}

/* Input guidance */
.intel-required-note {
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: rgba(217, 139, 25, 0.08);
  border: 1px solid rgba(217, 139, 25, 0.16);
  color: #1d1d1f;
  font-size: 0.95rem;
  line-height: 1.5;
}

.intel-req-em {
  font-weight: 700;
  color: #1d1d1f;
}

.intel-fetch-row {
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.intel-fetch-hint {
  font-size: 0.85rem;
  color: #6e6e73;
}

/* Tab navigation */
.tabbar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.3rem;
  margin: 1.2rem 0 1.4rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
}

.tabbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.tabbtn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.tabbtn-on {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tabbtn-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(217, 139, 25, 0.12);
  color: #1d1d1f;
  font-size: 0.72rem;
  font-weight: 700;
}

.tabbtn-on .tabbtn-num {
  background: #d98b19;
  color: #ffffff;
}

.tab-panel {
  margin-bottom: 3rem;
}

/* Structure + domain map — stacked, full width */
.intel-structure-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.domain-readout {
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: rgba(217, 139, 25, 0.08);
  border: 1px solid rgba(217, 139, 25, 0.16);
  font-size: 0.92rem;
  line-height: 1.45;
  color: #1d1d1f;
}

.domain-readout-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.domain-readout-desc {
  color: #44524b;
}

.domain-seg rect {
  transition: opacity 0.14s ease;
}

.domain-seg:hover rect {
  opacity: 1;
}

/* 3D fold + predicted band row */
.intel-fold-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1rem;
}

@media (max-width: 860px) {
  .intel-fold-row {
    grid-template-columns: 1fr;
  }
}

.gel-card {
  display: flex;
  flex-direction: column;
}

.gel-scroll {
  width: 100%;
  display: flex;
  justify-content: center;
}

.gel-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
}

.gel-axis {
  font-size: 11px;
  font-weight: 700;
  fill: #6e6e73;
}

.gel-tick {
  font-size: 11px;
  fill: #6e6e73;
}

.gel-band-label {
  font-size: 12px;
  font-weight: 700;
  fill: #1d1d1f;
}

.gel-notes {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #44524b;
}

.gel-notes-clean {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #6e6e73;
}

.gel-app-label {
  font-size: 11px;
  font-style: italic;
  fill: #6e6e73;
}

/* Copy / export toolbar */
.next-stage-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  padding: 1.2rem 1.4rem;
  border-radius: 18px;
  background: rgba(253, 183, 62, 0.14);
  border: 1px solid rgba(217, 139, 25, 0.28);
}

.next-stage-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b5720f;
}

.next-stage-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #1d1d1f;
  max-width: 52ch;
}

.next-stage-btn {
  flex: none;
}

.intel-tools {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.intel-tool-btn {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.intel-tool-btn:hover {
  background: #fdf3e3;
  border-color: rgba(217, 139, 25, 0.4);
  transform: translateY(-1px);
}

/* Epitope guidance */
.epi-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.4rem 0 0.2rem;
}

.epi-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: rgba(217, 139, 25, 0.06);
  border: 1px solid rgba(217, 139, 25, 0.12);
  font-size: 0.92rem;
}

.epi-item-top {
  background: rgba(253, 183, 62, 0.16);
  border-color: rgba(217, 139, 25, 0.32);
}

.epi-range {
  font-weight: 600;
  color: #1d1d1f;
}

.epi-len {
  color: #6e6e73;
  font-size: 0.85rem;
}

.epi-tag {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1d1d1f;
  background: #fdb73e;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.epi-avoid {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #6e6e73;
}

.epi-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #6e6e73;
}

/* Stage 2 — protocol planner */
.proto-planner {
  margin-bottom: 1.2rem;
}

/* Context selector */
.proto-context {
  padding: 1.5rem 1.6rem;
  margin-bottom: 2rem;
  border-radius: 18px;
  background: rgba(253, 183, 62, 0.1);
  border: 1px solid rgba(217, 139, 25, 0.2);
}

.proto-context-head {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.proto-context-sub {
  margin: 0 0 1.3rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #6e6e73;
}

.proto-context-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.proto-ctx-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.proto-ctx-label {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.proto-ctx-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.proto-chip {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #1d1d1f;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.proto-chip:hover {
  border-color: rgba(217, 139, 25, 0.45);
}

.proto-chip-on {
  background: #fdb73e;
  border-color: rgba(217, 139, 25, 0.6);
  box-shadow: 0 4px 12px rgba(217, 139, 25, 0.22);
}

/* What we know — premium stat tiles */
.proto-known {
  margin-bottom: 2.2rem;
  padding: 1.5rem 1.6rem;
}

.proto-known-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.proto-known-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(253, 183, 62, 0.08);
  border: 1px solid rgba(217, 139, 25, 0.14);
}

.proto-known-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6e6e73;
}

.proto-known-value {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #1d1d1f;
}

/* Grouped protocol sections */
.proto-section {
  margin-bottom: 2.4rem;
}

.proto-group-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
}

.proto-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.3rem;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(60, 45, 0, 0.06);
}

.proto-card-title {
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6e6e73;
}

.proto-card-value {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  line-height: 1.4;
}

.proto-card-whyrow {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.proto-why-tag {
  flex: none;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b5720f;
  background: rgba(253, 183, 62, 0.22);
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  margin-top: 0.1rem;
}

.proto-card-why {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #44524b;
}

.proto-switch {
  margin-top: auto;
  padding-top: 0.4rem;
}

.proto-switch-label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa0a6;
}

.proto-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.proto-opt {
  border: 1px solid var(--stroke);
  background: #fbfbfd;
  color: #1d1d1f;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.proto-opt:hover {
  border-color: rgba(217, 139, 25, 0.4);
  background: #fff;
}

.proto-opt-on {
  background: rgba(253, 183, 62, 0.22);
  border-color: rgba(217, 139, 25, 0.5);
  font-weight: 600;
}

/* Antibody strategy card */
.proto-ab {
  margin-top: 1.4rem;
  padding: 1.5rem 1.6rem;
}

.proto-ab-list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.8rem;
  font-size: 0.96rem;
  line-height: 1.65;
  color: #44524b;
}

.proto-ab-note {
  margin: 1.3rem 0 0;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(253, 183, 62, 0.14);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1d1d1f;
}

.proto-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.6rem;
}

/* Stage 3 — Antibody Compatibility */
.ab-section {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.ab-knowledge {
  margin-bottom: 1.6rem;
}

.ab-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.ab-rule {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(253, 183, 62, 0.08);
  border: 1px solid rgba(217, 139, 25, 0.14);
}

.ab-rule-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.ab-rule-body {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #44524b;
}

.ab-lit {
  margin-bottom: 1.6rem;
}

.ab-lit-state {
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
  color: #6e6e73;
}

.ab-lit-state a,
.ab-lit-more {
  color: #b5720f;
  font-weight: 600;
}

.ab-lit-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.ab-lit-item {
  display: block;
  text-decoration: none;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: #fbfbfd;
  border: 1px solid var(--stroke);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ab-lit-item:hover {
  border-color: rgba(217, 139, 25, 0.4);
  background: #fff;
  transform: translateY(-1px);
}

.ab-lit-title {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  line-height: 1.45;
}

.ab-lit-meta {
  margin: 0;
  font-size: 0.84rem;
  color: #6e6e73;
  line-height: 1.4;
}

.ab-lit-more {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.ab-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.2rem;
}

.ab-section .field-group {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(60, 45, 0, 0.06);
}

.ab-check-row {
  margin-bottom: 1.4rem;
}

.ab-result {
  margin-top: 0.4rem;
}

.ab-result-title {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

/* Stage 5 — Run plan & guide */
.runplan {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.runplan-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.2rem;
}

.print-area {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.8rem 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(60, 45, 0, 0.06);
}

.runplan-head {
  border-bottom: 2px solid rgba(217, 139, 25, 0.3);
  padding-bottom: 0.9rem;
  margin-bottom: 1.4rem;
}

.runplan-h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.runplan-meta {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: #6e6e73;
}

.runplan-block {
  margin-bottom: 1.8rem;
}

.runplan-h3 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1d1d1f;
}

.runplan-table {
  width: 100%;
  border-collapse: collapse;
}

.runplan-table th,
.runplan-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--stroke);
  font-size: 0.95rem;
  line-height: 1.5;
}

.runplan-table th {
  width: 34%;
  color: #6e6e73;
  font-weight: 600;
}

.runplan-table td {
  color: #1d1d1f;
  font-weight: 500;
}

.runplan-note {
  margin: 0.8rem 0 0;
  font-size: 0.86rem;
  color: #6e6e73;
}

.runplan-lead {
  margin: 0 0 0.8rem;
  font-size: 0.96rem;
  line-height: 1.6;
  color: #44524b;
}

/* Closed-loop troubleshooting (expect / if it fails) */
.dtree-closedloop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.dtree-cl-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fbfbfd;
  border: 1px solid var(--stroke);
}

.dtree-cl-tag {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
}

.dtree-cl-expect {
  background: rgba(253, 183, 62, 0.22);
  color: #b5720f;
}

.dtree-cl-fail {
  background: rgba(197, 95, 95, 0.16);
  color: #9a3b3b;
}

.dtree-cl-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #44524b;
}

/* Pre-run checklist */
.checklist {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #fbfbfd;
  cursor: pointer;
  font-size: 0.94rem;
  line-height: 1.45;
  color: #1d1d1f;
}

.check-item input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex: none;
  accent-color: #d98b19;
}

.check-on label {
  background: rgba(253, 183, 62, 0.12);
  border-color: rgba(217, 139, 25, 0.3);
}

.check-done {
  margin: 0.8rem 0 0;
  font-weight: 600;
  color: #b5720f;
}

/* Visual pattern gallery */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.pattern-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #fbfbfd;
  border: 1px solid var(--stroke);
}

.blot-svg {
  flex: none;
  width: 52px;
  height: 72px;
}

.pattern-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.pattern-meaning {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #44524b;
}

.runplan-steps,
.runplan-list {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #44524b;
}

.runplan-glossary {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 0.3fr) 1fr;
  gap: 0.45rem 1rem;
}

.runplan-glossary dt {
  font-weight: 700;
  color: #1d1d1f;
  font-size: 0.92rem;
}

.runplan-glossary dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #44524b;
}

.runplan-divider {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  margin: 2rem 0 1.5rem;
  color: #6e6e73;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runplan-divider::before,
.runplan-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(217, 139, 25, 0.3);
}

.app-footer {
  margin-top: 2.5rem;
  padding: 1.4rem 0 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  text-align: center;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.app-footer p {
  margin: 0.15rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* About page */
.about-para {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #333;
  max-width: 72ch;
}

.about-para:last-child {
  margin-bottom: 0;
}

.about-quote {
  margin: 0 0 1.8rem;
  padding: 1.3rem 1.5rem;
  border-left: 4px solid #d98b19;
  border-radius: 0 14px 14px 0;
  background: rgba(253, 183, 62, 0.14);
  font-size: 1.12rem;
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  max-width: 72ch;
}

.about-disclaimer {
  padding: 1.4rem 1.5rem;
  border-radius: 14px;
  background: #fbfbfd;
  border: 1px solid var(--stroke);
}

.about-disclaimer .about-para {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #44524b;
}

.about-credit {
  padding-top: 1.2rem;
  border-top: 1px solid var(--stroke);
}

/* Feedback form */
.fb-card {
  max-width: 780px;
}

.fb-field {
  margin-top: 1.3rem;
}

.fb-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.fb-input,
.fb-textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fbfbfd;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1d1d1f;
  resize: vertical;
}

.fb-input:focus,
.fb-textarea:focus {
  outline: none;
  border-color: rgba(217, 139, 25, 0.55);
  background: #ffffff;
}

.fb-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.fb-scale {
  font-size: 0.82rem;
  color: #6e6e73;
  margin-left: 0.3rem;
}

.fb-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.fb-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.fb-error {
  color: #8a2b12;
  font-size: 0.92rem;
  line-height: 1.45;
}

.fb-direct {
  margin: 1.2rem 0 0;
  font-size: 0.88rem;
  color: #6e6e73;
}

.fb-direct a {
  color: #b5720f;
  font-weight: 600;
}

.about-credit .about-para {
  font-size: 0.92rem;
  color: #6e6e73;
}

.app-footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.app-footer-link {
  border: none;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  text-decoration: underline;
}

.app-footer-link:hover {
  color: #5a4a1f;
}

.app-footer-sep {
  color: #5a4a1f;
}

.app-footer .app-footer-fine {
  font-weight: 400;
  font-size: 0.78rem;
  color: #5a4a1f;
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area::after {
    content: "Butterfly  ·  © M Ali.  All rights reserved.  Proprietary; unauthorised copying prohibited.";
    visibility: visible;
    display: block;
    margin-top: 1.6rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
    color: #444;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .no-print {
    display: none !important;
  }
  .runplan-glossary {
    grid-template-columns: minmax(140px, 0.3fr) 1fr;
  }
}

.struct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.struct-conf {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.struct-conf-high {
  background: rgba(217, 139, 25, 0.14);
  color: #1d1d1f;
}

.struct-conf-moderate {
  background: rgba(199, 151, 105, 0.18);
  color: #8a5a23;
}

.struct-conf-cautious {
  background: rgba(197, 95, 95, 0.16);
  color: #9a3b3b;
}

.struct-viewer-wrap {
  position: relative;
  width: 100%;
  height: 440px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* Metric cards in the unified Apple style */
.intel-results .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.intel-results .metric-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 0.95rem 1.05rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.intel-results .metric-card .metric-label {
  margin: 0 0 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6e6e73;
}

.intel-results .metric-card .metric-value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.struct-viewer {
  position: relative;
  width: 100%;
  height: 100%;
}

.struct-viewer canvas {
  border-radius: 14px;
}

.struct-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: #6e6e73;
  font-size: 0.92rem;
  background: rgba(252, 252, 253, 0.85);
}

.struct-overlay a {
  color: #1d1d1f;
  font-weight: 600;
}

.struct-legend-note,
.struct-note {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #6e6e73;
}

/* Domain / topology map */
.domain-sub {
  margin: 0.2rem 0 0.9rem;
  font-size: 0.9rem;
  color: #6e6e73;
}

.domain-map-scroll {
  width: 100%;
  overflow-x: auto;
}

.domain-map-svg {
  width: 100%;
  min-width: 520px;
  height: auto;
  display: block;
}

.domain-lane-label {
  font-size: 11px;
  font-weight: 600;
  fill: #44524b;
}

.domain-tick {
  font-size: 10px;
  fill: #9aa6a0;
}

.domain-term {
  font-size: 13px;
  font-weight: 700;
  fill: #1d1d1f;
}

.domain-empty {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: #6e6e73;
}

.domain-card .domain-map-svg rect {
  transition: opacity 0.15s ease;
}

.domain-card .domain-map-svg g:hover rect {
  opacity: 1;
}

.dtree-symptom-blurb {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--dtree-muted);
}

/* Question flow */
.dtree-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.dtree-back {
  border: none;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.2rem 0.1rem;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

.dtree-back:hover {
  opacity: 0.6;
}

.dtree-step-label {
  font-size: 0.85rem;
  color: var(--dtree-muted);
  letter-spacing: -0.01em;
}

.dtree-progress {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.dtree-dot {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease;
}

.dtree-dot-on {
  background: var(--dtree-accent);
}

.dtree-question {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dtree-why {
  margin: 0 0 1.4rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--dtree-muted);
  max-width: 62ch;
}

.dtree-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.dtree-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--dtree-line);
  border-radius: 14px;
  background: #fbfbfd;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dtree-option:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(217, 139, 25, 0.4);
  box-shadow: 0 10px 24px rgba(60, 45, 0, 0.12);
}

.dtree-option-label {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dtree-option-arrow {
  font-size: 1.3rem;
  color: var(--dtree-muted);
  transition: transform 0.16s ease, color 0.16s ease;
}

.dtree-option:hover .dtree-option-arrow {
  color: #1d1d1f;
  transform: translateX(3px);
}

/* Ranked results */
.dtree-results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.dtree-result-card {
  display: flex;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--dtree-line);
  border-radius: 16px;
  background: #fbfbfd;
}

.dtree-result-card:first-child {
  border-color: rgba(217, 139, 25, 0.32);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(60, 45, 0, 0.1);
}

.dtree-rank {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dtree-accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.dtree-result-body {
  flex: 1;
  min-width: 0;
}

.dtree-result-title {
  display: block;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.3rem;
}

.dtree-result-why {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--dtree-muted);
}

.dtree-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.dtree-impact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dtree-impact-track {
  width: 88px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.dtree-impact-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--dtree-accent);
}

.dtree-impact-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d1d1f;
}

.dtree-effort {
  font-size: 0.82rem;
  color: var(--dtree-muted);
}

.dtree-restart-row {
  display: flex;
  justify-content: flex-end;
}

.dtree-restart {
  border: 1px solid var(--dtree-line);
  background: #fff;
  color: var(--dtree-ink);
  font: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dtree-restart:hover {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.18);
}

.dtree-divider {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  margin: 1.6rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dtree-divider::before,
.dtree-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.dtree-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
}

.dtree-detail-btn {
  border: none;
  background: var(--dtree-accent);
  color: #1d1d1f;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 8px 20px rgba(217, 139, 25, 0.22);
}

.dtree-detail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(217, 139, 25, 0.28);
}

.dtree-detail-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.dtree-detail {
  margin-top: 1.4rem;
}

.dtree-detail-hint {
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px dashed var(--dtree-line);
  border-radius: 14px;
  background: #fbfbfd;
  color: var(--dtree-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.dtree-detail-divider {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  margin: 0 0 1.1rem;
  color: var(--dtree-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dtree-detail-divider::before,
.dtree-detail-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--dtree-line);
}

/* Optional context disclosure */
.assistant-optional {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 0.4rem 1rem;
  margin-bottom: 1.2rem;
}

.assistant-optional > summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  padding: 0.55rem 0;
  list-style: revert;
}

.assistant-optional[open] > summary {
  margin-bottom: 0.6rem;
}

.assistant-optional-body {
  display: grid;
  gap: 0.8rem;
  padding-bottom: 0.6rem;
}

@media (max-width: 720px) {
  .dtree {
    padding: 1.5rem 1.25rem;
  }
  .dtree-title {
    font-size: 1.45rem;
  }
  .dtree-question {
    font-size: 1.25rem;
  }
  .dtree-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .dtree-detail-btn {
    width: 100%;
  }
}
