/* Library reading and lookup improvements; loaded after the existing theme.
   Type follows the library conventions (DM Sans .72–.8rem, JetBrains Mono for
   kickers). The `font:inherit` shorthand is avoided on buttons/inputs — on a
   <button> it drops the app font for the 16px browser default (2026-09-11i). */
.mgh-clinical-label {
  border-top: 1px solid var(--border);
  padding-top: .65rem;
  margin-top: .85rem;
}
.mgh-lib-content > .mgh-clinical-label:first-child { border-top: 0; margin-top: 0; }
.mgh-lib-content .mgh-section-hdr { margin-top: 1.3rem; }
.mgh-lib-content .mgh-section-hdr:first-child { margin-top: 0; }
.pg-sources { display: flex; flex-wrap: wrap; gap: .45rem 1rem; border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .65rem; }
.pg-sources a { color: var(--text-secondary); font-size: .8rem; text-decoration: underline; overflow-wrap: anywhere; }
.le-rapid-access { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .25rem 0 .9rem; }
.le-rapid-access > span { color: var(--text-secondary); font-size: .85rem; margin-right: .25rem; }
.le-rapid-access button { min-height: 40px; padding: .4rem .8rem; border: 1px solid rgba(6,182,212,.22); border-radius: 999px; background: var(--bg-card); color: var(--text-secondary); font-family: 'DM Sans', sans-serif; font-size: .72rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.le-rapid-access button:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.le-reference-values { padding: .7rem .85rem; margin: .65rem 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); }
.le-reference-values > strong { font-size: .8rem; }
.le-reference-values p { color: var(--text-secondary); font-size: .8rem; margin: .25rem 0 .65rem; line-height: 1.5; }
.le-reference-values dl { display: flex; flex-wrap: wrap; gap: .7rem 1.5rem; margin: 0; }
.le-reference-values dt { font-size: .8rem; color: var(--text-secondary); }
.le-reference-values dd { font-size: .84rem; margin: .15rem 0 0; }
.le-reference-values dd span { display: block; margin-top: .15rem; font-size: .8rem; color: var(--text-secondary); }
#labs-explained .le-card-toggle { width: 100%; text-align: left; color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
#labs-explained .le-cat-banner { width: 100%; text-align: left; color: inherit; font-size: inherit; line-height: inherit; }
#labs-explained .le-card-toggle { background: transparent; border: 0; }
#labs-explained .le-cat-banner { border-top: 0; border-right: 0; border-bottom: 0; }
.le-page-tools { margin-top: 1rem; }
.le-page-tools summary { min-height: 44px; padding: .65rem; cursor: pointer; color: var(--text-secondary); }
#labs-explained button:focus-visible, .pg-sources a:focus-visible { outline: 2px solid var(--accent-cyan, #06b6d4); outline-offset: 3px; }
@media (max-width: 680px) {
  #labs-explained .le-cols, #labs-explained .le-browser-col { min-width: 0; }
  #labs-explained .le-cat-rail.at-section-rail { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: .4rem; }
  #labs-explained .le-cat-rail .le-cat-tile { flex: 0 0 130px; min-height: 44px; }
  #labs-explained .le-cat-rail-label { flex: 0 0 auto; align-self: center; }
  #labs-explained .le-lab-jump, #labs-explained .search-clear-btn { min-height: 44px; min-width: 44px; }
  #labs-explained .le-meaning, #labs-explained .le-dx li, #labs-explained .le-pearl,
  #labs-explained .le-detail-list li, #labs-explained .le-dx-table { font-size: .95rem; line-height: 1.6; }
  .mgh-lib-content { overflow-wrap: anywhere; }
  .pg-sources { flex-direction: column; }
  .pg-sources a { padding: .4rem 0; }
}

