/* =====================================================================
   MedTestBank 3D Anatomy (anatomy.medtestbank.com)
   Clinical but warm: linen-gray paper, scrub teal, arterial red for alerts,
   a study highlighter for exam tips, and a deep stage for the 3D model.
   ===================================================================== */
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #e9efee;
  --ink: #10212a;
  --ink-2: #2b3f48;
  --muted: #566a72;
  --line: #d5dfe0;
  --line-2: #bfcdcf;
  --scrub: #0e6b67;
  --scrub-2: #0a5450;
  --scrub-soft: #d8ece9;
  --pulse: #c23a30;
  --pulse-soft: #f8e3e0;
  --ok: #157046;
  --ok-soft: #dcf1e5;
  --mark: #ffe680;
  --stage: #0f1d25;
  --stage-2: #172d38;
  --stage-3: #20404d;
  --stage-ink: #e6f0f1;
  --stage-muted: #9fb4ba;
  --f-display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --r-s: 9px;
  --wrap: 1220px;
  --gutter: 20px;
  --shadow: 0 1px 2px rgba(16, 33, 42, .06), 0 10px 30px -14px rgba(16, 33, 42, .25);
  --head-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--scrub); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--scrub-2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #4fb3ad; outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; letter-spacing: -.018em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -.032em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
