/* Conduites à tenir — feuille de style (mobile d'abord, thème clair/sombre) */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --text: #15202b;
  --muted: #5b6b7b;
  --border: #dfe5eb;
  --line: #c9d3dc;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --primary-weak: #ccfbf1;
  --on-primary: #ffffff;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 16px rgba(16, 32, 48, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --danger: #b42318; --danger-bg: #fdecea; --danger-bd: #f5c2bd;
  --warn: #a15c07;   --warn-bg: #fef4e2;   --warn-bd: #f6d9a6;
  --ok: #18794e;     --ok-bg: #e7f6ee;     --ok-bd: #b5e2c9;
  --rx: #5b3fbf;     --rx-bg: #efebfc;     --rx-bd: #d3c8f5;
  --info: #1d5fbf;   --info-bg: #e8f0fc;   --info-bd: #c3d6f5;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1318; --surface: #161d24; --surface-2: #1d262f; --text: #e6edf3; --muted: #95a3b1;
    --border: #28323d; --line: #3a4652; --primary: #2dd4bf; --primary-strong: #5eead4; --primary-weak: #0d3b37; --on-primary: #042f2e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --danger: #ff8a80; --danger-bg: #3a1714; --danger-bd: #6b2a24;
    --warn: #f5b950;   --warn-bg: #352610;   --warn-bd: #634818;
    --ok: #5fd39a;     --ok-bg: #12301f;     --ok-bd: #22573a;
    --rx: #b9a6ff;     --rx-bg: #241d42;     --rx-bd: #42367a;
    --info: #8ab8ff;   --info-bg: #142640;   --info-bd: #27446e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1318; --surface: #161d24; --surface-2: #1d262f; --text: #e6edf3; --muted: #95a3b1;
  --border: #28323d; --line: #3a4652; --primary: #2dd4bf; --primary-strong: #5eead4; --primary-weak: #0d3b37; --on-primary: #042f2e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --danger: #ff8a80; --danger-bg: #3a1714; --danger-bd: #6b2a24;
  --warn: #f5b950;   --warn-bg: #352610;   --warn-bd: #634818;
  --ok: #5fd39a;     --ok-bg: #12301f;     --ok-bd: #22573a;
  --rx: #b9a6ff;     --rx-bg: #241d42;     --rx-bd: #42367a;
  --info: #8ab8ff;   --info-bg: #142640;   --info-bd: #27446e;
  color-scheme: dark;
}

/* Niveaux (couleur sémantique) */
.lv-danger { --c: var(--danger); --cb: var(--danger-bg); --cbd: var(--danger-bd); }
.lv-warn   { --c: var(--warn);   --cb: var(--warn-bg);   --cbd: var(--warn-bd); }
.lv-ok     { --c: var(--ok);     --cb: var(--ok-bg);     --cbd: var(--ok-bd); }
.lv-rx     { --c: var(--rx);     --cb: var(--rx-bg);     --cbd: var(--rx-bd); }
.lv-info   { --c: var(--info);   --cb: var(--info-bg);   --cbd: var(--info-bd); }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 64px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .75em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.filled svg { fill: currentColor; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; text-align: left;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-strong); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn .ic { width: 18px; height: 18px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 50%; border: 0; background: transparent; color: var(--text); text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ic.filled { color: #e8a317; }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--primary-weak); color: var(--primary-strong);
}
.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--cb, var(--surface-2)); color: var(--c, var(--muted)); border: 1px solid var(--cbd, var(--border)); white-space: nowrap;
}