/* ── Radiology (2026-09-11): practice drills + phone parity with Labs ── */
.rad-practice-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .9rem; }
.rad-practice-tab { min-height: 44px; padding: .5rem .95rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-secondary); color: var(--text-primary); font-family: 'DM Sans', sans-serif; font-size: .76rem; font-weight: 600; cursor: pointer; }
.rad-practice-tab.active, .rad-practice-tab[aria-pressed="true"] { border-color: var(--accent-cyan); background: rgba(6,182,212,.12); color: var(--accent-cyan); font-weight: 600; }
.rad-practice-card { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card, var(--bg-secondary)); padding: 1rem 1.1rem 1.1rem; }
.rad-practice-kicker { font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: .35rem; }
.rad-practice-card h5 { margin: 0 0 .35rem; font-size: .95rem; }
.rad-practice-prompt { margin: 0 0 .8rem; color: var(--text-secondary); font-size: .88rem; }
.rad-practice-opts { display: grid; gap: .5rem; }
.rad-practice-opt { display: flex; gap: .7rem; align-items: flex-start; width: 100%; text-align: left; min-height: 48px; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); font-family: 'DM Sans', sans-serif; font-size: .8rem; line-height: 1.45; cursor: pointer; }
.rad-practice-opt:hover:not(:disabled) { border-color: var(--accent-cyan); }
.rad-practice-opt:disabled { cursor: default; }
.rad-practice-opt.is-correct { border-color: var(--accent-green, #22c55e); background: rgba(34,197,94,.12); }
.rad-practice-opt.is-wrong { border-color: var(--accent-red, #ef4444); background: rgba(239,68,68,.12); }
.rad-practice-opt.is-muted { opacity: .55; }
.rad-practice-letter { flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent-cyan); }
.rad-practice-feedback { margin-top: .9rem; padding: .8rem .9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-secondary); }
.rad-practice-feedback.ok { border-color: rgba(34,197,94,.45); }
.rad-practice-feedback.miss { border-color: rgba(239,68,68,.45); }
.rad-practice-verdict { font-weight: 700; margin-bottom: .45rem; }
.rad-practice-explain { font-size: .86rem; line-height: 1.55; margin: .3rem 0; }
.rad-practice-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.rad-practice-btn { min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card, var(--bg-secondary)); color: var(--text-primary); font-family: 'DM Sans', sans-serif; font-size: .76rem; font-weight: 600; cursor: pointer; }
.rad-practice-btn.primary { border-color: var(--accent-cyan); color: var(--accent-cyan); font-weight: 600; }
.rad-practice-impression { margin: .4rem 0 .9rem; padding: .7rem .9rem; border-left: 3px solid var(--accent-cyan); background: var(--bg-secondary); border-radius: 0 10px 10px 0; font-size: .9rem; line-height: 1.55; }
.rad-practice-label { display: block; font-size: .8rem; color: var(--text-secondary); margin-bottom: .3rem; }
.rad-practice-input { width: 100%; box-sizing: border-box; font-family: 'DM Sans', sans-serif; font-size: .8rem; line-height: 1.45; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); resize: vertical; }
.rad-practice-note { font-size: .74rem; color: var(--text-dim); margin-top: .8rem; line-height: 1.5; }
#radiology button:focus-visible, [id^="rad-"] button:focus-visible { outline: 2px solid var(--accent-cyan, #06b6d4); outline-offset: 3px; }
@media (max-width: 680px) {
  [id^="rad-"] .at-section-rail { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: .4rem; }
  [id^="rad-"] .at-section-rail .at-section-tile { flex: 0 0 150px; min-height: 44px; }
  [id^="rad-"] .at-section-nav, [id^="rad-"] .search-clear-btn { min-width: 44px; min-height: 44px; }
  [id^="rad-"] .re-side-body, [id^="rad-"] .at-dash-item, [id^="rad-"] .at-table td { font-size: .92rem; line-height: 1.6; }
  [id^="rad-"] .at-table-wrap { overflow-x: auto; }
  .rad-practice-actions .rad-practice-btn { flex: 1 1 100%; }
  .rad-sys-tile { min-height: 64px; }
}

