body.exam-new-mode {
    --biochem-sky: #a9d3f5;
    --biochem-mint: #a9d5b8;
    --biochem-gold: #e7c980;
    --biochem-rose: #e5aeb7;
    --biochem-lilac: #c8b3e8;
    --biochem-aqua: #86d7d1;
    --physiology-peach: #e4b18f;
    --physiology-plum: #c9b4df;
    --physiology-steel: #b7c4d0;
    --physiology-sand: #d6c49e;
}

body.exam-new-mode .red-mode-toggle {
    display: none;
}

body.exam-new-mode .topic-controls [data-topic-filter="blood"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="blood"] {
    --topic-accent: #e5aeb7;
    --new-topic-accent: #e5aeb7;
}

body.exam-new-mode .topic-controls [data-topic-filter="cardiovascular"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="cardiovascular"] {
    --topic-accent: #e4b18f;
    --new-topic-accent: #e4b18f;
}

body.exam-new-mode .topic-controls [data-topic-filter="respiratory"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="respiratory"] {
    --topic-accent: #9fcfd5;
    --new-topic-accent: #9fcfd5;
}

body.exam-new-mode .topic-controls [data-topic-filter="renal"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="renal"] {
    --topic-accent: #a9c9e8;
    --new-topic-accent: #a9c9e8;
}

body.exam-new-mode .topic-controls [data-topic-filter="digestive"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="digestive"] {
    --topic-accent: #d9c18e;
    --new-topic-accent: #d9c18e;
}

body.exam-new-mode .topic-controls [data-topic-filter="endocrine"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="endocrine"] {
    --topic-accent: #c9b4df;
    --new-topic-accent: #c9b4df;
}

body.exam-new-mode .topic-controls [data-topic-filter="neuro-sensory"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="neuro-sensory"] {
    --topic-accent: #aebee8;
    --new-topic-accent: #aebee8;
}

body.exam-new-mode .topic-controls [data-topic-filter="excitable"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="excitable"] {
    --topic-accent: #a9d6c0;
    --new-topic-accent: #a9d6c0;
}

body.exam-new-mode .topic-controls [data-topic-filter="metabolism"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="metabolism"] {
    --topic-accent: #d6c49e;
    --new-topic-accent: #d6c49e;
}

body.exam-new-mode .topic-controls [data-topic-filter="integrative"],
body.exam-new-mode .new-subtopic-controls[data-topic-theme="integrative"] {
    --topic-accent: #b7c4d0;
    --new-topic-accent: #b7c4d0;
}

body.exam-new-mode .topic-controls [data-topic-filter="practical-1"] {
    --topic-accent: #efc69f;
    --new-topic-accent: #efc69f;
}

body.exam-new-mode .topic-controls .practical-filter-toggle {
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(239, 198, 159, 0.08);
}

body.exam-new-mode .topic-controls .practical-filter-toggle::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px color-mix(in srgb, currentColor 48%, transparent);
}

