/* One ficha per dated class; diseases remain chapters within that ficha. */
.reader-head .class-meta { color: #855370; font-weight: 700; margin: 2px 0 9px; }
.chapter-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #875778; font-size: 13px; font-weight: 700; margin: 0 0 16px; }
.chapter-meta > span { border: 1px solid #c9b1ca; border-radius: 5px; padding: 3px 7px; color: #7a627f; font-size: 11px; font-weight: 500; }
.reader:has(.class-meta) .section-tabs { max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.class-oral-dialogue > article { border-left: 3px solid #bc91ae; padding: 2px 0 4px 18px; margin-bottom: 26px; }
.class-oral-dialogue .dialogue-prompt { color: #63415a; }
.class-oral-dialogue .dialogue-followup { color: #785f7c; }
.class-oral-dialogue .source { font-size: 11px; }
@media (max-width: 560px) {
  .reader:has(.class-meta) .section-tabs { max-height: 225px; }
  .class-oral-dialogue > article { padding-left: 12px; }
}

/* A topic selector keeps each class compact; the tabs follow the chosen topic. */
.study-chapters { margin: 16px 0 12px; padding: 14px; background: #f8eef5; border: 1px solid #dbabc7; border-radius: 12px; }
.study-chapters > span { display:block; margin-bottom:9px; color:#78405f; font-size:12px; font-weight:700; }
.study-chapters > div { display:flex; flex-wrap:wrap; gap:7px; }
.study-chapter { min-height:40px; padding:9px 12px; border:1px solid #d4b4c7; border-radius:8px; background:white; color:#68465c; text-align:left; font:inherit; font-size:13px; cursor:pointer; }
.study-chapter.selected { background:#71334f; border-color:#ff131e; color:white; box-shadow:0 0 9px #ff0b1855; }
.study-related { padding:14px 18px; margin:18px 0; border:1px solid #dba8c8; border-radius:10px; background:#fcf4fa; }
.study-related strong { color:#763655; }
.study-related p { font-size:12px; margin:5px 0 10px; color:#7e6577; }
.study-related a { display:inline-block; margin:0 14px 6px 0; color:#864273; font-weight:700; font-size:13px; }
.viewer-sections:has(.study-chapters) { display:block; white-space:normal; overflow:visible; max-height:none; }
.viewer-sections .study-chapters { margin:0 0 8px; }
.viewer-sections .viewer-tab { margin:3px; }
.shared-medication-link { color:#83355f; font-weight:700; }
@media(max-width:560px) { .study-chapter { flex:1 1 140px; font-size:12px; } .study-chapters { padding:10px; } }

.medication-shared-link { display:inline-block; color:#813457; font-weight:600; text-underline-offset:3px; line-height:1.65; }
#reader-viewer .viewer-sections:has(.study-chapters) { display:block; white-space:normal; overflow:visible; max-height:none; }
#reader-viewer .viewer-sections:has(.study-chapters) .viewer-tab { display:inline-flex; white-space:normal; }
