/* ── RELATED CLINICAL TOOLS (v2.55 Phase 2) ─────────────────────────────────────
   Reusable consolidated contextual section — used on presentation + condition detail.
   Reasoning surface: lifted cards, semantic accent per tool kind. */
.related-tools-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.related-tool {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--reasoning);
  box-shadow: var(--shadow-sm); text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  min-height: 68px;
}
/* v2.55 — tools section reads as a deliberate action zone, not an afterthought:
   sits on a sunken well so the cards visibly lift off it. */
.related-tools-section { background: var(--surface-sunken); }
.related-tools-section .cond-section-title { font-size: 13.5px; }
.related-tool:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.related-tool:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.related-tool-icon {
  font-size: 20px; line-height: 1; flex-shrink: 0;
  width: 28px; text-align: center; color: var(--reasoning);
}
.related-tool-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.related-tool-label {
  font-size: var(--fs-body); font-weight: 700; color: var(--text);
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis;
}
.related-tool-sub {
  font-size: var(--fs-caption); color: var(--text-muted); line-height: 1.3;
}
.related-tool-arrow {
  font-size: 20px; color: var(--text-muted); flex-shrink: 0; font-weight: 300;
}
/* Semantic accent per kind */
.related-tool--blueprint { border-left-color: var(--reasoning); }
.related-tool--blueprint .related-tool-icon { color: var(--reasoning); }
.related-tool--deck      { border-left-color: var(--col-cervical); }
.related-tool--deck      .related-tool-icon { color: var(--col-cervical); }
.related-tool--tree      { border-left-color: var(--reasoning); }
.related-tool--tree      .related-tool-icon { color: var(--reasoning); }
.related-tool--checklist { border-left-color: var(--col-knee); }
.related-tool--checklist .related-tool-icon { color: var(--col-knee); }
.related-tool--script    { border-left-color: var(--caution); }
.related-tool--script    .related-tool-icon { color: var(--caution); }
.related-tool--presentation { border-left-color: var(--col-shoulder); }
.related-tool--presentation .related-tool-icon { color: var(--col-shoulder); }
.related-tool--flashcard { border-left-color: #7c3aed; }
.related-tool--flashcard .related-tool-icon { color: #7c3aed; }
@media (max-width: 560px) {
  .related-tools-grid { grid-template-columns: 1fr; }
}

/* ── PRESENTATIONS TAB ──────────────────────────────────────────────────────── */
.pres-page-header { margin-bottom: 16px; }
.pres-page-header .back-link { font-size: 13px; }
.page-title    { font-size: 22px; font-weight: 700; color: var(--text); margin: 4px 0 2px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }

/* ── Presentations — top search bar ─────────────────────────────────────── */
.pres-page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.pres-page-header .page-title { margin-bottom: 0; }
.pres-search-wrap--top {
  margin-bottom: 10px;
}
.pres-search-input--top {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text);
  background: var(--surface); outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pres-search-input--top:focus { border-color: var(--primary); box-shadow: var(--glow-primary); }

/* v2.44 — single-column list at all widths; tapping opens the full-page detail
   (the desktop 2-column split is retired for one consistent layout). */
.pres-layout {
  display: flex; flex-direction: column;
  height: auto; min-height: 0;
  border: none; border-radius: 0; overflow: visible;
  background: transparent; box-shadow: none;
}

.pres-sidebar {
  width: 100%; min-width: 0; flex-shrink: 0;
  overflow-y: visible; border-right: none;
  background: transparent; display: flex; flex-direction: column;
}
/* Legacy search-wrap inside sidebar — kept for old code paths, hidden now */
.pres-search-wrap {
  padding: 10px 10px 8px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.pres-search-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text); outline: none;
}
.pres-search-input:focus { border-color: var(--primary); box-shadow: var(--glow-primary); }
.pres-item-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.pres-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  min-height: unset;
  transition: background var(--transition);
}
.pres-item:hover { background: rgba(0, 0, 0, 0.02); }
.pres-item.active { background: transparent; }
.pres-item-label { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; margin: 0; }

/* Tier-1 alert dot */
.pres-item-tier1-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--tier1-color); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
  flex-shrink: 0;
}
.pres-item-nonmsk-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; font-weight: 700; line-height: 1;
  background: #FEF3C7; color: #92600a;
  border: 1px solid #E8C97A; border-radius: 9px;
  flex-shrink: 0;
}
.pres-item.active .pres-item-nonmsk-count { background: #EAF3FF; color: var(--primary); border-color: #b3d0f5; }
.pres-no-results { padding: 12px 14px; font-size: 13px; color: var(--text-muted); }

/* Empty state — shown in detail panel when no presentation selected */
.pres-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 260px; gap: 10px;
  padding: 32px 24px; text-align: center;
}
.pres-empty-icon { font-size: 40px; opacity: 0.35; }
.pres-empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.pres-empty-sub { font-size: 13px; color: var(--text-muted); max-width: 260px; line-height: 1.6; }