body.exam-new-mode .card-hover-meta .subtopic-tag {
    align-items: center;
    background: color-mix(in srgb, var(--subtopic-accent, var(--biochem-sky)) 19%, rgba(48, 56, 65, 0.82));
    border: 1px solid color-mix(in srgb, var(--subtopic-accent, var(--biochem-sky)) 48%, transparent);
    border-radius: 999px;
    box-sizing: border-box;
    color: color-mix(in srgb, var(--subtopic-accent, var(--biochem-sky)) 72%, #f4f8fb 28%);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 750;
    height: 30px;
    line-height: 1;
    max-width: min(320px, 34vw);
    min-height: 30px;
    overflow: hidden;
    padding: 0 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.exam-new-mode .card-hover-meta .subtopic-tag[hidden] {
    display: none;
}

body.exam-new-mode .topic-controls button[data-topic-filter]:not([data-topic-filter="all"]) {
    color: color-mix(in srgb, var(--topic-accent, var(--biochem-sky)) 88%, white);
}

body.exam-new-mode .topic-controls button[data-topic-filter]:not([data-topic-filter="all"]):hover,
body.exam-new-mode .topic-controls button[data-topic-filter]:not([data-topic-filter="all"]):focus-visible,
body.exam-new-mode .topic-controls button[data-topic-filter]:not([data-topic-filter="all"]).is-active {
    border-color: color-mix(in srgb, var(--topic-accent, var(--biochem-sky)) 55%, transparent);
    background: color-mix(in srgb, var(--topic-accent, var(--biochem-sky)) 23%, #303740);
}

.exam-card-search {
    position: relative;
    z-index: 18;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: stretch;
    height: 48px;
}

.exam-card-search-toggle {
    display: inline-grid;
    width: 52px;
    height: 48px;
    flex: 0 0 52px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(157, 184, 208, 0.34);
    border-radius: 0.42rem;
    color: #d7e6f3;
    background: rgba(51, 61, 72, 0.82);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 180ms ease;
}

.exam-card-search-toggle svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.exam-card-search-toggle:hover,
.exam-card-search-toggle:focus-visible,
.exam-card-search.is-open .exam-card-search-toggle {
    border-color: rgba(169, 211, 245, 0.68);
    color: #f0f6fb;
    background: rgba(80, 111, 140, 0.68);
    box-shadow: 0 0 0 3px rgba(121, 175, 220, 0.1), inset 0 1px rgba(255, 255, 255, 0.06);
    outline: none;
}

.exam-card-search-panel {
    position: absolute;
    top: 0;
    left: calc(100% + 0.48rem);
    width: 0;
    min-width: 0;
    margin-left: 0;
    opacity: 0;
    transform: translateX(-0.55rem);
    pointer-events: none;
    transition: width 230ms cubic-bezier(0.22, 1, 0.36, 1), margin-left 230ms cubic-bezier(0.22, 1, 0.36, 1), opacity 130ms ease, transform 230ms cubic-bezier(0.22, 1, 0.36, 1);
}

.exam-card-search.is-open .exam-card-search-panel {
    width: clamp(15rem, 22vw, 22rem);
    margin-left: 0;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

#exam-card-search-input {
    width: 100%;
    height: 48px;
    padding: 0 0.92rem;
    border: 1px solid rgba(157, 184, 208, 0.38);
    border-radius: 0.42rem;
    outline: none;
    color: #edf3f8;
    background: rgba(32, 39, 47, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 0.75rem 2rem rgba(8, 12, 16, 0.12);
    font: inherit;
    font-size: 0.96rem;
    letter-spacing: 0;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

#exam-card-search-input::placeholder {
    color: rgba(194, 207, 219, 0.58);
}

#exam-card-search-input:focus {
    border-color: rgba(169, 211, 245, 0.74);
    background: rgba(35, 43, 52, 0.99);
    box-shadow: 0 0 0 3px rgba(121, 175, 220, 0.1), 0 0.9rem 2.4rem rgba(8, 12, 16, 0.16);
}

.exam-card-search-results {
    position: absolute;
    z-index: 24;
    top: calc(100% + 0.45rem);
    right: 0;
    width: min(32rem, 82vw);
    max-height: min(28rem, 62vh);
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(157, 184, 208, 0.32);
    border-radius: 0.5rem;
    background: rgba(31, 38, 46, 0.985);
    box-shadow: 0 1rem 3rem rgba(5, 9, 13, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 211, 245, 0.32) transparent;
}

.exam-card-search-result {
    display: grid;
    width: 100%;
    gap: 0.32rem;
    padding: 0.7rem 0.76rem;
    border: 1px solid transparent;
    border-radius: 0.36rem;
    color: #e7edf3;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.exam-card-search-result:hover,
.exam-card-search-result:focus-visible,
.exam-card-search-result.is-active {
    border-color: rgba(169, 211, 245, 0.28);
    outline: none;
    background: rgba(112, 158, 199, 0.14);
    transform: translateX(0.12rem);
}

.exam-card-search-result-copy {
    overflow: hidden;
    font-size: 0.92rem;
    font-weight: 670;
    line-height: 1.32;
}

.exam-card-search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.62rem;
    color: rgba(192, 206, 218, 0.68);
    font-size: 0.72rem;
    font-weight: 590;
}

.exam-card-search-empty {
    padding: 0.9rem;
    color: rgba(202, 214, 224, 0.68);
    text-align: center;
}

.anki-imported-html {
    width: min(100%, 72rem);
    max-height: 100%;
    overflow: auto;
    padding: clamp(0.2rem, 1vw, 0.75rem);
    font-size: clamp(1.08rem, 1.65vw, 1.55rem);
    font-weight: 470;
    line-height: 1.48;
    letter-spacing: 0;
    text-align: left;
    color: #e4ebf2;
    white-space: normal;
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 211, 245, 0.35) transparent;
}

.anki-imported-html mark,
.anki-imported-html .anki-format-shell {
    color: inherit;
    background: transparent;
    font-weight: inherit;
}

.anki-imported-html .anki-format-shell {
    display: contents;
}

.anki-imported-html strong,
.anki-imported-html b {
    color: #f1f5f8;
    font-weight: 680;
}

.card-content.is-answer-side .anki-imported-html {
    max-height: min(64vh, 46rem);
    font-weight: 430;
}

.card-content.is-answer-side .anki-imported-html strong,
.card-content.is-answer-side .anki-imported-html b {
    font-weight: 620;
}

.card-content.is-answer-side .anki-imported-html .biochem-term {
    font-weight: 560;
}

.card-content.is-answer-side .anki-text:not(.anki-imported-html) {
    font-weight: 480;
}

.card-content.is-answer-side .anki-text:not(.anki-imported-html).is-long,
.card-content.is-answer-side .anki-text:not(.anki-imported-html).is-very-long,
.card-content.is-answer-side .anki-text:not(.anki-imported-html).is-language-answer {
    font-weight: 450;
}

.card-content.is-answer-side .anki-text:not(.anki-imported-html) strong,
.card-content.is-answer-side .anki-text:not(.anki-imported-html) b,
.card-content.is-answer-side .exam-answer-language-label {
    font-weight: 650;
}

.card-content.is-answer-side .answer-term {
    font-weight: 580;
}

.anki-imported-html u {
    text-decoration-color: rgba(154, 205, 235, 0.66);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.16em;
}

.anki-imported-html::-webkit-scrollbar {
    width: 6px;
}

.anki-imported-html::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background: rgba(169, 211, 245, 0.35);
}

.anki-imported-html > :first-child,
.anki-imported-html .anki-import-stack > :first-child {
    margin-top: 0;
}

.anki-imported-html > :last-child,
.anki-imported-html .anki-import-stack > :last-child {
    margin-bottom: 0;
}

.anki-imported-html h1,
.anki-imported-html h2,
.anki-imported-html h3,
.anki-imported-html h4 {
    margin: 0.7em 0 0.35em;
    color: #edf3f8;
    font-size: 1.2em;
    line-height: 1.25;
    letter-spacing: 0;
}

.anki-imported-html p,
.anki-imported-html ul,
.anki-imported-html ol,
.anki-imported-html table,
.anki-imported-html .anki-import-stack > div {
    margin: 0.55em 0;
}

.anki-imported-html ul,
.anki-imported-html ol {
    padding-left: 1.45em;
}

.anki-imported-html table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

.anki-imported-html th,
.anki-imported-html td {
    padding: 0.5em 0.65em;
    border: 1px solid rgba(162, 181, 199, 0.24);
    vertical-align: top;
}

.anki-imported-html img {
    display: block;
    width: auto;
    max-width: min(100%, 58rem);
    max-height: min(58vh, 42rem);
    margin: 0.65rem auto;
    object-fit: contain;
}

.anki-imported-html audio {
    display: block;
    width: min(100%, 30rem);
    margin: 0.8rem auto;
}

.biochem-native-answer {
    display: grid;
    gap: clamp(0.85rem, 1.8vw, 1.35rem);
    width: 100%;
    margin-top: clamp(0.75rem, 2vw, 1.4rem);
    color: #dfe7ee;
    font-size: clamp(0.92rem, 1.15vw, 1.08rem);
    font-weight: 430;
    line-height: 1.45;
}

.biochem-native-answer:first-child {
    margin-top: 0;
}

.biochem-native-section {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(157, 181, 202, 0.24);
    border-radius: 0.48rem;
    background: rgba(23, 29, 35, 0.34);
    box-shadow: inset 0 1px 0 rgba(235, 244, 250, 0.025);
}

.anki-imported-html .biochem-native-section-title {
    margin: 0;
    padding: 0.72rem 0.9rem 0.66rem;
    border-bottom: 1px solid rgba(157, 181, 202, 0.2);
    color: #e9f0f5;
    background: rgba(110, 145, 176, 0.09);
    font-size: clamp(0.96rem, 1.22vw, 1.12rem);
    font-weight: 650;
    line-height: 1.25;
}

.biochem-native-table-shell {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 211, 245, 0.3) transparent;
}

