/* ============================================================
   RAR PATHOLOGY · Atelectasis (Page 1) styles
   Scoped to .rar-topic-content so nothing leaks to other pages.
   House rules held here: BLACK body text everywhere (no grey),
   titles clearly larger than body, text-only boxes use the shared
   .solid-text-card, NBME/high-yield use the shared .hy-callout +
   the inline .atl-flag tag.
   ============================================================ */

/* keep shared text cards black on this page too (no grey) */
.rar-topic-content .solid-text-card p { color: var(--text, #111318); }

/* ---------- Module stepper ---------- */
.rar-topic-content .atl-stepper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 6px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(94, 92, 230, 0.06);
    border: 1px solid rgba(94, 92, 230, 0.22);
}
.rar-topic-content .atl-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.1);
}
.rar-topic-content .atl-step__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text, #111318);
    font-size: 12.5px;
    font-weight: 800;
}
.rar-topic-content .atl-step__t {
    color: var(--text, #111318);
    font-size: 14px;
    font-weight: 750;
}
.rar-topic-content .atl-step__soon {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text, #111318);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.rar-topic-content .atl-step.is-active {
    background: #5e5ce6;
    border-color: #5e5ce6;
}
.rar-topic-content .atl-step.is-active .atl-step__n { background: rgba(255, 255, 255, 0.28); color: #fff; }
.rar-topic-content .atl-step.is-active .atl-step__t { color: #fff; }
.rar-topic-content .atl-step.is-locked { opacity: 0.72; }
/* completed page — rendered as a real clickable button */
.rar-topic-content button.atl-step {
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.rar-topic-content button.atl-step:hover { border-color: rgba(52, 199, 89, 0.55); transform: translateY(-1px); }
.rar-topic-content button.atl-step:focus-visible { outline: 3px solid rgba(10, 132, 255, 0.5); outline-offset: 2px; }
.rar-topic-content .atl-step.is-done { border-color: rgba(52, 199, 89, 0.4); background: rgba(52, 199, 89, 0.08); }
.rar-topic-content .atl-step__done-tag {
    background: rgba(52, 199, 89, 0.18);
    color: #1f8f43;
}
.rar-topic-content .atl-step__sep {
    color: var(--text, #111318);
    font-weight: 800;
    opacity: 0.5;
}

/* ---------- Inline Key / NBME flag (mirrors .mov-flag) ---------- */
.rar-topic-content .atl-flag {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 176, 32, 0.12);
    border: 1px solid rgba(255, 176, 32, 0.4);
    color: var(--text, #111318);
    font-size: 14.5px;
    line-height: 1.55;
}
.rar-topic-content .atl-flag--tight { margin-top: 8px; font-size: 13.5px; padding: 9px 11px; }
.rar-topic-content .atl-flag strong { font-weight: 800; }
.rar-topic-content .atl-flag-tag {
    display: inline-block;
    margin-right: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f5a623;
    color: #201400;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
}
.rar-topic-content .atl-flag-tag--nbme { background: var(--accent, #0a84ff); color: #fff; }

/* ---------- Deferral stub ---------- */
.rar-topic-content .atl-defer {
    margin: 14px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text, #111318);
}
.rar-topic-content .atl-defer-link {
    color: var(--accent-strong, #0066cc);
    font-weight: 750;
    text-decoration: underline dotted;
    cursor: pointer;
}

/* ---------- Sub-sections inside NRDS ---------- */
.rar-topic-content .atl-sub { margin-top: 20px; }
.rar-topic-content .atl-sub__label {
    margin: 0 0 10px;
    color: var(--text, #111318);
    font-size: 17px;
    font-weight: 850;
    letter-spacing: -0.01em;
}
.rar-topic-content .atl-sub__label::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 18px;
    margin-right: 9px;
    border-radius: 3px;
    background: #5e5ce6;
    vertical-align: -3px;
}

/* ---------- Config-card grids ---------- */
.rar-topic-content .atl-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.rar-topic-content .atl-grid--causes { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rar-topic-content .atl-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(238, 245, 255, 0.9), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(10, 132, 255, 0.16);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}
.rar-topic-content .atl-card__h {
    margin: 0 0 6px;
    color: var(--text, #111318);
    font-size: 15.5px;
    font-weight: 850;
    line-height: 1.25;
}
.rar-topic-content .atl-card p {
    margin: 0;
    color: var(--text, #111318);
    font-size: 14px;
    line-height: 1.55;
}
.rar-topic-content .atl-card p + p { margin-top: 8px; }
.rar-topic-content .atl-card strong { font-weight: 800; }

/* shared NBME pill sitting inside a card header — nudge it off the text */
.rar-topic-content .atl-card__h .nbme-flag { margin-left: 6px; vertical-align: 2px; }

/* ---------- Findings as separate bulleted lines (not comma-lists) ---------- */
.rar-topic-content .atl-find-lead {
    margin: 0 0 8px;
    color: var(--text, #111318);
    font-size: 13.5px;
    line-height: 1.5;
}
.rar-topic-content .atl-find-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.rar-topic-content .atl-find-list li {
    position: relative;
    padding-left: 26px;
    color: var(--text, #111318);
    font-size: 14px;
    line-height: 1.5;
}
.rar-topic-content .atl-find-list li strong { font-weight: 800; }
.rar-topic-content .atl-find-emoji {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 15px;
    line-height: 1.5;
}
.rar-topic-content .atl-find-list .nbme-flag { margin-left: 4px; }

/* ---------- Inline NBME note box (uses the shared .nbme-flag pill) ---------- */
.rar-topic-content .atl-note {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 149, 0, 0.09);
    border: 1px solid rgba(255, 149, 0, 0.28);
    color: var(--text, #111318);
    font-size: 14px;
    line-height: 1.55;
}
.rar-topic-content .atl-note .nbme-flag { margin-right: 8px; }
.rar-topic-content .atl-note strong { font-weight: 800; }
.rar-topic-content .atl-note--tight { margin-top: 8px; font-size: 13px; padding: 9px 11px; }

/* ---------- Pathogenesis — horizontal wrapping flow ---------- */
.rar-topic-content .atl-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    margin: 8px 0 0;
}
.rar-topic-content .atl-flow-step {
    position: relative;
    padding: 9px 13px;
    border-radius: 11px;
    background: rgba(10, 132, 255, 0.08);
    border: 1px solid rgba(10, 132, 255, 0.2);
    color: var(--text, #111318);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    cursor: help;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.rar-topic-content .atl-flow-step:hover,
.rar-topic-content .atl-flow-step:focus-visible {
    background: rgba(10, 132, 255, 0.14);
    border-color: rgba(10, 132, 255, 0.45);
    transform: translateY(-1px);
    outline: none;
}
/* hover explanation bubble — mirrors the shared .cav-term tooltip */
.rar-topic-content .atl-flow-step[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: min(280px, 80vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    color: var(--text, #111318);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(15, 23, 42, 0.06);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 25;
    white-space: normal;
}
.rar-topic-content .atl-flow-step:hover::after,
.rar-topic-content .atl-flow-step:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.rar-topic-content .atl-flow-arrow {
    color: #5e5ce6;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}
.rar-topic-content .atl-flow-step--anchor {
    background: linear-gradient(180deg, rgba(255, 214, 229, 0.9), rgba(255, 235, 243, 0.97));
    border: 2px solid #d6336c;
    box-shadow: 0 10px 22px rgba(214, 51, 108, 0.18);
    font-size: 14.5px;
}
.rar-topic-content .atl-flow-step--anchor strong { color: #a01048; font-weight: 900; }
.rar-topic-content .atl-flow-step--anchor:hover,
.rar-topic-content .atl-flow-step--anchor:focus-visible {
    background: linear-gradient(180deg, rgba(255, 205, 223, 0.95), rgba(255, 232, 241, 1));
    border-color: #c02760;
}

/* ---------- Figures ---------- */
.rar-topic-content .atl-figrow {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.rar-topic-content .atl-figure {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
}
.rar-topic-content .atl-figure__img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f4f6fb;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.rar-topic-content .atl-figure__slot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 116px;
    background: repeating-linear-gradient(45deg, rgba(94, 92, 230, 0.06) 0 12px, rgba(94, 92, 230, 0.11) 12px 24px);
    color: #4a3ea8;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: 0.08em;
}
.rar-topic-content .atl-figure figcaption {
    padding: 10px 12px;
    color: var(--text, #111318);
    font-size: 12.5px;
    line-height: 1.5;
}
.rar-topic-content .atl-figure__src {
    display: block;
    margin-top: 4px;
    color: var(--text, #111318);
    font-size: 11px;
    font-style: italic;
    opacity: 0.75;
}

/* ---------- Section teaser to Two-Roads ---------- */
.rar-topic-content .atl-teaser {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    border-left: 4px solid #d6336c;
    background: rgba(214, 51, 108, 0.06);
    color: var(--text, #111318);
    font-size: 14.5px;
    line-height: 1.55;
    font-style: italic;
}
.rar-topic-content .atl-teaser strong { font-style: normal; font-weight: 850; color: #a01048; }

/* ============================================================
   Four-Types comparator
   ============================================================ */
.rar-topic-content .atl-comparator {
    display: grid;
    grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.6fr);
    gap: 14px;
    margin-top: 6px;
}
@media (max-width: 720px) {
    .rar-topic-content .atl-comparator { grid-template-columns: 1fr; }
}

/* left: type tabs */
.rar-topic-content .atl-typetabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rar-topic-content .atl-typetab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.rar-topic-content .atl-typetab:hover { border-color: rgba(94, 92, 230, 0.5); transform: translateY(-1px); }
.rar-topic-content .atl-typetab__name {
    color: var(--text, #111318);
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.2;
}
.rar-topic-content .atl-typetab__chip {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.rar-topic-content .atl-typetab.is-active {
    background: rgba(94, 92, 230, 0.1);
    border-color: #5e5ce6;
    box-shadow: 0 8px 20px rgba(94, 92, 230, 0.16);
}

/* diagram-direction color coding (chips + shiftbox) */
.rar-topic-content .atl-typetab__chip--toward,
.rar-topic-content .atl-shiftbox--toward .atl-shiftbox__tag { background: rgba(245, 166, 35, 0.18); color: #8a5a00; }
.rar-topic-content .atl-typetab__chip--away,
.rar-topic-content .atl-shiftbox--away .atl-shiftbox__tag { background: rgba(10, 132, 255, 0.16); color: #0059b3; }
.rar-topic-content .atl-typetab__chip--traction,
.rar-topic-content .atl-shiftbox--traction .atl-shiftbox__tag { background: rgba(142, 68, 230, 0.16); color: #5b21b6; }
.rar-topic-content .atl-typetab__chip--bilateral,
.rar-topic-content .atl-shiftbox--bilateral .atl-shiftbox__tag { background: rgba(20, 160, 133, 0.16); color: #0b6b57; }

/* right: detail panel */
.rar-topic-content .atl-typepanel {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    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);
}
@media (max-width: 900px) {
    .rar-topic-content .atl-typepanel { grid-template-columns: 1fr; }
}
.rar-topic-content .atl-schematic-wrap {
    align-self: start;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    padding: 8px;
}
.rar-topic-content .atl-schematic { width: 100%; height: auto; display: block; }

/* schematic parts */
.rar-topic-content .atl-sch-frame { fill: rgba(10, 132, 255, 0.04); stroke: rgba(15, 23, 42, 0.18); stroke-width: 1.5; }
.rar-topic-content .atl-sch-lung { fill: rgba(10, 132, 255, 0.14); stroke: #0a84ff; stroke-width: 2; transition: d 0.4s ease; }
.rar-topic-content .atl-sch-lung--affected { fill: rgba(214, 51, 108, 0.16); stroke: #d6336c; }
.rar-topic-content .atl-sch-mid { transition: transform 0.4s ease; }
.rar-topic-content .atl-sch-trachea { fill: rgba(15, 23, 42, 0.75); }
.rar-topic-content .atl-sch-midline { stroke: rgba(15, 23, 42, 0.75); stroke-width: 2.5; stroke-dasharray: 5 5; }
.rar-topic-content .atl-sch-arrow { transition: opacity 0.3s ease; }
.rar-topic-content .atl-sch-arrow-line { stroke: #d6336c; stroke-width: 3.5; }
.rar-topic-content .atl-sch-arrow-head { fill: #d6336c; }
.rar-topic-content .atl-sch-caption { fill: var(--text, #111318); font-size: 12px; font-weight: 800; }

/* detail body */
.rar-topic-content .atl-typebody__name {
    margin: 0 0 8px;
    color: var(--text, #111318);
    font-size: 19px;
    font-weight: 850;
    line-height: 1.2;
}
.rar-topic-content .atl-typebody__mech {
    margin: 0 0 12px;
    color: var(--text, #111318);
    font-size: 14.5px;
    line-height: 1.6;
}
.rar-topic-content .atl-typebody__k {
    margin: 12px 0 6px;
    color: var(--text, #111318);
    font-size: 11.5px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}
.rar-topic-content .atl-typebody__mech .atl-typebody__k {
    display: inline-block;
    margin: 0 4px 0 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(94, 92, 230, 0.12);
    color: #4a3ea8;
    vertical-align: 1px;
}
.rar-topic-content .atl-shiftbox {
    display: grid;
    gap: 11px;
    margin: 4px 0 4px;
    padding: 14px 16px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(15, 23, 42, 0.14);
}
.rar-topic-content .atl-shiftbox__tag {
    width: fit-content;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.rar-topic-content .atl-shiftbox__txt {
    color: var(--text, #111318);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.6;
}
.rar-topic-content .atl-typelist {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rar-topic-content .atl-typelist li {
    color: var(--text, #111318);
    font-size: 14px;
    line-height: 1.5;
}
.rar-topic-content .atl-revrow {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(15, 23, 42, 0.15);
}
.rar-topic-content .atl-revbadge {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.02em;
}
.rar-topic-content .atl-revbadge--yes { background: rgba(52, 199, 89, 0.16); color: #1f8f43; border: 1px solid rgba(52, 199, 89, 0.4); }
.rar-topic-content .atl-revbadge--no { background: rgba(214, 51, 108, 0.14); color: #b01050; border: 1px solid rgba(214, 51, 108, 0.4); }
.rar-topic-content .atl-revnote {
    color: var(--text, #111318);
    font-size: 13.5px;
    line-height: 1.5;
    font-weight: 600;
}