/* Mobile back button — hidden on desktop */
.pres-detail-back {
  display: none;
  align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--primary);
  padding: 0 0 12px; margin-bottom: 4px;
}

.pres-diff-group { margin-bottom: 16px; }
.pres-diff-group:last-child { margin-bottom: 0; }
.pres-diff-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 0 8px; border-bottom: 2px solid var(--border); margin-bottom: 8px;
}
.pres-diff-group-msk .pres-diff-group-label { color: var(--primary); border-color: var(--primary); }
.pres-diff-group-nonmsk .pres-diff-group-label { color: #92600a; border-color: #E8C97A; }
.pres-diff-group-nonmsk {
  background: #FFFBF2;
  border: 1px solid #E8C97A;
  border-left: 5px solid #d97706; /* v2.35d — slight priority bump; calm amber, below red-flag red */
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 12px;
}
.pres-diff-group-nonmsk .pres-diff-row {
  background: #fffdf7;
  border-color: #f0dfa0;
}

/* v2.44 — inline detail panel retired (taps open the full-page route instead) */
.pres-detail { display: none; }
.pres-detail-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.pres-detail-title { font-size: 18px; font-weight: 700; color: var(--text); }
.pres-region-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-bg); color: var(--primary);
  border: 1px solid #b3d0f0; font-weight: 600; white-space: nowrap;
}

/* v2.54 — section base: more breathing room, calmer surface, neutral by default */
.pres-section {
  border-left: 3px solid var(--border);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pres-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: var(--sp-3);
}

/* v2.54 — Differentials: reasoning bar but neutral surface (lets red flags + key Qs lead) */
.pres-differentials { border-left: 4px solid var(--reasoning); background: var(--surface); }
/* v2.33a — reduce nested differentials indent so group/items sit closer to the section title (was padding-left 14px) */
.pres-differentials { padding-left: 4px; }
/* v2.38 — minimise the left gap on the presentation differentials section:
   collapse the redundant nested-box left indent (border + padding) so the diff
   rows align under the section title, and trim the row's own left padding.
   Scoped to .cond-section--pres-diffs so the condition page (shared #differentials) is untouched. */
.cond-section--pres-diffs .pres-differentials {
  padding-left: 0;
  border-left: 0;
  border-radius: 8px;
}
.cond-section--pres-diffs .pres-diff-row { padding-left: 9px; }
.pres-differentials .pres-section-title { color: var(--primary); }