.biochem-native-table-shell::-webkit-scrollbar {
    height: 5px;
}

.biochem-native-table-shell::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(169, 211, 245, 0.3);
}

.anki-imported-html .biochem-native-table {
    width: 100%;
    min-width: max(34rem, calc(var(--native-columns, 2) * 10.5rem));
    margin: 0;
    border-collapse: collapse;
    color: inherit;
    font-size: inherit;
    line-height: 1.4;
}

.anki-imported-html .biochem-native-table th,
.anki-imported-html .biochem-native-table td {
    padding: 0.64rem 0.78rem;
    border: 0;
    border-right: 1px solid rgba(157, 181, 202, 0.17);
    border-bottom: 1px solid rgba(157, 181, 202, 0.17);
    text-align: left;
    vertical-align: top;
}

.anki-imported-html .biochem-native-table th:last-child,
.anki-imported-html .biochem-native-table td:last-child {
    border-right: 0;
}

.anki-imported-html .biochem-native-table tbody tr:last-child td {
    border-bottom: 0;
}

.anki-imported-html .biochem-native-table th {
    color: #d5e7f4;
    background: rgba(103, 143, 176, 0.14);
    font-size: 0.88em;
    font-weight: 650;
}

.anki-imported-html .biochem-native-table td {
    font-weight: 430;
}

.anki-imported-html .biochem-native-table tbody tr:nth-child(even) td {
    background: rgba(119, 145, 166, 0.045);
}

.anki-imported-html .biochem-native-table td:first-child {
    color: #ecf1f5;
    font-weight: 590;
}

.biochem-native-facts {
    display: grid;
    margin: 0;
}

.biochem-native-fact {
    display: grid;
    grid-template-columns: minmax(8.5rem, 0.32fr) minmax(0, 1fr);
    gap: 0.72rem;
    padding: 0.62rem 0.82rem;
    border-bottom: 1px solid rgba(157, 181, 202, 0.15);
}

