/* BIOMED REWIRED - full lesson reading page */
.lesson { padding: 22px 16px 56px; }
.les-head { margin-bottom: 18px; }
.les-cat { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.les-head h1 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.1; margin-bottom: 10px; }
.les-head h1:focus { outline: none; }
.les-general { margin-bottom: 18px; }
.les-loading { color: var(--muted); padding: 40px 0; }
.les-foot { margin-top: 28px; }

.les-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
.toc-wrap { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(12,34,68,.9), rgba(7,20,42,.92)); }
.toc-toggle { display: none; }
.toc ol { list-style: none; padding: 8px; }
.toc a, .toc-missing { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: .88rem; line-height: 1.3; border-left: 3px solid transparent; color: #dce8fa; }
.toc a:hover { background: rgba(25,211,240,.1); }
.toc a.active { background: rgba(25,211,240,.14); border-left-color: var(--cyan); color: #fff; font-weight: 600; }
.toc-missing { color: #8fa3c4; }
.toc-missing em { font-size: .72rem; }
.num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px; background: rgba(25,211,240,.16); color: var(--cyan); font-size: .76rem; font-weight: 700; flex-shrink: 0; }

.les-body { background: rgba(8,22,44,.7); border: 1.5px solid rgba(40,200,255,.25); border-radius: 14px; padding: clamp(18px, 4vw, 40px); font-size: 1.06rem; line-height: 1.75; color: #e2ecfa; }
.les-body > * { max-width: 76ch; }
.les-sec { scroll-margin-top: 130px; margin-bottom: 44px; max-width: none; }
.les-sec:last-child { margin-bottom: 0; }
.les-sec h2 { display: flex; gap: 12px; align-items: center; font-size: 1.55rem; line-height: 1.2; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(40,200,255,.25); scroll-margin-top: 130px; max-width: 76ch; }
.les-sec h2:focus { outline: none; }
.les-sec h3 { font-size: 1.15rem; margin: 22px 0 8px; color: #fff; }
.les-sec > p, .les-sec > .les-list, .les-sec > details, .les-sec > .callout, .les-sec > .terms, .les-sec > .refs { max-width: 76ch; }
.les-sec p { margin: 0 0 14px; }
.les-list { padding-left: 24px; margin: 0 0 16px; display: grid; gap: 6px; }
ul.les-list { list-style: disc; }
ol.les-list { list-style: decimal; }
.cite { font-size: .75em; }
.cite a { color: var(--cyan); text-decoration: none; padding: 0 1px; }
.cite a:hover { text-decoration: underline; }
.sec-sources { font-size: .85rem; color: var(--muted); }
.sec-sources a { color: var(--cyan); }

.callout { border-left: 4px solid var(--cyan); background: rgba(25,211,240,.08); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 0 0 18px; font-size: .98rem; line-height: 1.6; }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout-h { font-weight: 700; font-size: .78rem !important; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.c-safety { border-left-color: #fe8401; background: rgba(254,132,1,.1); }
.c-safety .callout-h { color: #fe8401; }
.c-manufacturer { border-left-color: #b79cff; background: rgba(183,156,255,.1); }
.c-manufacturer .callout-h { color: #cdb9ff; }
.c-example { border-left-color: #6fe3a0; background: rgba(111,227,160,.09); }
.c-example .callout-h { color: #8fe8b4; }

.fig { margin: 20px 0 24px; max-width: 900px; }
.fig-art, .fig > img { background: #07142b; border: 1.5px solid rgba(40,200,255,.35); border-radius: 12px; padding: 14px; }
.fig-art svg, .fig > img { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.expand { border: 1.5px solid rgba(40,200,255,.3); border-radius: 10px; margin: 0 0 14px; background: rgba(5,16,34,.5); }
.expand summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
.expand summary::-webkit-details-marker { display: none; }
.expand summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(25,211,240,.16); color: var(--cyan); font-weight: 700; flex-shrink: 0; }
.expand[open] summary::before { content: "\2212"; }
.expand-body { padding: 4px 18px 8px; border-top: 1px solid rgba(255,255,255,.1); }
.expand-body > *:first-child { margin-top: 14px; }

.tbl-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid rgba(40,200,255,.3); border-radius: 10px; max-width: 900px; }
.les-table { border-collapse: collapse; width: 100%; font-size: .94rem; line-height: 1.5; }
.les-table caption { text-align: left; padding: 10px 14px; font-weight: 700; }
.les-table th, .les-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.1); vertical-align: top; }
.les-table th { background: rgba(25,211,240,.12); color: #fff; }

.terms { display: grid; gap: 4px 0; margin: 0 0 16px; }
.terms dt { font-weight: 700; color: var(--cyan); margin-top: 12px; }
.terms dd { margin: 0; }

.refs { list-style: decimal; padding-left: 28px; display: grid; gap: 10px; font-size: .95rem; line-height: 1.55; }
.refs li:target, .refs li:focus { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }
.refs a { color: var(--cyan); }

/* Knowledge checks */
.quiz { border: 1.5px solid rgba(40,200,255,.35); border-radius: 12px; padding: 16px 18px 8px; margin: 0 0 22px; background: rgba(5,16,34,.55); max-width: 76ch; }
.quiz-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.05rem !important; margin: 0 0 4px !important; }
.quiz-note { font-size: .84rem; color: var(--muted); margin-bottom: 12px !important; }
.q { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1); }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { font-weight: 600; padding: 0; margin-bottom: 8px; line-height: 1.5; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; line-height: 1.5; font-size: 1rem; }
.q-opt:hover { background: rgba(25,211,240,.08); }
.q-opt input { margin-top: 5px; accent-color: var(--cyan); width: 17px; height: 17px; flex-shrink: 0; }
.q-check { font: inherit; font-weight: 600; font-size: .9rem; color: #04202a; background: var(--cyan); border: 0; border-radius: 8px; padding: 8px 16px; margin-top: 8px; cursor: pointer; }
.q-fb p { margin: 10px 0 0; padding: 10px 14px; border-radius: 8px; font-size: .95rem; line-height: 1.55; }
.is-right .q-fb p { background: rgba(49,211,106,.14); border-left: 4px solid #31d36a; }
.is-wrong .q-fb p { background: rgba(254,132,1,.13); border-left: 4px solid #fe8401; }
.q-fb p:only-child:not(:empty) { background: rgba(255,255,255,.06); }

/* Lesson in development / error */
.les-dev { margin-top: 22px; padding: 26px; border: 1.5px dashed var(--line); border-radius: 14px; max-width: 720px; background: rgba(8,22,44,.6); }
.les-dev-h { font-size: 1.15rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.les-dev p { color: #d4e2f5; margin-bottom: 12px; }
.les-dev-sum { padding: 12px 14px; background: rgba(255,255,255,.05); border-radius: 8px; }

@media (max-width: 960px) {
  .les-layout { grid-template-columns: 1fr; gap: 16px; }
  .toc-wrap { position: static; max-height: none; overflow: visible; }
  .toc-toggle { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; font-weight: 700; color: var(--text); background: none; border: 0; padding: 14px 16px; cursor: pointer; text-align: left; }
  .toc-toggle .ic { transition: transform .15s; }
  .toc-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
  .toc { display: none; border-top: 1px solid rgba(255,255,255,.12); }
  .toc.open { display: block; }
  .les-body { font-size: 1.02rem; }
  .les-sec h2 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .toc-toggle .ic { transition: none; } }

/* Pick-four practice problems */
.prob-how { margin: 0 0 10px; font-size: .9rem; opacity: .8; }
.prob-opts { display: grid; gap: 8px; margin: 0 0 10px; }
.prob-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; border: 1.5px solid rgba(40,200,255,.35); background: rgba(8,28,52,.75); color: inherit; font: inherit; cursor: pointer; min-height: 48px; }
.prob-opt:hover:not(:disabled) { border-color: #28c8ff; background: rgba(40,200,255,.12); }
.prob-opt:focus-visible { outline: 2px solid #fe8401; outline-offset: 2px; }
.prob-l { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; font-size: .85rem; }
.prob-opt.is-wrong { opacity: .5; text-decoration: line-through; border-style: dashed; cursor: default; }
.prob-opt.is-right, .prob-opt.is-answer { border-color: #3ddc97; background: rgba(61,220,151,.14); opacity: 1; cursor: default; }
.prob-opt:disabled:not(.is-wrong):not(.is-right):not(.is-answer) { opacity: .7; cursor: default; }
.prob-fb { min-height: 1.4em; margin: 0 0 10px; font-weight: 600; }
.prob-fb.ok { color: #3ddc97; }
.prob-fb.no { color: #fe8401; }
.prob-skip { background: none; border: 1.5px solid rgba(40,200,255,.5); color: inherit; padding: 9px 14px; border-radius: 10px; font: inherit; cursor: pointer; min-height: 44px; }
.prob-sol { margin-top: 14px; padding: 12px 14px; border-left: 3px solid #28c8ff; background: rgba(5,16,34,.6); border-radius: 0 10px 10px 0; }
.prob-sol[hidden] { display: none; }
.prob-sol-h { font-weight: 700; margin: 0 0 6px; }
