:root { color-scheme: dark; --bg: #25292d; --text: #e7edf3; --muted: #b5bfc7; --line: #454d52; --green: #b4d4ad; --blue: #a8cfe4; --gold: #dfc18c; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, sans-serif; letter-spacing: 0; }
a { color: var(--blue); text-underline-offset: 4px; }
button { font: inherit; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.section-nav { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.section-nav > div { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 22px; max-width: 1056px; padding: 10px 28px; margin: auto; }
.section-nav a { color: var(--muted); font-size: 14px; text-decoration: none; padding-block: 5px; }
.section-nav a:hover { color: white; }
.icon-link { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-link svg { width: 20px; height: 20px; }
.quiz-link { margin-left: auto; }
main { max-width: 1056px; margin: auto; padding: 28px 28px 0; overflow-wrap: anywhere; }
section { margin: 0 0 40px; }
section + section { border-top: 1px solid var(--line); padding-top: 32px; }
article + article { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
article, tr { scroll-margin-top: 12px; }
h2, h3 { color: #f3f5f7; font-weight: 650; line-height: 1.4; }
h2 { font-size: 23px; margin: 0 0 22px; }
article h2, h3 { font-size: 19px; margin: 0 0 18px; }
.question-number { color: var(--green); font-variant-numeric: tabular-nums; margin-right: 5px; }
strong { color: #f3f5f7; font-weight: 650; }
p { margin: 0 0 12px; }
dl { margin: 0; }
.long-answer > div { display: grid; grid-template-columns: 195px minmax(0, 1fr); gap: 24px; margin-bottom: 17px; }
dt { font-size: 14px; line-height: 1.65; font-weight: 600; color: var(--green); padding-top: 3px; }
dd { margin: 0; }
.key-point { margin: 18px 0 12px; border-left: 2px solid var(--gold); padding: 2px 0 2px 14px; font-size: 15px; color: #d5dce1; }
.page-ref { display: inline-block; font-size: 13px; }
.formula { padding: 16px 0; margin: 12px 0 16px; border-block: 1px solid var(--line); color: var(--gold); font-size: 18px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; line-height: 1.6; margin: 20px 0; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 14px 16px; overflow-wrap: anywhere; }
thead th { background: #2c3236; font-size: 13px; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 550; }
tr > :first-child { width: 26%; padding-left: 12px; }
.short-table tr > :first-child { width: 49%; }
td p:last-child { margin-bottom: 0; }
tbody tr:nth-child(even) { background: #ffffff03; }
figure { margin: 20px 0; }
.diagram { display: block; position: relative; max-width: 100%; padding: 0; background: #fff; border: 0; cursor: zoom-in; }
.diagram img { display: block; max-width: 100%; max-height: 480px; width: auto; height: auto; object-fit: contain; }
.diagram-zoom { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 30px; height: 30px; background: #25292de8; color: white; border-radius: 4px; opacity: 0; }
.diagram-zoom svg { width: 18px; height: 18px; }
.diagram:hover .diagram-zoom, .diagram:focus-visible .diagram-zoom { opacity: 1; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 5px; }
ul { padding-left: 23px; margin: 16px 0; }
li { margin: 8px 0; }
footer { max-width: 1056px; margin: auto; padding: 0 28px 32px; color: var(--muted); font-size: 12px; }
.enzyme-term { cursor: help; text-decoration: underline dotted #a8cfe45a; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.enzyme-term:hover, .enzyme-term[aria-expanded="true"] { text-decoration-color: var(--green); }
.enzyme-term-tooltip { position: fixed; z-index: 20; width: 360px; max-width: calc(100vw - 24px); max-height: min(430px, calc(100dvh - 24px)); overflow: auto; padding: 16px; color: var(--text); background: #191d20; border: 1px solid #687773; border-radius: 6px; box-shadow: 0 8px 26px #0005; font: 14px/1.6 system-ui, sans-serif; overflow-wrap: anywhere; }
.enzyme-term-tooltip[hidden] { display: none; }
.enzyme-term-tooltip strong { display: block; color: var(--green); padding-right: 28px; margin-bottom: 7px; }
.enzyme-term-tooltip p { margin: 0; }
.enzyme-term-tooltip button { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.enzyme-term-tooltip svg { width: 18px; height: 18px; }
dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 48px 12px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
dialog::backdrop { background: #000b; }
dialog > img { display: block; max-width: 100%; max-height: calc(100dvh - 100px); width: auto; height: auto; object-fit: contain; }
.dialog-close { position: absolute; right: 6px; top: 6px; }
@media (max-width: 640px) {
    body { font-size: 16px; }
    main { padding: 22px 16px 0; }
    .section-nav > div { padding: 8px 12px; gap: 3px 12px; }
    .section-nav a { font-size: 13px; }
    .nav-full { display: none; }
    .section-nav .icon-link { width: 28px; flex-basis: 28px; }
    h2 { font-size: 21px; }
    article h2, h3 { font-size: 18px; }
    .long-answer > div { display: block; margin-bottom: 19px; }
    dt { margin-bottom: 5px; padding: 0; }
    .key-point { font-size: 14px; }
    table, tbody { display: block; }
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    tbody tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
    tbody tr > th, tbody tr > td, .short-table tr > :first-child { display: block; width: 100%; padding: 0; border: 0; }
    tbody th { margin-bottom: 8px; color: var(--green); }
    tbody td + td { margin-top: 10px; }
    tbody td::before { display: block; content: attr(data-label); color: var(--muted); font-size: 12px; margin-bottom: 3px; }
    .short-table td::before { display: none; }
    tbody tr:nth-child(even) { background: none; }
    .formula { font-size: 16px; }
    footer { padding-inline: 16px; }
}
@media (max-width: 360px) { .section-nav > div { gap: 2px 8px; } .section-nav a { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
    :root { color-scheme: light; --text: #111; --muted: #444; --line: #bbb; --green: #225132; --blue: #245777; --gold: #634b14; }
    body { background: white; font-size: 10pt; }
    main { max-width: none; padding: 0; }
    .section-nav, .enzyme-term-tooltip, dialog, .page-ref, .diagram-zoom { display: none !important; }
    h2, h3, strong, .key-point { color: #111; }
    h2, h3, dt { break-after: avoid; }
    figure, tr { break-inside: avoid; }
    .enzyme-term { text-decoration: none; }
    table { display: table; font-size: 9pt; }
    tbody { display: table-row-group; }
    thead { display: table-header-group; position: static; width: auto; height: auto; clip-path: none; }
    tbody tr { display: table-row; }
    tbody tr > th, tbody tr > td, .short-table tr > :first-child { display: table-cell; width: auto; padding: 8px; }
    tbody td::before { display: none; }
    .diagram img { max-height: 300px; }
}