.biochem-native-fact:last-child {
    border-bottom: 0;
}

.biochem-native-fact:nth-child(even) {
    background: rgba(119, 145, 166, 0.045);
}

.biochem-native-fact dt,
.biochem-native-fact dd {
    margin: 0;
}

.biochem-native-fact dt {
    color: #b9d6eb;
    font-weight: 620;
}

.biochem-native-fact dd {
    font-weight: 430;
}

.biochem-native-section--note {
    padding-bottom: 0.78rem;
}

.biochem-native-section--note p {
    margin: 0;
    padding: 0.7rem 0.9rem 0;
    font-weight: 430;
}

.anki-cloze-gap,
.anki-cloze-answer {
    display: inline;
    padding: 0.04em 0.26em;
    border-radius: 0.22em;
}

.anki-cloze-gap {
    color: #d6e8f8;
    background: rgba(112, 158, 199, 0.2);
    border-bottom: 2px solid rgba(169, 211, 245, 0.66);
}

.anki-cloze-answer {
    color: #d8f1e0;
    background: rgba(99, 166, 124, 0.2);
}

.anki-occlusion-stage {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0.75rem auto;
    isolation: isolate;
}

.anki-imported-html .anki-occlusion-stage img {
    width: auto;
    max-width: min(100%, 58rem);
    max-height: min(56vh, 40rem);
    margin: 0;
}

.anki-imported-html .anki-occlusion-stage img + img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.anki-image-occlusion {
    width: 100%;
    text-align: center;
}

.biochem-term {
    padding: 0 0.04em;
    border-radius: 0.18em;
    font-weight: 690;
    text-decoration-line: underline;
    text-decoration-thickness: 0.075em;
    text-underline-offset: 0.17em;
}

.biochem-term--process {
    color: #a8e2db;
    text-decoration-color: rgba(134, 215, 209, 0.38);
}

.biochem-term--enzyme {
    color: #b6d9f5;
    text-decoration-color: rgba(169, 211, 245, 0.38);
}

.biochem-term--cofactor {
    color: #ecd699;
    text-decoration-color: rgba(231, 201, 128, 0.4);
}

.biochem-term--hormone {
    color: #d6c3ef;
    text-decoration-color: rgba(200, 179, 232, 0.4);
}

.biochem-term--clinical {
    color: #edbdc5;
    text-decoration-color: rgba(229, 174, 183, 0.42);
}

.biochem-text-occlusion {
    width: min(100%, 64rem);
    margin: auto;
    padding: clamp(1.15rem, 2.8vw, 2.25rem);
    border: 1px solid rgba(163, 187, 208, 0.24);
    border-radius: 0.5rem;
    background:
        linear-gradient(135deg, rgba(113, 145, 173, 0.075), transparent 44%),
        rgba(32, 39, 47, 0.68);
    box-shadow: 0 1rem 2.8rem rgba(10, 14, 19, 0.16);
}

.biochem-occlusion-title {
    margin-bottom: clamp(1rem, 2.4vw, 1.65rem);
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(169, 211, 245, 0.2);
    color: #eef3f7;
    font-size: clamp(1.28rem, 2.5vw, 2rem);
    font-weight: 780;
    line-height: 1.18;
}

.biochem-occlusion-section {
    margin: 0 0 0.75rem;
    color: #a9d3f5;
    font-size: 0.78em;
    font-weight: 760;
    text-transform: uppercase;
}

.biochem-occlusion-rows {
    display: grid;
    gap: 0.68rem;
}

.biochem-occlusion-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.38rem 0.58rem;
    min-height: 2.25rem;
    padding: 0.65rem 0.78rem;
    border: 1px solid rgba(159, 181, 201, 0.14);
    border-radius: 0.4rem;
    background: rgba(22, 28, 34, 0.32);
}

.biochem-occlusion-token {
    display: inline-block;
    max-width: 100%;
    line-height: 1.32;
}

.biochem-occlusion-token.is-visible {
    color: #e4ebf2;
}

.biochem-occlusion-token.is-masked {
    position: relative;
    min-width: max(5.5ch, min(20ch, 100%));
    overflow: hidden;
    padding: 0.08em 0.42em;
    border: 1px solid rgba(157, 190, 219, 0.3);
    border-radius: 0.26em;
    color: transparent;
    user-select: none;
    background:
        linear-gradient(100deg, transparent 18%, rgba(211, 229, 242, 0.085) 44%, transparent 70%) 0 0 / 220% 100%,
        rgba(91, 117, 141, 0.34);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
    animation: biochem-mask-breathe 3.8s ease-in-out infinite;
}

.biochem-occlusion-token.is-context-mask {
    border-color: rgba(188, 176, 216, 0.22);
    background: rgba(112, 101, 137, 0.24);
}