/* ------------------------------------------------------------------ barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-logo .ic { width: 18px; height: 18px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt small { color: var(--muted); font-size: 12px; }
.bar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.bar-title strong, .bar-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { color: var(--muted); font-size: 12px; }
.fiche-bar { padding-left: 4px; }

/* Liens du site parent (mode intégré) */
.site-links { display: none; align-items: center; gap: 4px; margin-left: 16px; }
.site-links a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.site-links a:hover { color: var(--text); background: var(--surface-2); }
.site-links a.active { color: var(--primary-strong); background: var(--primary-weak); }
@media (min-width: 760px) { .site-links { display: flex; } }
.brand-site { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-site span { color: var(--primary); }

/* Contenu statique (référencement), remplacé par l'application au chargement */
.seo-static { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.seo-static h1 { font-size: 30px; margin: 12px 0 4px; }
.seo-static h2 { font-size: 20px; margin: 24px 0 8px; }

/* ------------------------------------------------------------------ accueil */
.home { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; }
.hero { padding: 20px 0 8px; }
.hero h1 { font-size: clamp(26px, 6vw, 38px); letter-spacing: -.02em; }
.hero-sub { color: var(--muted); max-width: 60ch; margin-top: 8px; }
.search {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 0 16px; height: 52px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.search .ic { color: var(--muted); }
.search-input { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; font-size: 16px; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-n { font-size: 12px; opacity: .7; }
.count { color: var(--muted); font-size: 14px; margin: 12px 0 8px; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } .chips { flex-wrap: wrap; overflow: visible; } }
.gcard {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s;
}
.gcard:hover { border-color: var(--primary); transform: translateY(-1px); }
.gcard-top { display: flex; align-items: flex-start; gap: 8px; }
.gcard-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.gcard-fav { margin-left: auto; color: #e8a317; }
.gcard-fav .ic svg { fill: currentColor; }
.gcard-title { font-size: 20px; margin-top: 4px; }
.gcard-sub { color: var(--muted); margin: 0; }
.gcard-feats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; color: var(--primary-strong); font-size: 13.5px; font-weight: 600; }
.gcard-feats span { display: inline-flex; align-items: center; gap: 5px; }
.gcard-feats .ic { width: 16px; height: 16px; }
.gcard-maj { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.empty { color: var(--muted); padding: 24px 0; }
.disclaimer {
  display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 13px;
  margin-top: 32px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.disclaimer .ic { width: 18px; height: 18px; margin-top: 1px; }

/* ------------------------------------------------------------------ fiche : en-tête et mise en page */
.fiche-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.fiche-head-in { max-width: 1240px; margin: 0 auto; padding: 18px 16px 16px; }
.fiche-head h1 { font-size: clamp(26px, 6vw, 36px); letter-spacing: -.02em; margin-top: 10px; }
.h1-sub { display: block; font-size: .5em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 700; }

.fiche-layout { max-width: 1240px; margin: 0 auto; padding: 0 0 32px; }
.toc {
  position: sticky; top: var(--topbar-h); z-index: 20; display: flex; gap: 4px; overflow-x: auto;
  padding: 8px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc-link {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px;
  border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.toc-link .ic { width: 17px; height: 17px; }
.toc-link:hover { color: var(--text); background: var(--surface-2); }
.toc-link.active { color: var(--primary-strong); background: var(--primary-weak); }
.fiche-content { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

@media (min-width: 1000px) {
  .fiche-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding: 20px 16px 40px; }
  .toc {
    flex-direction: column; top: calc(var(--topbar-h) + 16px); align-self: start; overflow: visible;
    padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  }
  .toc-link { border-radius: 10px; justify-content: flex-start; }
  .fiche-content { padding: 0; gap: 16px; }
  html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
}

.sec {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px 20px; box-shadow: var(--shadow);
}
@media (min-width: 700px) { .sec { padding: 22px 24px 24px; } }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.sec-head h2 .ic { color: var(--primary); width: 22px; height: 22px; }
.sec-head .btn { margin-left: auto; }
.fiche-foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 40px; }
.fiche-foot .disclaimer { margin-top: 0; }

/* ------------------------------------------------------------------ l'essentiel */
.keypoints { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.keypoints li { display: flex; gap: 10px; align-items: flex-start; }
.keypoints .ic { color: var(--ok); margin-top: 2px; width: 18px; height: 18px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ------------------------------------------------------------------ encadrés */
.callout {
  border: 1px solid var(--cbd); background: var(--cb); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 12px 0;
}
.callout-head { display: flex; align-items: center; gap: 8px; color: var(--c); }
.callout-head .ic { width: 19px; height: 19px; }
.callout p { margin: 6px 0 0; }
.callout ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* ------------------------------------------------------------------ blocs */
.blocks > * + * { margin-top: 12px; }
.blocks h3 { font-size: 17px; margin-top: 22px; }
.list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.list-check { list-style: none; padding: 0; }
.list-check li { display: flex; gap: 10px; align-items: flex-start; }
.list-check .ic { color: var(--primary); width: 18px; height: 18px; margin-top: 2px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-size: 13px; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .table-wrap { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; padding: 6px 0; background: var(--surface); }
  td { border: 0; padding: 4px 12px; }
  td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
  td.empty-cell { display: none; }
}

.acc { display: grid; gap: 8px; }
.acc-item { border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: var(--radius-sm); background: var(--surface); }
.acc-item summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; min-height: 48px;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-title { flex: 1; }
.acc-chev { color: var(--muted); transition: transform .2s; }
.acc-item[open] .acc-chev { transform: rotate(90deg); }
.acc-body { padding: 0 14px 14px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; min-height: 38px; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { margin-top: 12px; }
.tab-panel > .blocks > * + * { margin-top: 12px; }

/* ------------------------------------------------------------------ parcours interactif */
.flow { display: flex; flex-direction: column; gap: 12px; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.trail-step {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 5px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); text-align: left; line-height: 1.25;
}
.trail-step:hover { border-color: var(--primary); }
.trail-q { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.trail-a { font-size: 13.5px; font-weight: 700; }

.step { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.step-no { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.step-q { font-size: 19px; margin: 4px 0 12px; }
.step-aide { margin: 0 0 14px; padding: 10px 14px 10px 30px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 4px; font-size: 14.5px; }
.step-aide.danger { background: var(--danger-bg); border-color: var(--danger-bd); }
.opts { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px;
  padding: 12px 40px 12px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface);
  text-align: left; transition: border-color .15s, background .15s, transform .1s;
}
.opt:hover { border-color: var(--primary); }
.opt:active { transform: scale(.99); }
.opt-label { font-weight: 700; }
.opt-aide { font-size: 13px; color: var(--muted); }
.opt-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.opt.lv-danger { border-color: var(--danger-bd); }
.opt.lv-danger .opt-label { color: var(--danger); }
.step-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.result { border: 1.5px solid var(--cbd); background: var(--cb); border-radius: var(--radius); padding: 16px; }
.result-head { display: flex; align-items: center; gap: 8px; color: var(--c); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.result h3 { font-size: 20px; margin: 6px 0 10px; color: var(--c); }
.result ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.result-ords { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--cbd); }
.result-ords-lab { font-size: 13px; font-weight: 700; color: var(--muted); }
.flow-ctrl { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------ schéma (arbre) */
.schema-hint { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; }
.schema-hint .ic { width: 17px; height: 17px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 12px; padding-left: 20px; }
.tree li { position: relative; padding-top: 10px; }
.tree ul > li::before {
  content: ""; position: absolute; left: -20px; top: 0; width: 16px; height: 24px;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 10px;
}
.tree ul > li::after { content: ""; position: absolute; left: -20px; top: 24px; bottom: 0; border-left: 2px solid var(--line); }
.tree ul > li:last-child::after { display: none; }
.schema.has-path .tree ul > li.on::before { border-color: var(--primary); }
.edge {
  display: inline-block; margin: 2px 0 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.edge.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tnode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; max-width: 520px;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface);
  text-align: left; transition: opacity .2s, border-color .15s;
}
.tnode:hover { border-color: var(--primary); }
.tnode-kind { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tnode-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.tnode-sub { font-size: 12.5px; color: var(--muted); }
.tnode.t-result { background: var(--cb); border-color: var(--cbd); }
.tnode.t-result .tnode-kind, .tnode.t-result .tnode-title { color: var(--c); }
.tnode.t-score { border-style: dashed; }
.schema.has-path .tnode { opacity: .45; }
.schema.has-path .tnode.on { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.schema.has-path .tnode.cur { box-shadow: 0 0 0 3px var(--primary); }
@media (max-width: 640px) {
  .tree ul { margin-left: 6px; padding-left: 14px; }
  .tree ul > li::before { left: -14px; width: 11px; }
  .tree ul > li::after { left: -14px; }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--cb); border: 1.5px solid var(--c); }

/* ------------------------------------------------------------------ score */
.score-pop { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.score-pop .ic { width: 17px; height: 17px; }
.score-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .score-grid { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; } }
.score-items { display: grid; gap: 8px; }
.score-row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
}
.score-row input { position: absolute; opacity: 0; pointer-events: none; }
.score-row .box {
  width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all .15s;
}
.score-row .box .ic { width: 16px; height: 16px; }
.score-row input:checked + .box { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.score-row:has(input:checked) { border-color: var(--primary); background: var(--primary-weak); }
.score-row input:focus-visible + .box { outline: 3px solid var(--primary); outline-offset: 2px; }
.score-label { flex: 1; font-weight: 600; }
.pts { font-weight: 800; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.score-row.choix { flex-wrap: wrap; cursor: default; }
.seg { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 8px;
  padding: 6px 12px; font-weight: 600; font-size: 14px; min-height: 36px;
}
.seg-btn.active { background: var(--primary); color: var(--on-primary); }
.seg-btn.active .pts { color: inherit; opacity: .85; }
.score-side { display: grid; gap: 10px; }
@media (min-width: 760px) { .score-side { position: sticky; top: calc(var(--topbar-h) + 16px); } }
.score-total-wrap {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.score-total-wrap small { font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.score-num { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-max { color: var(--muted); font-weight: 700; margin-left: 4px; }
.score-interp .callout { margin: 0; }

/* ------------------------------------------------------------------ calcul de doses */
.dosecalc { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dc-head h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dc-head h4 .ic { color: var(--primary); }
.poids {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--primary); font-weight: 700; font-size: 14px;
}
.poids .ic { width: 18px; height: 18px; color: var(--primary); }
.poids input {
  width: 74px; height: 36px; border: 0; border-radius: 999px; background: var(--primary-weak); text-align: center;
  font-size: 17px; font-weight: 800; outline: none; -moz-appearance: textfield;
}
.poids input::-webkit-outer-spin-button, .poids input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.poids .unit { color: var(--muted); padding-right: 8px; }
.dc-rows { display: grid; }
.dc-row { display: grid; gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); grid-template-columns: 1fr; }
.dc-row:last-child { border-bottom: 0; }
@media (min-width: 760px) { .dc-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 230px; align-items: center; } .dc-forme { justify-self: end; text-align: right; } }
.dc-med { display: flex; flex-direction: column; }
.dc-med small { color: var(--muted); font-size: 13px; }
.dc-note { font-style: italic; }
.dc-res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dc-mg { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dc-mg small { font-size: 12px; color: var(--muted); font-weight: 600; }
.dc-ml { font-weight: 800; color: var(--primary-strong); padding: 1px 8px; border-radius: 6px; background: var(--primary-weak); font-variant-numeric: tabular-nums; }
.dc-res small { color: var(--muted); font-size: 12.5px; flex-basis: 100%; }
.dc-forme .forme-one { font-size: 13px; color: var(--muted); }
.forme-sel { max-width: 100%; min-height: 36px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; }
.dc-foot { font-size: 12.5px; color: var(--muted); padding: 10px 14px; margin: 0; background: var(--surface-2); border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ ordonnances */
.ord { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ord > * { min-width: 0; }
@media (min-width: 900px) { .ord { grid-template-columns: 290px minmax(0, 1fr); align-items: start; } }
.ord-list { display: flex; flex-direction: column; gap: 4px; }
.ord-select-wrap {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 48px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary); background: var(--surface);
}
.ord-select-wrap .ic { color: var(--primary); }
.ord-select { flex: 1; min-width: 0; width: 100%; text-overflow: ellipsis; height: 46px; border: 0; background: transparent; font-weight: 700; font-size: 15px; outline: none; }
@media (max-width: 899px) { .ord-list { display: none; } }
@media (min-width: 900px) { .ord-select-wrap { display: none; } }
.ord-group { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 4px 2px; }
.ord-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; min-height: 44px;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600;
}
.ord-item:hover { border-color: var(--primary); }
.ord-item.active { background: var(--primary-weak); border-color: var(--primary); color: var(--primary-strong); }
.ord-view { display: grid; gap: 12px; min-width: 0; }
.ord-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ord-btns { display: flex; gap: 8px; }
.ord-paper {
  background: #fff; color: #1b2430; border-radius: 6px; padding: 22px 20px 26px; border: 1px solid #d8dee5;
  box-shadow: 0 2px 10px rgba(0,0,0,.08); font-size: 15px;
}
.ord-top { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #1b2430; padding-bottom: 10px; }
.ord-doc { font-weight: 800; }
.ord-doc-sub, .ord-date { font-size: 13px; color: #556270; }
.ord-patient { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 12px 0; font-size: 14px; color: #3a4654; }
.ord-situation { font-size: 13px; font-weight: 700; color: #115e59; background: #ccfbf1; display: inline-block; padding: 2px 10px; border-radius: 999px; }
.ord-lines { display: grid; gap: 12px; margin-top: 10px; }
.ord-line { display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.ord-k { width: 24px; height: 24px; border-radius: 50%; background: #1b2430; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; }
.ord-med { font-weight: 800; font-size: 15px; }
.ord-poso { margin-top: 2px; }
.ord-line.manque .ord-poso { color: #a15c07; font-style: italic; }
.ord-forme { margin-top: 6px; font-size: 13px; color: #556270; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ord-forme .forme-sel { background: #fff; color: #1b2430; border-color: #d8dee5; }
.ord-cond { font-weight: 800; margin: 6px 0 -4px; text-decoration: underline; }
.ord-conseils { margin-top: 18px; padding-top: 10px; border-top: 1px dashed #c4ccd5; font-size: 14px; }
.ord-conseils ul { margin: 4px 0 0; padding-left: 18px; }
.ord-sign { margin-top: 26px; text-align: right; font-size: 13px; color: #8a96a3; }

/* ------------------------------------------------------------------ sources */
.sources { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.src-org { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--primary); }
.src-title { font-weight: 600; text-decoration: none; display: inline; }
a.src-title:hover { text-decoration: underline; }
.src-title .ic { width: 14px; height: 14px; vertical-align: -2px; margin-left: 4px; }
.src-date { font-size: 13px; color: var(--muted); }

/* Fil d'Ariane, titre, FAQ, liens « voir aussi » */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.crumb-sep { opacity: .6; }
.h1-cat { font-weight: 600; color: var(--muted); }
.faq { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.faq-item summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 48px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { flex: 1; font-size: 16px; }
.faq-item[open] .acc-chev { transform: rotate(90deg); }
.faq-r { padding: 0 14px 14px; color: var(--text); }
.liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 700px) { .liens { grid-template-columns: 1fr 1fr; } }
.liens a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600;
}
.liens a:hover { border-color: var(--primary); color: var(--primary-strong); }
.liens a > span:not(.ic) { flex: 1; }
.liens .ic { color: var(--primary); }
.liens-chev { color: var(--muted) !important; }

/* Liens vers les fiches molécules du site */
.mol-link { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.mol-link:hover { color: var(--primary); text-decoration-style: solid; }
.ord-paper .mol-link { text-decoration-color: #0f766e; }

/* ------------------------------------------------------------------ notification */
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ impression */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f5f7; --text: #000; --shadow: none; color-scheme: light; }
  body { background: #fff; font-size: 11.5pt; }
  .topbar, .toc, .flow-ctrl, .quick, .no-print, .sec-head .btn, #toast, .schema-hint, .ord-list, .ord-tools { display: none !important; }
  .fiche-layout { display: block; padding: 0; }
  .sec { box-shadow: none; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; padding: 12px 0; break-inside: avoid-page; }
  .sec-parcours { display: none; }
  .schema.has-path .tnode { opacity: 1; }
  .acc-item { break-inside: avoid; }
  .acc-body { display: block !important; }
  a { color: #000; }
  .mol-link { text-decoration: none; }

  /* Impression d'une seule ordonnance */
  body.print-ord * { visibility: hidden; }
  body.print-ord .ord-paper, body.print-ord .ord-paper * { visibility: visible; }
  body.print-ord .ord-paper { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; padding: 0; font-size: 12.5pt; }
  body.print-ord .sec-parcours { display: block; }
}
@page { margin: 14mm; }

/* Calculateur d'automesure tensionnelle (règle des 3) */
.amt-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.amt-opts .tabs { background: var(--surface); }
.amt-opts .tab { min-height: 34px; padding: 6px 14px; }
.amt-age { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.amt-age[hidden] { display: none; }
.amt-age input { width: 18px; height: 18px; accent-color: var(--primary); }
.amt-body { display: grid; gap: 14px; padding: 14px; }
.amt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .amt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; } }
.amt-slot { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px 10px; margin: 0; min-width: 0; display: grid; gap: 6px; }
.amt-slot legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.amt-line { display: grid; grid-template-columns: 14px minmax(0, 1fr) 8px minmax(0, 1fr); align-items: center; gap: 4px; }
.amt-k { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.amt-slash { color: var(--muted); text-align: center; }
.amt-line input { width: 100%; min-width: 0; min-height: 38px; padding: 6px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; text-align: center; -moz-appearance: textfield; }
.amt-line input::-webkit-outer-spin-button, .amt-line input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amt-line input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.amt-line input[aria-invalid] { border-color: var(--warn); background: var(--warn-bg); }
.amt-res { display: grid; gap: 10px; }
.amt-moy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.amt-num { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.amt-moy small { color: var(--muted); font-weight: 600; }
.amt-n { margin-left: auto; font-size: 13px; color: var(--muted); }
.amt-vide, .amt-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.amt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