.pres-diff-list { display: flex; flex-direction: column; gap: 8px; }
.pres-diff-row {
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.pres-diff-row:hover { box-shadow: var(--shadow-sm); }
.pres-diff-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; margin-left: auto; }
.pres-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 8px; text-transform: uppercase;
  letter-spacing: 0.04em; white-space: nowrap;
}
.pres-type-msk           { background: var(--primary-bg); color: var(--primary); border: 1px solid #90caf9; }
.pres-type-neurological  { background: #f3e5f5; color: #6a1b9a;  border: 1px solid #ce93d8; }
.pres-type-vascular      { background: #fce4ec; color: #880e4f;  border: 1px solid #f48fb1; }
.pres-type-cardiac       { background: var(--tier1-bg); color: var(--tier1-color); border: 1px solid #ef9a9a; }
.pres-type-inflammatory  { background: #fff3e0; color: #e65100;  border: 1px solid #ffcc80; }
.pres-type-malignant     { background: #ede7f6; color: #4a148c;  border: 1px solid #b39ddb; }
.pres-type-visceral      { background: #e0f7fa; color: #006064;  border: 1px solid #80deea; }
.pres-type-gynaecological{ background: #fce4ec; color: #c2185b;  border: 1px solid #f48fb1; }
.pres-type-toxic         { background: #efebe9; color: #4e342e;  border: 1px solid #bcaaa4; }
.pres-urg-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.pres-urg-tier-1 { background: var(--tier1-bg); color: var(--tier1-color); border: 1px solid #ef9a9a; }
.pres-urg-tier-2 { background: #fff8e1; color: #e65100; border: 1px solid #ffe082; }
.pres-urg-tier-3 { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

.pres-diff-top      { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 3px; }
.pres-diff-name     { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; flex: 1; min-width: 0; }
.pres-diff-link     { color: var(--primary); text-decoration: none; }
.pres-diff-link:hover { text-decoration: underline; }
.pres-diff-rationale {
  margin: 0; font-size: 13px; color: var(--text-secondary);
  line-height: 1.55; padding-left: 0;
}
.pres-diff-row-urgent {
  border-left: 3px solid var(--tier1-color);
  background: rgba(254, 236, 236, 0.7);
}
.pres-diff-row-urgent:hover { box-shadow: var(--shadow-sm), var(--glow-tier1); }
.pres-diff-group-nonmsk .pres-diff-row-urgent { background: #feecec; }
.pres-nonmsk-note {
  margin: 0 0 8px; font-size: 11px;
  color: #92600a; line-height: 1.4;
}
.pres-med-notes {
  margin: 0 0 8px; font-size: 12px;
  color: #2e7d32; line-height: 1.5;
}

/* v2.54 — Red Flags read as clearly highest-stakes: thick risk bar, tinted surface, lift */
.pres-redflags {
  border-left: 5px solid var(--risk);
  border-top-color: rgba(183,28,28,0.18);
  border-right-color: rgba(183,28,28,0.18);
  border-bottom-color: rgba(183,28,28,0.18);
  background: var(--risk-bg);
  box-shadow: var(--shadow-sm);
}
.pres-redflags .pres-section-title { color: var(--risk); letter-spacing: 0.08em; }
.pres-list { margin: 0; padding-left: 18px; }
.pres-list li { font-size: 13px; margin-bottom: 4px; line-height: 1.45; }
.pres-redflag-list li { color: #7f0000; }

/* v2.54 — Key Questions: reasoning accent (4px) over a calm blue-tint surface */
.pres-questions {
  border-left: 4px solid var(--reasoning);
  background: var(--primary-bg);
}
.pres-questions .pres-section-title { color: var(--reasoning); }
/* Key question items with rules-out badges */
.pres-kq-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  list-style: none; color: #1a237e;
}
.pres-kq-item:last-child { border-bottom: none; }

/* Tier-1 question gets a subtle red-left accent */
.pres-kq-item--tier-1 { border-left: 3px solid var(--tier1-color); padding-left: 8px; margin-left: -8px; }

.pres-kq-text { font-size: 13px; line-height: 1.45; }

.pres-kq-badge {
  display: inline-block; align-self: flex-start;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 10px;
  line-height: 1.4;
}
.pres-kq-badge--tier1 {
  background: var(--tier1-bg); color: var(--tier1-color);
  border: 1px solid rgba(183,28,28,0.25);
}
.pres-kq-badge--tier2 {
  background: #FEF3C7; color: #92600a;
  border: 1px solid rgba(184,120,10,0.25);
}
.pres-kq-badge--tier3 {
  background: var(--col-multi-bg); color: var(--col-multi);
  border: 1px solid rgba(55,65,81,0.2);
}

/* Legacy plain li inside question list */
.pres-question-list li { color: #1a237e; }

/* ── BLUEPRINT ENTRY BUTTON (in detail panel) ───────────────────────────── */
.blueprint-entry-wrap { margin-top: 18px; }
.blueprint-entry-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #F4EDFF 0%, #EDE0FF 100%);
  border: 1.5px solid rgba(107,33,168,0.2);
  text-decoration: none; color: var(--col-cervical);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.blueprint-entry-btn:hover { box-shadow: var(--shadow-md); border-color: rgba(107,33,168,0.4); }
.blueprint-entry-icon { font-size: 20px; flex-shrink: 0; }
.blueprint-entry-label { font-size: 14px; font-weight: 700; flex: 1; }
.blueprint-entry-sub { font-size: 11px; color: var(--text-muted); }
.blueprint-entry-arrow { font-size: 20px; color: var(--col-cervical); opacity: 0.6; }

/* ── DIAGNOSTIC BLUEPRINT PAGE ──────────────────────────────────────────── */
.blueprint-page { max-width: 1440px; padding: 16px 20px 80px; }

.blueprint-nav {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.blueprint-nav-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-left: auto;
}
.blueprint-hero {
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.blueprint-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }

/* ── KEY QUESTIONS — NEW CARD SYSTEM ────────────────────────────────────── */

/* Sticky Tier-1 strip */
.kq-tier1-strip {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  background: var(--tier1-bg); border: 1px solid var(--tier1-color);
  border-left-width: 4px; border-radius: 8px;
  /* v2.43 — contained within the sheet body (was margin -18px -22px which overflowed the panel) */
  padding: 8px 12px; margin: 0 0 12px;
  position: sticky; top: 0; z-index: 10;
}
.kq-strip-label {
  font-size: 11px; font-weight: 800; color: var(--tier1-color);
  white-space: nowrap; padding-top: 2px;
}
.kq-strip-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.kq-strip-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  background: rgba(183,28,28,0.12); color: var(--tier1-color);
  border: 1px solid rgba(183,28,28,0.3); border-radius: 10px;
}

/* Zone containers */
.kq-zone { margin-bottom: 12px; }

.kq-zone-header {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 8px;
}
.kq-zone-icon { font-size: 14px; flex-shrink: 0; }
.kq-zone-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary);
}
.kq-zone-sub {
  font-size: 11px; color: var(--text-muted);
  margin-left: auto;
}

.kq-zone--screen-first .kq-zone-title { color: var(--tier1-color); }

/* Cards list */
.kq-cards { display: flex; flex-direction: column; gap: 4px; }

/* Individual question card — uses <details> for native expand */
.kq-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.kq-card:hover { box-shadow: var(--shadow-sm); }
.kq-card[open] { box-shadow: var(--shadow-sm); }

.kq-card--tier-1 {
  border-color: rgba(183,28,28,0.3);
  border-left: 3px solid var(--tier1-color);
  background: #fffafa;
}
.kq-card--tier-2 {
  border-left: 3px solid #d97706;
  background: #fffef9;
}
.kq-card--tier-3 {
  border-left: 3px solid var(--col-multi);
  background: var(--surface);
}

/* Summary row — always visible */
.kq-summary {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px; cursor: pointer;
  list-style: none; -webkit-appearance: none;
  user-select: none; -webkit-user-select: none;
}
.kq-summary::-webkit-details-marker { display: none; }
.kq-summary::marker { display: none; }

.kq-icon { font-size: 12px; flex-shrink: 0; margin-top: 1px; }

.kq-text {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text);
  line-height: 1.45;
}

.kq-badge {
  flex-shrink: 0; align-self: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 10px; line-height: 1.4;
  max-width: 260px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Tight truncation is a small-screen measure only */
@media (max-width: 600px) {
  .kq-badge { max-width: 130px; }
}
.kq-badge--tier-1 { background: var(--tier1-bg); color: var(--tier1-color); border: 1px solid rgba(183,28,28,0.25); }
.kq-badge--tier-2 { background: #FEF3C7; color: #92600a; border: 1px solid rgba(184,120,10,0.25); }
.kq-badge--tier-3 { background: var(--col-multi-bg); color: var(--col-multi); border: 1px solid rgba(55,65,81,0.2); }

.kq-chevron {
  font-size: 16px; color: var(--text-muted); flex-shrink: 0;
  transition: transform 0.18s ease; align-self: center;
  line-height: 1;
}
.kq-card[open] .kq-chevron { transform: rotate(90deg); }

/* Follow-up action block */
.kq-followup {
  padding: 9px 12px 10px 33px;
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap;
}
.kq-followup--tier-1 { background: var(--tier1-bg); border-color: rgba(183,28,28,0.15); }
.kq-followup--tier-2 { background: #FFFBF2; border-color: rgba(184,120,10,0.2); }
.kq-followup--tier-3 { background: #F8F9FB; }

.kq-followup-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0; padding-top: 1px;
}
.kq-followup--tier-1 .kq-followup-label { color: var(--tier1-color); }
.kq-followup--tier-2 .kq-followup-label { color: #92600a; }
.kq-followup--tier-3 .kq-followup-label { color: var(--text-secondary); }

.kq-followup-text {
  font-size: 12px; line-height: 1.5; color: var(--text);
}
.kq-followup--tier-1 .kq-followup-text { color: #7f1111; }
.kq-followup-text strong { font-weight: 700; }

.pres-meds { border-left-color: #2e7d32; background: #f1f8f1; }
.pres-meds .pres-section-title { color: #2e7d32; }
.pres-med-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pres-med-chip {
  font-size: 12px; padding: 4px 11px; border-radius: 12px;
  font-weight: 600; white-space: nowrap; text-decoration: none;
}
.pres-med-treatment { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.pres-med-treatment:hover { background: #c8e6c9; }
.pres-med-caution   { background: var(--draft-bg); color: var(--draft-color); border: 1px solid var(--draft-border); }

/* ── PRESENTATION — PATIENT BACKGROUND MEDS SECTION ────────────────────────── */
.pres-mb-intro { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.4; }
.pres-mb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pres-mb-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px 7px 9px;
  background: var(--surface); border: 1.5px solid var(--border); border-left-width: 3px;
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.pres-mb-chip:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.pres-mb-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pres-mb-chip-icon  { font-size: 16px; flex-shrink: 0; line-height: 1; }
.pres-mb-chip-body  { display: flex; flex-direction: column; min-width: 0; }
.pres-mb-chip-label { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.pres-mb-chip-tag   { font-size: 10px; color: var(--text-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Accent colours — left border per category */
.pres-mb-chip--analgesics       { border-left-color: #6d28d9; }
.pres-mb-chip--nsaid-context    { border-left-color: #dc2626; }
.pres-mb-chip--anticoagulants   { border-left-color: #be123c; }
.pres-mb-chip--steroids         { border-left-color: #d97706; }
.pres-mb-chip--antidepressants  { border-left-color: #7c3aed; }
.pres-mb-chip--antihypertensives{ border-left-color: #0369a1; }
.pres-mb-chip--bone-health      { border-left-color: #15803d; }
.pres-mb-chip--diabetes         { border-left-color: #0891b2; }
.pres-mb-chip--cardiac          { border-left-color: #e11d48; }
.pres-mb-chip--statins          { border-left-color: #b45309; }
.pres-mb-chip--renal-risk       { border-left-color: #0e7490; }
.pres-mb-chip--polypharmacy     { border-left-color: #374151; }

/* ── VINDICATE TEACHING BLOCK (experiment — low-back-pain only) ─────────────── */
.vindicate-block {
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
}
.vindicate-summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.vindicate-summary::-webkit-details-marker { display: none; }
.vindicate-summary::after {
  content: '▸';
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.vindicate-block[open] .vindicate-summary::after { transform: rotate(90deg); }
.vindicate-summary:hover { background: #eef1f5; }
.vindicate-list {
  margin: 0;
  padding: 8px 14px 12px;
  list-style: none;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.vindicate-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.vindicate-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
}
.vindicate-letter {
  display: inline-block;
  width: 13px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-right: 3px;
}
.vindicate-cue {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  padding-left: 16px;
}

/* ── DDX SCHEMA SECTION ──────────────────────────────────────────────────────── */
/* v3.4 — DDx schema is now a quiet collapsible nested under the Differentials list */
.ddx-schema-collapse { margin-top: var(--sp-2); }
.ddx-schema-summary {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; list-style: none;
  font-size: var(--fs-caption); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: var(--sp-2) 0; min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.ddx-schema-summary::-webkit-details-marker { display: none; }
.ddx-schema-summary::before {
  content: '▾'; font-size: 10px; color: var(--text-muted);
  transition: transform var(--transition); flex-shrink: 0;
}
.ddx-schema-collapse[open] .ddx-schema-summary::before { transform: rotate(180deg); }
.ddx-schema-body {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  margin-top: var(--sp-2);
}

.ddx-group {
  margin-bottom: 14px;
}
.ddx-group:last-child { margin-bottom: 0; }

.ddx-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
/* Group accent colours — quiet but distinct */
/* v2.35h — concise weighting guidance under high-priority DDx group titles */
.ddx-group-help { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin: -1px 0 8px; }
.ddx-group--must_not_miss   .ddx-group-title { color: var(--tier1-color); border-bottom-color: rgba(183,28,28,0.18); }
.ddx-group--commonly_missed .ddx-group-title { color: #92400e; border-bottom-color: rgba(217,119,6,0.2); }
.ddx-group--systemic        .ddx-group-title { color: #5b21b6; border-bottom-color: rgba(124,58,237,0.18); }
.ddx-group--med_related     .ddx-group-title { color: #0e7490; border-bottom-color: rgba(14,116,144,0.18); }

.ddx-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.ddx-item {
  display: flex; flex-direction: column; gap: 2px;
  padding-left: 16px; position: relative;
}
.ddx-item::before {
  content: '–'; position: absolute; left: 0; top: 0;
  color: var(--border); font-size: 13px; line-height: 1.35;
}
.ddx-group--must_not_miss   .ddx-item::before { color: rgba(183,28,28,0.4); }
.ddx-group--commonly_missed .ddx-item::before { color: rgba(217,119,6,0.4); }
.ddx-group--systemic        .ddx-item::before { color: rgba(124,58,237,0.3); }
.ddx-group--med_related     .ddx-item::before { color: rgba(14,116,144,0.35); }

.ddx-item-label {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  line-height: 1.35;
}
.ddx-item-cue {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.5;
}

/* Mobile: tighter inter-group spacing */
@media (max-width: 767px) {
  .ddx-group { margin-bottom: 12px; }
  .ddx-item-label { font-size: 14px; }
  .ddx-item-cue   { font-size: 12px; }
}

/* ── PRESENTATION ACCORDIONS (progressive disclosure) ───────────────────────── */
.pres-accordion {
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}
.pres-accordion > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  border-left: 3px solid var(--border);
  background: var(--bg);
  user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.12s;
}
.pres-accordion > summary::-webkit-details-marker { display: none; }
.pres-accordion > summary::after {
  content: '▸';
  font-size: 13px; color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.pres-accordion[open] > summary::after { transform: rotate(90deg); }
.pres-accordion > summary:hover { background: #eef1f5; }

/* Question accordion — blue theme */
.pres-accordion-questions > summary {
  border-left-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.pres-accordion-questions > summary:hover { background: #d5e9ff; }
.pres-accordion-questions > summary::after { color: var(--primary); }

/* Medication accordion — green theme */
.pres-accordion-meds > summary {
  border-left-color: #2e7d32;
  color: #2e7d32;
  background: #f1f8f1;
}
.pres-accordion-meds > summary:hover { background: #dff0df; }
.pres-accordion-meds > summary::after { color: #2e7d32; }

/* Body — revealed section (the .pres-section is already styled; we just remove border-radius from it when nested) */
.pres-accordion > .pres-section {
  border-radius: 0;
  margin-bottom: 0;
}

/* ── GUIDANCE CARD ───────────────────────────────────────────────────────────── */
.guidance-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--primary-bg);
  border: 1px solid rgba(15, 94, 168, 0.16);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* Standalone variant — used on condition detail pages (full-width, not inside pres panel) */
.guidance-card--standalone {
  border-radius: var(--radius-sm);
  border-left-width: 3px;
  margin-top: 16px;
}
.guidance-card-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--primary); margin-bottom: 10px;
}
.guidance-card-note {
  font-size: 12px; color: var(--text-muted); margin-bottom: 8px;
}
.guidance-group { margin-bottom: 10px; }
.guidance-group:last-child { margin-bottom: 0; }
.guidance-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 5px;
}
.guidance-links { display: flex; flex-direction: column; gap: 4px; }
.guidance-link {
  display: flex; align-items: center;
  padding: 6px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 500; text-decoration: none;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 94, 168, 0.12);
  color: var(--primary); line-height: 1.35;
  transition: background var(--transition), box-shadow var(--transition);
}
.guidance-link:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}
/* Tier-1 must-not-miss links — red tint */
.guidance-link--tier1 {
  color: var(--tier1-color);
  border-color: rgba(183, 28, 28, 0.14);
  background: rgba(254, 236, 236, 0.55);
}
.guidance-link--tier1:hover { background: rgba(254, 236, 236, 0.95); }
/* Presentation back-links */
.guidance-link--pres { color: var(--primary); }

/* ── PRESENTATION NON-MSK TYPE SUB-GROUPS ────────────────────────────────────── */
.pres-type-group { margin-bottom: 16px; }
.pres-type-group:last-child { margin-bottom: 0; }

.pres-type-group-header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.pres-type-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 8px; border-radius: 4px;
  border: 1px solid transparent;
  flex-shrink: 0;
}
/* Type-specific label colors — mirror the existing pres-type badge palette */
.pres-type-group--cardiac        { background: var(--tier1-bg);   color: var(--tier1-color); border-color: #ef9a9a; }
.pres-type-group--vascular       { background: #fce4ec; color: #880e4f;  border-color: #f48fb1; }
.pres-type-group--neurological   { background: #f3e5f5; color: #6a1b9a;  border-color: #ce93d8; }
.pres-type-group--malignant      { background: #ede7f6; color: #4a148c;  border-color: #b39ddb; }
.pres-type-group--visceral       { background: #e0f7fa; color: #006064;  border-color: #80deea; }
.pres-type-group--gynaecological { background: #fce4ec; color: #c2185b;  border-color: #f48fb1; }
.pres-type-group--inflammatory   { background: #fff3e0; color: #e65100;  border-color: #ffcc80; }
.pres-type-group--toxic          { background: #efebe9; color: #4e342e;  border-color: #bcaaa4; }

.pres-type-group-note {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
  flex: 1; min-width: 0;
  font-style: italic;
}

/* ── BLUEPRINTS INDEX ─────────────────────────────────────────────────────── */
.bp-index-list { display: flex; flex-direction: column; gap: 6px; }
.bp-index-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--border);
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  border-left-width: 4px;
}
.bp-index-row:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--primary); }
.bp-index-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bp-index-label { font-size: 14px; font-weight: 700; color: var(--text); }
.bp-index-region { font-size: 11px; color: var(--text-muted); }
.bp-index-row-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bp-index-count { font-size: 11px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 1px 7px; }
.bp-index-flag-count { font-size: 11px; color: #b71c1c; background: var(--tier1-bg); border: 1px solid #f5c6c6; border-radius: 20px; padding: 1px 7px; }
.bp-index-arrow { font-size: 12px; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Region left-border tints — reuse existing colour tokens */
.bp-index-row.pres-item--lumbar     { border-left-color: var(--col-lumbar); }
.bp-index-row.pres-item--cervical   { border-left-color: var(--col-cervical); }
.bp-index-row.pres-item--shoulder   { border-left-color: var(--col-shoulder); }
.bp-index-row.pres-item--hip        { border-left-color: var(--col-hip); }
.bp-index-row.pres-item--knee       { border-left-color: var(--col-knee); }
.bp-index-row.pres-item--lower-limb { border-left-color: var(--col-lower-limb); }
.bp-index-row.pres-item--upper-limb { border-left-color: var(--col-upper-limb); }
.bp-index-row.pres-item--multi      { border-left-color: var(--col-multi); }

/* ── Presentations sidebar item wrapper ────────────────────────────────────── */
/* Each item is now a flex row: [presentation button] [⊞ blueprint link]       */
.pres-item-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  border-left: 4px solid var(--border);
}
.pres-item-wrap:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.pres-item-wrap.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md), var(--glow-primary);
}

/* Subtle region-specific left border and tinted backgrounds (Tailkits style) */
.pres-item-wrap--lumbar     { border-left-color: var(--col-lumbar);     background: color-mix(in srgb, var(--col-lumbar-bg) 18%, var(--surface)); }
.pres-item-wrap--cervical   { border-left-color: var(--col-cervical);   background: color-mix(in srgb, var(--col-cervical-bg) 18%, var(--surface)); }
.pres-item-wrap--shoulder   { border-left-color: var(--col-shoulder);   background: color-mix(in srgb, var(--col-shoulder-bg) 18%, var(--surface)); }
.pres-item-wrap--hip        { border-left-color: var(--col-hip);        background: color-mix(in srgb, var(--col-hip-bg) 18%, var(--surface)); }
.pres-item-wrap--knee       { border-left-color: var(--col-knee);       background: color-mix(in srgb, var(--col-knee-bg) 18%, var(--surface)); }
.pres-item-wrap--lower-limb { border-left-color: var(--col-lower-limb); background: color-mix(in srgb, var(--col-lower-limb-bg) 18%, var(--surface)); }
.pres-item-wrap--upper-limb { border-left-color: var(--col-upper-limb); background: color-mix(in srgb, var(--col-upper-limb-bg) 18%, var(--surface)); }
.pres-item-wrap--multi      { border-left-color: var(--col-multi);      background: color-mix(in srgb, var(--col-multi-bg) 18%, var(--surface)); }

.pres-item-wrap .pres-item {
  flex: 1; border: none; background: transparent;
  padding: 10px 12px;
}

@media (max-width: 480px) {
  .pres-item-wrap .pres-item {
    padding: 7px 10px;
  }
  .pres-item-wrap {
    margin-bottom: 6px;
  }
  .pres-item-label {
    font-size: 13.5px !important;
  }
  .pres-card-summary {
    font-size: 10.5px !important;
  }
  .pres-card-badge {
    font-size: 9px !important;
    padding: 0px 4px !important;
  }
  .pres-card-title-row {
    margin: 2px 0 !important;
  }
}
.pres-item-bp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; min-height: 100%;
  flex-shrink: 0;
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-bg);
  border-left: 1px solid rgba(15, 94, 168, 0.15);
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
  opacity: 0.82;
}
.pres-item-bp-btn:hover {
  background: var(--primary);
  color: #fff;
  opacity: 1;
}
.pres-bp-icon {
  font-size: 20px;
  font-weight: 600;
}

/* ── New Clinical Presentations Card Layout ── */
.pres-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2px;
}
.pres-card-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.4;
}
.pres-card-badge--lumbar     { background: rgba(15, 94, 168, 0.15);  color: var(--col-lumbar); }
.pres-card-badge--cervical   { background: rgba(107, 33, 168, 0.15); color: var(--col-cervical); }
.pres-card-badge--shoulder   { background: rgba(14, 116, 144, 0.15); color: var(--col-shoulder); }
.pres-card-badge--hip        { background: rgba(180, 83, 9, 0.15);   color: var(--col-hip); }
.pres-card-badge--knee       { background: rgba(22, 101, 52, 0.15);  color: var(--col-knee); }
.pres-card-badge--lower-limb { background: rgba(154, 52, 18, 0.15);  color: var(--col-lower-limb); }
.pres-card-badge--upper-limb { background: rgba(157, 23, 77, 0.15);  color: var(--col-upper-limb); }
.pres-card-badge--multi      { background: rgba(55, 65, 81, 0.15);   color: var(--col-multi); }

.pres-card-rf-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--tier1-color);
  background: var(--tier1-bg);
  border: 1px solid rgba(183, 28, 28, 0.2);
  border-radius: 4px;
  padding: 0px 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.4;
}

.pres-card-title-row {
  width: 100%;
  margin: 4px 0;
}

.pres-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.pres-card-summary {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── KEY QUESTION SUMMARY LIST (presentation detail page) ────────────────── */
.key-question-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.key-question-list li {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.55;
  align-items: flex-start;
}
/* v2.35a — decorative leading arrow removed; the 🔴/🟡 urgency dot is the leading marker. */
.key-question-list li:last-child { border-bottom: none; }
.kq-rules-out { color: var(--text-muted); font-style: normal; font-size: 12px; }

/* ── PRESENTATION DETAIL STANDALONE PAGE ─────────────────────────────────── */
.pres-detail-section { margin-bottom: 20px; }
.pres-detail-section h3 { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ══════════════════════════════════════════════════════════════════════════════
   v2.21 — UI/Design improvement pass
   ════════════════════════════════════════════════════════════════════════════ */

/* ── PRESENTATIONS: pres-item — scripts-group-header style ───────────────── */
/* Legacy pres-item overrides cleaned up to prevent card styling conflicts */
.pres-item-icon { display: none; }
.pres-item--lumbar, .pres-item--cervical, .pres-item--shoulder, .pres-item--hip,
.pres-item--knee, .pres-item--lower-limb, .pres-item--upper-limb, .pres-item--multi {
  background: transparent !important;
}
.pres-item--lumbar .pres-item-label, .pres-item--cervical .pres-item-label,
.pres-item--shoulder .pres-item-label, .pres-item--hip .pres-item-label,
.pres-item--knee .pres-item-label, .pres-item--lower-limb .pres-item-label,
.pres-item--upper-limb .pres-item-label, .pres-item--multi .pres-item-label {
  color: var(--text);
}

/* Filter chips: more gap, stronger active */
.filter-chips { gap: 8px; }
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* Empty state: calm card-like panel */
.pres-empty-state {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  margin: 24px 16px;
}
.pres-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.pres-empty-sub { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.6; }



/* ════════════════════════════════════════════════════════════════════════════
   v3.93 : consultation-spine stages (Screen / Gather / Weigh / Context / Act)
   ════════════════════════════════════════════════════════════════════════════ */
.pres-stage {
  margin-top: var(--section-gap);
  scroll-margin-top: var(--section-sticky-offset);
}
.stage-head {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 14px; padding-bottom: 9px;
  border-bottom: 2px solid var(--border);
}
.stage-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.stage-title { font-size: 17px; font-weight: 800; color: var(--text); margin: 0; line-height: 1.3; }
.stage-sub   { font-size: 12.5px; color: var(--text-muted); margin: 1px 0 0; }
.stage-head--screen  .stage-num { background: var(--tier1-color); }
.stage-head--screen  { border-bottom-color: rgba(183,28,28,0.25); }
.stage-head--weigh   .stage-num { background: var(--col-cervical); }
.stage-head--context .stage-num { background: var(--col-shoulder); }
.stage-head--act     .stage-num { background: var(--col-knee); }

/* ── Weigh: reasoning-weight differential groups ── */
.wdx-group {
  margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.wdx-group-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 9px 13px;
  border-top: 3px solid var(--border);
  background: var(--surface-sunken);
}
.wdx-group-title {
  font-size: 12.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.wdx-group-help  { font-size: 11.5px; color: var(--text-muted); flex: 1; min-width: 140px; }
.wdx-group-count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.wdx-group .pres-diff-list { padding: 10px 12px; }
.wdx-group--must_not_miss   .wdx-group-head  { border-top-color: var(--tier1-color); }
.wdx-group--must_not_miss   .wdx-group-title { color: var(--tier1-color); }
.wdx-group--common          .wdx-group-head  { border-top-color: var(--primary); }
.wdx-group--common          .wdx-group-title { color: var(--primary); }
.wdx-group--commonly_missed .wdx-group-head  { border-top-color: #d97706; }
.wdx-group--commonly_missed .wdx-group-title { color: #92600a; }
.wdx-group--systemic        .wdx-group-head  { border-top-color: var(--col-systemic); }
.wdx-group--systemic        .wdx-group-title { color: var(--col-systemic); }
.wdx-group--med_related     .wdx-group-head  { border-top-color: var(--col-medications); }
.wdx-group--med_related     .wdx-group-title { color: var(--col-medications); }

/* ── Secondary collapses: by-system view, full red-flag reference ── */
.pres-system-collapse, .pres-rf-full {
  margin-top: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.pres-system-summary, .pres-rf-full-summary {
  cursor: pointer; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
  list-style: none; -webkit-appearance: none; user-select: none;
}
.pres-system-summary::-webkit-details-marker,
.pres-rf-full-summary::-webkit-details-marker { display: none; }
.pres-system-collapse[open] > .pres-system-summary,
.pres-rf-full[open] > .pres-rf-full-summary {
  border-bottom: 1px solid var(--border); color: var(--primary);
}
.pres-system-collapse .pres-differentials { padding: 12px; }
.pres-rf-full .warning-callout { margin: 12px; }