.biochem-occlusion-token.is-revealed {
    padding: 0.08em 0.34em;
    border-radius: 0.24em;
    color: #bfe6ca;
    background: rgba(105, 169, 126, 0.14);
    box-shadow: inset 0 -1px rgba(169, 213, 184, 0.22);
    font-weight: 760;
}

.biochem-occlusion-extra {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(163, 187, 208, 0.16);
    color: #bac7d2;
    font-size: 0.82em;
}

.biochem-deficiency-card {
    width: min(100%, 70rem);
    padding: clamp(0.8rem, 1.8vw, 1.35rem);
}

.biochem-deficiency-card .biochem-occlusion-title {
    margin-bottom: 0.45rem;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: clamp(1.14rem, 2vw, 1.58rem);
}

.biochem-deficiency-note {
    margin-bottom: 0.82rem;
    color: rgba(203, 215, 225, 0.72);
    font-size: 0.72em;
    line-height: 1.35;
}

.biochem-deficiency-grid {
    overflow: hidden;
    border: 1px solid rgba(166, 187, 205, 0.24);
    border-radius: 0.42rem;
    background: rgba(20, 25, 31, 0.28);
}

.biochem-deficiency-header,
.biochem-deficiency-row {
    display: grid;
    grid-template-columns: minmax(11rem, 1.42fr) minmax(7.5rem, 1fr) minmax(7.5rem, 1fr);
    align-items: stretch;
}

.biochem-deficiency-header {
    color: #dce8f1;
    background: rgba(105, 139, 169, 0.18);
    font-size: 0.76em;
    font-weight: 760;
}

.biochem-deficiency-header > span,
.biochem-deficiency-row > span {
    min-width: 0;
    padding: 0.55rem 0.66rem;
    border-right: 1px solid rgba(166, 187, 205, 0.16);
}

.biochem-deficiency-header > span:last-child,
.biochem-deficiency-row > span:last-child {
    border-right: 0;
}

.biochem-deficiency-row {
    border-top: 1px solid rgba(166, 187, 205, 0.14);
    font-size: 0.77em;
}

.biochem-deficiency-row:nth-child(odd) {
    background: rgba(133, 153, 173, 0.035);
}

.biochem-deficiency-risk {
    display: flex;
    align-items: center;
    color: #e2e9ef;
    font-weight: 650;
    line-height: 1.25;
}

.biochem-deficiency-value {
    display: flex;
    align-items: center;
}

.biochem-deficiency-value .biochem-occlusion-token {
    width: fit-content;
    min-width: 5ch;
    max-width: 100%;
}

.biochem-image-occlusion {
    overflow: hidden;
    border: 1px solid rgba(163, 187, 208, 0.22);
    border-radius: 0.45rem;
    background: #eef1f4;
    box-shadow: 0 0.9rem 2.7rem rgba(8, 12, 16, 0.18);
}

.biochem-image-mask {
    position: absolute;
    z-index: 3;
    left: var(--mask-x);
    top: var(--mask-y);
    width: var(--mask-width);
    height: var(--mask-height);
    border: 1px solid rgba(108, 130, 151, 0.48);
    border-radius: min(0.32rem, 12%);
    background: rgba(78, 94, 110, 0.94);
    box-shadow: 0 0.16rem 0.48rem rgba(17, 23, 29, 0.24);
}

.biochem-image-mask.is-target {
    border-color: rgba(159, 201, 234, 0.74);
    background: rgba(87, 119, 148, 0.96);
}

.biochem-image-mask.is-context {
    border-color: rgba(190, 179, 217, 0.5);
    background: rgba(103, 94, 122, 0.92);
}

.card-surface.is-occlusion-composite {
    align-content: start;
    cursor: default;
    padding: clamp(1.15rem, 2.4vw, 2rem);
}

.card-surface.is-occlusion-composite:hover,
.card-surface.is-occlusion-composite:focus-within {
    transform: none;
}

.card-surface.is-occlusion-composite .side-label {
    color: rgba(177, 196, 211, 0.68);
}

.biochem-composite-board {
    width: 100%;
    margin: auto;
}

.biochem-composite-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 72rem);
    margin: 0 auto clamp(0.8rem, 1.8vw, 1.25rem);
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(169, 211, 245, 0.2);
}

.biochem-composite-head h2 {
    margin: 0;
    color: #edf3f8;
    font-size: clamp(1.15rem, 2.2vw, 1.8rem);
    line-height: 1.16;
}

.biochem-composite-head > span {
    flex: 0 0 auto;
    color: #a9d3f5;
    font-size: 0.84rem;
    font-weight: 760;
}

.biochem-composite-head-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.62rem;
}

.biochem-composite-head-tools > span {
    color: #a9d3f5;
    font-size: 0.84rem;
    font-weight: 760;
}

