/* ============================================================
   RAR PATHOLOGY · Page 3 · "Four Phases of Diffuse Alveolar Damage"
   Self-contained interactive styles. Scoped under .rar-topic-content
   (black text / no grey rule holds). Original SVG line-art.
   Accents: interstitial = yellow (A), capillary = pink/red (B);
   pink is reserved for the hyaline membrane.
   ============================================================ */
.rar-topic-content .dad { margin: 0 0 18px; }

.rar-topic-content .dad-intro {
    margin: 0 0 12px;
    color: var(--text, #111318);
    font-size: 14.5px;
    line-height: 1.55;
}

/* ---------- tabs ---------- */
.rar-topic-content .dad-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.rar-topic-content .dad-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid rgba(15, 23, 42, 0.14);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.rar-topic-content .dad-tab:hover { border-color: rgba(94, 92, 230, 0.5); transform: translateY(-1px); }
.rar-topic-content .dad-tab:focus-visible { outline: 3px solid rgba(10, 132, 255, 0.5); outline-offset: 2px; }
.rar-topic-content .dad-tab__label { color: var(--text, #111318); font-size: 14px; font-weight: 820; }
.rar-topic-content .dad-tab__day {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(94, 92, 230, 0.12);
    color: #4a3ea8;
    font-size: 10.5px;
    font-weight: 850;
}
.rar-topic-content .dad-tab.is-active { background: rgba(94, 92, 230, 0.1); border-color: #5e5ce6; box-shadow: 0 8px 20px rgba(94, 92, 230, 0.16); }

/* ---------- stage / svg ---------- */
.rar-topic-content .dad-stage {
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.9), rgba(255, 255, 255, 0.97));
    border: 1px solid rgba(10, 132, 255, 0.14);
    border-radius: 18px;
    padding: 12px;
}
.rar-topic-content .dad-svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }

/* base drawing tokens */
.rar-topic-content .dad-airfill { fill: rgba(147, 197, 253, 0.12); }
.rar-topic-content .dad-wall { stroke: #6b7280; stroke-width: 3; transition: stroke-width 0.25s ease; }
.rar-topic-content .dad-nuc { fill: #64748b; }
.rar-topic-content .dad-interstitium { fill: rgba(245, 200, 66, 0.16); stroke: rgba(191, 148, 20, 0.5); stroke-width: 1; }
.rar-topic-content .dad-cap { fill: rgba(244, 114, 128, 0.12); stroke: rgba(214, 51, 108, 0.4); stroke-width: 1; }
.rar-topic-content .dad-band-label { fill: #4b5563; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

/* cells */
.rar-topic-content .dad-mac-body { fill: #cbb2f2; stroke: #7c4dd0; stroke-width: 1.5; }
.rar-topic-content .dad-mac-nuc { fill: #5b2ca0; }
.rar-topic-content .dad-cell--m1 .dad-mac-body { fill: #f4b8c0; stroke: #c53a52; }
.rar-topic-content .dad-cell--m1 .dad-mac-nuc { fill: #a01840; }
.rar-topic-content .dad-cell--m2 .dad-mac-body { fill: #bfe3c8; stroke: #2f8f52; }
.rar-topic-content .dad-cell--m2 .dad-mac-nuc { fill: #1c6b3a; }
.rar-topic-content .dad-neut-body { fill: #dbe4ff; stroke: #4666c4; stroke-width: 1.4; }
.rar-topic-content .dad-neut-lobe { fill: #33489a; }
.rar-topic-content .dad-cell-lbl { fill: var(--text, #111318); font-size: 11px; font-weight: 850; text-anchor: middle; }

/* fibroblasts */
.rar-topic-content .dad-fibro-body { fill: rgba(245, 200, 66, 0.55); stroke: #b9861a; stroke-width: 1.2; }
.rar-topic-content .dad-fibro-nuc { fill: #7a5a10; }

/* RBCs */
.rar-topic-content .dad-rbc { fill: #d64550; stroke: #a01722; stroke-width: 1; }

/* hyaline membrane — pink, echoes the two-roads DAD node */
.rar-topic-content .dad-hyaline { stroke: #ec6a9c; }

/* endothelium variants */
.rar-topic-content .dad-endo-line line { stroke: #d6336c; stroke-width: 2; }
.rar-topic-content .dad-endo-broken line { stroke: #d6336c; stroke-width: 2; }
.rar-topic-content .dad-endo-nuc ellipse { fill: #b01050; }
.rar-topic-content .dad-fibrin path { stroke: #9aa1b0; stroke-width: 1.5; stroke-dasharray: 2 3; }
.rar-topic-content .dad-cap-obliterate { opacity: 0; }

/* ---------- phase visibility engine ---------- */
.rar-topic-content .dad-phasic { opacity: 0; transition: opacity 0.25s ease; }
.rar-topic-content .dad-svg--noanim .dad-phasic,
.rar-topic-content .dad-svg--noanim .dad-wall { transition: none; }

/* exudative-only */
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-hyaline,
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-cell--m1,
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-cell--neut,
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-endo-broken,
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-neut-cross,
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-fibrin { opacity: 1; }

/* proliferative + fibrotic */
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-cell--m2,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-cell--m2,
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-nuc--extra,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-nuc--extra,
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-fibro--extra,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-fibro--extra { opacity: 1; }

/* proliferative-only */
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-endo-nuc { opacity: 1; }

/* fibrotic-only */
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-wisp,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-hatch-interstitium,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-cap-obliterate { opacity: 1; }

/* wall hatch: faint as it starts (proliferative), dense (fibrotic) */
.rar-topic-content .dad-hatch-wall { opacity: 0; transition: opacity 0.25s ease; }
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-hatch-wall { opacity: 0.32; }
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-hatch-wall { opacity: 0.85; }

/* wall thickness */
.rar-topic-content .dad-svg[data-phase="proliferative"] .dad-wall { stroke-width: 6; }
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-wall { stroke-width: 9; }

/* intact endothelium hidden in exudative + fibrotic */
.rar-topic-content .dad-endo-line { opacity: 1; transition: opacity 0.25s ease; }
.rar-topic-content .dad-svg[data-phase="exudative"] .dad-endo-line,
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-endo-line { opacity: 0; }

/* RBCs: drop most in the obliterated (fibrotic) capillary */
.rar-topic-content .dad-rbc { transition: opacity 0.25s ease; }
.rar-topic-content .dad-svg[data-phase="fibrotic"] .dad-rbc--drop { opacity: 0; }

/* ---------- cell legend ---------- */
.rar-topic-content .dad-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; min-height: 26px; }
.rar-topic-content .dad-legend__chip {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 750;
    border: 1px solid transparent;
}
.rar-topic-content .dad-legend__chip .cav-term { color: inherit; }
.rar-topic-content .dad-legend__chip--m1 { background: rgba(197, 58, 82, 0.12); color: #a01840; border-color: rgba(197, 58, 82, 0.3); }
.rar-topic-content .dad-legend__chip--m2 { background: rgba(47, 143, 82, 0.14); color: #1c6b3a; border-color: rgba(47, 143, 82, 0.32); }
.rar-topic-content .dad-legend__chip--neut { background: rgba(70, 102, 196, 0.12); color: #33489a; border-color: rgba(70, 102, 196, 0.3); }
.rar-topic-content .dad-legend__empty { color: var(--text, #111318); font-size: 13px; font-style: italic; opacity: 0.75; }

/* ---------- summary + change-rows ---------- */
.rar-topic-content .dad-summary {
    margin: 8px 0 12px;
    color: var(--text, #111318);
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.5;
}
.rar-topic-content .dad-rows { display: grid; gap: 10px; }
.rar-topic-content .dad-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
}
.rar-topic-content .dad-row__tag {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 850;
    letter-spacing: 0.02em;
}
.rar-topic-content .dad-row__txt { color: var(--text, #111318); font-size: 14.5px; line-height: 1.5; font-weight: 650; }
.rar-topic-content .dad-row--interstitial { background: rgba(245, 200, 66, 0.12); border: 1px solid rgba(191, 148, 20, 0.35); }
.rar-topic-content .dad-row--interstitial .dad-row__tag { background: rgba(191, 148, 20, 0.18); color: #8a6512; }
.rar-topic-content .dad-row--capillary { background: rgba(214, 51, 108, 0.08); border: 1px solid rgba(214, 51, 108, 0.3); }
.rar-topic-content .dad-row--capillary .dad-row__tag { background: rgba(214, 51, 108, 0.16); color: #b01050; }

/* ---------- progression strip ---------- */
.rar-topic-content .dad-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; }
.rar-topic-content .dad-strip__step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text, #111318);
    font-size: 12.5px;
    font-weight: 750;
}
.rar-topic-content .dad-strip__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(15, 23, 42, 0.25); }
.rar-topic-content .dad-strip__step.is-done { background: rgba(94, 92, 230, 0.1); }
.rar-topic-content .dad-strip__step.is-done .dad-strip__dot { background: #a5a2ec; }
.rar-topic-content .dad-strip__step.is-active { background: #5e5ce6; color: #fff; font-weight: 850; }
.rar-topic-content .dad-strip__step.is-active .dad-strip__dot { background: #fff; }
.rar-topic-content .dad-strip__arrow { color: #5e5ce6; font-weight: 800; }

.rar-topic-content .dad-callout { margin-top: 14px; }
