/* Medha by MEDiscuss: the stylesheet.
 *
 * Built on the Dixith Labs tokens (dixith-labs-design/tokens.css, version 1.2) as the newer
 * Swasthya uses them: warm paper, one accent chosen by the reader, Fraunces for headings,
 * depth from light and hairlines. The mc- classes carry the same names and the same jobs as in
 * the CDSS and Swasthya, so the three systems are learned once. The md- classes are Medha's own.
 *
 * Never type a raw colour below the token block. Use a token, or color-mix() from a token.
 * The one exception is the label palette (.k-*), as the design philosophy allows.
 *
 * Needs on <html>: data-accent="ink|lagoon|clay", and data-theme="light|dark" or the class
 * "auto-dark". The script at the head of index.php sets them before first paint.
 */

/* ------------------------------------------------------------------ fonts */
@font-face {
    font-family: 'Fraunces';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('fonts/fraunces-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal; font-weight: 400 800; font-display: swap;
    src: url('fonts/noto-sans-latin.woff2') format('woff2');
}

/* ------------------------------------------------------------------ tokens */
:root {
    --font: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --bg: #F6F4EF; --bg-2: #EEEBE4; --surface: #FFFFFF; --surface-2: #FAF9F6;
    --ink: #1C1E24; --ink-2: #50555F; --ink-3: #8D919B;
    --line: rgba(28, 30, 36, .08); --line-2: rgba(28, 30, 36, .15);
    --hover: rgba(28, 30, 36, .045); --press: rgba(28, 30, 36, .08);
    --late: #B53B31; --good: #26784A; --warn: #955A10; --info: #35607F;
    --shadow-1: 0 1px 2px rgba(20, 22, 30, .05), 0 2px 8px rgba(20, 22, 30, .04);
    --shadow-2: 0 2px 6px rgba(20, 22, 30, .06), 0 16px 40px rgba(20, 22, 30, .10);
    --bar: #FCFBF8;
    --field-a: .10; --field-b: .16;
    --r: 14px; --r-lg: 20px;
    --shell: 860px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --on-accent: #fff;
    color-scheme: light;
}
:root, :root[data-accent="ink"] { --accent: #3552A8; --accent-2: #5C6FD8; --accent-ink: #2B4491; --accent-soft: rgba(53, 82, 168, .11); --accent-line: rgba(53, 82, 168, .28); }
:root[data-accent="lagoon"]    { --accent: #0E7C73; --accent-2: #22867A; --accent-ink: #0A665E; --accent-soft: rgba(14, 124, 115, .11); --accent-line: rgba(14, 124, 115, .28); }
:root[data-accent="clay"]      { --accent: #B4532F; --accent-2: #C25A29; --accent-ink: #9A4526; --accent-soft: rgba(180, 83, 47, .11); --accent-line: rgba(180, 83, 47, .28); }

/* Dark: chosen, not inverted. */
:root[data-theme="dark"], :root.auto-dark {
    --bg: #111317; --bg-2: #16191E; --surface: #1A1D23; --surface-2: #1F232A;
    --ink: #ECEDEF; --ink-2: #A8ACB5; --ink-3: #737882;
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
    --hover: rgba(255, 255, 255, .045); --press: rgba(255, 255, 255, .08);
    --late: #F07A6E; --good: #5FC58E; --warn: #F2A844; --info: #8FB4CF;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 40px rgba(0, 0, 0, .45);
    --bar: #181B21;
    --field-a: .09; --field-b: .05;
    --on-accent: #0D1018;
    color-scheme: dark;
}
:root[data-theme="dark"], :root.auto-dark,
:root[data-theme="dark"][data-accent="ink"], :root.auto-dark[data-accent="ink"]       { --accent: #94A8F2; --accent-2: #B3A6F5; --accent-ink: #AEBCF6; --accent-soft: rgba(148, 168, 242, .14); --accent-line: rgba(148, 168, 242, .34); }
:root[data-theme="dark"][data-accent="lagoon"], :root.auto-dark[data-accent="lagoon"] { --accent: #52C8B8; --accent-2: #7FD9C2; --accent-ink: #72D6C8; --accent-soft: rgba(82, 200, 184, .14); --accent-line: rgba(82, 200, 184, .34); }
:root[data-theme="dark"][data-accent="clay"], :root.auto-dark[data-accent="clay"]     { --accent: #F0916B; --accent-2: #F5B27F; --accent-ink: #F4A585; --accent-soft: rgba(240, 145, 107, .14); --accent-line: rgba(240, 145, 107, .34); }

/* The label palette, for the parts of a name. Colour is never the only carrier: each part
   also has its caption written under it. */
.k-p { --c: #7C8594; } .k-t { --c: #1F9A8D; } .k-s { --c: #D7A021; } .k-m { --c: #5A5FD0; } .k-w { --c: #D25C92; } .k-x { --c: #7C8594; }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html.booting body { visibility: hidden; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh; background: transparent; color: var(--ink);
    font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent; overflow-x: hidden; overflow-wrap: anywhere;
}
/* The colour fields: the accent, very faintly, behind the page. */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        radial-gradient(60vmax 60vmax at 4% -6%, color-mix(in srgb, var(--accent) calc(var(--field-a) * 100%), transparent), transparent 70%),
        radial-gradient(44vmax 44vmax at 104% 0%, color-mix(in srgb, var(--accent-2) calc(var(--field-b) * 100%), transparent), transparent 70%),
        radial-gradient(50vmax 50vmax at 60% 110%, color-mix(in srgb, var(--accent) calc(var(--field-a) * 60%), transparent), transparent 70%);
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
.md-sprite { position: absolute; width: 0; height: 0; }
.md-grow { flex: 1 1 200px; }
.md-gap-top { margin-top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ the bar */
.md-bar {
    position: sticky; top: 0; z-index: 40;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 12%, transparent) 70%, color-mix(in srgb, var(--accent) 16%, transparent)), var(--bar);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    padding-top: env(safe-area-inset-top, 0px);
}
:root[data-theme="dark"] .md-bar, :root.auto-dark .md-bar { background: var(--bar); border-bottom-color: var(--line); }
.md-bar-in { max-width: var(--shell); margin: 0 auto; padding: 0 16px; min-height: 56px; display: flex; align-items: center; gap: 12px; }
.md-wordmark { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none; min-height: 44px; padding-top: 10px; }
.md-wordmark:hover { text-decoration: none; color: var(--accent-ink); }
.md-wordmark b { font: 700 22px/1 var(--display); letter-spacing: -.01em; }
/* The icon beside the name. The name sits on a baseline with 10px of padding above it, which
   would push a centred icon 5px below the middle of the bar. The negative margin takes that
   back, so the icon's middle is the bar's middle and the menu button's. */
.md-mark { flex: none; width: 28px; height: 28px; align-self: center; margin-top: -10px; margin-right: 1px; }
.md-wordmark span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.md-bar-gap { flex: 1; }
.md-icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .15s; }
.md-icon-btn:hover { background: var(--hover); color: var(--ink); }
.md-icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.md-menu-wrap { position: relative; }
.md-menu {
    position: absolute; right: 0; top: calc(100% + 6px); width: 272px; z-index: 50;
    background: var(--surface); border-radius: 16px; padding: 12px;
    box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}
.md-menu-head { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px 8px; }
.md-menu-head + .md-seg, .md-accents { margin-bottom: 12px; }
.md-accents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.md-accents button {
    display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 7px; min-height: 44px;
    border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.md-accents button i { display: block; width: 100%; height: 22px; border-radius: 7px; background: linear-gradient(90deg, var(--a1) 0 55%, var(--a2) 55% 100%); }
.md-accents button:hover { background: var(--hover); }
.md-accents button[aria-checked="true"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.md-trial { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.md-trial p { max-width: var(--shell); margin: 0 auto; padding: 9px 16px; font-size: 13.5px; line-height: 1.5; }
.md-trial strong { color: var(--warn); }

/* ------------------------------------------------------------------ the shell */
.md-shell { max-width: var(--shell); margin: 0 auto; padding: 18px 16px 40px; animation: mdRise .32s var(--ease) both; }
@keyframes mdRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ the hub */
.md-hub-head { padding: 14px 0 6px; }
.md-hub-head h1 { font: 700 34px/1.08 var(--display); letter-spacing: -.02em; }
.md-hub-title { display: flex; align-items: center; gap: 14px; }
.md-hub-mark { flex: none; width: 56px; height: 56px; }
.md-hub-head p { font-size: 17px; color: var(--ink-2); margin-top: 8px; max-width: 34em; }
.md-section-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 26px 2px 10px; }
.md-packs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.md-pack {
    display: block; color: var(--ink); background: var(--surface); border-radius: 18px; padding: 16px 16px 15px;
    box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); transition: box-shadow .18s var(--ease), transform .12s;
}
.md-pack:hover { text-decoration: none; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--accent-line); }
.md-pack:active { transform: scale(.985); }
.md-pack-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.md-pack h3 { font: 700 21px/1.2 var(--display); margin: 6px 0 6px; }
.md-pack p { font-size: 14.5px; color: var(--ink-2); }
.md-pack-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.md-statement { margin-top: 28px; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.md-statement strong { color: var(--ink); }

/* ------------------------------------------------------------------ the module: header and tabs */
#mc-core-app .mc-header { padding: 8px 0 4px; margin-bottom: 14px; }
.mc-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.mc-title { font: 700 30px/1.12 var(--display); letter-spacing: -.015em; margin-top: 4px; }
.mc-subtitle { display: block; font-size: 16.5px; line-height: 1.45; color: var(--ink-2); margin-top: 6px; }
.mc-tabs-container { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 30; padding: 8px 16px; margin: 0 -16px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mc-tabs, .md-seg { display: flex; background: var(--bg-2); border-radius: 13px; padding: 3px; gap: 2px; }
.mc-tab, .md-seg button {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px; border-radius: 10px;
    font-size: 14.5px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2;
    transition: background .15s var(--ease), color .15s, box-shadow .15s;
}
.mc-tab.active, .md-seg button[aria-checked="true"], .md-seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .mc-tab.active, :root.auto-dark .mc-tab.active,
:root[data-theme="dark"] .md-seg button[aria-checked="true"], :root.auto-dark .md-seg button[aria-checked="true"],
:root[data-theme="dark"] .md-seg button[aria-selected="true"], :root.auto-dark .md-seg button[aria-selected="true"] { background: var(--surface-2); }
.mc-panel { display: none; }
.mc-panel.active { display: block; }

/* ------------------------------------------------------------------ cards, type, buttons */
.mc-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 18px; margin: 0 0 14px; }
.mc-heading { font: 700 21px/1.2 var(--display); letter-spacing: -.01em; margin: 0 0 8px; }
.mc-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.mc-text { font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.mc-text + .mc-text { margin-top: 10px; }
.mc-hint { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.mc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
    border-radius: 15px; font-weight: 600; font-size: 15.5px; transition: transform .12s, background .15s, box-shadow .15s, opacity .15s;
}
.mc-btn:hover { text-decoration: none; }
.mc-btn:active { transform: scale(.97); }
.mc-btn:disabled { opacity: .45; pointer-events: none; }
.mc-btn-primary { color: var(--on-accent); background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
.mc-btn-secondary { color: var(--accent-ink); background: var(--accent-soft); }
.mc-btn-clear { color: var(--ink-2); min-height: 44px; padding: 0 14px; border-radius: 11px; font-size: 14.5px; box-shadow: inset 0 0 0 1px var(--line-2); }
.mc-btn-clear:hover { background: var(--hover); color: var(--ink); }
.mc-btn-wide { width: 100%; }
.mc-input {
    width: 100%; font-size: 16px; padding: 12px 14px; min-height: 48px; border-radius: 13px; border: 1px solid var(--line-2);
    background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.mc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mc-input::placeholder { color: var(--ink-3); }

.mc-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.mc-badge-accent  { background: var(--accent-soft); color: var(--accent-ink); }
.mc-badge-success { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); }
.mc-badge-warning { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); }
.mc-badge-danger  { background: color-mix(in srgb, var(--late) 12%, transparent); color: var(--late); }

.mc-alert { border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.mc-alert-info    { background: color-mix(in srgb, var(--info) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 26%, transparent); }
.mc-alert-success { background: color-mix(in srgb, var(--good) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 28%, transparent); }
.mc-alert-warning { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 28%, transparent); }
.mc-alert-danger  { background: color-mix(in srgb, var(--late) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--late) 28%, transparent); }
.mc-alert-info strong { color: var(--info); } .mc-alert-success strong { color: var(--good); }
.mc-alert-warning strong { color: var(--warn); } .mc-alert-danger strong { color: var(--late); }

/* The instructions block and the scope box: a variant of the alert, as in the CDSS. */
.mc-howto { padding: 0; }
.mc-howto-head { font-size: inherit; }
.mc-howto-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 16px; text-align: left; font-weight: 700; font-size: 14.5px; border-radius: 16px; }
.mc-howto-icon, .mc-howto-chev { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mc-alert-info .mc-howto-icon { color: var(--info); } .mc-alert-warning .mc-howto-icon { color: var(--warn); }
.mc-howto-label { flex: 1; }
.mc-howto-chev { color: var(--ink-2); transition: transform .2s var(--ease); }
.mc-howto[data-open="true"] .mc-howto-chev { transform: rotate(180deg); }
.mc-howto-body { padding: 0 16px 14px; }
.mc-howto[data-open="false"] .mc-howto-body { display: none; }
.mc-howto-list { margin: 0; padding-left: 20px; }
.mc-howto-list li { margin: 0 0 6px; }

.mc-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 4px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.mc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.mc-table th, .mc-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.mc-table th, .mc-table td { overflow-wrap: normal; word-break: normal; }
.mc-table thead th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.mc-table tbody th { font-weight: 600; }
.mc-table.mc-wide { min-width: 640px; }
.mc-table tr:last-child td { border-bottom: 0; }

.mc-pearl-title { font: 700 18px/1.3 var(--display); margin: 22px 0 8px; }
.mc-pearl-title:first-child { margin-top: 0; }
.mc-pearl-text { font-size: 15.5px; line-height: 1.6; margin: 0 0 10px; }
.mc-pearl-list { margin: 0 0 10px; padding-left: 20px; font-size: 15.5px; line-height: 1.6; }
.mc-pearl-list li { margin-bottom: 6px; }

.mc-references { margin: 0 0 14px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.mc-references summary { cursor: pointer; padding: 13px 16px; min-height: 48px; font-weight: 700; color: var(--ink); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-references summary::-webkit-details-marker { display: none; }
.mc-references summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s var(--ease); margin-right: 4px; flex-shrink: 0; }
.mc-references[open] summary::after { transform: rotate(-135deg); }
.mc-references > :not(summary) { padding: 0 16px 14px; margin: 0; }
.mc-references ol { padding-left: 36px; }
.mc-references li { margin-bottom: 8px; }
.mc-provenance { text-align: center; font-size: 13px; line-height: 1.6; color: var(--ink-2); padding: 10px 14px; margin: 22px auto 0; max-width: 640px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); }
.mc-provenance.is-unreviewed { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.mc-provenance.is-unreviewed strong { color: var(--warn); }

/* ------------------------------------------------------------------ Learn: sub-views, search, chips */
.md-seg { margin: 0 0 14px; }
.md-view[hidden] { display: none; }
.md-tools { display: grid; gap: 10px; margin: 0 0 6px; }
.md-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.md-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 18px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .15s, color .15s; }
.md-chip:hover { background: var(--hover); }
.md-chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.md-count { font-size: 13.5px; color: var(--ink-2); margin: 2px 2px 0; }

.md-fam { margin: 22px 0 0; }
.md-fam-head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.md-fam-head h2 { font: 700 20px/1.2 var(--display); }
.md-fam-n { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.md-fam-line { font-size: 14px; color: var(--ink-2); margin: -4px 2px 10px; }

/* One antibody. */
.md-drug, #md-practise { scroll-margin-top: calc(132px + env(safe-area-inset-top, 0px)); }
.md-drug { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); margin: 0 0 10px; overflow: hidden; }
.md-drug > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 13px 16px; min-height: 60px; }
.md-drug > summary::-webkit-details-marker { display: none; }
.md-drug > summary:hover { background: var(--hover); }
.md-drug-name { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.md-drug-target { grid-column: 1; font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.md-drug-target b { color: var(--accent-ink); font-weight: 700; }
.md-drug-chev { grid-row: 1 / span 2; grid-column: 2; width: 9px; height: 9px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s var(--ease); margin: 0 6px 4px; }
.md-drug[open] .md-drug-chev { transform: rotate(-135deg); margin-bottom: -4px; }
.md-drug[open] > summary { border-bottom: 1px solid var(--line); }
.md-drug-body { padding: 14px 16px 16px; display: grid; gap: 14px; }
.md-kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 14.5px; line-height: 1.5; }
.md-kv dt { color: var(--ink-2); font-size: 13px; font-weight: 600; padding-top: 1px; }
.md-kv dd { margin: 0; }
.md-block h3 { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.md-list { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.5; }
.md-list li { margin-bottom: 3px; }
.md-boxed { border-radius: 14px; padding: 11px 14px; font-size: 14.5px; line-height: 1.5; background: color-mix(in srgb, var(--late) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--late) 30%, transparent); }
.md-boxed strong { display: block; color: var(--late); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.md-hook { border-radius: 14px; padding: 11px 14px; font-size: 15px; line-height: 1.55; background: var(--accent-soft); }
.md-hook strong { display: block; color: var(--accent-ink); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.md-note { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.md-check { border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.5; background: color-mix(in srgb, var(--warn) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 28%, transparent); }
.md-check strong { color: var(--warn); }
.md-src { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* The parts of a name. */
.md-parts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; }
.md-part { display: flex; flex-direction: column; align-items: center; min-width: 56px; max-width: 150px; text-align: center; }
.md-part b { font: 700 20px/1.25 var(--display); padding: 0 5px 2px; border-bottom: 3px solid var(--c, var(--ink-3)); }
.md-part small { font-size: 12px; line-height: 1.3; color: var(--ink-2); margin-top: 4px; }
.md-part.k-p b, .md-part.k-x b { color: var(--ink-2); }
.md-part-gap { width: 4px; }

/* ------------------------------------------------------------------ Learn: lookalikes and the decoder */
.md-pair-point { font-size: 15px; line-height: 1.55; margin: 0 0 8px; }
.md-link { color: var(--accent-ink); font-weight: 700; text-align: left; min-height: 32px; }
.md-link:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The table of antibodies without a card: a heading row for each region, and the brand beside the name. */
.mc-table tbody tr.md-group-row th { background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.md-brand { color: var(--ink-2); font-weight: 400; font-size: 13px; }
.md-decoder-out { margin-top: 14px; display: grid; gap: 12px; }
.md-eras { counter-reset: era; display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.md-eras li { display: grid; grid-template-columns: 124px 1fr; gap: 4px 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.45; }
.md-eras li b { font-weight: 700; }
.md-eras li code { font: 600 13.5px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent-ink); }
.md-eras li span { grid-column: 2; color: var(--ink-2); }

/* ------------------------------------------------------------------ Practise */
.md-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 14px; }
.md-stat { border-radius: 15px; padding: 11px 8px 9px; text-align: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.md-stat b { display: block; font: 700 23px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.md-stat span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 3px; line-height: 1.25; }
.md-starts { display: grid; gap: 10px; }
.md-levels { margin: 14px 0 0; }
.md-level-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.md-level-row:first-child { border-top: 0; }
.md-level-row span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.md-missed { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }

.md-steps { display: flex; gap: 4px; margin: 0 0 12px; }
.md-steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); }
.md-steps i.done { background: var(--accent-line); }
.md-steps i.now { background: var(--accent); }
.md-q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.md-q-stem { font-size: 17px; line-height: 1.5; font-weight: 500; margin: 0 0 14px; }
.md-opts { display: grid; gap: 8px; }
.md-opt {
    display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left;
    min-height: 52px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
    font-size: 15.5px; line-height: 1.45; transition: background .15s, box-shadow .15s, transform .12s;
}
.md-opt:hover:not(:disabled) { background: var(--hover); }
.md-opt:active:not(:disabled) { transform: scale(.985); }
.md-opt-key { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); }
.md-opt:disabled { cursor: default; color: var(--ink); }
.md-opt.is-right { background: color-mix(in srgb, var(--good) 10%, var(--surface)); box-shadow: inset 0 0 0 2px var(--good); }
.md-opt.is-right .md-opt-key { background: var(--good); color: var(--surface); }
.md-opt.is-wrong { background: color-mix(in srgb, var(--late) 8%, var(--surface)); box-shadow: inset 0 0 0 2px var(--late); }
.md-opt.is-wrong .md-opt-key { background: var(--late); color: var(--surface); }
.md-opt-why { display: block; grid-column: 2; font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 4px; }
.md-opt-tag { display: block; grid-column: 2; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.md-opt.is-right .md-opt-tag { color: var(--good); } .md-opt.is-wrong .md-opt-tag { color: var(--late); }
.md-after { margin-top: 14px; display: grid; gap: 12px; }
.md-verdict { font: 700 20px/1.25 var(--display); }
.md-verdict.is-right { color: var(--good); } .md-verdict.is-wrong { color: var(--late); }
.md-done h2 { font: 700 24px/1.2 var(--display); margin-bottom: 6px; }

/* ------------------------------------------------------------------ toast */
.md-toast {
    position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); z-index: 60; opacity: 0; pointer-events: none;
    display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 18px; border-radius: 16px; max-width: calc(100vw - 32px);
    background: color-mix(in srgb, var(--ink) 90%, transparent); color: var(--bg); box-shadow: var(--shadow-2); font-size: 15px; font-weight: 500;
    transition: opacity .2s, transform .28s var(--ease);
}
.md-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.md-toast button { color: var(--toast-accent); font-weight: 700; padding: 4px 8px; border-radius: 8px; min-height: 40px; }
:root { --toast-accent: #AEBCF6; }
:root[data-accent="lagoon"] { --toast-accent: #72D6C8; }
:root[data-accent="clay"] { --toast-accent: #F4A585; }
:root[data-theme="dark"], :root.auto-dark { --toast-accent: #2B4491; }
:root[data-theme="dark"][data-accent="lagoon"], :root.auto-dark[data-accent="lagoon"] { --toast-accent: #095C55; }
:root[data-theme="dark"][data-accent="clay"], :root.auto-dark[data-accent="clay"] { --toast-accent: #8A3D21; }

/* ------------------------------------------------------------------ the site footer */
.md-foot { margin-top: 30px; background: var(--bar); border-top: 1px solid var(--line); color: var(--ink-2); }
.md-foot-in { max-width: var(--shell); margin: 0 auto; padding: 22px 16px calc(26px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
.md-foot-mark { font: 700 19px/1 var(--display); color: var(--ink); }
.md-foot p { font-size: 13.5px; line-height: 1.6; max-width: 46em; }
.md-foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; font-weight: 600; }
.md-foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 560px) {
    .md-hub-head h1 { font-size: 29px; }
    .md-hub-title { gap: 12px; }
    .md-hub-mark { width: 48px; height: 48px; }
    .mc-title { font-size: 26px; }
    .mc-card { padding: 16px 14px; }
    .mc-tab, .md-seg button { font-size: 13.5px; padding: 6px 4px; }
    .md-stats { grid-template-columns: repeat(2, 1fr); }
    .md-kv { grid-template-columns: 84px 1fr; }
    .md-eras li { grid-template-columns: 1fr; }
    .md-eras li span { grid-column: 1; }
    .md-menu { width: min(272px, calc(100vw - 24px)); }
    #md-fields { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
    #md-fields::-webkit-scrollbar { display: none; }
    #md-fields .md-chip { flex: 0 0 auto; }
}

/* ------------------------------------------------------------------ motion, print */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
    .md-shell { animation: none; }
}
@media print {
    body::before, .md-bar, .md-trial, .mc-tabs-container, .md-toast, .md-foot-links { display: none !important; }
    .mc-panel { display: block !important; }
    .mc-card, .md-drug { box-shadow: inset 0 0 0 1px var(--line-2); break-inside: avoid; }
}

/* ── accounts and tests, added 5 October 2026 ─────────────────────────────────────────── */
.md-bar-nav { display: flex; align-items: center; gap: 2px; margin-right: 2px; }
.md-wordmark, .md-bar-nav a { white-space: nowrap; overflow-wrap: normal; }
.md-wordmark { flex: none; }
.md-bar-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.md-bar-nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.md-bar-nav a[hidden] { display: none; }
.md-narrow { max-width: 460px; margin: 0 auto; }
.md-prose { max-width: 720px; margin: 0 auto; }
.md-prose .mc-text + .mc-text { margin-top: 10px; }
.md-page-head { margin: 6px 2px 18px; }
.md-form { display: grid; gap: 14px; }
.md-form-alt { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.md-form-alt.mc-row { display: flex; }
.md-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.md-code { font: 700 24px/1.2 var(--mono, ui-monospace, Menlo, Consolas, monospace); letter-spacing: .3em; text-align: center; }
.md-tick { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14.5px; color: var(--ink-2); }
.md-tick input { width: 20px; height: 20px; accent-color: var(--accent); }
select.mc-input { appearance: auto; }
.md-pick { display: grid; gap: 6px; margin-top: 8px; }
.md-pick-row { text-align: left; min-height: 44px; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.35; color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.md-pick-row:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--accent-line); }
.md-timer { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); }
.md-timer-clock { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }
.md-timer.is-low { box-shadow: var(--shadow-2), inset 0 0 0 2px var(--late); }
.md-timer.is-low .md-timer-clock { color: var(--late); }
.md-opt.is-chosen { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.md-opt.is-chosen .md-opt-key { background: var(--accent); color: var(--on-accent); }
.md-opt-static { cursor: default; }
.md-opt-static:hover { background: var(--surface); }
.md-opt-static.is-right:hover { background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.md-opt-static.is-wrong:hover { background: color-mix(in srgb, var(--late) 8%, var(--surface)); }
.md-waiting { color: var(--warn); font-weight: 600; }
.md-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin-top: 8px; }
.md-qnum { min-height: 44px; border-radius: 12px; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.md-qnum.is-done { color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.md-qnum.is-here { box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); }
@media (max-width: 520px) {
    /* On a phone the bar holds the name, two links and the menu. "by MEDiscuss" gives way:
       it is in the page title, the footer and the statement. */
    .md-bar-has-nav .md-wordmark span { display: none; }
    .md-bar-nav a { padding: 0 9px; font-size: 14px; }
    .md-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 343px) {
    /* The narrowest phones, once the links are showing. The icon, the name, two links and the
       menu button are 9px more than a 320px screen has, and a bar is the one row that must
       never make the page scroll sideways. The gaps give way before anything is hidden.
       Clean at every width from 301 to 600, measured on three pages, 5 October 2026. */
    .md-bar-has-nav .md-bar-in { gap: 6px; padding: 0 10px; }
    .md-bar-has-nav .md-wordmark { gap: 6px; }
}


/* ── short modules, added 7 October 2026 ──────────────────────────────────────────────── */
/* One session of about ten questions: the question, then its explanation in the place of the
   options, then a result and a one-page revision sheet. A short module has no tabs and no
   cards. Why: medha-dev/SHORT-MODULES-PLAN-2026-10-07.md. Everything else it shows is drawn
   with the classes above (md-q-stem, md-opt, mc-alert, md-hook, md-stats, mc-table). */
.md-back { font-weight: 700; }
/* A question is brought to the top of the screen, and the bar is fixed there. */
#sm-app { scroll-margin-top: calc(72px + env(safe-area-inset-top, 0px)); }
.mc-label.md-gap-top { margin-top: 16px; }
.md-steps i.is-right { background: var(--good); }
.md-steps i.is-wrong { background: var(--late); }
.md-sm-actions { display: grid; gap: 8px; margin-top: 14px; }
.md-sm-foot { margin: 0 0 14px; }
.md-sm-foot:empty { display: none; }
.md-ex { display: grid; gap: 4px; margin-top: 16px; }
.md-ex-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.md-ex-good .md-ex-head { color: var(--good); }
.md-ex-bad .md-ex-head { color: var(--late); }
.md-ex-item { display: grid; gap: 2px; }
.md-ex-item + .md-ex-item { margin-top: 10px; }
.md-ex-opt { font-size: 15.5px; line-height: 1.45; font-weight: 600; }
.md-ex-why { font-size: 15px; line-height: 1.55; }
.md-sm-links { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.md-sm-links a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; color: var(--accent-ink); }
.md-grid { display: grid; gap: 14px; }
.md-grid-name { font-size: 16px; font-weight: 700; }
.md-grid-row .md-seg { margin: 6px 0 0; }
.md-grid-row .md-seg button[aria-checked="true"],
:root[data-theme="dark"] .md-grid-row .md-seg button[aria-checked="true"], :root.auto-dark .md-grid-row .md-seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.md-points { margin: 6px 0 0; padding-left: 22px; font-size: 15px; line-height: 1.55; }
.md-points li { margin-bottom: 8px; }
.md-points .mc-badge { margin-left: 6px; }
.md-infix { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent-line); }
/* The sheet is three columns of fixed share, so that it fits a 320px phone and never scrolls sideways. */
.md-sheet { table-layout: fixed; font-size: 13.5px; }
.md-sheet th, .md-sheet td { padding: 9px 8px; overflow-wrap: break-word; }
.md-sheet thead th { white-space: normal; }
.md-sheet thead th:nth-child(1) { width: 35%; }
.md-sheet thead th:nth-child(2) { width: 27%; }
.md-sheet tbody th .mc-badge { margin-top: 4px; }
/* "Hide the answers": the cells of the sheet are covered, and a covered cell is uncovered by
   pressing it. The words stay in the page, so a screen reader still reads them. */
.md-sheet.is-veiled tbody td { color: transparent; background: var(--bg-2); cursor: pointer; }
.md-sheet.is-veiled tbody td.is-shown { color: inherit; background: transparent; cursor: default; }
@media print {
    .md-sm-actions, .md-sm-print-hide, .mc-howto, .mc-references, .md-foot { display: none !important; }
    .md-sheet.is-veiled tbody td { color: inherit; background: transparent; }
}

/* ── the hub in two sections, and the note at the head of a topic: added 7 October 2026 ──
   The modules come first and keep the card as it was. The topics, which are for later study,
   sit below them on a quieter surface. */
.md-section-note { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin: -4px 2px 12px; max-width: 40em; }
.md-packs-topics .md-pack { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.md-packs-topics .md-pack:hover { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--accent-line); }
.md-packs-topics .md-pack h3 { font-size: 19px; }
.md-topic-note .md-list { margin-top: 10px; }
.md-topic-note .md-list a { font-weight: 700; }
.md-topic-note .md-list li { margin-bottom: 5px; }