.biochem-composite-expand {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(169, 211, 245, 0.28);
    border-radius: 0.42rem;
    background: rgba(90, 115, 138, 0.1);
    color: #c9d9e6;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.biochem-composite-expand:hover,
.biochem-composite-expand:focus-visible {
    border-color: rgba(169, 211, 245, 0.7);
    outline: none;
    background: rgba(118, 157, 190, 0.2);
    color: #edf6fd;
    transform: translateY(-1px);
}

.biochem-composite-expand svg {
    width: 1.18rem;
    height: 1.18rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.biochem-composite-expand .collapse-path,
.biochem-composite-expand[aria-expanded="true"] .expand-path {
    display: none;
}

.biochem-composite-expand[aria-expanded="true"] .collapse-path {
    display: block;
}

.biochem-composite-image-stage {
    position: relative;
    overflow: hidden;
    max-height: 62vh;
    margin: auto;
    border: 1px solid rgba(171, 191, 209, 0.28);
    border-radius: 0.45rem;
    background: #eef1f4;
    box-shadow: 0 1rem 2.8rem rgba(7, 11, 15, 0.2);
    isolation: isolate;
}

.biochem-composite-image-stage > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.biochem-composite-image-mask {
    position: absolute;
    z-index: 2;
    left: var(--mask-x);
    top: var(--mask-y);
    width: var(--mask-width);
    height: var(--mask-height);
    min-width: 3px;
    min-height: 3px;
    padding: 0;
    border: 1px solid rgba(159, 191, 219, 0.58);
    border-radius: min(0.28rem, 12%);
    background: #435260;
    box-shadow: 0 0.16rem 0.5rem rgba(11, 16, 21, 0.24), inset 0 1px rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.biochem-composite-image-mask::before,
.biochem-composite-text-mask::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--field-pointer-x, 50%) var(--field-pointer-y, 50%),
        rgba(202, 229, 249, 0.3),
        rgba(146, 194, 231, 0.1) 38%,
        transparent 72%
    );
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.biochem-composite-image-mask::after {
    position: absolute;
    inset: -4px;
    content: "";
}

.biochem-composite-image-mask.is-hidden:hover,
.biochem-composite-image-mask.is-hidden:focus-visible {
    z-index: 4;
    border-color: #b9dcf6;
    box-shadow: 0 0 0 3px rgba(169, 211, 245, 0.24), 0 0.3rem 0.8rem rgba(13, 20, 27, 0.28);
    outline: none;
    transform: perspective(18rem) rotateX(var(--field-tilt-x, 0deg)) rotateY(var(--field-tilt-y, 0deg)) scale(1.035);
}

.biochem-composite-image-mask:hover::before,
.biochem-composite-image-mask:focus-visible::before,
.biochem-composite-text-mask:hover::before,
.biochem-composite-text-mask:focus-visible::before {
    opacity: 1;
}

.biochem-composite-image-mask.is-revealed {
    background: rgba(75, 93, 108, 0.04);
    box-shadow: inset 0 0 0 1px rgba(221, 233, 242, 0.2);
}

.biochem-composite-image-mask.is-active {
    z-index: 5;
    border-color: #a9d3f5;
    box-shadow: 0 0 0 3px rgba(169, 211, 245, 0.26), 0 0 1rem rgba(125, 178, 221, 0.24);
}

.biochem-composite-image-mask.is-known {
    border-color: rgba(169, 213, 184, 0.94);
    background: #435260;
}

.biochem-composite-image-mask.is-missed {
    border-color: rgba(229, 174, 183, 0.96);
    background: #435260;
}

.biochem-composite-image-mask.is-revealed.is-known {
    background: rgba(86, 152, 108, 0.07);
}

.biochem-composite-image-mask.is-revealed.is-missed {
    background: rgba(179, 89, 104, 0.08);
}

.biochem-composite-table {
    overflow: hidden;
    width: min(100%, 70rem);
    margin: auto;
    border: 1px solid rgba(166, 187, 205, 0.28);
    border-radius: 0.45rem;
    background: rgba(20, 25, 31, 0.28);
}

.biochem-composite-table-head,
.biochem-composite-table-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.42fr) repeat(2, minmax(5rem, 1fr));
}

.biochem-composite-table-head {
    color: #dce8f1;
    background: rgba(105, 139, 169, 0.18);
    font-size: clamp(0.72rem, 1.3vw, 0.88rem);
    font-weight: 760;
}

.biochem-composite-table-head > span,
.biochem-composite-table-row > span {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: clamp(0.4rem, 1vw, 0.62rem);
    border-right: 1px solid rgba(166, 187, 205, 0.16);
}

.biochem-composite-table-head > span:last-child,
.biochem-composite-table-row > span:last-child {
    border-right: 0;
}

.biochem-composite-table-row {
    border-top: 1px solid rgba(166, 187, 205, 0.15);
    color: #e2e9ef;
    font-size: clamp(0.7rem, 1.25vw, 0.88rem);
}

.biochem-composite-table-row:nth-child(odd) {
    background: rgba(133, 153, 173, 0.035);
}

.biochem-composite-risk {
    font-weight: 650;
    line-height: 1.25;
}

