/* Chest Pain text v2.2.7. Extends the shared chapter hierarchy. */
.chest-pain-page .chest-pain-teaching { max-width:1050px; margin-inline:0 auto; }
.chest-pain-teaching > .teaching-stage { border-top:0; padding-top:0; margin-top:44px; }
.chest-pain-teaching > .teaching-stage > .teaching-stage-heading { margin-bottom:24px; }
.chest-pain-teaching .chapter-overview-heading { font-size:1.875rem; color:#303438; }
.chest-pain-teaching .text-outline-group { margin:24px 0 0; padding-left:16px; }
.chest-pain-teaching .outline-level-3 { padding-left:0; margin-top:32px; }
.chest-pain-teaching .outline-level-4 { padding-left:16px; }
.chest-pain-teaching .outline-body { padding-top:1px; }
.chest-pain-teaching h3, .chest-pain-teaching h4, .chest-pain-teaching h5, .chest-pain-teaching h6 { text-align:left; scroll-margin-top:130px; }
.chest-pain-teaching h4 { margin:0 0 12px; font-size:1.13rem; }
.chest-pain-teaching h5 { margin:0 0 10px; font-size:1.05rem; }
.chest-pain-teaching h6 { margin:0 0 10px; font-size:1rem; }
.chest-pain-teaching ul { margin:10px 0 16px; padding-left:25px; }
.chest-pain-teaching li { margin:0; }
.chest-pain-teaching li + li { margin-top:5px; }
.chest-pain-teaching li > ul { margin:5px 0 8px; padding-left:25px; }
.chest-pain-teaching .outline-body > ul, .chest-pain-teaching .teaching-stage-body > ul { max-width:820px; }
.chest-pain-teaching a { overflow-wrap:anywhere; }
/* Right-floating scorecards let subsequent teaching fill the available space. */
.chest-pain-page .chest-pain-teaching > .teaching-stage { display:flow-root; }
.chest-pain-teaching .clinical-tool-layout, .chest-pain-teaching .clinical-tool-copy { display:contents; }
.chest-pain-teaching .clinical-tools { float:right; width:300px; margin:0 0 22px 26px; position:relative; z-index:1; }
.clinical-calculator-disclosure { border:1px solid #cfd4d6; border-top:3px solid var(--chapter-accent); border-radius:3px; background:#f5f6f7; color:#303438; }
.clinical-calculator-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; min-height:84px; box-sizing:border-box; cursor:pointer; list-style:none; }
.clinical-calculator-disclosure > summary::-webkit-details-marker { display:none; }
.clinical-calculator-disclosure > summary:hover { background:var(--chapter-tint); }
.clinical-calculator-disclosure > summary:focus-visible { outline:3px solid var(--chapter-accent); outline-offset:3px; }
.calculator-summary-copy { display:grid; gap:5px; min-width:0; }
.calculator-summary-copy strong { font-size:1rem; line-height:1.3; }
.calculator-summary-copy > span { font-size:.875rem; line-height:1.4; color:#555e62; }
.calculator-disclosure-arrow { flex:0 0 32px; color:var(--chapter-accent); }
.clinical-calculator-disclosure[open] > summary { border-bottom:1px solid #cfd4d6; }
.clinical-calculator-disclosure[open] .calculator-disclosure-arrow { transform:rotate(180deg); }
.clinical-calculator-disclosure .clinical-score-card { border:0; border-radius:0; }
.chest-pain-teaching .text-outline-group > :is(h3,h4,h5,h6), .chest-pain-teaching .chapter-deep-dive { display:flow-root; }
.clinical-score-card { box-sizing:border-box; border:1px solid #cfd4d6; border-top:3px solid var(--chapter-accent); background:#f5f6f7; padding:13px; border-radius:3px; font-size:.875rem; line-height:1.4; color:#303438; }
.clinical-score-card .score-tool-switch { display:flex; gap:6px; margin-bottom:10px; }
.clinical-score-card .score-tool-switch button { flex:1; min-height:40px; padding:7px 10px; font:inherit; font-weight:600; background:#fff; border:1px solid #abb2b5; border-radius:3px; cursor:pointer; }
.clinical-score-card .score-tool-switch button[aria-pressed="true"] { border:2px solid var(--chapter-accent); background:var(--chapter-tint); }
.clinical-score-card .score-version { margin:3px 0 6px; font-size:.8125rem; color:#555e62; }
.clinical-score-card .score-note { font-size:.875rem; line-height:1.4; margin:6px 0; }
.clinical-score-card .score-use { margin:0 0 12px; font-size:.8125rem; }
.clinical-score-card .score-use summary { cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.clinical-score-card .score-use p { margin:6px 0 10px; font-size:.875rem; }
.clinical-score-card .score-field { min-width:0; border:0; padding:0; margin:0 0 10px; display:flow-root; }
.clinical-score-card legend, .clinical-score-card .score-number label { padding:0; font-size:.875rem; font-weight:600; line-height:1.4; margin:0 0 5px; }
.clinical-score-card .score-field small { display:block; clear:both; color:#555e62; font-size:.8125rem; line-height:1.35; padding-top:4px; }
.clinical-score-card .score-options { display:flex; gap:4px; }
.clinical-score-card .score-options-long { flex-direction:column; }
.clinical-score-card .score-option { flex:1; cursor:pointer; min-width:0; margin:0; padding:7px 5px; display:flex; align-items:center; justify-content:center; gap:5px; min-height:40px; box-sizing:border-box; border:1px solid #aab2b6; border-radius:3px; background:#fff; font-size:.875rem; line-height:1.25; }
.clinical-score-card .score-option input { width:14px; height:14px; margin:0; accent-color:var(--chapter-accent); flex:0 0 14px; }
.clinical-score-card .score-option:has(input:checked) { border-color:var(--chapter-accent); box-shadow:inset 0 0 0 1px var(--chapter-accent); background:var(--chapter-tint); font-weight:600; }
.clinical-score-card .score-option:has(input:focus-visible), .clinical-score-card button:focus-visible, .clinical-score-card input[type="number"]:focus-visible { outline:3px solid #D2202750; outline-offset:2px; }
.clinical-score-card .score-binary > legend { float:left; width:calc(100% - 126px); padding-top:3px; padding-right:8px; box-sizing:border-box; }
.clinical-score-card .score-binary > .score-options { float:right; width:120px; }
.clinical-score-card .score-number { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.clinical-score-card .score-number label { margin:0; }
.clinical-score-card input[type="number"] { box-sizing:border-box; width:88px; flex:0 0 88px; min-height:40px; border:1px solid #aab2b6; border-radius:3px; padding:7px; color:#1c2529; background:#fff; font:inherit; }
.clinical-score-card .score-result { display:block; border:1px solid #d1d6d8; background:white; border-radius:3px; padding:10px; margin:12px 0 8px; }
.clinical-score-card .score-result strong, .clinical-score-card .score-result span { display:block; }
.clinical-score-card .score-result span { font-size:.875rem; margin-top:4px; }
.clinical-score-card .score-result[data-complete="true"] { border-color:var(--chapter-accent); background:#fff8fa; }
.clinical-score-card .score-footer { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.clinical-score-card .score-reset { min-height:40px; background:white; color:#303438; border:1px solid #aab2b6; border-radius:3px; padding:7px 12px; font:inherit; cursor:pointer; }
.clinical-score-card .score-source { font-size:.875rem; }
.chest-pathway-figure { box-sizing:border-box; width:300px; max-width:100%; margin:16px 0 12px auto; padding:5px; border:1px solid #dce0e2; background:white; }
.chest-pathway-figure > a { display:block; cursor:zoom-in; }
.chest-pathway-figure > a:focus-visible { outline:2px solid var(--chapter-accent); outline-offset:3px; }
.chest-pathway-figure img { display:block; width:100%; height:auto; }
.chest-pathway-figure figcaption { color:#586368; font-size:.8125rem; margin-top:6px; line-height:1.3; }
@media (max-width:1050px) {
 .chest-pain-teaching .clinical-tool-layout { display:flex; flex-direction:column; gap:14px; }
 .chest-pain-teaching .clinical-tool-copy { display:block; order:0; }
 .chest-pain-teaching .clinical-tools { float:none; order:1; width:100%; margin:0 0 20px; }
 .clinical-score-card { max-width:550px; }
}
@media (max-width:640px) {
 .chest-pain-teaching .text-outline-group { padding-left:12px; }
 .chest-pain-teaching .outline-level-3 { padding-left:0; }
 .chest-pain-teaching .outline-level-4 { padding-left:12px; }
 .chest-pain-teaching .teaching-stage-body { padding-left:6px; }
 .chest-pain-teaching .chapter-overview-heading { font-size:1.5rem; }
 .chest-pain-teaching ul { padding-left:22px; }
 .chest-pain-teaching li > ul { padding-left:22px; }
 .clinical-score-card input[type="number"] { font-size:1rem; }
 .chest-pathway-figure { padding:5px; }
}
@media print {
 .clinical-tools { display:none; }
 .chest-pain-teaching .clinical-tool-layout { display:block; }
 .chest-pathway-figure { break-inside:avoid; }
}

/* Override older broad chapter selectors without changing other chapters. */
.chest-pain-page .chest-pain-teaching > .teaching-stage { border-top:0; padding-top:0; }
.chest-pain-page .chest-pain-teaching > .teaching-stage:first-child { margin-top:0; }
.chest-pain-page .chest-pain-teaching .text-outline-group { margin-inline-start:0; }
.chest-pain-page .chest-pain-teaching .clinical-score-card h5 { margin:14px 0 4px; font-size:1.125rem; }

.chest-pain-page .chest-pain-teaching .text-outline-group h3[id^="overview-"] { color:var(--chapter-accent); font-size:1.375rem; }
.chest-pain-page .chest-pain-teaching .clinical-score-card h5 { margin:0 0 3px; font-size:1.0625rem; }
.chest-pain-page .chapter-contents { padding:4px 12px 4px 0; }
.chest-pain-page .chapter-contents-label { margin:0 8px 8px; font-size:.6875rem; }
.chest-pain-page .chapter-contents-list a { min-height:30px; padding:5px 8px; font-size:.8125rem; line-height:1.3; }
.chest-pain-page .chapter-contents-list > li > a { font-weight:650; }
.chest-pain-page .chapter-contents-list > li + li { margin-top:4.4px; }
.chest-pain-page .chapter-contents-list .toc-subsection > a { display:block; font-weight:500; }
.chest-pain-page .chapter-contents-list ul { padding:0; margin:1px 0 5px 10px; border-left:1px solid #e0e3e4; }
.chest-pain-page .chapter-contents-list ul a { padding-left:10px; }
.chest-pain-page .chapter-contents-list a[aria-current="location"] { color:var(--chapter-accent); background:var(--chapter-tint); font-weight:650; }
.chest-pain-page .chapter-contents .chapter-contents-references { margin-top:5px; padding-top:8px; }
.chest-pain-page .chest-pain-teaching a.inline-citation { color:#60686c; font-size:.8125em; font-weight:400; white-space:normal; text-decoration-color:#aeb4b7; text-underline-offset:3px; }
.chest-pain-page .chest-pain-teaching a.inline-citation:hover { color:var(--chapter-accent); text-decoration-color:currentColor; }
.chest-reference-details > summary { padding-block:10px; cursor:pointer; color:var(--chapter-accent); font-size:.9375rem; font-weight:600; }
.chest-reference-details > .teaching-stage-body { margin-top:16px; }

.clinical-score-card .score-binary .score-option { white-space:nowrap; }

/* Chest Pain experiment: current branch stays above the reading column. */
.chest-pain-page .chapter-reading-header {
 --reading-row-height:36px;
 position:fixed; z-index:25; box-sizing:border-box;
 border:1px solid #cfd4d6; border-left:3px solid var(--chapter-accent);
 background:#fff; box-shadow:0 3px 8px #11171912;
 color:#303438; pointer-events:none;
}
.chest-pain-page .chapter-reading-header[hidden],
.chest-pain-page .chapter-reading-header [hidden] { display:none; }
.chest-pain-page .reading-level {
 height:var(--reading-row-height); display:block;
 padding:0 12px; overflow:hidden; white-space:nowrap;
 font-family:var(--font-text); font-size:.875rem; font-weight:600; line-height:var(--reading-row-height);
 text-overflow:ellipsis;
}
.chest-pain-page .reading-level-1 { background:#DCE0E2; font-size:1rem; font-weight:700; }
.chest-pain-page .reading-level-2 { padding-left:22px; background:#f4f5f5; border-top:1px solid #fff; }
.chest-pain-page .reading-disease { background:var(--chapter-tint); font-weight:700; }
body.chest-pain-page.has-reading-hierarchy .algorithm-teaching [id] {
 scroll-margin-top:var(--chest-reading-offset, 180px) !important;
}
@media (max-width:960px) {
 .chest-pain-page .chapter-reading-header { --reading-row-height:30px; }
 .chest-pain-page .reading-level-1 { font-size:.875rem; }
 .chest-pain-page .reading-level-2 { padding-left:18px; }
 .chest-pain-page .chapter-contents-list a { min-height:36px; padding-block:7px; }
}
@media print { .chest-pain-page .chapter-reading-header { display:none; } }

/* Compact teaching rhythm; retain all existing horizontal and hanging indents. */
.chest-pain-page .algorithm-teaching.chest-pain-teaching { line-height:1.4; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .text-outline-group { margin-block:20px 0; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .outline-level-3 { margin-top:20px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .outline-body > .text-outline-group:first-child { margin-top:4px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .text-outline-group > :is(h3,h4,h5,h6):not(.disease-heading) { margin-block:0 4px; line-height:1.3; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .disease-heading { margin-block:0 8px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching :is(ul,ol) { margin-block:4px 6px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching li + li { margin-top:4.4px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching li > :is(ul,ol) { margin-block:2px 3px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .outline-body > p,
.chest-pain-page .algorithm-teaching.chest-pain-teaching .teaching-stage-body > p { margin-block:4px 6px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching > .teaching-stage { margin-top:28px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching > .teaching-stage:first-child { margin-top:0; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching > .teaching-stage > :is(h2,.teaching-stage-heading) { margin-bottom:12px; }

/* Compact right-aligned resources; preserve original media and destinations. */
.chest-pain-page .algorithm-teaching .chapter-deep-dive {
 box-sizing:border-box; float:right; width:190px; max-width:100%;
 margin:4px 0 12px 24px; padding:4px 0 4px 12px;
}
.chest-pain-page .algorithm-teaching .deep-dive-label {
 display:block; font-size:.75rem; line-height:1.3; letter-spacing:.08em; margin:0 0 6px;
}
.chest-pain-page .algorithm-teaching a.deep-dive-link {
 flex-direction:column; align-items:flex-start; flex-wrap:nowrap; min-height:44px; gap:8px; width:100%;
}
.chest-pain-page .algorithm-teaching .deep-dive-brand { gap:7px; }
.chest-pain-page .algorithm-teaching .deep-dive-brand img { width:28px; height:28px; flex-basis:28px; }
.chest-pain-page .algorithm-teaching .deep-dive-brand strong { font-size:.875rem; }
.chest-pain-page .algorithm-teaching .deep-dive-brand-copy { gap:1px; }
.chest-pain-page .algorithm-teaching .deep-dive-brand-copy > span { font-size:.75rem; }
.chest-pain-page .algorithm-teaching .deep-dive-topic { padding-left:0; border-left:0; gap:5px; line-height:1.3; }
.chest-pain-page .algorithm-teaching .deep-dive-topic strong { font-size:.875rem; }
.chest-pain-page .algorithm-teaching .deep-dive-topic > span { font-size:.8125rem; }
/* Contain each resource within its disease while allowing teaching to flow beside it. */
.chest-pain-teaching .outline-body:has(> .chapter-deep-dive) { display:flow-root; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .chapter-deep-dive + .text-outline-group { margin-top:4px; }
@media (max-width:760px) {
 .chest-pain-page .algorithm-teaching .chapter-deep-dive { float:none; margin:4px 0 12px auto; }
}
@media print { .chest-pathway-figure { width:100%; max-width:900px; } }

@media (min-width:1051px) {
 .chest-pain-teaching .outline-body:has(> .chest-pathway-figure) { display:flow-root; }
 .chest-pathway-figure { float:right; margin:10px 0 12px 24px; }
}

/* Start supporting figures beside their own subsection, without a trailing empty row. */
.chest-pain-page .algorithm-teaching.chest-pain-teaching .outline-body > .chest-pathway-figure:first-child { margin-top:4px; }
.chest-pain-page .algorithm-teaching.chest-pain-teaching .chest-pathway-figure + .text-outline-group { margin-top:4px; }