mark { background: linear-gradient(transparent 8%, var(--mark) 8%, var(--mark) 92%, transparent 92%); color: inherit; padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn-primary { background: var(--scrub); color: #fff; }
.btn-primary:hover { background: var(--scrub-2); color: #fff; }
.btn-ghost { border-color: var(--line-2); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-light { background: var(--stage-ink); color: var(--stage); }
.btn-light:hover { background: #fff; color: var(--stage); }
.btn-ghost-light { border-color: rgba(230, 240, 241, .35); color: var(--stage-ink); }
.btn-ghost-light:hover { border-color: var(--stage-ink); color: #fff; }
.btn-shop { background: var(--ink); color: #fff; }
.btn-shop:hover { background: #000; color: #fff; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; color: var(--scrub); font-weight: 700; cursor: pointer; text-decoration: none; font-size: .95rem; }
.link-btn:hover { color: var(--scrub-2); text-decoration: underline; }
.link-btn .ico { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- bandeau MedTestBank.com ---------- */
.strip { background: #0b161c; color: #c9d8db; font-size: .86rem; line-height: 1.4; }
.strip-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.strip a { color: #fff; text-decoration: none; }
.strip a:hover { text-decoration: underline; color: #fff; }
.strip-cta { flex: none; font-weight: 700; color: #9fd8d3 !important; text-decoration: underline !important; text-underline-offset: .2em; }
.hero-link { color: #9fd8d3; font-weight: 700; }
.hero-link:hover { color: #fff; }
.foot-brand p a, .credit a { font-weight: 700; }

/* ---------- en-tête ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--head-h); background: rgba(242, 245, 244, .9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo-mark { width: 34px; height: 34px; }
.logo-bg { fill: var(--scrub); }
.logo-fg { fill: #f4fbfa; }
.logo-line { stroke: var(--scrub); stroke-width: 1.4; }
.brand-text { display: grid; line-height: 1.05; }
.brand-text b { font-family: var(--f-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-text small { font-size: .74rem; color: var(--muted); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--scrub); }
.nav .nav-shop { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; border: 1.5px solid var(--line-2); border-radius: 999px; }
.nav .nav-shop .ico { width: 18px; height: 18px; }
.nav-toggle { display: none; margin-left: auto; }
.top-dark { background: rgba(15, 29, 37, .88); border-bottom-color: rgba(255, 255, 255, .08); }
.top-dark .brand, .top-dark .nav a { color: var(--stage-ink); }
.top-dark .brand-text small { color: var(--stage-muted); }
.top-dark .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.top-dark .nav .nav-shop { border-color: rgba(230, 240, 241, .3); }
.top-dark .logo-bg { fill: #e6f0f1; }
.top-dark .logo-fg { fill: var(--stage); }
.top-dark .logo-line { stroke: #e6f0f1; }
.top-dark .nav-toggle { background: transparent; border-color: rgba(255, 255, 255, .2); color: var(--stage-ink); }

/* ---------- accueil ---------- */
.hero { background: radial-gradient(120% 90% at 78% 35%, var(--stage-3) 0%, var(--stage-2) 38%, var(--stage) 75%); color: var(--stage-ink); margin-top: calc(var(--head-h) * -1); padding-top: var(--head-h); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; min-height: min(760px, calc(100vh - 10px)); padding-top: 28px; padding-bottom: 36px; }
.hero h1 { color: #fff; max-width: 13ch; }
.hero-sub { color: var(--stage-muted); font-size: 1.12rem; max-width: 52ch; }
.hero-search { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 6px 6px 16px; margin: 26px 0 16px; max-width: 560px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); }
.hero-search .ico { color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 1rem; background: transparent; padding: 10px 0; color: var(--ink); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; z-index: 5; max-height: 320px; overflow: auto; }
.suggest a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--surface-2); }
.suggest small { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 34px 0 0; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { color: var(--stage-muted); font-size: .9rem; }
.hero-stats dd { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }

.section { padding: 72px 0; }
.section-head { max-width: 760px; margin-bottom: 30px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.sys-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.sys-list > li { border-bottom: 1px solid var(--line); }
.sys-list > li > a { display: grid; grid-template-columns: 12px 1fr; grid-template-areas: "bar name" "bar tag" "bar meta"; column-gap: 16px; padding: 18px 4px; text-decoration: none; color: var(--ink); }
.sys-list > li > a::before { content: ""; grid-area: bar; border-radius: 4px; background: var(--sys); }
.sys-list > li > a:hover .sys-name { color: var(--scrub); }
.sys-name { grid-area: name; font-family: var(--f-display); font-weight: 750; font-size: 1.2rem; letter-spacing: -.015em; }
.sys-tag { grid-area: tag; color: var(--muted); font-size: .97rem; }
.sys-meta { grid-area: meta; display: flex; gap: 14px; font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.sys-list-page { grid-template-columns: 1fr; }
.sys-sub { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -6px 0 16px 32px; padding: 0; font-size: .92rem; }

.studies-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.study-row { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; }
.study-row li { scroll-snap-align: start; }
.study-row a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border-radius: var(--r); background: var(--stage); color: var(--stage-ink); text-decoration: none; transition: transform .15s; }
.study-row a:hover { transform: translateY(-2px); color: #fff; }
.study-row b { font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -.01em; }
.study-row span { color: var(--stage-muted); font-size: .92rem; }
.study-row em { margin-top: auto; font-style: normal; font-size: .85rem; color: #9fd8d3; }
.study-grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); overflow: visible; }

.how-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: 40px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.how-steps li { counter-increment: s; border-top: 3px solid var(--ink); padding-top: 14px; }
.how-steps h3::before { content: counter(s) " "; color: var(--scrub); }
.how-steps p { color: var(--ink-2); }

.shop-band { padding: 56px 0; }
.shop-in { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; background: var(--scrub-soft); border-radius: 22px; padding: 34px; }
.shop-in h2 { margin-bottom: .3em; }
.shop-in p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- visionneuse intégrée ---------- */
.viewer { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: radial-gradient(110% 90% at 50% 30%, var(--stage-3) 0%, var(--stage-2) 45%, var(--stage) 100%); color: var(--stage-ink); isolation: isolate; }
.viewer-stage { position: absolute; inset: 0; }
.atlas-canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.viewer-hero { aspect-ratio: 4 / 5; max-height: 720px; background: transparent; border-radius: 0; overflow: visible; }
.viewer-side { aspect-ratio: 4 / 5; max-height: calc(100vh - var(--head-h) - 140px); min-height: 360px; }
.viewer-load { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: 10px; justify-items: center; font-size: .9rem; color: var(--stage-muted); pointer-events: none; transition: opacity .3s; }
.viewer-load.done { opacity: 0; }
.viewer-bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.viewer-bar i { display: block; height: 100%; width: 0; background: #7fd1c9; transition: width .25s; }
.viewer-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.vt { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(15, 29, 37, .62); backdrop-filter: blur(6px); color: var(--stage-ink); font-size: .84rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.vt:hover { background: rgba(32, 64, 77, .9); color: #fff; }
.vt[aria-pressed="true"] { background: #e6f0f1; color: var(--stage); }
.vt .ico { width: 17px; height: 17px; }
.viewer-hero .viewer-tools { top: auto; bottom: 8px; right: 8px; }
.viewer-hint { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: .78rem; color: var(--stage-muted); max-width: 60%; pointer-events: none; }
.viewer-hero .viewer-hint { display: none; }
.viewer-label { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
.viewer-label span { position: absolute; transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; background: #fff; color: var(--ink); font-weight: 700; font-size: .85rem; padding: 6px 10px; border-radius: 9px; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.viewer-label span::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.viewer-tip { position: fixed; z-index: 60; pointer-events: none; background: rgba(15, 29, 37, .92); color: #fff; font-size: .82rem; padding: 5px 9px; border-radius: 7px; transform: translate(12px, 12px); white-space: nowrap; }
.viewer-noscript { position: absolute; inset: 0; display: grid; place-items: center; color: var(--stage-muted); }
.viewer-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--stage-muted); font-size: .95rem; }

/* ---------- pages système / structure ---------- */
.page-head { padding-top: 34px; padding-bottom: 22px; }
.page-head h1 { max-width: 20ch; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 68ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.jump a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 700; }
.jump a:hover { border-color: var(--line-2); color: var(--ink); }
.sys-page .page-head h1, .struct-page .page-head h1 { padding-left: 18px; border-left: 6px solid var(--sys); }
.sys-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; align-items: start; padding-bottom: 72px; }
.sys-3d .sticky { position: sticky; top: calc(var(--head-h) + 16px); display: grid; gap: 12px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.quick .chip { flex: none; }
.study-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.study-link span { display: grid; font-size: .88rem; color: var(--muted); }
.study-link b { color: var(--ink); font-size: .98rem; }
.study-link:hover { border-color: var(--line-2); }
.sys-body { min-width: 0; }
.block { padding: 6px 0 26px; }
.block + .block { border-top: 1px solid var(--line); padding-top: 26px; }
.block p, .block li { max-width: 72ch; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 22px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; border-radius: 3px; background: var(--sys, var(--scrub)); }
.structs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.structs li { padding: 14px 0; border-bottom: 1px dashed var(--line-2); }
.structs li:last-child { border-bottom: 0; }
.structs h3 { margin-bottom: .25em; }
.structs h3 a { color: var(--ink); text-decoration: none; }
.structs h3 a:hover { color: var(--scrub); }
.structs p { margin-bottom: .4em; color: var(--ink-2); }
.struct-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tips li { line-height: 1.75; }
.note { font-size: .9rem; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-family: var(--f-display); font-size: .88rem; font-weight: 700; color: var(--ink-2); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 700; min-width: 140px; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.labs td.num { white-space: normal; min-width: 150px; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; padding: 24px; border-radius: 18px; background: var(--scrub-soft); margin: 10px 0 28px; }
.cta-card h2 { font-size: 1.3rem; margin-bottom: .25em; }
.cta-card p { margin: 0; color: var(--ink-2); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-dark { background: var(--stage); color: var(--stage-ink); margin-top: 28px; }
.cta-dark p { color: var(--stage-muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager a { display: grid; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; min-width: 45%; }
.pager small { color: var(--muted); font-weight: 400; }
.pager-next { text-align: right; margin-left: auto; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .92rem; font-weight: 700; color: var(--ink-2); }
.related h2 { font-size: 1.2rem; }
.parts-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.parts-list summary { cursor: pointer; font-weight: 700; }
.parts-list ul { margin: 8px 0 0; padding-left: 18px; max-height: 240px; overflow: auto; columns: 2; column-gap: 20px; }
.name-cols { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: 28px; font-size: .93rem; }
.name-cols li { break-inside: avoid; padding: 3px 0; }
.name-cols a { color: var(--ink-2); text-decoration: none; }
.name-cols a:hover { color: var(--scrub); text-decoration: underline; }
.name-cols .link-btn { font-weight: 400; color: var(--ink-2); text-align: left; padding: 2px 0; }
.prose-wrap { display: grid; grid-template-columns: minmax(0, 820px); padding-bottom: 72px; }
.narrow-head { padding-top: 80px; padding-bottom: 120px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- diagrammes animés ---------- */
.diagram { position: relative; margin: 6px 0 18px; padding: 50px 16px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram svg text { font-family: var(--f-body); font-size: 13px; fill: var(--ink-2); }
.diagram svg .lbl-b { font-weight: 700; fill: var(--ink); }
.diagram-play { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.diagram-play .ico { width: 15px; height: 15px; }
.diagram-play .ico-play { display: none; }
.diagram-play[aria-pressed="false"] .ico-play { display: block; }
.diagram-play[aria-pressed="false"] .ico-pause { display: none; }
.diagram.paused * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .diagram * { animation: none !important; } .diagram-play { display: none; } }

/* ---------- quiz ---------- */
.quiz { display: grid; gap: 14px; }
.quiz-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; position: sticky; top: var(--head-h); z-index: 5; background: var(--paper); padding: 10px 0; border-bottom: 1px solid var(--line); }
.quiz-score { margin: 0; font-size: .95rem; color: var(--ink-2); }
.quiz-score b { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); }
.quiz-best { margin-left: 10px; color: var(--muted); }
.quiz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: q; }
.q { counter-increment: q; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.q-text { font-weight: 700; margin-bottom: 12px; }
.q-text::before { content: counter(q) ". "; color: var(--scrub); }
.q-opts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.q-opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; line-height: 1.45; }
.q-opt:hover:not([disabled]) { border-color: var(--line-2); background: #fafcfc; }
.q-letter { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font-family: var(--f-display); font-weight: 800; font-size: .85rem; }
.q-opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.q-opt.is-right .q-letter { background: var(--ok); color: #fff; }
.q-opt.is-wrong { border-color: var(--pulse); background: var(--pulse-soft); }
.q-opt.is-wrong .q-letter { background: var(--pulse); color: #fff; }
.q-opt[disabled] { cursor: default; }
.q-why summary { cursor: pointer; color: var(--scrub); font-weight: 700; font-size: .92rem; }
.q-why p { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: .97rem; }
.q.answered .q-why summary { display: none; }
.quiz-hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.quiz-hub a { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--sys); text-decoration: none; color: var(--ink); }
.quiz-hub a:hover { border-color: var(--line-2); border-left-color: var(--sys); }
.qh-meta { color: var(--muted); font-size: .9rem; }
.qh-best { font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.qh-best.done { color: var(--ok); }

/* ---------- A–Z ---------- */
.az-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.az-key a { display: grid; padding: 10px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.az-key span { font-size: .85rem; color: var(--muted); }
.az-letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; position: sticky; top: var(--head-h); background: var(--paper); padding: 8px 0; z-index: 4; }
.az-letters a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--ink-2); }
.az-letter { font-size: 1.6rem; margin: 22px 0 8px; color: var(--scrub); }

/* ---------- pied de page ---------- */
.foot { background: var(--stage); color: var(--stage-ink); padding: 56px 0 28px; }
.foot .brand { color: #fff; }
.foot .brand-text small { color: var(--stage-muted); }
.foot .logo-bg { fill: #e6f0f1; }
.foot .logo-fg { fill: var(--stage); }
.foot .logo-line { stroke: #e6f0f1; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-brand p { color: var(--stage-muted); max-width: 42ch; margin: 14px 0 18px; }
.foot .btn-shop { background: #e6f0f1; color: var(--stage); }
.foot-col h2 { font-size: 1rem; color: #fff; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-col a { color: var(--stage-muted); text-decoration: none; }
.foot-col a:hover { color: #fff; }
.foot-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: var(--stage-muted); }
.foot-legal a { color: #bfe3df; }

/* =====================================================================
   Atlas plein écran
   ===================================================================== */
.app-body { overflow: hidden; height: 100dvh; background: var(--stage); }
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr) 330px; grid-template-rows: 60px minmax(0, 1fr); grid-template-areas: "top top top" "layers stage info"; height: 100dvh; color: var(--stage-ink); }
.app-top { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: var(--stage); z-index: 10; }
.brand-light { color: #fff; }
.brand-light .brand-text small { color: var(--stage-muted); }
.brand-light .logo-bg { fill: #e6f0f1; }
.brand-light .logo-fg { fill: var(--stage); }
.brand-light .logo-line { stroke: #e6f0f1; }
.app-search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); }
.app-search:focus-within { background: rgba(255, 255, 255, .12); border-color: rgba(127, 209, 201, .6); }
.app-search .ico { color: var(--stage-muted); }
.app-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: .98rem; }
.app-search input::placeholder { color: var(--stage-muted); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); max-height: min(60vh, 440px); overflow: auto; z-index: 30; }
.results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: .95rem; }
.results li[aria-selected="true"], .results li:hover { background: var(--surface-2); }
.results .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.results small { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.results .empty { color: var(--muted); cursor: default; }
.app-top-actions { margin-left: auto; display: flex; gap: 6px; }
.tb { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: var(--stage-ink); font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; }
.tb:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tb-shop { background: #e6f0f1; color: var(--stage); border-color: #e6f0f1; }
.tb-shop:hover { background: #fff; color: var(--stage); }
.panel { background: #12232c; overflow-y: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: #2b4652 transparent; }
.panel-layers { grid-area: layers; border-right: 1px solid rgba(255, 255, 255, .08); }
.panel-info { grid-area: info; border-left: 1px solid rgba(255, 255, 255, .08); }
.panel h2 { font-size: 1.05rem; color: #fff; margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-close { display: none; background: transparent; border-color: rgba(255, 255, 255, .14); color: var(--stage-ink); }
.panel-sub { font-size: .8rem; font-weight: 700; color: var(--stage-muted); margin: 18px 0 8px; letter-spacing: .01em; }
.dataset { display: grid; gap: 6px; }
.ds { display: grid; text-align: left; gap: 1px; width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); color: var(--stage-ink); cursor: pointer; }
.ds b { font-size: .93rem; }
.ds span { font-size: .78rem; color: var(--stage-muted); }
.ds:hover { border-color: rgba(255, 255, 255, .25); }
.ds[aria-pressed="true"] { border-color: #7fd1c9; background: rgba(127, 209, 201, .1); }
.ds-more summary { cursor: pointer; font-size: .88rem; font-weight: 700; padding: 8px 2px; color: var(--stage-ink); }
.ds-list { display: grid; gap: 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.panel .chip { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); color: var(--stage-ink); min-height: 32px; font-size: .82rem; }
.panel .chip[aria-pressed="true"] { background: #e6f0f1; border-color: #e6f0f1; color: var(--stage); }
.layer-list, .study-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.layer { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--stage-muted); cursor: pointer; text-align: left; font-size: .92rem; }
.layer:hover { background: rgba(255, 255, 255, .05); color: var(--stage-ink); }
.layer .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--dot); opacity: .35; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.layer em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--stage-muted); }
.layer[aria-pressed="true"] { color: #fff; }
.layer[aria-pressed="true"] .dot { opacity: 1; }
.layer[data-ghost="true"] .dot { opacity: .65; background: transparent; box-shadow: inset 0 0 0 2px var(--dot); }
.study-parts button { width: 100%; text-align: left; padding: 6px 8px; border-radius: 8px; border: 0; background: transparent; color: var(--stage-ink); font-size: .86rem; cursor: pointer; }
.study-parts button:hover, .study-parts button[aria-pressed="true"] { background: rgba(127, 209, 201, .14); }
.switches { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 10px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: #2b4652; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: #2a9d94; }
.switch input:checked::after { transform: translateX(16px); }
.credit { margin-top: 18px; font-size: .75rem; color: var(--stage-muted); }
.credit a { color: #9fd8d3; }
.stage { grid-area: stage; position: relative; background: radial-gradient(90% 80% at 50% 40%, var(--stage-3) 0%, var(--stage-2) 45%, var(--stage) 100%); overflow: hidden; }
.stage-canvas { position: absolute; inset: 0; }
.stage-load { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 999px; background: rgba(15, 29, 37, .8); font-size: .85rem; color: var(--stage-ink); transition: opacity .3s; z-index: 4; }
.stage-load.done { opacity: 0; pointer-events: none; }
.stage-views { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(15, 29, 37, .78); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(6px); z-index: 4; }
.stage-views button { height: 34px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--stage-ink); font-size: .85rem; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; }
.stage-views button:hover { background: rgba(255, 255, 255, .1); }
.stage-views .ico { width: 18px; height: 18px; }
.stage-hidden { position: absolute; left: 16px; top: 16px; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 11px; background: rgba(15, 29, 37, .85); font-size: .85rem; z-index: 4; }
.stage-hidden button { height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: #e6f0f1; color: var(--stage); font-weight: 700; cursor: pointer; font-size: .82rem; }
.stage-hint { position: absolute; right: 16px; top: 16px; margin: 0; font-size: .8rem; color: var(--stage-muted); max-width: 250px; text-align: right; pointer-events: none; z-index: 3; }
.quiz-on .stage-hint { display: none; }
.quiz-card { position: absolute; right: 16px; top: 16px; width: min(360px, calc(100% - 32px)); padding: 16px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7); z-index: 6; }
.quiz-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.quiz-card-head h2 { font-size: 1.05rem; color: var(--ink); margin: 0; }
.quiz-card-head .icon-btn { width: 34px; height: 34px; }
.quiz-card-score { font-size: .85rem; color: var(--muted); margin: 4px 0 10px; }
.quiz-card-opts { display: grid; gap: 6px; }
.quiz-card-opts button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: .92rem; line-height: 1.35; }
.quiz-card-opts button:hover:not([disabled]) { border-color: var(--line-2); }
.quiz-card-opts .is-right { border-color: var(--ok); background: var(--ok-soft); }
.quiz-card-opts .is-wrong { border-color: var(--pulse); background: var(--pulse-soft); }
.quiz-card-msg { font-size: .88rem; margin: 10px 0; color: var(--ink-2); min-height: 1em; }
.info-empty p { color: var(--stage-muted); font-size: .95rem; }
.info-empty h2 { font-size: 1.15rem; margin-bottom: .4em; }
.starters { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.panel .link-btn { color: #9fd8d3; }
.panel .link-btn:hover { color: #fff; }
.info-sys { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--stage-muted); margin: 0 0 6px; }
.info-sys i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.info-name { font-size: 1.4rem !important; line-height: 1.2; margin-bottom: 8px !important; }
.info-group { font-size: .88rem; color: #9fd8d3; margin-bottom: 10px; }
.info-desc { font-size: .95rem; color: var(--stage-ink); }
.info-flag { font-size: .82rem; color: #ffd28a; background: rgba(255, 210, 138, .1); border-radius: 9px; padding: 8px 10px; }
.info-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0; }
.act { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: var(--stage-ink); font-weight: 700; font-size: .86rem; cursor: pointer; }
.act:hover { background: rgba(255, 255, 255, .1); }
.act[aria-pressed="true"] { background: #e6f0f1; color: var(--stage); }
.act .ico { width: 18px; height: 18px; }
.act span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-more { display: block; padding: 12px 14px; border-radius: 11px; background: #e6f0f1; color: var(--stage); text-decoration: none; font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.info-more:hover { background: #fff; color: var(--stage); }
.info-shop { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .14); color: var(--stage-ink); text-decoration: none; font-size: .88rem; }
.info-shop:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }
.app-dock { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 250px minmax(0, 1fr) 300px; }
}
@media (max-width: 980px) {
  .nav { position: fixed; inset: var(--head-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1.05rem; }
  .nav .nav-shop { margin: 8px 0 0; justify-content: center; }
  .top-dark .nav { background: var(--stage); }
  .nav-toggle { display: inline-grid; }
  .hero-in { grid-template-columns: 1fr; min-height: 0; gap: 8px; }
  .viewer-hero { aspect-ratio: 1 / 1; max-height: 560px; margin: 0 calc(var(--gutter) * -1); }
  .sys-grid { grid-template-columns: 1fr; gap: 20px; }
  .sys-3d .sticky { position: static; }
  .viewer-side { aspect-ratio: 1 / 1; max-height: 70vh; min-height: 300px; }
  .how-in { grid-template-columns: 1fr; gap: 10px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  /* atlas */
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "stage" "dock"; }
  .app-top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .app-top .brand-text { display: none; }
  .app-search { order: 3; flex-basis: 100%; max-width: none; }
  .app-top-actions .tb span { display: none; }
  .app-top-actions [data-quiz-start] { display: none; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 72dvh; z-index: 20; border-radius: 18px 18px 0 0; border: 0; box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .6); transform: translateY(105%); transition: transform .25s ease; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .panel.open { transform: translateY(0); }
  .panel-close { display: inline-grid; }
  .app-dock { grid-area: dock; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--stage); border-top: 1px solid rgba(255, 255, 255, .08); padding-bottom: env(safe-area-inset-bottom); z-index: 15; }
  .app-dock button { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border: 0; background: transparent; color: var(--stage-ink); font-size: .75rem; font-weight: 700; cursor: pointer; }
  .app-dock .ico { width: 22px; height: 22px; }
  .stage-hint { display: none; }
  .stage-views { bottom: 10px; }
  .stage-views button { padding: 0 8px; font-size: .8rem; }
  .quiz-card { left: 10px; right: 10px; top: auto; bottom: 64px; width: auto; }
}
@media (max-width: 680px) {
  :root { --gutter: 16px; --head-h: 58px; }
  .strip-cta { display: none; }
  .strip { font-size: .8rem; }
  body { font-size: 1rem; }
  .section { padding: 52px 0; }
  .sys-list { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .hero-search { flex-wrap: wrap; border-radius: 18px; padding: 6px 6px 6px 14px; }
  .hero-search input { flex-basis: calc(100% - 40px); }
  .hero-search .btn { width: 100%; }
  .hero-stats dd { font-size: 1.5rem; }
  .shop-in { padding: 24px; }
  .cond thead, .labs thead { display: none; }
  .cond tr, .labs tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .cond tbody tr:last-child, .labs tbody tr:last-child { border-bottom: 0; }
  .cond th, .cond td, .labs th, .labs td { display: block; padding: 3px 0; border: 0; }
  .cond td::before, .labs td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
  td.num { white-space: normal; }
  .foot-in { grid-template-columns: 1fr; }
  .viewer-tools .vt span { display: none; }
  .viewer-hint { display: none; }
  .brand-text small { display: none; }
  .stage-views [data-view="top"] { display: none; }
  .parts-list ul { columns: 1; }
}
@media (max-width: 380px) { .stage-views button { padding: 0 6px; } }