.biochem-composite-text-mask {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 4.5ch;
    min-height: 1.75rem;
    padding: 0.16rem 0.42rem;
    overflow: hidden;
    border: 1px solid rgba(157, 190, 219, 0.32);
    border-radius: 0.28rem;
    background: #506273;
    color: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 720;
    line-height: 1.25;
    text-align: left;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    isolation: isolate;
    transform-style: preserve-3d;
    will-change: transform;
}

.biochem-composite-text-mask span {
    position: relative;
    z-index: 1;
    color: inherit;
}

.biochem-composite-text-mask.is-hidden:hover,
.biochem-composite-text-mask.is-hidden:focus-visible {
    border-color: #b9dcf6;
    box-shadow: 0 0 0 3px rgba(169, 211, 245, 0.18);
    outline: none;
    transform: perspective(18rem) rotateX(var(--field-tilt-x, 0deg)) rotateY(var(--field-tilt-y, 0deg)) scale(1.025);
}

.biochem-composite-text-mask.is-revealed {
    color: #edf3f8;
    background: rgba(117, 145, 169, 0.14);
}

.biochem-composite-text-mask.is-active {
    border-color: #a9d3f5;
    box-shadow: 0 0 0 3px rgba(169, 211, 245, 0.2);
}

.biochem-composite-text-mask.is-known {
    border-color: rgba(169, 213, 184, 0.72);
    color: transparent;
    background: #506273;
}

.biochem-composite-text-mask.is-missed {
    border-color: rgba(229, 174, 183, 0.76);
    color: transparent;
    background: #506273;
}

.biochem-composite-text-mask.is-revealed.is-known {
    color: #c7ead1;
    background: rgba(91, 151, 111, 0.14);
}

.biochem-composite-text-mask.is-revealed.is-missed {
    color: #f0c5cc;
    background: rgba(174, 88, 102, 0.14);
}

.biochem-composite-plain-value {
    color: #c7d0d9;
}

.biochem-coenzyme-table .biochem-composite-table-head,
.biochem-coenzyme-table .biochem-composite-table-row {
    grid-template-columns: minmax(10rem, 1.35fr) minmax(5.4rem, 0.62fr) minmax(11rem, 1.45fr);
}

.biochem-coenzyme-table .biochem-composite-table-head {
    background: rgba(104, 139, 168, 0.2);
    letter-spacing: 0.01em;
}

