/* ============================================================
   Metabolic Liver Academy (MLA)
   Colours: mineral white / deep pine / bile amber,
   plus a five-step fibrosis scale (F0 to F4) used as the site's signature.
   Fonts: IBM Plex Sans (English) + IBM Plex Sans Arabic (Arabic)
   ============================================================ */

:root {
  --paper: #F4F7F6;
  --white: #FFFFFF;
  --ink: #0F2B2C;
  --pine: #155E5C;
  --pine-2: #0E4645;
  --pine-tint: #E3EEEC;
  --amber: #C98E1E;
  --amber-tint: #FBF1DC;
  --muted: #526567;
  --line: #D3DEDB;
  --f0: #3E9C7B;
  --f1: #94B95A;
  --f2: #E0B43C;
  --f3: #D97B3A;
  --f4: #A3423E;
  --danger: #A3423E;
  --on-pine: #FFFFFF;   /* text on pine-coloured buttons */
  --line-strong: #B8C8C5;
  --amber-ink: #7A5410;
  --danger-tint: #F8E9E7;
  --ok-tint: #E2F2EB;
  --rec-bg: #F2F8F6;
  --rec-line: #9CC2BB;
  --foot-bg: #0F2B2C;
  --deep: #155E5C;      /* large filled panels with white text */
  --side-bg: #EEF4F2;   /* side menu */
  --deep-2: #0E4645;
  --radius-s: 6px;
  --radius-l: 14px;
  --max: 1140px;
  --read: 68ch;
  --sans: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sans-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, Tahoma, Arial, sans-serif;
}

/* ---------- Dark mode ----------
   Follows the visitor's phone or computer setting, unless they chose
   light or dark with the moon/sun button (saved as data-theme on <html>).
   Only the colour tokens change; the F0-F4 scale keeps its colours. */
