/* Natural Companion — styles
   Colours come from the original App Inventor project (primary #1565C0, dark #0D47A1, light #64B5F6).
   The five-element meridian colours are the only accent. */

:root {
  --blue: #1565C0;
  --blue-dark: #0D47A1;
  --blue-light: #64B5F6;
  --blue-read: #BBDEFB;
  --paper: #FFFFFF;        /* fond d'écran (blanc, comme la version App Inventor 12) */
  --surface: #FFFFFF;
  --ink: #17212B;
  --ink-soft: #4A5968;
  --line: #D6E2EE;
  --disabled-bg: #BDBDBD;
  --disabled-ink: #424242;
  --select: #D9EAFB;
  --danger: #B3261E;

  /* five-element meridian colours (from the pain screen buttons) */
  --m-metal: #2C92FF;
  --m-earth: #EBCA61;
  --m-fire: #DA615C;
  --m-water: #000000;
  --m-minister: #E59D59;
  --m-wood: #499459;
  --m-vessel: #8E4BB5;

  --radius-btn: 12px;
  --radius-panel: 18px;
  --font: "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 1.875rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }

.boot { text-align: center; margin-top: 40vh; color: var(--ink-soft); }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 32px;
}

/* ---------- header ---------- */
.lang-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.lang-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 3px;
  line-height: 0;
  cursor: pointer;
}
.lang-btn img { width: 60px; height: 20px; display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  padding: 8px 0;
  background: var(--paper);
}
.icon-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: var(--step-1);
  cursor: pointer;
}
.home-btn {
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: var(--blue-dark);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.2; margin: 0; }
.screen-title { font-size: var(--step-2); text-align: center; margin: 12px 0 16px; }
.section-title { font-size: var(--step-1); text-align: center; margin: 16px 0 12px; }
.hint { color: var(--ink-soft); text-align: center; margin: 12px 0; white-space: pre-line; }
.body-text { white-space: pre-line; margin: 8px 0 16px; }
.status { text-align: center; color: var(--blue); font-weight: 700; margin: 8px 0; }
.small { font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- buttons ---------- */
.stack { display: grid; gap: 10px; margin: 10px 0; }
.btn {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: pre-line;
  transition: filter .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn.dark { background: var(--blue-dark); }
.btn.light { background: var(--blue-light); }
.btn.big { font-size: var(--step-1); min-height: 58px; }
.btn.read { background: var(--blue-read); color: #0B4F9B; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  cursor: not-allowed;
  filter: none;
  transform: none;
}
.btn.selected { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--blue-dark); background: var(--blue-dark); }
.btn.ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  margin: 8px 0 14px;
}
.tabs a, .tabs button {
  border: 0;
  border-radius: 10px;
  padding: 10px 4px;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: var(--step--1);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.tabs .on { background: var(--blue); color: #fff; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 .btn { padding: 10px 6px; font-size: var(--step--1); }

/* ---------- home ---------- */
.hero { text-align: center; margin: 6px 0 18px; }
.hero h1 { font-size: var(--step-3); white-space: pre-line; letter-spacing: -0.01em; }
.hero img { width: min(240px, 70%); height: auto; margin: 12px auto 0; display: block; }
.home-actions .btn { text-align: left; padding-left: 20px; }

/* ---------- meridian thread (signature element) ---------- */
.dot { width: 22px; height: 22px; flex: none; border-radius: 50%; }
.dot-lg { width: 30px; height: 30px; }

.list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
}
.list li + li { border-top: 1px solid var(--line); }
.list a, .list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.list a:active, .list button:active { background: var(--select); }
.list .main { display: block; font-weight: 700; }
.list .sub { display: block; color: var(--ink-soft); font-size: var(--step--1); }
.list .empty { padding: 16px; color: var(--ink-soft); text-align: center; }

.selected-meridian {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--step-1);
  font-weight: 700;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
}