/* ── Add research / My Research (2026-09-11) ── */
.lib-research-lead { font-size: .8rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: .6rem; }
.lib-research-input { width: 100%; box-sizing: border-box; font-family: 'DM Sans', sans-serif; font-size: .8rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); }
.lib-research-manual { margin-top: .6rem; }
.lib-research-manual summary { cursor: pointer; font-size: .78rem; color: var(--text-secondary); min-height: 36px; align-content: center; }
.lib-research-manual textarea, .lib-research-summary { width: 100%; box-sizing: border-box; font-family: 'DM Sans', sans-serif; font-size: .8rem; line-height: 1.45; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); resize: vertical; margin-top: .35rem; }
.lib-research-source { border: 1px solid var(--border); border-left: 3px solid var(--accent-green, #22c55e); border-radius: 0 10px 10px 0; padding: .6rem .8rem; background: var(--bg-secondary); margin-bottom: .6rem; }
.lib-research-title { font-weight: 600; font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.lib-research-title a { color: var(--accent-cyan); text-decoration: underline; }
.lib-research-line, .lib-research-via { font-size: .74rem; color: var(--text-secondary); margin-top: .2rem; }
.lib-research-facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .74rem; color: var(--text-secondary); margin: .45rem 0 .2rem; line-height: 1.5; }
.lib-research-caution { font-size: .76rem; color: var(--accent-amber, #f59e0b); margin: .3rem 0; }
.lib-addnote-opt.is-selected { border-color: var(--accent-green, #22c55e); background: rgba(34,197,94,.12); }
.lib-research-standalone { margin-top: .5rem; min-height: 40px; }
.lib-research-standalone.is-selected { border-color: var(--accent-green, #22c55e); color: var(--accent-green, #22c55e); }
.lib-research-standalone:disabled { opacity: .55; }
.lib-addnote-research-btn { margin-top: .4rem; }
.lib-personal-action-research { border-color: rgba(34,197,94,.55); }
.lib-note-src-research { background: rgba(34,197,94,.14); color: var(--accent-green, #22c55e); }
.lib-research-item .lib-note-actions a.lib-note-act { text-decoration: none; display: inline-flex; align-items: center; }
.pg-research { margin: .8rem 0 .2rem; padding: .65rem .85rem; border: 1px solid rgba(34,197,94,.4); border-radius: 12px; background: rgba(34,197,94,.06); }
.pg-research-hdr { font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-green, #22c55e); margin-bottom: .4rem; display: flex; align-items: center; gap: .4rem; }
.pg-research-n { display: inline-block; min-width: 1.4em; text-align: center; padding: .05rem .35rem; border-radius: 999px; background: rgba(34,197,94,.18); }
.pg-research-item { padding: .35rem 0; border-top: 1px dashed rgba(34,197,94,.25); }
.pg-research-item:first-of-type { border-top: 0; }
.pg-research-finding { font-size: .86rem; line-height: 1.55; }
.pg-research-meta { font-size: .74rem; color: var(--text-secondary); margin-top: .2rem; overflow-wrap: anywhere; }
.pg-research-meta a { color: var(--accent-cyan); text-decoration: underline; }
.pg-research-all { margin-top: .5rem; min-height: 36px; padding: .35rem .7rem; border: 1px solid rgba(34,197,94,.45); border-radius: 8px; background: transparent; color: var(--accent-green, #22c55e); font-family: 'DM Sans', sans-serif; font-size: .74rem; font-weight: 600; cursor: pointer; }
.lib-hl-noted[data-ann-kind="research"] { text-decoration-color: var(--accent-green, #22c55e); box-shadow: inset 0 -2px 0 rgba(34,197,94,.55); }
@media (max-width: 680px) { .lib-research-facts { flex-direction: column; gap: .2rem; } }

/* The ICU & Critical Care rules (bedside brief, first-week prep path, sources,
   reading-mode tabs, hemodynamic input validation) moved to styles.css on
   2026-09-12a so they ship in the stylesheet that is re-fetched every round. */