:root[data-theme="dark"] {
  --paper: #0C1718;
  --white: #12211F;
  --ink: #E3EDEB;
  --pine: #5EC2B0;
  --pine-2: #8DD9CB;
  --pine-tint: #193230;
  --amber: #E2B04A;
  --amber-tint: #2E2614;
  --amber-ink: #F0CF86;
  --muted: #A3B6B4;
  --line: #27403E;
  --line-strong: #3B5A57;
  --danger: #F0908A;
  --danger-tint: #3A1F1E;
  --ok-tint: #173229;
  --rec-bg: #142927;
  --rec-line: #31564F;
  --on-pine: #0C1718;
  --foot-bg: #071011;
  --deep: #1A5A55;
  --side-bg: #0F1D1E;
  --deep-2: #20706A;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1718;
    --white: #12211F;
    --ink: #E3EDEB;
    --pine: #5EC2B0;
    --pine-2: #8DD9CB;
    --pine-tint: #193230;
    --amber: #E2B04A;
    --amber-tint: #2E2614;
    --amber-ink: #F0CF86;
    --muted: #A3B6B4;
    --line: #27403E;
    --line-strong: #3B5A57;
    --danger: #F0908A;
    --danger-tint: #3A1F1E;
    --ok-tint: #173229;
    --rec-bg: #142927;
    --rec-line: #31564F;
    --on-pine: #0C1718;
    --foot-bg: #071011;
  --deep: #1A5A55;
  --side-bg: #0F1D1E;
  --deep-2: #20706A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--sans-ar); font-size: 18px; line-height: 1.85; }

/* ---------- Language switching ----------
   Every bilingual piece of text is written twice:
   <span data-lang="en">...</span><span data-lang="ar">...</span>
   Only the active language is shown. */
html[lang="en"] [data-lang="ar"],
html[lang="ar"] [data-lang="en"] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: var(--pine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--pine-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.4; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.read { max-width: var(--read); }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: #0F2B2C; color: #fff; padding: 8px 14px; z-index: 50; border-radius: var(--radius-s); }
.skip:focus { inset-inline-start: 8px; }

/* ---------- Header and side menu ----------
   Written into every page by build.py (chrome.py); main.js adds behaviour.
   Computers: a fixed menu down the left side (right side in Arabic), like
   the SGA platform; groups open in place, and the current one starts open.
   Phones and tablets: the menu button slides the same menu in. */
:root { --bar-h: 64px; --side-w: 264px; }
html { scroll-padding-top: calc(var(--bar-h) + 12px); }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header .bar { display: flex; align-items: center; gap: 12px; height: var(--bar-h); padding-inline: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 600; font-size: 1.06rem; letter-spacing: -0.005em; }
.brand-tag { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
html[lang="ar"] .brand-name { font-size: 1.02rem; letter-spacing: 0; }
.bar-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex: none; }
.lang-btn { display: inline-block; text-decoration: none; font: inherit; font-size: 0.92rem; border: 1px solid var(--pine); color: var(--pine); background: transparent; padding: 6px 14px; border-radius: 999px; }
.lang-btn:hover { background: var(--pine); color: var(--on-pine); text-decoration: none; }
.theme-btn, .menu-btn { width: 40px; height: 40px; padding: 9px; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; flex: none; }
.menu-btn { display: none; border-radius: var(--radius-s); padding: 8px; }
.theme-btn svg, .menu-btn svg { width: 100%; height: 100%; display: block; }
.theme-btn:hover, .menu-btn:hover { background: var(--pine-tint); }
.theme-btn .i-sun { display: none; }

.site-nav { position: fixed; top: var(--bar-h); bottom: 0; inset-inline-start: 0; width: var(--side-w); overflow-y: auto; background: var(--side-bg); border-inline-end: 1px solid var(--line); padding: 14px 12px 32px; z-index: 25; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-top { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; font: inherit; font-size: 0.97rem; font-weight: 500; color: var(--ink); background: none; border: 0; border-radius: 8px; text-align: start; text-decoration: none; cursor: pointer; }
.nav-top:hover, .nav-sub a:hover { background: var(--pine-tint); color: var(--ink); text-decoration: none; }
.nav-ico { width: 20px; height: 20px; flex: none; color: var(--pine); }
.nav-chev { width: 16px; height: 16px; flex: none; margin-inline-start: auto; color: var(--muted); transition: transform .15s; }
.nav-toggle[aria-expanded="true"] .nav-chev { transform: rotate(180deg); }
.nav-item.is-active > .nav-top { color: var(--pine); font-weight: 600; }
.nav-sub { display: none; list-style: none; margin: 0; padding: 2px 0 8px; }
.nav-toggle[aria-expanded="true"] + .nav-sub { display: block; }
.nav-sub a { display: block; padding: 8px 12px; padding-inline-start: 44px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.93rem; }
.site-nav a[aria-current="page"] { background: var(--white); color: var(--pine); font-weight: 600; box-shadow: inset 3px 0 0 var(--pine); }
html[dir="rtl"] .site-nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--pine); }
.nav-close { display: none; }
.nav-shade[hidden] { display: none; }
/* page content sits beside the menu */
main, .touch-band, .site-footer { margin-inline-start: var(--side-w); }

@media (max-width: 1024px) {
  .menu-btn { display: block; }
  .site-header .bar { padding-inline: 12px; }
  main, .touch-band, .site-footer { margin-inline-start: 0; }
  .site-nav { top: 0; width: min(320px, 86vw); padding: 16px 12px 32px; z-index: 40; transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  html[dir="rtl"] .site-nav { transform: translateX(105%); }
  body.nav-open .site-nav { transform: none; visibility: visible; box-shadow: 0 8px 30px rgba(15, 43, 44, .2); }
  .nav-shade { position: fixed; inset: 0; background: rgba(15, 43, 44, .4); z-index: 35; }
  .nav-close { display: block; width: 40px; height: 40px; padding: 9px; margin-block-end: 8px; margin-inline: auto 0; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; }
  .nav-close svg { width: 100%; height: 100%; display: block; }
}
@media (max-width: 480px) { .brand-tag { display: none; } .site-header .bar { gap: 8px; padding-inline: 10px; } .lang-btn { padding: 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .site-nav, .nav-chev { transition: none; } }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section.tint { background: var(--white); }
.page-head { padding: 56px 0 36px; background: var(--white); border-bottom: 1px solid var(--line); }
.page-head p { max-width: 60ch; color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---------- Hero ---------- */
.hero { background: var(--white); padding: 56px 0 0; border-bottom: 1px solid var(--line); }
.hero h1 { max-width: 17ch; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 40px; max-width: 760px; }
.door { display: block; text-decoration: none; padding: 20px 22px; border-radius: var(--radius-l); border: 1.5px solid var(--pine); color: var(--ink); background: var(--white); }
.door strong { display: block; font-size: 1.25rem; color: var(--pine); }
.door > span { display: block; color: var(--muted); font-size: 0.95rem; }
.door strong span { font-size: inherit; color: inherit; }
.door.primary { background: var(--deep); border-color: var(--deep); }
.door.primary strong, .door.primary > span { color: #fff; }
.door:hover { border-color: var(--pine-2); color: var(--ink); }
.door.primary:hover { background: var(--deep-2); border-color: var(--deep-2); }
@media (max-width: 560px) { .doors { grid-template-columns: 1fr; } }

/* ---------- The fibrosis scale (signature element) ---------- */
.scale-block { padding: 8px 0 40px; }
.scale-title { font-size: 0.95rem; color: var(--muted); margin: 0 0 10px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.scale > div { padding: 12px 12px 10px; color: #fff; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.scale > div:first-child { border-start-start-radius: var(--radius-l); border-end-start-radius: var(--radius-l); }
.scale > div:last-child { border-start-end-radius: var(--radius-l); border-end-end-radius: var(--radius-l); }
.scale b { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.scale span { font-size: 0.88rem; line-height: 1.3; }
.s0 { background: #2E7D61; } /* darker than --f0 so white text passes WCAG AA (4.97:1) */ .s1 { background: var(--f1); color: #0F2B2C !important; } .s2 { background: var(--f2); color: #0F2B2C !important; }
.s3 { background: #B05A23; } /* darker than --f3 for AA contrast (4.85:1) */ .s4 { background: var(--f4); }
.scale-window { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 8px; font-size: 0.9rem; }
.scale-window .catch { grid-column: 1 / span 3; border-top: 2px solid var(--pine); padding-top: 6px; color: var(--pine); font-weight: 600; }
@media (max-width: 560px) {
  .scale > div { min-height: 70px; padding: 8px; }
  .scale span { font-size: 0.74rem; }
  .scale b { font-size: 1.15rem; }
}

/* ---------- Generic blocks ---------- */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 24px; }
.panel h3 { margin-bottom: 0.35em; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
a.panel { display: block; text-decoration: none; color: var(--ink); }
a.panel:hover { border-color: var(--pine); }
a.panel h3 { color: var(--pine); }
.tag { display: inline-block; font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; background: var(--pine-tint); color: var(--pine-2); margin-bottom: 8px; }
.tag.soon { background: var(--amber-tint); color: var(--amber-ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.ticks { padding-inline-start: 1.2em; }
ul.ticks li { margin-bottom: 0.35em; }

/* ---------- Journey (a true sequence, so it is numbered) ---------- */
.journey { list-style: none; padding: 0; margin: 0; counter-reset: step; max-width: 760px; }
.journey li { position: relative; padding-inline-start: 64px; padding-bottom: 28px; counter-increment: step; }
.journey li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--pine); color: var(--on-pine); display: grid; place-items: center; font-weight: 600; }
.journey li::after { content: ""; position: absolute; inset-inline-start: 20px; top: 46px; bottom: 4px; width: 2px; background: var(--line); }
.journey li:last-child::after { display: none; }
.journey h3 { margin: 6px 0 4px; }

/* ---------- Forms, tools ---------- */
.tool { background: var(--white); border: 1.5px solid var(--pine); border-radius: var(--radius-l); padding: 26px; max-width: 760px; }
.tool h3 { color: var(--pine); }
.consent { background: var(--amber-tint); border-radius: var(--radius-s); padding: 14px 16px; margin: 14px 0 18px; }
.consent label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.consent input { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: var(--pine); }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset[disabled] { opacity: 0.45; }
.q { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.q p { margin: 0; flex: 1 1 280px; }
.yn { display: flex; gap: 6px; }
.yn label { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.yn input { position: absolute; opacity: 0; pointer-events: none; }
.yn input:checked + span { font-weight: 600; color: var(--pine); }
.yn label:has(input:checked) { border-color: var(--pine); background: var(--pine-tint); }
.yn label:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 680px) { .fields { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: 0.92rem; font-weight: 500; margin-bottom: 4px; }
.field input, .field select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--white); color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--pine); outline: 2px solid var(--pine-tint); }
.field small { color: var(--muted); font-size: 0.8rem; }
.btn { font: inherit; font-weight: 600; background: var(--pine); color: var(--on-pine); border: 0; border-radius: 999px; padding: 11px 24px; cursor: pointer; margin-top: 18px; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--pine-2); color: var(--on-pine); }
.btn.ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--pine); }
.btn.ghost:hover { background: var(--pine-tint); color: var(--pine-2); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.result { margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-s); border-inline-start: 5px solid var(--pine); background: var(--pine-tint); }
.result[hidden] { display: none; }
.result.low { border-color: var(--f0); }
.result.mid { border-color: var(--f2); background: var(--amber-tint); }
.result.high { border-color: var(--f4); background: var(--danger-tint); }
.result .score { font-size: 2rem; font-weight: 600; line-height: 1; }
.result p { margin: 6px 0 0; }
.error { color: var(--danger); font-weight: 500; }
.fine { font-size: 0.85rem; color: var(--muted); margin-top: 14px; }

/* ---------- Urgent box ---------- */
.urgent { border: 2px solid var(--danger); background: var(--danger-tint); border-radius: var(--radius-l); padding: 22px 24px; }
.urgent h3 { color: var(--danger); }

/* ---------- News ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button { font: inherit; font-size: 0.95rem; border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.post { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.post time { color: var(--muted); font-size: 0.92rem; }
.post h3 { margin: 4px 0 6px; }
.post p { margin: 0 0 6px; max-width: 70ch; }
.post .when-extra { display: block; color: var(--pine-2); font-size: 0.9rem; }
@media (max-width: 560px) { .post { grid-template-columns: 1fr; gap: 4px; } }
.empty { padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius-l); color: var(--muted); }

/* ---------- Videos ---------- */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.video { text-decoration: none; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; display: flex; flex-direction: column; }
.video:hover { border-color: var(--pine); color: var(--ink); }
.video-thumb { aspect-ratio: 16 / 9; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; color: var(--pine); background: linear-gradient(90deg, #3E9C7B22 0 20%, #94B95A22 20% 40%, #E0B43C22 40% 60%, #D97B3A22 60% 80%, #A3423E22 80%), var(--pine-tint); }
.video:hover .video-thumb { color: var(--pine-2); }
.video-thumb em { position: absolute; bottom: 8px; inset-inline-end: 10px; font-style: normal; font-size: 0.8rem; background: #0F2B2C; color: #fff; padding: 1px 7px; border-radius: 6px; }
button.video-play { border: 0; padding: 0; font: inherit; cursor: pointer; }
button.video-play:hover svg circle { fill: var(--pine-2); }
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.video div { padding: 12px 14px; }
.video strong { display: block; font-weight: 500; line-height: 1.5; }
.video small { color: var(--muted); }

/* ---------- Founder ---------- */
.founder { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
.founder img { border-radius: var(--radius-l); width: 240px; height: 240px; object-fit: cover; }
.founder .role { font-size: 1.1rem; color: var(--pine); font-weight: 600; margin: 0; }
.founder .sub { color: var(--muted); margin: 0 0 16px; }
.founder-mini { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; max-width: 760px; }
.founder-mini img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
@media (max-width: 680px) { .founder { grid-template-columns: 1fr; } .founder img { width: 180px; height: 180px; } }
.links { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 0; list-style: none; margin: 14px 0 0; }
.pubs { padding-inline-start: 1.2em; }
.pubs li { margin-bottom: 12px; max-width: 75ch; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--white); font-size: 0.95rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--pine-tint); font-weight: 600; }

/* ---------- Legal ---------- */
.legal h2 { margin-top: 1.6em; font-size: 1.5rem; }
.legal h2:first-child { margin-top: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--foot-bg); color: #D7E4E2; padding: 52px 0 28px; }
.site-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, .4); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.foot-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.foot-brand .brand-mark { width: 28px; height: 28px; }
.foot-h { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #A9BDBA; margin: 4px 0 12px; }
html[lang="ar"] .foot-h { letter-spacing: 0; font-size: 0.9rem; }
.site-footer .note { font-size: 0.88rem; color: #A9BDBA; max-width: 52ch; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .bottom { border-top: 1px solid #2A4748; margin-top: 32px; padding-top: 16px; font-size: 0.85rem; color: #A9BDBA; }

/* Reading-width blocks stay aligned with the page edge */
.wrap.read { max-width: none; }
.wrap.read > * { max-width: var(--read); }

/* ---------- Patient Q&A ---------- */
.crumbs { color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.shortbox { background: var(--pine-tint); border-radius: var(--radius-l); padding: 18px 22px; margin-bottom: 24px; font-size: 1.08rem; }
.shortbox p { margin: 0; }
.shortbox p + p { margin-top: 4px; }
.h-small { font-size: 1.25rem; margin-top: 1.6em; }
.qgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 40px; }
@media (max-width: 760px) { .qgrid { grid-template-columns: 1fr; } }
.qcat .h-small { margin-top: 1em; }
.qlist { list-style: none; padding: 0; margin: 0; }
.qlist li { border-bottom: 1px solid var(--line); }
.qlist a { display: block; padding: 10px 0; text-decoration: none; }
.qlist a:hover { text-decoration: underline; }
.searchbox { max-width: 520px; margin-bottom: 8px; }
[hidden] { display: none !important; }

/* Doctors' reference library */
.tag.pro { background: var(--amber-tint); color: var(--amber-ink); margin: 4px 0 0; }
.shortbox ul.ticks { margin: 8px 0 0; font-size: 1rem; }
.wrap.read > .table-wrap { max-width: 980px; margin: 12px 0 8px; }
.ref-table th[scope="row"] { font-weight: 600; white-space: normal; min-width: 7em; }
.ref-table td, .ref-table th { vertical-align: top; }

/* Page record (governance) */
.record { margin-top: 28px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--white); }
.record .h-small { margin-top: 0; }
.record dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 10px; }
.record dt { color: var(--muted); }
.record dd { margin: 0; }
.record p { margin: 0; }

/* Institution */
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 600; color: var(--pine); margin: 0 0 4px; }
.about-band { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.panel.region { text-decoration: none; color: var(--ink); }
.panel.region .big-num { font-size: 2.4rem; font-weight: 600; color: var(--pine); margin: 6px 0 0; line-height: 1.1; }
.panel.region .muted { margin: 0 0 8px; }
.panel.join { margin-top: 14px; border-color: var(--amber); }
@media (max-width: 780px) { .about-band { grid-template-columns: 1fr; } }
.unit-row { display: flex; gap: 6px; }
.unit-row select { width: auto; flex: none; }

/* ============================================================
   Teaching modules: textbook-chapter layout
   Serif text (Source Serif 4 / Noto Naskh Arabic), contents rail,
   margin notes, graded recommendation boxes.
   ============================================================ */
.mod-head { background: var(--white); border-bottom: 1px solid var(--line); padding: 36px 0 28px; }
.mod-head h1, .mod-body h2, .mod-body h3, .case h3 {
  font-family: "Source Serif 4", "Noto Naskh Arabic", Georgia, serif; font-weight: 600; letter-spacing: -0.005em; }
[dir="rtl"] .mod-body h2, [dir="rtl"] .mod-body h3 { font-family: "Noto Naskh Arabic", "Source Serif 4", serif; letter-spacing: 0; }
/* Arabic module title and subtitle use the site's Arabic sans (already loaded),
   so the first screen does not wait for, or jump to, the serif font */
[dir="rtl"] .mod-head h1 { font-family: var(--sans-ar); letter-spacing: 0; line-height: 1.35; }
.mod-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); line-height: 1.12; margin: 4px 0 10px; max-width: 22ch; }
.mod-no { margin: 14px 0 0; color: var(--pine); font-weight: 600; }
.mod-sub { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-size: 1.2rem; color: var(--muted); max-width: 56ch; margin: 0 0 22px; }
[dir="rtl"] .mod-sub { font-family: var(--sans-ar); font-style: normal; }
.mod-meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.mod-meta div { max-width: 34ch; }
.mod-meta dt { color: var(--muted); font-size: 0.8rem; }
.mod-meta dd { margin: 0; }

.mod-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 56px; }
.mod-toc { position: sticky; top: 92px; align-self: start; font-size: 0.88rem; }
.mod-toc .toc-title { font-weight: 600; margin: 0 0 8px; }
.mod-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; border-inline-start: 2px solid var(--line); }
.mod-toc li { counter-increment: toc; }
.mod-toc li:last-child { counter-increment: none; }
.mod-toc a { display: block; padding: 5px 0 5px 14px; color: var(--muted); text-decoration: none; margin-inline-start: -2px; border-inline-start: 2px solid transparent; }
[dir="rtl"] .mod-toc a { padding: 5px 14px 5px 0; }
.mod-toc li:not(:last-child) a::before { content: counter(toc) ". "; }
.mod-toc a:hover, .mod-toc a.on { color: var(--pine); border-inline-start-color: var(--pine); }

.mod-body { max-width: 66ch; font-family: "Source Serif 4", Georgia, serif; font-size: 1.12rem; line-height: 1.72; }
[dir="rtl"] .mod-body { font-family: "Noto Naskh Arabic", "Source Serif 4", serif; font-size: 1.15rem; line-height: 1.95; }
.mod-body .small, .mod-body .fine, .mod-body table, .mod-body .rec-tags, .mod-body figcaption, .mod-body .muted, .mod-body .record,
.mod-body .mcq .opt, .mod-body .cite-box, .mod-body .refs { font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }
[dir="rtl"] .mod-body .small, [dir="rtl"] .mod-body table, [dir="rtl"] .mod-body .rec-tags, [dir="rtl"] .mod-body figcaption, [dir="rtl"] .mod-body .mcq .opt { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif; }
.mod-body h2 { font-size: 1.6rem; margin: 2.2em 0 0.6em; display: flex; gap: 0.5em; align-items: baseline; scroll-margin-top: 90px; }
.mod-body h2 .num { color: var(--pine); font-size: 0.85em; }
.mod-body h2.h-small { font-size: 1.15rem; margin: 0 0 0.4em; display: block; }
.mod-body p { margin: 0 0 1em; }
.cite { font-family: "IBM Plex Sans", sans-serif; font-size: 0.68em; line-height: 0; }
.cite a { text-decoration: none; }

.objectives { background: var(--white); border: 1px solid var(--line); border-inline-start: 4px solid var(--pine); border-radius: 6px; padding: 18px 22px 8px; }
.objectives ol { margin: 0 0 12px; padding-inline-start: 1.3em; }
.objectives .small { color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

/* margin notes: in the margin on wide screens, inline on small ones */
.sidenote { font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; font-size: 0.86rem; line-height: 1.55; color: var(--ink);
  background: var(--amber-tint); border-radius: 6px; padding: 12px 14px; margin: 0 0 1em; }
@media (min-width: 1504px) {  /* 1240px of page + the 264px side menu */
  .mod-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .mod-body { position: relative; }
  .sidenote { float: right; clear: right; width: 230px; margin-right: -270px; margin-top: 4px; background: none; padding: 0 0 0 14px; border-left: 3px solid #E0B43C; border-radius: 0; color: var(--muted); }
  [dir="rtl"] .sidenote { float: left; clear: left; margin-right: 0; margin-left: -270px; padding: 0 14px 0 0; border-left: 0; border-right: 3px solid #E0B43C; }
}

/* graded recommendation */
.rec { border: 1px solid var(--rec-line); background: var(--rec-bg); border-radius: 6px; padding: 12px 16px 4px; margin: 0 0 1em; }
.rec-tags { margin: 0 0 6px; font-size: 0.78rem; }
.rec-tags a { text-decoration: none; color: var(--pine-2); display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rec-tags > a > span { border: 1px solid var(--rec-line); border-radius: 4px; padding: 1px 7px; background: var(--white); }
.rec-tags .g-loe { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.rec-text { margin: 0 0 8px !important; }

.mod-body .table-wrap { margin: 1.4em 0; }
.mod-body caption { caption-side: top; text-align: start; font-weight: 600; padding: 0 0 8px; font-size: 0.92rem; }
.mod-body table { font-size: 0.9rem; line-height: 1.5; }

.fig { margin: 1.6em 0; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.fig-svg { width: 100%; height: auto; display: block; font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; }
.fig figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 10px; }

.case { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 18px 22px; }
.case h3 { margin: 0 0 12px; font-size: 1.25rem; }
.case dl { margin: 0; display: grid; grid-template-columns: 9.5em 1fr; gap: 10px 18px; }
.case dt { font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; font-weight: 600; font-size: 0.85rem; color: var(--pine); padding-top: 3px; }
.case dd { margin: 0; }
@media (max-width: 640px) { .case dl { grid-template-columns: 1fr; } .case dd { margin-bottom: 8px; } }

.mcq { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.mcq .q { display: block; padding: 0; border: 0; margin: 0 0 10px; font-weight: 600; }
.mcq .qn { color: var(--pine); }
.mcq .opts { display: grid; gap: 8px; }
.mcq .opt { text-align: start; font-size: 0.95rem; padding: 9px 12px; background: var(--white); border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; color: var(--ink); }
.mcq .opt:hover { border-color: var(--pine); }
.mcq .opt:focus-visible { outline: 3px solid var(--pine-tint); border-color: var(--pine); }
.mcq .opt.right { border-color: #3E9C7B; background: var(--ok-tint); }
.mcq .opt.wrong { border-color: #A3423E; background: var(--danger-tint); }
.mcq .why { margin: 10px 0 0; font-size: 0.98rem; padding: 10px 14px; background: var(--pine-tint); border-radius: 6px; }

.refs li { margin-bottom: 6px; scroll-margin-top: 90px; }
.refs li:target { background: var(--amber-tint); }
.cite-box { margin: 28px 0 8px; padding: 14px 18px; border: 1px dashed var(--rec-line); border-radius: 6px; font-size: 0.9rem; }
.cite-box p { margin: 0; word-break: break-word; }

@media (max-width: 960px) {
  .mod-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .mod-toc { position: static; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
}
@media print {
  .site-header, .site-footer, .site-nav, .nav-shade, .skip, .mod-toc, .mcq .opts { display: none !important; }
  .mod-layout { display: block; } .sidenote { float: none; margin: 0 0 1em; width: auto; }
}
.module-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.module-list li { border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; background: var(--white); display: grid; gap: 4px; color: var(--muted); }
.module-list li strong { font-family: "Source Serif 4", "Noto Naskh Arabic", Georgia, serif; font-weight: 600; font-size: 1.12rem; }
.module-list li.ready { border-color: var(--pine); border-inline-start-width: 4px; }
.module-list li.ready a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.module-list li.ready a:hover strong { color: var(--pine); text-decoration: underline; }
.modules-panel { border-color: var(--pine); border-inline-start-width: 4px; }
.modules-panel li { padding: 4px 0; font-family: "Source Serif 4", "Noto Naskh Arabic", Georgia, serif; font-size: 1.08rem; }

/* ---------- Publication Radar ---------- */
.radar-head { background: linear-gradient(160deg, var(--white) 55%, var(--pine-tint)); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; color: var(--pine); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin: 0 0 14px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--f0); box-shadow: 0 0 0 0 rgba(62,156,123,.55); animation: radar-pulse 2s infinite; }
@keyframes radar-pulse { 70% { box-shadow: 0 0 0 9px rgba(62,156,123,0); } 100% { box-shadow: 0 0 0 0 rgba(62,156,123,0); } }
.radar-stamp { margin-top: 14px !important; font-size: 0.95rem !important; color: var(--pine-2) !important; font-weight: 500; }
.radar-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
@media (max-width: 880px) { .radar-picks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .radar-picks { grid-template-columns: 1fr; } }
.radar-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.radar-tabs button { font: inherit; font-weight: 600; background: none; border: 0; padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.radar-tabs button[aria-selected="true"] { color: var(--pine); border-bottom-color: var(--pine); }
.radar-tabs em { font-style: normal; font-weight: 400; font-size: 0.85rem; }
.radar-controls .filters { margin-bottom: 14px; }
.radar-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.radar-fields .field > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 760px) { .radar-fields { grid-template-columns: 1fr; } }
.radar-count { color: var(--muted); font-size: 0.92rem; margin: 10px 0 6px; }
.radar-list { display: grid; gap: 12px; }
.paper { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; transition: border-color .2s, box-shadow .2s, transform .2s; text-align: left; }
.paper:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(15,43,44,.07); transform: translateY(-1px); }
.paper-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.paper time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.paper h3 { font-size: 1.05rem; line-height: 1.4; margin: 0 0 6px; font-family: var(--sans); }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--pine); text-decoration: underline; }
.paper-meta { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.paper-meta strong { color: var(--ink); font-weight: 500; font-style: italic; }
.paper-links { margin: 6px 0 0; font-size: 0.88rem; }
.paper.compact { display: flex; flex-direction: column; }
.paper.compact h3 { font-size: 0.98rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { font-size: 0.76rem; padding: 2px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.chip.c-place { background: var(--amber-tint); border-color: transparent; color: var(--amber-ink); }
.ptype { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--muted); }
/* Paper-type labels: every colour gives white text at least 4.5:1 contrast (WCAG AA) */
.t-guide { background: var(--f4); }
.t-meta { background: #155E5C; }
.t-rct { background: #2E7D61; }
.t-trial { background: #3D7259; }
.t-review { background: #B05A23; }
.t-obs { background: #45606A; }
.t-res { background: #5F6F71; } /* AA contrast with white (5.25:1) */
.radar-more { text-align: center; margin: 8px 0 0; }
.note-box { margin-top: 28px; padding: 14px 16px; border-radius: var(--radius-l); background: var(--paper); border: 1px solid var(--line); color: var(--muted); }

/* ---------- Calculator hub ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 32px; }
.calc-card { display: flex; flex-direction: column; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; text-decoration: none; color: var(--ink); }
.calc-card:hover { border-color: var(--pine); color: var(--ink); box-shadow: 0 2px 10px rgba(15, 43, 44, .08); }
.calc-card .tag { align-self: flex-start; margin: 0; }
.calc-card strong { font-size: 1.05rem; color: var(--pine); }
.calc-src { font-size: 0.78rem; color: var(--muted); margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); direction: ltr; text-align: start; }
.calc-card[hidden], .calc-tool[hidden] { display: none; }
.calc-tool { margin-top: 28px; scroll-margin-top: 80px; }
.calc-tool .tool { max-width: 860px; }
.calc-tool h3 { margin: 6px 0 2px; }
.calc-notes { margin: 10px 0 0; padding-inline-start: 20px; font-size: 0.92rem; }
.result h4 { margin: 8px 0 0; font-size: 1.05rem; }

/* ---------- Q&A cards + share ---------- */
.qgrid.cards { display: block; }
.qgrid.cards .qcat { margin-bottom: 36px; }
.qcat .count { font-size: 0.8rem; font-weight: 500; color: var(--muted); background: var(--pine-tint); border-radius: 999px; padding: 1px 9px; vertical-align: middle; }
.qcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.qcard { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: visible; position: relative; }
.qcard[hidden], .qcat[hidden] { display: none; }
.qcard:hover { border-color: var(--pine); box-shadow: 0 2px 10px rgba(15, 43, 44, .08); }
.qcard-link { display: block; padding: 16px 18px 8px; text-decoration: none; color: var(--ink); flex: 1; }
.qcard-link:hover { color: var(--ink); }
.qcard .tag { margin: 0 0 8px; }
.qcard h3 { font-size: 1.05rem; color: var(--pine); margin: 0 0 6px; line-height: 1.35; }
.qcard p { font-size: 0.92rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 10px 18px; border-top: 1px solid var(--line); position: relative; }
html[dir="rtl"] .qcard-foot { padding: 8px 18px 10px 12px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.85rem; color: var(--pine); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.share-btn:hover { background: var(--pine-tint); }
.share-btn svg { width: 15px; height: 15px; }
.qmeta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
.share-pop { position: absolute; z-index: 15; inset-inline-end: 8px; top: calc(100% + 4px); display: flex; flex-direction: column; min-width: 160px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 43, 44, .15); padding: 6px; }
.qmeta .share-pop { inset-inline-end: auto; inset-inline-start: 0; }
.share-pop a, .share-pop button { font: inherit; font-size: 0.92rem; text-align: start; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; }
.share-pop a:hover, .share-pop button:hover { background: var(--pine-tint); }

/* ---------- Home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--pine); background: var(--white); color: var(--ink); }
.tile-n { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--pine); font-variant-numeric: tabular-nums; }
.tile-live { color: #3E9C7B; font-size: 1.6rem; line-height: 1.4; }
.tile-l { font-weight: 600; margin-top: 6px; }
.tile-s { font-size: 0.86rem; color: var(--muted); }

/* ---------- Install app ---------- */
.side-install { margin: 18px 4px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.side-install[hidden] { display: none; }
.install-btn { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; font-weight: 600; font-size: 0.95rem; color: var(--on-pine); background: var(--pine); border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.install-btn:hover { background: var(--pine-2); }
.install-btn svg { width: 18px; height: 18px; }
.install-tip { font-size: 0.85rem; color: var(--muted); margin: 8px 6px 0; }
.install-tip[hidden] { display: none; }

/* Text for screen readers only (keeps heading order correct without changing the look) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Wide tables can be scrolled with the keyboard (they get tabindex="0" at build time) */
.table-wrap:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }

/* ---------- Meet the Expert ---------- */
.expert-filters { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.expert-filters .filters { margin-bottom: 12px; }
.expert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 8px; }
.expert-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.expert-card:hover { border-color: var(--pine); color: var(--ink); text-decoration: none; box-shadow: 0 2px 10px rgba(15, 43, 44, .08); }
.expert-card.is-sample { border-style: dashed; }
.ex-photo { flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--pine-tint); color: var(--pine); font-weight: 600; font-size: 1.4rem; }
.ex-photo.big { width: 128px; height: 128px; font-size: 2.4rem; }
.ex-photo img { width: 100%; height: 100%; object-fit: cover; }
.ex-photo svg { width: 70%; height: 70%; }
.ex-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-name { font-size: 1.08rem; }
.ex-title { color: var(--muted); font-size: 0.92rem; }
.ex-topic { font-size: 0.95rem; margin-top: 4px; }
.ex-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.c-aud { background: var(--pine-tint); border-color: transparent; color: var(--pine); }
.sample-badge { align-self: flex-start; font-size: 0.74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--amber-tint); color: var(--amber-ink); margin-bottom: 4px; }
.sample-note { padding: 10px 14px; border-radius: var(--radius-s); background: var(--amber-tint); color: var(--amber-ink); font-weight: 500; max-width: none; margin: 0 0 18px; }
.expert-hero { display: flex; gap: 24px; align-items: center; }
.expert-hero h1 { margin-bottom: 0.15em; }
.expert-hero .ex-title { margin: 0; font-size: 1.05rem; }
@media (max-width: 560px) { .expert-hero { flex-direction: column; align-items: flex-start; gap: 14px; } .ex-photo.big { width: 96px; height: 96px; font-size: 1.8rem; } }
.expert-video { margin: 8px 0 0; max-width: 760px; }
.takeaways { margin: 28px 0; padding: 18px 22px; border-radius: var(--radius-l); background: var(--pine-tint); }
.takeaways .h-small { margin-top: 0; }
.expert-qa dt { font-weight: 600; margin-top: 18px; }
.expert-qa dd { margin: 4px 0 0; }
.transcript { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--white); }
.transcript summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.transcript .tr-text { padding: 0 16px 16px; }

/* Home: upcoming expert sessions */
.session-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.session-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-inline-start: 4px solid var(--pine); border-radius: var(--radius-l); background: var(--white); color: var(--ink); text-decoration: none; }
.session-card:hover { border-color: var(--pine); color: var(--ink); }
.session-card time { color: var(--pine); font-weight: 600; font-size: 0.92rem; }

/* Contact */
.contact-card { text-decoration: none; color: var(--ink); }
.contact-card:hover { border-color: var(--pine); color: var(--ink); text-decoration: none; }
.contact-card .h-small { margin-top: 0; }
.contact-value { font-size: 1.1rem; font-weight: 600; color: var(--pine); margin: 0 0 6px; overflow-wrap: anywhere; }
.contact-warning { margin-top: 24px; }
.contact-warning .h-small { margin-top: 0; }

/* Lists filled in by a script (experts, videos, talks, Radar): keep their
   space while they load, so the rest of the page does not jump. */
#ex-grid:empty, [data-videos]:empty, [data-news]:empty, #radar-picks:empty, #radar-list:empty { min-height: 100vh; }
#calc-hub { min-height: 100vh; }
[data-expert-sessions]:empty { min-height: 120px; }
[data-talks]:empty { min-height: 240px; }

/* ---------- Stay in touch (above the footer on every page) ---------- */
.touch-band { background: var(--pine-tint); border-top: 1px solid var(--line); padding: 36px 0; }
.touch-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
.touch-h { font-size: 1.4rem; margin: 0 0 4px; }
.touch-band p { margin: 0; color: var(--muted); max-width: 58ch; }
.touch-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.touch-actions .btn { margin-top: 0; }
.touch-band .btn.ghost { background: var(--white); }
@media print { .touch-band { display: none !important; } }