/* ---------- panels / detail ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 16px;
  margin: 12px 0;
}
.panel h2 { font-size: var(--step-1); text-align: center; }
.role { color: var(--blue); font-size: var(--step-1); font-weight: 700; text-align: center; }
.code { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--step-1); font-weight: 700; margin: 6px 0; }
.kv { margin: 6px 0; }
.badge-demo { display: inline-block; background: #FFF3CD; color: #6B4E00; border-radius: 6px; padding: 2px 8px; font-size: var(--step--1); }

/* ---------- pain screen ---------- */
.regions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.region-img { display: block; width: min(300px, 100%); height: auto; margin: 8px auto; }
.meridian-nums { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0; }
.mnum {
  width: 50px; height: 60px;
  border: 0;
  border-radius: 25px / 30px;
  color: #fff;
  font-weight: 700;
  font-size: var(--step-1);
  cursor: pointer;
}
.mnum.on { outline: 4px solid var(--blue-dark); outline-offset: 2px; }
.pain-heading { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--step-1); font-weight: 700; margin: 8px 0; flex-wrap: wrap; }

/* ---------- forms ---------- */
.field {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--surface);
}
textarea.field { min-height: 140px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 6px 2px; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.checks input { width: 22px; height: 22px; accent-color: var(--blue); }
.banner { width: 100%; height: 130px; object-fit: contain; display: block; margin: 8px 0; }
.photo { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; display: block; margin: 8px auto; background: var(--select); }
.course-img { width: 100%; height: 140px; object-fit: contain; display: block; }

/* ---------- dialog ---------- */
dialog {
  width: min(92vw, 480px);
  max-height: 86vh;
  border: 0;
  border-radius: 20px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(13, 71, 161, .28);
}
dialog::backdrop { background: rgba(10, 30, 60, .45); }
dialog[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-head { padding: 18px 20px 6px; }
.dlg-head h2 { font-size: var(--step-1); }
.dlg-body { padding: 6px 20px 12px; overflow: auto; }
.dlg-body .msg { white-space: pre-line; margin: 0 0 12px; }
.dlg-body .list { margin: 8px 0 0; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px 16px 16px; }
.dlg-foot .btn { width: auto; min-height: 44px; padding: 8px 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--blue-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  z-index: 50;
  max-width: 90vw;
}

.install { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}



.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bouton rond rouge des vidéos d'aide (YouTube) */
.topbar.with-video { grid-template-columns: 48px 1fr 48px 48px; }
.icon-btn.video-btn {
  background: #E60000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 1px;
  padding: 0;
}
.icon-btn.video-btn .video-label { font-size: 10px; font-weight: 700; }
.icon-btn.video-btn:active { filter: brightness(.9); }
.lang-row .icon-btn.video-btn { width: 40px; height: 40px; font-size: .8rem; }
.lang-row .icon-btn.video-btn .video-label { font-size: 9px; }

.btn.yt { background: #E60000; color: #fff; }
.btn.yt:active { filter: brightness(.92); }

/* Paired actions stay side by side, including narrow phone screens. */
.treatment-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:10px 0; }
.treatment-pair .btn { min-width:0; width:100%; white-space:normal; padding:12px 7px; line-height:1.35; }
.treatment-pair .btn:only-child { grid-column:1 / -1; }
.treatment-card h3 { font-size:1.05rem; margin:0 0 10px; }
.guide-steps { padding-left:24px; text-align:left; line-height:1.55; }
.guide-steps li { margin:0 0 12px; }
summary { cursor:pointer; font-weight:700; line-height:1.45; }

.embed-tabs { grid-template-columns:1fr 1fr; }
.storage-warning { border:1px solid #d2a14a;background:#fff8e8;padding:12px;border-radius:8px;line-height:1.4;font-size:.9rem; }

/* ---------- Treatment sheets (v1.11) ---------- */
.fiche-rub { text-align:center; margin:4px 0 8px; font-weight:700; }
.fiche-rub a { text-decoration:none; background:var(--select); color:var(--blue-dark); padding:4px 12px; border-radius:999px; font-size:var(--step--1); }
.fiche-sec { border-top:1px solid var(--line); padding:10px 0 2px; }
.fiche-sec h4 { margin:0 0 4px; font-size:var(--step-0); color:var(--blue-dark); }
.fiche-sec p { margin:0 0 6px; line-height:1.55; }
.fiche-sec.caution h4 { color:var(--danger); }
.fiche-points { list-style:none; padding:0; margin:4px 0 6px; display:grid; grid-template-columns:1fr; gap:4px; }
.fiche-points li { display:flex; align-items:center; gap:8px; font-size:var(--step--1); }
.fiche-points .dot { width:16px; height:16px; flex:none; }
.disclaimer { background:#FFF8E8; border:1px solid #D2A14A; border-radius:12px; padding:12px 14px; margin:12px 0; font-size:var(--step--1); line-height:1.5; color:#4A3500; }
.note-box { border-top:2px solid var(--blue-light); margin-top:14px; padding-top:12px; }
.note-box label { display:block; margin-bottom:6px; color:var(--blue-dark); }
.note-field { min-height:120px; }
.note-status { margin:6px 2px 10px; }
.note-flag { margin-left:auto; color:var(--blue); font-weight:700; padding-left:8px; }
@media (min-width:480px) { .fiche-points { grid-template-columns:1fr 1fr; } }

/* ---------- Client files (v1.11) ---------- */
.tabs.four { grid-template-columns: repeat(4, 1fr); }
.tabs.four a { font-size: var(--step--1); padding: 10px 2px; }
.embed-tabs { grid-template-columns: repeat(3, 1fr); }
.sub-title { font-size: var(--step-0); color: var(--blue-dark); margin: 16px 0 6px; }
.cf { display: block; margin: 10px 0; }
.cf > span { display: block; font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 4px; }
.visit-points li { display: block; }
.visit-points .vp { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.visit-points .vp-label { flex: 1; font-weight: 700; }
.visit-points .vp { padding: 6px 10px; min-height: 48px; }
.x-btn { border: 1px solid var(--line); background: var(--surface); color: var(--danger); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; line-height: 1; cursor: pointer; flex: none; }
.privacy { background: #EEF5FC; border-color: var(--blue-light); color: var(--ink); }
.treatment-card > .btn.light { margin-top: 8px; }
.visit-points .x-btn { width: 36px; min-height: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; }

/* ---------- Lexiques: homeopathy (violet) + herbal medicine (green) — 1.14.0 ---------- */
:root { --homeo: #5E4B8B; --homeo-bg: #F4F1FA; --homeo-line: #D3C9E8; --phyto: #2E7D5B; --phyto-bg: #F0F8F3; --phyto-line: #A9D3BE; --lex: #0F6E74; }
.btn.lex-btn { background: var(--lex); }
.btn.homeo-btn { background: var(--homeo); }
.btn.phyto-btn { background: var(--phyto); }
.tr-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 12px 12px 14px; margin: 12px 0; display: grid; gap: 10px; }
.tr-group-title { margin: 0; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); text-align: center; }
.tr-group .btn { margin: 0; }
.lex-crumb { text-align: center; }
.lex-cards { display: grid; gap: 12px; margin: 14px 0; }
.lex-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius-panel); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); min-height: 84px; }
.lex-card:active { filter: brightness(.97); }
.lex-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; color: #fff; }
.lex-text { flex: 1; min-width: 0; }
.lex-title { display: block; font-weight: 700; font-size: var(--step-1); }
.lex-sub { display: block; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.4; margin-top: 2px; }
.lex-count { flex: none; font-weight: 700; font-size: var(--step-1); }
.lex-homeo { background: var(--homeo-bg); border-color: var(--homeo-line); } .lex-homeo .lex-icon { background: var(--homeo); } .lex-homeo .lex-count { color: var(--homeo); }
.lex-phyto { background: var(--phyto-bg); border-color: var(--phyto-line); } .lex-phyto .lex-icon { background: var(--phyto); } .lex-phyto .lex-count { color: var(--phyto); }
.lex-soon { opacity: .7; border-style: dashed; } .lex-soon .lex-icon { background: var(--disabled-bg); color: var(--disabled-ink); }
.lex-badge { flex: none; padding: 3px 10px; border-radius: 999px; background: #EEE; color: var(--ink-soft); font-size: var(--step--1); font-weight: 700; }
.mm-link { font-weight: 700; color: var(--homeo); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.ph-link { font-weight: 700; color: var(--phyto); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.mm-link:hover, .mm-link:focus-visible, .ph-link:hover, .ph-link:focus-visible { text-decoration-style: solid; }
.homeo-sec, .phyto-sec { border-radius: 10px; padding: 10px 12px 4px; margin-top: 8px; border-top: 0; }
.homeo-sec { background: var(--homeo-bg); } .homeo-sec h4 { color: var(--homeo); }
.phyto-sec { background: var(--phyto-bg); } .phyto-sec h4 { color: var(--phyto); }
.mm-tip { margin: 0 0 6px; }
.mm-group h3 { margin: 0 0 4px; font-size: var(--step-0); color: var(--homeo); }
.ph-group h3 { color: var(--phyto); }
.mm-group .small { margin: 0 0 8px; }
.mm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 40px; border-radius: 999px; border: 1px solid var(--homeo-line); background: var(--homeo-bg); color: #2F2450; text-decoration: none; font-weight: 700; font-size: var(--step--1); }
.mm-chip.ph-chip { border-color: var(--phyto-line); background: var(--phyto-bg); color: #17402D; }
.mm-count { display: inline-block; min-width: 1.6em; padding: 1px 7px; border-radius: 999px; background: var(--homeo); color: #fff; font-size: 0.8rem; text-align: center; font-weight: 700; }
.ph-chip .mm-count, .mm-count.ph-count { background: var(--phyto); }
.list .mm-count { margin-left: 8px; flex: none; }
.mm-ab { font-weight: 400; color: var(--ink-soft); font-size: 0.85em; }
.ph-lat { font-weight: 400; color: var(--ink-soft); font-size: 0.85em; }
.mm-sheet .mm-title { margin: 4px 0 2px; font-size: var(--step-2); }
.ph-latin { margin: 0 0 6px; color: var(--ink-soft); }
.mm-al { margin: 0 0 6px; }
.mm-badge { display: inline-block; margin: 4px 0 8px; padding: 4px 10px; border-radius: 8px; background: #FFF4D6; color: #6A4B00; font-size: var(--step--1); font-weight: 700; }
.ph-ev { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 8px; font-size: var(--step--1); font-weight: 700; }
.ph-ev-A { background: #DDF1E5; color: #145236; } .ph-ev-B { background: #E6F0FA; color: #0D47A1; } .ph-ev-T { background: #F1EDE4; color: #5A4A2A; }
.ph-dose { background: var(--phyto-bg); border-radius: 10px; padding: 10px 12px 4px; border-top: 0; margin: 8px 0; }
.ph-dose h4 { color: var(--phyto); }
.ph-preg h4 { color: #8A5A00; }
.mm-mod { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.mm-mod section { border-radius: 10px; padding: 10px 12px; }
.mm-mod h4 { margin: 0 0 4px; font-size: var(--step-0); }
.mm-mod p { margin: 0; line-height: 1.5; }
.mm-agg { background: #FDECEA; border: 1px solid #F1B8B2; } .mm-agg h4 { color: var(--danger); }
.mm-amel { background: #E9F6EE; border: 1px solid #A9D3BE; } .mm-amel h4 { color: #1E6B4A; }
.mm-used { margin-top: 6px; }
.mm-tid { flex: none; margin-left: 8px; color: var(--ink-soft); font-size: var(--step--1); }
@media (max-width: 520px) { .mm-mod { grid-template-columns: 1fr; } }

/* ---------- Lexiques 1.15.0: Bach (rose) + acupuncture points (terracotta) ---------- */
:root { --bach: #A23B6A; --bach-bg: #FBF0F5; --bach-line: #E7C0D3; --acu: #A4461F; --acu-bg: #FCF2EC; --acu-line: #EBC4AE; }
.btn.bach-btn { background: var(--bach); }
.btn.acu-btn { background: var(--acu); }
.lex-bach { background: var(--bach-bg); border-color: var(--bach-line); } .lex-bach .lex-icon { background: var(--bach); } .lex-bach .lex-count { color: var(--bach); }
.lex-acu { background: var(--acu-bg); border-color: var(--acu-line); } .lex-acu .lex-icon { background: var(--acu); } .lex-acu .lex-count { color: var(--acu); }
.ba-link { font-weight: 700; color: var(--bach); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.bach-sec { background: var(--bach-bg); border-radius: 10px; padding: 10px 12px 4px; margin-top: 8px; border-top: 0; }
.bach-sec h4 { color: var(--bach); }
.ba-group h3 { color: var(--bach); }
.mm-chip.ba-chip { border-color: var(--bach-line); background: var(--bach-bg); color: #5A1F3A; }
.ba-chip .mm-count, .mm-count.ba-count { background: var(--bach); }
.ba-badge { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: var(--bach-bg); color: var(--bach); font-size: var(--step--1); font-weight: 700; }
.ba-group-title { margin: 18px 0 6px; font-size: var(--step-0); color: var(--ink-soft); }
.ap-group h3 { color: var(--acu); }
.mm-chip.ap-chip { border-color: var(--acu-line); background: var(--acu-bg); color: #4F200C; }
.mm-chip.ap-chip .dot { width: 14px; height: 14px; }
.ap-chip .mm-count, .mm-count.ap-count { background: var(--acu); }
.ap-row { display: flex; align-items: flex-start; gap: 8px; }
.ap-row .dot { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.fiche-points a.ap-link { display: flex; align-items: center; gap: 8px; color: var(--acu); font-weight: 700; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; min-height: 28px; }
.ap-sheet .mm-title .dot { width: 20px; height: 20px; vertical-align: -2px; }
.ap-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ap-cat { padding: 3px 9px; border-radius: 8px; background: var(--acu-bg); border: 1px solid var(--acu-line); color: #4F200C; font-size: var(--step--1); font-weight: 700; }
.ap-preg { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: #FDECEA; color: var(--danger); font-weight: 700; font-size: var(--step--1); }
.ap-ind { background: var(--acu-bg); border-radius: 10px; padding: 10px 12px 4px; border-top: 0; margin: 8px 0; }
.ap-ind h4 { color: var(--acu); }

/* ---------- Lexiques 1.16.0: vitamins (amber) + glossary (slate) ---------- */
:root { --vita: #A66300; --vita-bg: #FFF6E6; --vita-line: #EED3A3; --glo: #3E5463; --glo-bg: #F1F4F6; --glo-line: #C9D3DA; }
.btn.vita-btn { background: var(--vita); }
.lex-vita { background: var(--vita-bg); border-color: var(--vita-line); } .lex-vita .lex-icon { background: var(--vita); } .lex-vita .lex-count { color: var(--vita); }
.lex-glo { background: var(--glo-bg); border-color: var(--glo-line); margin-bottom: 12px; } .lex-glo .lex-icon { background: var(--glo); font-weight: 700; font-size: 1.15rem; } .lex-glo .lex-count { color: var(--glo); }
.vi-link { font-weight: 700; color: var(--vita); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.vita-sec { background: var(--vita-bg); border-radius: 10px; padding: 10px 12px 4px; margin-top: 8px; border-top: 0; }
.vita-sec h4 { color: var(--vita); }
.vi-group h3 { color: var(--vita); }
.mm-chip.vi-chip { border-color: var(--vita-line); background: var(--vita-bg); color: #4A2C00; }
.vi-chip .mm-count, .mm-count.vi-count { background: var(--vita); }
.vi-badge { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: var(--vita-bg); color: var(--vita); font-size: var(--step--1); font-weight: 700; }
.vi-dose { background: var(--vita-bg); } .vi-dose h4 { color: var(--vita); }
.vi-ul h4 { color: var(--danger); }
.gl-chips { margin: 10px 0 4px; }
.mm-chip.gl-chip { border-color: var(--glo-line); background: var(--glo-bg); color: var(--glo); }
.mm-chip.gl-chip.on { background: var(--glo); color: #fff; border-color: var(--glo); }
.gl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gl-list li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.gl-term { margin: 0 0 4px; font-weight: 700; color: var(--glo); }
.gl-def { margin: 0; line-height: 1.5; }
.gl-more { display: inline-block; margin-top: 6px; font-size: var(--step--1); font-weight: 700; color: var(--lex); }

/* ---------- Lexiques 1.17.0: aromatherapy (cyan), meridians (indigo), safety (red) ---------- */
:root { --aroma: #0E7490; --aroma-bg: #ECF8FB; --aroma-line: #A9DCE8; --mer: #3949AB; --mer-bg: #EEF0FB; --mer-line: #C5CAEE; --saf: #B3261E; --saf-bg: #FDF0EF; --saf-line: #F0B9B4; }
.btn.aroma-btn { background: var(--aroma); } .btn.mer-btn { background: var(--mer); } .btn.saf-btn { background: var(--saf); }
.lex-aroma { background: var(--aroma-bg); border-color: var(--aroma-line); } .lex-aroma .lex-icon { background: var(--aroma); } .lex-aroma .lex-count { color: var(--aroma); }
.lex-mer { background: var(--mer-bg); border-color: var(--mer-line); } .lex-mer .lex-icon { background: var(--mer); } .lex-mer .lex-count { color: var(--mer); }
.lex-saf { background: var(--saf-bg); border-color: var(--saf-line); margin-bottom: 12px; } .lex-saf .lex-icon { background: var(--saf); } .lex-saf .lex-count { color: var(--saf); }
.ar-link { font-weight: 700; color: var(--aroma); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.aroma-sec { background: var(--aroma-bg); border-radius: 10px; padding: 10px 12px 4px; margin-top: 8px; border-top: 0; }
.aroma-sec h4, .ar-group h3, .ar-use h4 { color: var(--aroma); }
.ar-use { background: var(--aroma-bg); border-radius: 10px; padding: 10px 12px 4px; border-top: 0; margin: 8px 0; }
.mm-chip.ar-chip { border-color: var(--aroma-line); background: var(--aroma-bg); color: #0B3F4E; }
.ar-chip .mm-count, .mm-count.ar-count { background: var(--aroma); }
.ar-age { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: var(--aroma-bg); color: var(--aroma); font-size: var(--step--1); font-weight: 700; }
.mm-chip.mer-chip { border-color: var(--mer-line); background: var(--mer-bg); color: #1A237E; }
.mm-chip.mer-chip .dot { width: 14px; height: 14px; }
.mer-all { margin: 10px 0; }
.el-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .el-grid { grid-template-columns: 1fr 1fr; } }
.el-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.el-card .el-name { margin: 0 0 2px; font-weight: 700; font-size: var(--step-1); }
.el-card .small { margin: 0 0 8px; }
.el-bois { border-left: 6px solid var(--m-wood); } .el-feu { border-left: 6px solid var(--m-fire); } .el-terre { border-left: 6px solid var(--m-earth); } .el-metal { border-left: 6px solid var(--m-metal); } .el-eau { border-left: 6px solid var(--m-water); }
.mer-clock { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.mer-clock li { display: flex; align-items: center; gap: 10px; }
.mer-hour { min-width: 7.5em; font-weight: 700; color: var(--mer); font-variant-numeric: tabular-nums; }
.mer-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: var(--step--1); }
.mer-table th { text-align: left; color: var(--ink-soft); font-weight: 700; padding: 6px 8px 6px 0; width: 42%; vertical-align: top; }
.mer-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.mer-table th { border-bottom: 1px solid var(--line); }
.saf-grid { display: grid; gap: 8px; grid-template-columns: 1fr; margin: 12px 0; }
@media (min-width: 560px) { .saf-grid { grid-template-columns: 1fr 1fr; } }
.saf-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; border-radius: 12px; border: 1px solid var(--saf-line); background: var(--saf-bg); color: #5C0F0A; text-decoration: none; font-weight: 700; }
.saf-ic { font-size: 1.4rem; width: 1.8em; text-align: center; flex: none; }
.saf-intro { background: var(--saf-bg); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }

/* Formula ingredients without an individual portrait retain the same spacing. */
.reckeweg-ingredients li > span { display:block; padding:12px 14px; }

/* 1.20: consistent library controls and searchable lexicons. */
.tabs.four {align-items:stretch;grid-template-columns:repeat(4,minmax(0,1fr));}
.tabs.four > a {display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;text-align:center;padding:12px 3px;min-width:0;}
.library-icon {display:block;font-size:26px;line-height:32px;height:32px;}
.library-label {display:block;font-size:12px;line-height:1.25;overflow-wrap:normal;}
.brand-badges {display:flex;gap:14px;align-items:center;margin:14px 0;}
.brand-badges a {display:flex;align-items:center;justify-content:center;border:1px solid #d8e4df;border-radius:10px;background:white;min-height:52px;padding:8px 12px;}
.brand-badges img {width:94px;height:38px;object-fit:contain;}
.search-feedback {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:5px 0 16px;font-size:13px;min-height:30px;color:#425d52;}
.search-clear {border:1px solid #adc5b8;background:#fff;border-radius:8px;padding:7px 12px;color:#224d39;cursor:pointer;}
[data-text][hidden],.search-clear[hidden] {display:none!important;}
#acu-meridians > div {min-width:0;} #acu-meridians .lex-card {height:100%;box-sizing:border-box;}

/* 1.21 — intake questionnaire + key questions */
:root { --iq: #1565C0; --iq-bg: #EEF5FD; --iq-line: #BCD6F2; --q-rf: #B3261E; --q-w: #1565C0; --q-m: #2E7D5B; }
.iq-progress { height:8px; border-radius:99px; background:var(--line); overflow:hidden; margin:8px 0 6px; }
.iq-progress > div { height:100%; background:var(--iq); border-radius:99px; transition:width .25s; }
.iq-steps { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin:6px 0 2px; }
.iq-steps a { min-width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; border:1px solid var(--iq-line); color:var(--iq); text-decoration:none; font-weight:700; background:#fff; }
.iq-steps a.done { background:var(--iq-bg); }
.iq-steps a.on { background:var(--iq); color:#fff; border-color:var(--iq); }
.iq-count { text-align:center; margin:2px 0 8px; }
.iq-tip { background:var(--iq-bg); border:1px solid var(--iq-line); border-radius:12px; padding:10px 12px; margin:0 0 12px; font-size:var(--step--1); line-height:1.5; }
.iq-set { border:1px solid var(--line); border-radius:12px; padding:8px 12px 10px; margin:10px 0; min-width:0; }
.iq-set legend { font-weight:700; padding:0 4px; }
.iq-opt { display:flex; gap:10px; align-items:flex-start; padding:7px 0; line-height:1.4; cursor:pointer; }
.iq-opt input { width:20px; height:20px; flex:0 0 auto; margin-top:1px; accent-color:var(--iq); }
.iq-opt.none { border-top:1px dashed var(--line); margin-top:4px; padding-top:9px; }
.iq-choices .iq-opt { padding:6px 0; }
.iq-scale { display:grid; grid-template-columns:repeat(11, minmax(0,1fr)); gap:4px; }
.iq-scale label { position:relative; }
.iq-scale input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.iq-scale span { display:flex; align-items:center; justify-content:center; height:36px; border:1px solid var(--iq-line); border-radius:8px; font-weight:700; font-size:var(--step--1); }
.iq-scale input:checked + span { background:var(--iq); color:#fff; border-color:var(--iq); }
.iq-scale input:focus-visible + span { outline:3px solid var(--select); }
.iq-alert { background:#FDF0EF; border-color:#F0B9B4; color:#5B0F0A; }
.iq-flag { color:var(--danger); font-weight:700; margin:4px 0 8px; }
.iq-box { margin-top:12px; }
.iq-sum h4 { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.iq-edit { font-size:var(--step--1); font-weight:400; }
.iq-sum dl { margin:0 0 6px; }
.iq-sum dt { font-weight:700; font-size:var(--step--1); color:#3E5463; margin-top:6px; }
.iq-sum dd { margin:0; white-space:pre-wrap; line-height:1.5; overflow-wrap:anywhere; }
.q-sec { background:#FAFCFF; }
.q-group { border-left:4px solid var(--q-w); padding:2px 0 2px 10px; margin:10px 0; }
.q-group h5 { margin:0 0 4px; font-size:var(--step--1); color:var(--q-w); }
.q-group ul { margin:0; padding-left:18px; }
.q-group li { margin:3px 0; line-height:1.45; }
.q-group.q-rf { border-color:var(--q-rf); } .q-group.q-rf h5 { color:var(--q-rf); }
.q-group.q-m { border-color:var(--q-m); } .q-group.q-m h5 { color:var(--q-m); }
.q-urg { color:var(--q-rf); }
.q-pre { white-space:pre-wrap; font-family:inherit; font-size:var(--step--1); line-height:1.5; margin:0; max-height:55vh; overflow:auto; }
@media print { .iq-steps, .iq-progress, .btn, .tabs { display:none !important; } }
.meridian-why { background:#EEF5FC; border:1px solid var(--blue-light); border-radius:12px; padding:12px 14px; margin:10px 0; font-size:var(--step--1); line-height:1.5; }

/* 1.22: pain selection and accessible image enlargement */
.pain-region-title,.pain-choice-label {text-align:center;font-weight:700;margin:10px 0;}
.region-enlarge {display:block;width:100%;border:0;background:transparent;color:var(--blue);cursor:zoom-in;padding:0 0 10px;font:inherit;}
.region-enlarge span {display:block;font-size:14px;text-decoration:underline;}
.region-enlarge:focus-visible {outline:3px solid var(--blue);outline-offset:3px;}
.pain-zoom-dialog {width:min(96vw,1000px);max-width:1000px;max-height:95dvh;}
.pain-zoom-dialog .dlg-body {min-height:0;overflow:auto;}
.pain-zoom-controls {display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.pain-zoom-controls label {display:flex;align-items:center;gap:8px;flex:1;}
.pain-zoom-controls input {min-width:70px;width:100%;}
.pain-zoom-controls button {min-width:42px;min-height:42px;border:1px solid #aac5df;border-radius:8px;background:white;font-size:24px;}
.pain-zoom-viewport {overflow:auto;max-height:55dvh;width:100%;border:1px solid #d3deeb;background:white;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.pain-zoom-img {display:block;max-width:none!important;height:auto;touch-action:pan-x pan-y pinch-zoom;}

/* Compact help cards: artwork, manual paging and persistent switch. */
.guide-card {margin:12px 0 18px;padding:12px;border:1px solid #c7daec;border-radius:16px;background:#f2f8ff;color:#244764;}
.guide-message {display:flex;align-items:center;gap:10px;}
.guide-message img {width:76px;height:90px;flex-shrink:0;object-fit:contain;}
.guide-message p {margin:0;font-size:14px;line-height:1.45;}
.guide-footer {display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;margin-top:8px;border-top:1px solid #dce8f5;padding-top:6px;}
.guide-pager {display:flex;align-items:center;gap:6px;}
.guide-pager button {width:36px;min-height:40px;border:0;background:transparent;color:#1260ad;font-size:30px;cursor:pointer;border-radius:8px;}
.guide-count {font-size:13px;white-space:nowrap;min-width:48px;text-align:center;}
.guide-switch {display:inline-flex;gap:6px;align-items:center;min-height:44px;background:none;border:0;color:#244764;cursor:pointer;font-size:12px;padding:2px;}
.guide-switch-track {width:34px;height:20px;background:#738395;border-radius:15px;padding:3px;box-sizing:border-box;}
.guide-switch-track>span {display:block;width:14px;height:14px;background:white;border-radius:50%;}
.guide-switch[aria-checked="true"] .guide-switch-track {background:#1260ad;}
.guide-switch[aria-checked="true"] .guide-switch-track>span {transform:translateX(14px);}
.guide-card button:focus-visible,.guide-switch:focus-visible {outline:3px solid #3a86cf;outline-offset:2px;}