.biochem-coenzyme-row {
    position: relative;
    background: color-mix(in srgb, var(--coenzyme-tone, #a9d3f5) 7%, transparent);
}

.biochem-coenzyme-row::before {
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: 0.2rem;
    background: var(--coenzyme-tone, #a9d3f5);
    content: "";
    opacity: 0.78;
}

.biochem-coenzyme-row[data-row-tone="1"] { --coenzyme-tone: #e7d58d; }
.biochem-coenzyme-row[data-row-tone="2"] { --coenzyme-tone: #c7b8e2; }
.biochem-coenzyme-row[data-row-tone="3"] { --coenzyme-tone: #e7a6aa; }
.biochem-coenzyme-row[data-row-tone="4"] { --coenzyme-tone: #8ecce3; }
.biochem-coenzyme-row[data-row-tone="5"] { --coenzyme-tone: #acd58e; }
.biochem-coenzyme-row[data-row-tone="6"] { --coenzyme-tone: #e4bb78; }

.biochem-coenzyme-name {
    color: #eef3f7;
    font-weight: 720;
}

.biochem-coenzyme-vitamin .biochem-composite-plain-value {
    color: var(--coenzyme-tone, #c8d8e5);
    font-weight: 760;
}

.biochem-table-label-short {
    display: none;
}

body.has-occlusion-expanded {
    overflow: hidden;
}

.quiz-card.is-occlusion-expanded {
    position: fixed;
    z-index: 1200;
    inset: clamp(0.55rem, 1.6vw, 1.35rem);
    box-sizing: border-box;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: clamp(0.65rem, 1.25vw, 1rem);
    overflow: hidden;
    border-color: rgba(169, 211, 245, 0.48);
    background: #2d333a;
    box-shadow:
        0 0 0 100vmax rgba(8, 12, 16, 0.82),
        0 1.6rem 5rem rgba(3, 7, 11, 0.58),
        0 0 0 1px rgba(169, 211, 245, 0.08);
    animation: biochem-board-expand 190ms cubic-bezier(0.2, 0.82, 0.26, 1) both;
}

.quiz-card.is-occlusion-expanded > .question-meta-spacer {
    display: none;
}

.quiz-card.is-occlusion-expanded .card-hover-meta,
.quiz-card.is-occlusion-expanded .card-hover-tools {
    display: none;
}

.quiz-card.is-occlusion-expanded .card-frame,
.quiz-card.is-occlusion-expanded .card-surface,
.quiz-card.is-occlusion-expanded .card-content,
.quiz-card.is-occlusion-expanded .biochem-composite-board {
    min-height: 0;
    height: 100%;
}

.quiz-card.is-occlusion-expanded .card-frame {
    overflow: hidden;
}

.quiz-card.is-occlusion-expanded .card-surface {
    align-content: stretch;
    overflow: auto;
    scrollbar-color: rgba(169, 211, 245, 0.32) transparent;
    scrollbar-width: thin;
}

.quiz-card.is-occlusion-expanded .biochem-composite-board {
    display: flex;
    flex-direction: column;
}

.quiz-card.is-occlusion-expanded .biochem-composite-image-stage {
    flex: 1 1 auto;
    max-height: none;
    width: min(100%, calc((100vh - 12.5rem) * var(--board-ratio, 1))) !important;
}

.quiz-card.is-occlusion-expanded .biochem-composite-table {
    width: min(100%, 88rem);
    font-family: inherit;
    letter-spacing: 0;
}

.quiz-card.is-occlusion-expanded .biochem-composite-table-row {
    font-size: clamp(0.82rem, 1.3vw, 1.08rem);
}

.quiz-card.is-occlusion-expanded .biochem-composite-table-head {
    font-size: clamp(0.82rem, 1.25vw, 1rem);
}

.quiz-card.is-occlusion-expanded .model2-actions {
    position: relative;
    z-index: 2;
    margin-top: 0.72rem;
}

.quiz-card.is-occlusion-expanded .exam-status-rail {
    min-height: 1.45rem;
}

@keyframes biochem-board-expand {
    from { opacity: 0; transform: translateY(0.4rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .card-surface.is-occlusion-composite {
        min-height: 340px;
        padding: 0.85rem;
    }

    .biochem-composite-head {
        gap: 0.65rem;
        margin-bottom: 0.7rem;
    }

    .biochem-composite-table-head,
    .biochem-composite-table-row {
        grid-template-columns: minmax(6.2rem, 1.32fr) repeat(2, minmax(4.2rem, 1fr));
    }

    .biochem-composite-table-head > span,
    .biochem-composite-table-row > span {
        padding: 0.38rem 0.34rem;
    }

    .biochem-composite-text-mask {
        padding-inline: 0.28rem;
    }

    .biochem-coenzyme-table .biochem-composite-table-head,
    .biochem-coenzyme-table .biochem-composite-table-row {
        grid-template-columns: minmax(0, 1.25fr) minmax(3rem, 0.48fr) minmax(0, 1.35fr);
    }

    .biochem-coenzyme-table .biochem-composite-cell {
        overflow-wrap: anywhere;
    }

    .biochem-table-label-wide {
        display: none;
    }

    .biochem-table-label-short {
        display: inline;
    }

    .quiz-card.is-occlusion-expanded {
        inset: 0.35rem;
        padding: 0.55rem;
    }
}

@keyframes biochem-mask-breathe {
    0%, 100% { background-position: 100% 0, 0 0; }
    50% { background-position: -80% 0, 0 0; }
}

@media (max-width: 720px) {
    .exam-card-search {
        height: 44px;
    }

    .exam-card-search-toggle {
        width: 48px;
        height: 44px;
        flex-basis: 48px;
    }

    .exam-card-search-panel,
    .exam-card-search.is-open .exam-card-search-panel {
        position: absolute;
        top: calc(100% + 0.48rem);
        right: auto;
        left: 0;
        width: min(19rem, calc(100vw - 6rem));
        margin-left: 0;
        transform: translateY(-0.4rem);
    }

    .exam-card-search.is-open .exam-card-search-panel {
        transform: translateY(0);
    }

    #exam-card-search-input {
        height: 44px;
    }

    .exam-card-search-results {
        width: 100%;
        max-height: 52vh;
    }

    .anki-imported-html {
        padding: 0.2rem;
        font-size: clamp(0.96rem, 4vw, 1.18rem);
        line-height: 1.42;
    }

    .anki-imported-html th,
    .anki-imported-html td {
        padding: 0.38em 0.45em;
    }

    .biochem-native-fact {
        grid-template-columns: 1fr;
        gap: 0.22rem;
        padding: 0.66rem 0.72rem;
    }

    .anki-imported-html .biochem-native-table {
        min-width: max(31rem, calc(var(--native-columns, 2) * 9.25rem));
    }

    .biochem-text-occlusion {
        padding: 1rem;
    }

    .biochem-occlusion-row {
        padding: 0.56rem 0.62rem;
    }

    .biochem-deficiency-card {
        padding: 0.68rem;
    }

    .biochem-deficiency-header,
    .biochem-deficiency-row {
        grid-template-columns: minmax(7.2rem, 1.42fr) minmax(4.5rem, 1fr) minmax(4.5rem, 1fr);
    }

    .biochem-deficiency-header > span,
    .biochem-deficiency-row > span {
        padding: 0.44rem 0.38rem;
    }

    .biochem-deficiency-header,
    .biochem-deficiency-row {
        font-size: 0.72em;
    }

}

@media (prefers-reduced-motion: reduce) {
    .biochem-occlusion-token.is-masked,
    .exam-card-search-panel,
    .exam-card-search-result {
        animation: none;
        transition: none;
    }
}
