/* Pocket Inf — iOS "Liquid Glass" interface. No external dependencies.
   Content sits on opaque cards; controls (bars, buttons, fields) float above it in translucent glass. */

:root {
  --bg: #f4efe6;
  --bg2: #fcfaf6;
  --bg3: #efe8dc;
  --fill: rgba(120, 95, 70, 0.10);
  --fill2: rgba(120, 95, 70, 0.18);
  --label: #2e2823;
  --label2: rgba(70, 58, 48, 0.64);
  --label3: rgba(70, 58, 48, 0.32);
  --sep: rgba(90, 70, 52, 0.16);
  --tint: #a4563a;
  --red: #c1432e;
  --orange: #c97a35;
  --yellow: #c49a2c;
  --green: #6e8a58;
  --teal: #4f8580;
  --indigo: #6a6894;
  --purple: #8d5a86;
  --pink: #b85a6c;

  /* glass material */
  --glass: rgba(252, 249, 244, 0.55);
  --glass-strong: rgba(252, 249, 244, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-hi: inset 0 1px 1px rgba(255, 255, 255, 0.95), inset 0 -1px 1px rgba(255, 255, 255, 0.4), inset 0 0 0 0.5px rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 12px 32px -10px rgba(70, 45, 25, 0.22), 0 2px 8px rgba(70, 45, 25, 0.06);
  --glass-blur: blur(10px) saturate(200%) brightness(1.06);
  --lens: rgba(120, 80, 50, 0.09);

  --card-shadow: 0 1px 1px rgba(80, 55, 35, 0.03), 0 6px 20px -8px rgba(80, 55, 35, 0.13);
  --r-card: 24px;
  --r-row: 26px;
  --scale: 1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --nav-h: 56px;
  --tb-h: 62px;
  --tb-gap: max(14px, calc(var(--sab) - 6px));
  --bottom-space: calc(var(--tb-h) + var(--tb-gap) + 28px);
  color-scheme: light;
  --title: #3b4741;  /* slate green, large titles */
  --sage: #8f9c80;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: calc(17px * var(--scale));
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
body { position: fixed; inset: 0; overscroll-behavior: none; }
/* UI chrome is not selectable (no text selection or callout on buttons, rows, bars…); reading content still is */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rich, .qa-card, .doc, .lead, input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { -webkit-user-drag: none; }
a { color: var(--tint); }
.hidden { display: none !important; }

/* ---------- reusable glass material ---------- */
.glass,
.tabbar, .tab-search, .nav-left .nav-btn, .nav-right:has(> .nav-btn:not(.hidden)),
.search, .chip, .segmented, .score-bar, .toast, .update-banner, .update-pill, .viewer .v-close {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), var(--glass-shadow);
}

/* ---------- app frame ---------- */
#app { position: absolute; inset: 0; overflow: hidden; }
.tab { position: absolute; inset: 0; overflow: hidden; visibility: hidden; }
.tab.active { visibility: visible; }

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s;
}
.page, .splash {
  /* warm paper with faint botanical branches (top right, bottom left) */
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -30 190 260'><g fill='%238f9c80' fill-opacity='.22' stroke='%238f9c80' stroke-opacity='.3' stroke-width='1.2'><path fill='none' d='M74 218C112 110 128 50 158 0'/><path transform='translate(86.8 181.1) rotate(-111.1) scale(0.98)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(98.9 145.4) rotate(-31.3) scale(0.95)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(109.8 113.6) rotate(-111.0) scale(0.93)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(119.7 85.2) rotate(-30.1) scale(0.91)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(129.4 59.7) rotate(-108.4) scale(0.88)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(139.1 36.5) rotate(-25.8) scale(0.86)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(149.4 15.3) rotate(-102.2) scale(0.84)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(158.0 0.0) rotate(-59.0) scale(.8)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/></g></svg>") right -20px top calc(var(--sat) + 12px) / 178px auto no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -30 190 260'><g transform='rotate(180 85 100)'><g fill='%238f9c80' fill-opacity='.22' stroke='%238f9c80' stroke-opacity='.3' stroke-width='1.2'><path fill='none' d='M74 218C112 110 128 50 158 0'/><path transform='translate(86.8 181.1) rotate(-111.1) scale(0.98)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(98.9 145.4) rotate(-31.3) scale(0.95)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(109.8 113.6) rotate(-111.0) scale(0.93)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(119.7 85.2) rotate(-30.1) scale(0.91)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(129.4 59.7) rotate(-108.4) scale(0.88)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(139.1 36.5) rotate(-25.8) scale(0.86)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(149.4 15.3) rotate(-102.2) scale(0.84)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/><path transform='translate(158.0 0.0) rotate(-59.0) scale(.8)' d='M0 0C12-13 34-13 46 0C34 13 12 13 0 0Z'/></g></g></svg>") left -26px bottom 44px / 166px auto no-repeat,
    linear-gradient(var(--bg) 0, rgba(244, 239, 230, 0) 56px),   /* same colour as the status bar, fading out: no edge under it */
    radial-gradient(120% 60% at 100% 0%, rgba(214, 180, 150, 0.16), transparent 60%),
    var(--bg);
}
.page.under { transform: translate3d(-26%, 0, 0); filter: brightness(0.9); pointer-events: none; }
.page.offright { transform: translate3d(100%, 0, 0); }
.page.dragging { transition: none; }
.page:not(.under):not(.root) { box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1); }

/* ---------- navigation bar: floating glass buttons + scroll-edge blur ---------- */
.navbar {
  position: relative;
  z-index: 5;
  flex: none;
  padding-top: var(--sat);
  height: calc(var(--nav-h) + var(--sat));
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr);
  column-gap: 8px;
  align-items: center;
  pointer-events: none;
}
.navbar > * { pointer-events: auto; }
/* once scrolled, the whole bar takes taps (scroll to top) */
.page.scrolled .navbar { pointer-events: auto; }
/* iOS 27 top bar: once content scrolls under it, a frosted translucent panel exactly the bar's height,
   with a hairline at its bottom edge (no fade, no mask). */
:root { --frost: rgba(244, 239, 230, 0.8); }
.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  background: var(--frost);
  box-shadow: inset 0 -0.5px 0 var(--sep);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.page.scrolled .navbar::before, .page.solidnav .navbar::before { opacity: 1; }
.navbar .nav-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.page.scrolled .nav-title, .page.notitle .nav-title { opacity: 1; transform: none; }
/* long titles in the bar (sub-pages): up to two lines, slightly smaller */
.navbar .nav-title.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; line-height: 1.18; text-wrap: balance; }
.nav-left, .nav-right { display: flex; align-items: center; min-width: 0; }
.nav-left { padding-left: max(14px, var(--sal)); }
.nav-right { justify-content: flex-end; margin-right: max(14px, var(--sar)); justify-self: end; border-radius: 999px; padding: 0 2px; }
.nav-btn {
  border: 0;
  background: none;
  color: var(--label);
  font-size: 17px;
  font-weight: 500;
  height: 44px;
  min-width: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.nav-btn svg { width: 22px; height: 22px; flex: none; }
.nav-left .nav-btn { width: 44px; padding: 0; }
.nav-btn.back svg { width: 21px; height: 21px; margin-left: -2px; }
.nav-btn.back .lbl { display: none; }
.nav-right .nav-btn { background: none; box-shadow: none; }
/* several buttons sharing one glass capsule: thin divider between them, like iOS button groups */
.nav-right .nav-btn { position: relative; }
/* pressed: dim only the content (icon or text), never the button — its ::before divider must not move or fade */
.nav-right .nav-btn:is(.pressed) { transform: none; }
.nav-right .nav-btn > svg { transition: opacity 0.12s; }
.nav-right .nav-btn:is(.pressed) > svg { opacity: 0.55; }
.nav-right .nav-btn:not(:has(svg)):is(.pressed) { color: var(--label3); }
.nav-right > .nav-btn:not(.hidden) ~ .nav-btn:not(.hidden)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 1px;
  border-radius: 1px;
  background: var(--sep);
}
.nav-btn.fav.on { color: var(--orange); }

/* ---------- scroller ---------- */
.scroller {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  margin-top: calc(-1 * (var(--nav-h) + var(--sat)));
  /* no top padding: Safari and Chrome measure sticky offsets differently from it — a spacer element is used instead */
  padding: 0 max(16px, var(--sar)) var(--bottom-space) max(16px, var(--sal));
}
.scroll-space { height: calc(var(--nav-h) + var(--sat)); }
.page.notitle { --nav-h: 64px; }   /* inner pages: roomier frosted top bar */
.page.notitle .scroll-space { height: calc(var(--nav-h) + var(--sat) + 14px); }
/* tab pages with nothing in the top bar: the large title sits right under the status bar (no empty bar row) */
.page.large:not(:has(.nav-left .nav-btn, .nav-right .nav-btn:not(.hidden))) .scroll-space { height: calc(var(--sat) + 10px); }
.large-title {
  color: var(--title);
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 4px 13px; /* 10 + 41 + 13 = 64 = where a search field sticks (bar 56 + 8): no jump on any iPhone */
  overflow-wrap: anywhere;
}
.large-title.long { font-size: 28px; line-height: 34px; }
.lead { font-size: 1.06rem; line-height: 1.45; color: var(--label2); margin: -2px 4px 18px; }
.subtitle-line { font-size: 0.94rem; color: var(--label2); margin: -4px 4px 14px; }

/* ---------- search field (glass capsule) ---------- */
.searchbar {
  position: sticky;
  top: calc(var(--nav-h) + var(--sat) + 8px);   /* floats just below the frosted bar */
  z-index: 4;
  margin: 0 0 14px;
  pointer-events: none;                        /* only the field itself catches taps */
}
.searchbar > * { pointer-events: auto; }
.searchbar.static { position: relative; top: auto; }   /* Accueil: same place as Recherche, but scrolls away */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--label2);
  border: 0;
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 17px;
  color: var(--label);
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  margin: 0;
  text-indent: 0;
  font-family: inherit;
}
/* Safari adds an inset decoration to type=search inputs, which pushed the text right */
.search input::-webkit-search-decoration,
.search input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
.search input::placeholder { color: var(--label2); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: none; padding: 0; margin-right: -6px; width: 32px; height: 32px; color: rgba(60, 60, 67, 0.45); display: inline-flex; align-items: center; justify-content: center; visibility: hidden; flex: none; }
.search .clear svg { width: 20px; height: 20px; }
.search .clear:is(.pressed) { opacity: 0.5; }
.search.has-text .clear { visibility: visible; }
/* iOS draws the text cursor of a field on a blurred (backdrop-filter) surface in a separate layer that it sometimes stops
   updating: the cursor stays at an old place while typing or deleting. While the field is in use it gets a plain surface
   of the same colour; the frosted glass comes back when it's left. The ✕ keeps its room even when hidden, so the text
   area never changes width under the cursor. */
.search:focus-within { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg2); }
button.search { width: 100%; text-align: left; font-size: 17px; }

/* ---------- chips ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; margin: -6px -16px -2px; padding: 6px 16px 26px; scrollbar-width: none;
  /* tall bottom padding so the chips' shadows aren't clipped by the scroll box */
  /* edge fades: right while more chips follow, left only once scrolled */
  --fade-l: 0px; --fade-r: 32px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  transition: --fade-l 0.2s, --fade-r 0.2s;
}
.chips.fade-l { --fade-l: 32px; }
.chips.at-end { --fade-r: 0px; }
.chips::-webkit-scrollbar { display: none; }
@property --fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: '<length>'; inherits: false; initial-value: 32px; }
.chip {
  flex: none;
  border: 0;
  border-radius: 999px;
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 15px;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.2s;
  /* no backdrop blur on the filter row: plain fill */
  background: var(--glass-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--glass-hi), 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px -6px rgba(0, 0, 0, 0.12);
}
.chip:is(.pressed) { transform: scale(1.06); }
.chip.on { background: var(--tint); color: #fff; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 6px 16px -6px color-mix(in srgb, var(--tint) 70%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 4px 16px; }
.badge { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 5px 11px; background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); }

/* ---------- grouped lists ---------- */
.group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--label2);
  margin: 26px 18px 8px;
}
.group-title:first-child { margin-top: 6px; }
.group-detail { font-weight: 400; }   /* score items: the signs after « Visage : » */
.fav-list > .group-title:first-child { margin-top: 26px; }   /* Favoris: first section at the height of Réglages’ « Contenu » */
.group-title.with-action { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.group-action { border: 0; background: none; padding: 0; font-size: 15px; font-weight: 500; color: var(--tint); }
.group-action:is(.pressed) { opacity: 0.4; }
.group-foot { font-size: 13px; color: var(--label2); margin: 8px 18px 0; line-height: 1.35; }
.list { background: var(--bg2); border-radius: var(--r-row); overflow: hidden; box-shadow: var(--card-shadow); }
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 0 0 16px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 1rem;
  color: var(--label);
  text-decoration: none;
  transition: background 0.15s;
}
button.row:is(.pressed), a.row:is(.pressed), .row.tap:is(.pressed) { background: var(--fill); }
.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 12px 0;
  align-self: stretch;
}
.row + .row .row-main::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: var(--sep-left, 16px);
  height: 0.5px;
  background: var(--sep);
}
.row.has-icon { --sep-left: 62px; }
.row.has-thumb { --sep-left: 74px; }
.row-text { flex: 1; min-width: 0; }
.row-title { line-height: 1.3; overflow-wrap: anywhere; }
.row-sub {
  font-size: 0.86rem;
  color: var(--label2);
  line-height: 1.3;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* rows with a picture (logo or photo): one line of title and one of subtitle at most */
.row.has-thumb .row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.row.has-thumb .row-sub { -webkit-line-clamp: 1; overflow-wrap: normal; word-break: normal; }
.row-value { color: var(--label2); flex: none; font-size: 1rem; }
.row .chev { width: 8px; height: 13px; flex: none; color: var(--label3); }
.row .check { width: 18px; height: 18px; color: var(--tint); flex: none; opacity: 0; transform: scale(0.6); transition: 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.row.selected .check { opacity: 1; transform: none; }
.row.danger { color: var(--red); }
.row.tinted { color: var(--tint); }
.row.center .row-main { justify-content: center; }

.icon-sq {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;                          /* drawn icons are round, like Réglages */
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -1px 2px rgba(0, 0, 0, 0.08);
}
.icon-sq svg { width: 20px; height: 20px; }
.icon-sq img { width: 100%; height: 100%; object-fit: contain; }
.icon-sq:has(> img) { border-radius: 10px; }   /* pictures keep their rounded-square shape */
.icon-sq.img { background: transparent; box-shadow: 0 3px 8px -4px rgba(0, 0, 0, 0.35); }
.icon-sq.img img { border-radius: 23%; }
.thumb { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--fill); margin: 8px 0; }
.thumb.contain { object-fit: contain; background: transparent; }
/* section style « cartes »: one card per entry, the picture fills the card's left edge */
.list.cards { background: none; box-shadow: none; border-radius: 0; overflow: visible; display: grid; gap: 8px; }
.list.cards .row { background: var(--bg2); border-radius: var(--r-row); overflow: hidden; box-shadow: var(--card-shadow); padding-left: 0; min-height: 62px; gap: 14px; }
.list.cards .row + .row .row-main::before { display: none; }
.list.cards .thumb { width: 62px; height: auto; align-self: stretch; margin: 0; border-radius: 0; }
.list.cards .thumb.none { display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--label3); }
.list.cards .thumb .num { font-size: 17px; font-weight: 700; }

.empty { text-align: center; color: var(--label2); padding: 48px 24px; line-height: 1.45; }
.empty svg { width: 52px; height: 52px; color: rgb(70, 58, 48); opacity: 0.32; display: block; margin: 0 auto 12px; }   /* faded as a whole: overlapping strokes (the magnifier's handle) leave no darker seam */
.empty b { display: block; color: var(--label); font-size: 1.2rem; margin-bottom: 6px; }

/* alphabetical index */
.alpha-index {
  position: absolute;
  right: max(0px, var(--sar));
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--tint);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* sits in the page's 16px right margin, like iOS: the list keeps its normal padding */
.alpha-index span { line-height: 1.3; width: 16px; text-align: center; }
/* glossary cards (fiche with a « cards » field): placed by JS between the navigation bar and the tab bar */
.alpha-index.fit { top: 0; transform: none; justify-content: center; padding: 0; }
.alpha-index.fit span { height: var(--step, 15px); display: grid; place-items: center; line-height: 1; }

/* ---------- home ---------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 2px; }
.tile {
  position: relative;
  border: 0;
  border-radius: 26px;
  background: var(--bg2);
  box-shadow: var(--card-shadow);
  min-height: 118px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  gap: 14px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.tile:is(.pressed) { transform: scale(0.965); }
.tile .tile-icon { display: block; flex: none; width: 48px; height: 48px; }
.tile .tile-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tile .tile-icon.img { display: grid; place-items: center; width: 44px; height: 44px; }
.tile .tile-icon.sq { width: 46px; height: 46px; margin: 0; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 6px 14px -6px rgba(0, 0, 0, 0.35); }
.tile .tile-icon.sq svg { width: 26px; height: 26px; }
/* section icons drawn as SVG files, in lists (not the Accueil tiles): in a soft round badge, like Réglages (photos keep their shape) */
.icon-sq.img.svg, .icon-sq.img:has(> img[src*=".svg"]) {
  --c: var(--tint);
  border-radius: 50%; background: color-mix(in srgb, var(--c) 13%, var(--bg2));
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--c) 22%, transparent);
}
.icon-sq.img.svg.green { --c: var(--green); }   /* icon colour « vert » chosen in the admin */
.icon-sq.img.svg > img, .icon-sq.img > img[src*=".svg"] { width: 60%; height: 60%; border-radius: 0; }
.icon-sq.img.svg > img { transition: opacity 0.15s; }
.tile > div:not(.tile-icon) { min-width: 0; width: 100%; }
.tile.wide > div:not(.tile-icon), .tile.urgent > div:not(.tile-icon) { flex: 1; width: auto; }
/* one line only: JS shrinks the font a little when a title is too long for its tile */
.tile-title { font-size: 1.04rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 0.86rem; color: var(--label2); margin-top: 3px; line-height: 1.25; }
/* home: one item per line — every tile is a row card: icon · title + subtitle · chevron */
.tiles .tile { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 12px 40px 12px 14px; min-height: 74px; border-radius: 22px; }
.tiles .tile > div:not(.tile-icon) { flex: 1; width: auto; }
.tile.urgent { background: #f6e4dc; box-shadow: inset 0 0 0 1px rgba(193, 67, 46, 0.14), var(--card-shadow); }
.tile.urgent .tile-title { color: #9c3524; }
.tile.urgent .tile-sub { color: rgba(156, 53, 36, 0.72); }
.tile.urgent .tile-icon.sq { background: #fff; color: #c1432e; }
.tile .tile-chev { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 8px; height: 13px; color: var(--label3); }
.tile.urgent .tile-chev { color: rgba(156, 53, 36, 0.5); }

/* ---------- detail cards ---------- */
.card { background: var(--bg2); border-radius: var(--r-card); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--card-shadow); }
.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--label2);
  margin-bottom: 10px;
}
.card-head .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--fill); flex: none; }
.card-head svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; flex: none; background: var(--fill); }
.card[class*="tone-"] .card-head svg { color: #fff; background: var(--tone); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4); }
.card[class*="tone-"] .card-head { color: var(--tone); }
.card[class*="tone-"] { background: linear-gradient(to bottom, color-mix(in srgb, var(--tone) 7%, var(--bg2)), var(--bg2) 70px); }
.tone-danger { --tone: var(--red); }
.tone-warn { --tone: var(--orange); }
.tone-info { --tone: var(--tint); }
.tone-ok { --tone: var(--green); }
.tone-up { --tone: var(--red); }
.tone-down { --tone: var(--indigo); }

.rich { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.rich p { margin: 0 0 8px; }
.rich p:last-child, .rich ul:last-child, .rich ol:last-child { margin-bottom: 0; }
.rich .sub { font-weight: 600; margin: 12px 0 4px; }
.rich .sub:first-child { margin-top: 0; }
/* « ## Titre » inside a fiche card: never bigger than a « Label : » subtitle (same look) */
.card .rich .doc-h { font-size: inherit; font-weight: 600; line-height: inherit; color: var(--label); margin: 12px 0 4px; }
.card .rich .doc-h:first-child { margin-top: 0; }
.rich ul, .rich ol { margin: 0 0 8px; padding-left: 1.3em; }
.rich li { margin: 4px 0; padding-left: 2px; }
.rich ul li::marker { color: var(--label3); }
.rich ol li::marker { color: var(--tone, var(--tint)); font-weight: 700; }
.footnote { font-size: 13px; color: var(--label2); text-align: center; margin: 18px 8px 4px; }

.figure { margin: 0 0 12px; border-radius: var(--r-card); overflow: hidden; background: #fff; box-shadow: var(--card-shadow); border: 0; padding: 0; display: block; width: 100%; }
.figure img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.figure figcaption { font-size: 13px; color: var(--label2); padding: 9px 14px; background: var(--bg2); text-align: left; }
.banner { margin: 0 0 14px; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--card-shadow); background: #fff; }
.banner img { display: block; width: 100%; height: auto; }
.btn-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; padding: 14px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 12%, var(--bg2)); color: var(--tint); font-weight: 600; text-decoration: none; }
.btn-link svg { width: 20px; height: 20px; }

/* ---------- buttons (tinted glass capsules) ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 0%, rgba(255, 255, 255, 0.28), transparent 55%), var(--tint);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -1px 2px rgba(0, 0, 0, 0.12), 0 10px 24px -10px color-mix(in srgb, var(--tint) 80%, transparent);
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.btn:is(.pressed) { transform: scale(1.04); }
.btn:disabled { opacity: 0.45; }
.btn.secondary, .btn.plain {
  color: var(--tint);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), var(--glass-shadow);
}
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- segmented control: glass track + sliding lens ---------- */
.segmented {
  display: flex;
  border-radius: 999px;
  padding: 4px;
  margin: 0 0 16px;
  position: relative;
  isolation: isolate;
  overflow: hidden;   /* the springy lens overshoots but never shows outside the control */
}
.segmented button {
  position: relative;
  z-index: 1;
  flex: 1;
  border: 0;
  background: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 4px;
  line-height: 1.2;
  transition: color 0.2s;
}
.segmented button.on { font-weight: 600; }
.segmented .seg-lens {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--glass-hi), 0 4px 12px -4px rgba(0, 0, 0, 0.25);
  transition: transform 0.45s cubic-bezier(0.3, 1.35, 0.5, 1), width 0.45s cubic-bezier(0.3, 1.35, 0.5, 1);
}
.segmented:not(:has(.seg-lens)) button.on { background: var(--glass-strong); box-shadow: var(--glass-hi); }

/* ---------- forms (calculators) ---------- */
.field-row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 5px 16px; position: relative; }
.field-row + .field-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 0.5px; background: var(--sep); }
.field-row label { flex: 1; min-width: 0; line-height: 1.25; }
.field-row label small { display: block; color: var(--label2); font-size: 13px; }
.field-row input, .field-row select {
  width: 42%;
  max-width: 180px;
  border: 0;
  outline: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 17px;
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 0.2s;
}
.field-row input:focus, .field-row select:focus { box-shadow: 0 0 0 2px var(--tint); }
.field-row select { text-align: left; text-align-last: right; }
.field-row .unit { color: var(--label2); font-size: 15px; flex: none; white-space: nowrap; }
/* number fields: a narrow box holding the value and its unit */
.num-box { flex: none; display: flex; align-items: center; gap: 6px; width: var(--field-w); background: var(--fill); border-radius: 12px; padding: 0 12px; cursor: text; transition: box-shadow 0.2s; }
.num-box:focus-within { box-shadow: 0 0 0 2px var(--tint); }
.field-row .num-box input { flex: 1; min-width: 0; width: auto; max-width: none; background: none; border-radius: 0; padding: 9px 0; box-shadow: none; }
.result {
  position: relative;
  background: var(--bg2);
  border-radius: 28px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--card-shadow);
  margin: 16px 0 12px;
  overflow: hidden;
}
.result::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--tint) 10%, transparent), transparent 70%); pointer-events: none; }
.result > * { position: relative; }
.result .r-label { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--label2); letter-spacing: 0.4px; }
.result .r-value { font-size: 44px; font-weight: 700; letter-spacing: -0.5px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.result .r-value small { font-size: 20px; font-weight: 600; color: var(--label2); margin-left: 4px; }
.result .r-note { font-size: 15px; font-weight: 600; }
.result .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 0.5px solid var(--sep); }
.result .r-grid div { font-size: 13px; color: var(--label2); }
.result .r-grid b { display: block; font-size: 22px; color: var(--label); font-variant-numeric: tabular-nums; }
.formula { font-size: 13px; color: var(--label2); line-height: 1.45; margin: 4px 18px 0; }
.warnbox { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--orange) 13%, var(--bg2)); border-radius: 20px; padding: 13px 16px; font-size: 13px; line-height: 1.4; margin-top: 18px; }
.warnbox svg { width: 18px; height: 18px; color: var(--orange); flex: none; margin-top: 1px; }

.gauge { position: relative; height: 10px; border-radius: 5px; margin: 18px 4px 4px; background: linear-gradient(90deg, #8fb0ae 0 14%, #8ba373 14% 40%, #d6b45a 40% 60%, #d38c4f 60% 80%, #c1432e 80%); }
.gauge i { position: absolute; top: -6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: inset 0 1px 1px #fff, 0 2px 8px rgba(0, 0, 0, 0.3); transition: left 0.5s cubic-bezier(0.3, 1.3, 0.5, 1); }
.gauge-legend { position: relative; height: 16px; font-size: 11px; color: var(--label2); margin: 4px 4px 0; }
.gauge-legend span { position: absolute; top: 0; transform: translateX(-50%); }

/* ---------- scores: floating glass total ---------- */
.score-bar {
  position: sticky;
  bottom: 10px;
  z-index: 3;
  margin: 24px 0 10px;   /* room below, so at the end of the page it settles 24px under the last card instead of overlapping it */
  padding: 12px 18px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.score-total { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; line-height: 1; }
.score-total small { display: block; font-size: 11px; font-weight: 600; color: var(--label2); text-transform: uppercase; margin-top: 3px; }
.score-interp { flex: 1; font-size: 15px; font-weight: 600; line-height: 1.3; }
.score-interp small { display: block; font-weight: 400; color: var(--label2); font-size: 13px; }
/* Effacer: on the right of the score bar */
.score-reset { flex: none; border: 0; background: var(--fill); color: var(--tint); font-size: 15px; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.score-reset:is(.pressed) { transform: scale(0.94); }
.score-reset:disabled { opacity: 0.35; }
.row .pts { flex: none; min-width: 28px; text-align: center; font-size: 13px; font-weight: 700; color: var(--label2); background: var(--fill); border-radius: 999px; padding: 3px 8px; font-variant-numeric: tabular-nums; transition: 0.2s; }
.row.selected .pts { background: var(--tint); color: #fff; }
/* score key (Interprétation): a plain legend, not tappable rows; the line matching the finished score is lit */
.key-lines { display: grid; grid-template-columns: max-content 1fr; column-gap: 14px; }   /* every meaning starts in the same column */
.key-line { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; padding: 9px 0; border-top: 0.5px solid var(--sep); line-height: 1.35; }
.key-line:first-child { border-top: 0; padding-top: 0; }
.key-line:last-child { padding-bottom: 0; }
.key-range { font-weight: 700; color: var(--label2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.key-line.on .key-range, .key-line.on .key-text { color: var(--tint); }
.key-line.on .key-text { font-weight: 600; }

/* ---------- quiz ---------- */
.quiz-progress { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 0 4px 18px; }
.quiz-progress i { display: block; height: 100%; background: var(--tint); border-radius: 3px; transition: width 0.4s cubic-bezier(0.3, 1.2, 0.5, 1); }
.quiz-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--label2); margin: 4px 4px 8px; font-weight: 600; }
.quiz-q { font-size: 1.25rem; font-weight: 600; line-height: 1.35; margin: 4px 4px 18px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 24px;
  background: var(--bg2);
  padding: 15px 16px;
  margin-bottom: 10px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.35;
  box-shadow: var(--card-shadow);
  transition: background 0.25s, transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.choice:is(.pressed) { transform: scale(0.98); }
.choice .letter { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--fill); transition: 0.25s; }
.choice.good { background: color-mix(in srgb, var(--green) 16%, var(--bg2)); }
.choice.good .letter { background: var(--green); color: #fff; }
.choice.bad { background: color-mix(in srgb, var(--red) 14%, var(--bg2)); }
.choice.bad .letter { background: var(--red); color: #fff; }
.choice:disabled { color: inherit; opacity: 1; }
.big-score { text-align: center; padding: 26px 0 10px; }
.big-score .ring { width: 150px; height: 150px; margin: 0 auto 14px; }
.big-score b { font-size: 26px; display: block; }
.big-score span { color: var(--label2); }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.g-item { border: 0; padding: 0; border-radius: 24px; overflow: hidden; background: var(--bg2); box-shadow: var(--card-shadow); text-align: left; transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
.g-item:is(.pressed) { transform: scale(0.965); }
/* flex column so the caption sits at the bottom of every card (Safari centres button content vertically) */
.g-item { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
/* square image box; the image is positioned inside it so a tall picture can't stretch the card on iOS */
.g-item .g-img { position: relative; width: 100%; aspect-ratio: 1 / 1; flex: none; background: #fff; }
.g-item img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.g-item .g-cap { margin-top: auto; font-size: 0.85rem; font-weight: 600; padding: 10px 12px 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 50; touch-action: none; background: rgba(46, 36, 28, 0); transition: background 0.35s; }
.viewer.show { background: rgba(46, 36, 28, 0.32); }
.viewer:has(.v-sheet.dragging) { transition: none; }
/* sheet sliding up from the bottom, the page stays visible (dimmed) above it */
.viewer .v-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--sat) + 46px); will-change: transform; background: #fff; border-radius: 26px 26px 0 0; overflow: hidden; box-shadow: 0 -8px 30px -10px rgba(46, 36, 28, 0.35); transform: translateY(100%); transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
.viewer.show .v-sheet { transform: translateY(0); }
.viewer .v-sheet.dragging { transition: none; }
.viewer .v-stage { position: absolute; inset: 0; overflow: hidden; }
.viewer img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-select: none; }
.viewer .v-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #000; background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 4px 14px -6px rgba(0, 0, 0, 0.3); transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.viewer .v-close:is(.pressed) { transform: scale(1.06); background: rgba(255, 255, 255, 0.85); }
.viewer .v-close svg { transition: opacity 0.2s; }
.viewer .v-close:is(.pressed) svg { opacity: 0.55; }
.viewer .v-close svg { width: 18px; height: 18px; }
.viewer.chrome-off .v-close { opacity: 0; pointer-events: none; }
.viewer .v-grab { position: absolute; z-index: 2; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(60, 50, 40, 0.28); pointer-events: none; transition: opacity 0.2s; }
.viewer.chrome-off .v-grab { opacity: 0; }

/* ---------- docs ---------- */
.doc-pages { margin: 0 -16px; background: #efefef; }
.doc-pages img { display: block; width: 100%; height: auto; }

/* ---------- floating glass tab bar ---------- */
.tabbar-wrap {
  position: absolute;
  z-index: 20;
  left: max(16px, var(--sal));
  right: max(16px, var(--sar));
  bottom: var(--tb-gap);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.tabbar-wrap > * { pointer-events: auto; }
.tabbar {
  --tb-ease: cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  flex: none;
  width: calc(100% - var(--tb-h) - 12px); /* JS sets an exact pixel width so it can animate */
  height: var(--tb-h);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  align-items: stretch;
  isolation: isolate;
  overflow: hidden;
  transition: width 0.5s var(--tb-ease);
}
/* specular sheen on the glass edge */
.tabbar::after, .tab-search::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.18));
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.tabbar button {
  position: relative;
  z-index: 1;
  flex: 1 1 0%;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--label);
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  transition: color 0.25s, flex-grow 0.5s var(--tb-ease), opacity 0.3s;
}
.tabbar button span { display: block; max-height: 14px; overflow: hidden; transition: max-height 0.4s var(--tb-ease), opacity 0.25s; }
.tabbar button svg { width: 25px; height: 25px; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
/* tap: icon and label bounce together (each grows away from the gap between them, so they move as one) */
.tabbar button:is(.pressed) svg, .tabbar button:is(.pressed) span { transform: scale(1.08); }
.tabbar button svg { transform-origin: 50% 100%; }
.tabbar button span { transform-origin: 50% 0; }
.tabbar button.on { color: var(--tint); }
.tb-lens {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--lens);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.5s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.5s cubic-bezier(0.3, 1.3, 0.5, 1), opacity 0.2s;
}
.tb-lens.follow { transition: opacity 0.2s; }
.tb-lens.hide { opacity: 0 !important; }
.tb-lens:not(.hide) { transition-duration: 0.5s, 0.5s, 0.12s; }   /* the grey pill comes back right away */
/* pressed tab: icon and label swell a little */
.tabbar button svg, .tabbar button span { transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), max-height 0.4s var(--tb-ease), opacity 0.25s; }
.tabbar button.pressing svg, .tabbar button.pressing span { transform: scale(1.05); }
.tabbar button:not(.pressing) svg, .tabbar button:not(.pressing) span { transition: transform 0.16s ease-out, max-height 0.4s var(--tb-ease), opacity 0.25s; }
/* clear glass bubble shown while pressing / switching tabs (taller than the bar, thin rainbow rim) */
.tb-bubble {
  --bx: 0px;
  position: absolute;
  z-index: 2;
  left: 0;
  top: 7px;   /* inside .tb-clip, which starts 10px above the bar */
  height: calc(var(--tb-h) + 6px);
  width: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(var(--bx)) scale(0.94);
  background: radial-gradient(120% 90% at 50% 15%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0.1));
  -webkit-backdrop-filter: saturate(150%) brightness(1.05);   /* clear glass: no blur, the tab stays sharp */
  backdrop-filter: saturate(150%) brightness(1.05);
  /* a wide refraction band along the edge (light bending through thick glass), same bubble size */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.75),
    inset 0 0 9px 3px rgba(255, 255, 255, 0.5),
    inset 0 2px 5px rgba(255, 255, 255, 0.65),
    inset 0 -3px 6px -1px rgba(120, 85, 55, 0.12),
    0 4px 12px -6px rgba(70, 45, 25, 0.22);
  transition: transform 0.42s cubic-bezier(0.3, 1.12, 0.5, 1), width 0.42s cubic-bezier(0.3, 1.12, 0.5, 1), opacity 0.22s;
}
.tb-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 4px;   /* wider rainbow rim (was 1.5px) */
  background: conic-gradient(from 200deg, rgba(255, 170, 200, 0.7), rgba(255, 230, 150, 0.6), rgba(150, 230, 210, 0.6), rgba(150, 180, 255, 0.7), rgba(230, 160, 255, 0.6), rgba(255, 170, 200, 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: blur(0.8px);
  opacity: 0.42;
}
.tb-bubble.show { opacity: 1; transform: translateX(var(--bx)) scale(1); }
/* settling back: the bubble shrinks into the grey pill's exact size and place (then the pill takes over) */
.tb-bubble.settle {
  top: 14px;
  height: calc(var(--tb-h) - 8px);
  background: var(--lens);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: transform 0.18s ease-out, width 0.18s ease-out, top 0.18s ease-out, height 0.18s ease-out, background 0.18s, box-shadow 0.18s;
}
.tb-bubble.settle::before { opacity: 0; transition: opacity 0.12s; }
.tb-bubble:not(.show) { transition: opacity 0.12s ease-out; }
.tb-bubble.instant { transition: none; }
/* clip box for the bubble: same left/right edges as the tab bar, extra room above and below */
/* only the sides are trimmed (clip-path with room above and below), so the bubble's rounded top and bottom are never cut */
.tb-clip { position: absolute; z-index: 2; left: 0; top: -10px; bottom: -10px; width: 0; overflow: visible; clip-path: inset(-30px 0 -30px 0); pointer-events: none; }
/* while dragged the bubble tracks the finger closely; the bar itself never scrolls the page */
.tb-bubble.dragging { transition: width 0.15s ease-out, opacity 0.2s; will-change: transform; -webkit-backdrop-filter: none; backdrop-filter: none; }   /* follows the finger frame by frame, nothing costly to repaint */
.tabbar { touch-action: none; }
.tab-search {
  position: relative;
  flex: none;
  width: var(--tb-h);
  height: var(--tb-h);
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--label);
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), color 0.2s;
}
.tab-search svg { width: 25px; height: 25px; }
.tab-search:is(.pressed) { transform: scale(1.06); background: rgba(255, 255, 255, 0.7); }
.tab-search svg { transition: opacity 0.2s; }
.tab-search:is(.pressed) svg { opacity: 0.55; }
.tab-search.on { color: var(--tint); }
.tab-search.on::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--lens); }
.tb-badge { position: absolute; top: 9px; left: calc(50% + 7px); width: 10px; height: 10px; border-radius: 5px; background: var(--red); box-shadow: 0 0 0 2px var(--glass-strong); }

/* compact: while scrolling down the bar shrinks to the current tab only */
/* (width is animated from JS; buttons only change flex-grow, which interpolates smoothly) */
.tabbar-wrap.compact .tabbar button:not(.on) { flex-grow: 0; opacity: 0; pointer-events: none; }
.tabbar-wrap.compact .tabbar button span { max-height: 0; opacity: 0; }

/* ---------- toast / progress / banners ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tb-gap) + var(--tb-h) + 14px);
  transform: translate(-50%, 16px) scale(0.92);
  color: var(--label);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
  z-index: 60;
  max-width: 86vw;
  text-align: center;
  --glass: rgba(255, 255, 255, 0.72);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.progress { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 14px 4px 6px; }
.progress i { display: block; height: 100%; width: 0; background: var(--tint); border-radius: 3px; transition: width 0.25s; }
/* overlaid in the row's bottom padding so the row keeps its height while downloading */
.row.busy { pointer-events: none; }
.row.busy .row-title { color: var(--label2); font-variant-numeric: tabular-nums; }
.update-banner { display: flex; align-items: center; gap: 12px; border: 0; width: 100%; text-align: left; border-radius: 26px; padding: 13px 16px; margin: 14px 0 0; transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.update-banner:is(.pressed) { transform: scale(0.98); }
.update-banner svg { width: 30px; height: 30px; color: var(--tint); flex: none; }
.update-banner b { display: block; font-size: 15px; }
.update-banner span { font-size: 13px; color: var(--label2); }

/* first-run / download screen */
.splash { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }   /* background: shared with .page (above) */
.splash img { width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.35); margin-bottom: 22px; }
.splash h1 { font-size: 30px; margin: 0 0 8px; color: var(--title); }
.splash p { color: var(--label2); margin: 0 0 18px; line-height: 1.45; max-width: 320px; }
.splash .progress { width: 240px; }
.splash .small { font-size: 13px; color: var(--label2); min-height: 18px; }
.splash .btn { max-width: 260px; margin-top: 18px; }

/* ---------- official medicine database (BDPM) ---------- */
.badge.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.badge.orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.badge.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--label)); }
.badge.indigo { background: color-mix(in srgb, var(--indigo) 15%, transparent); color: var(--indigo); }
.badge.grey { background: var(--fill); color: var(--label2); }
.catalogue { margin-bottom: 20px; }  /* + 6px of the first letter heading = the usual 26px gap before a group title */
.dot-warn { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin: 0 7px 2px 0; vertical-align: middle; }
.warn-text { color: var(--orange); font-weight: 600; }
.sheet-link { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; border-radius: var(--r-card); padding: 13px 16px; margin: 0 0 12px; background: color-mix(in srgb, var(--tint) 10%, var(--bg2)); box-shadow: var(--card-shadow); }
.sheet-link b { display: block; font-size: 16px; }
.sheet-link span:not(.icon-sq) { font-size: 13px; color: var(--label2); }
.sheet-link div { flex: 1; }
.sheet-link .chev { width: 8px; height: 13px; color: var(--label3); }
.alert-line { display: block; padding: 6px 0; line-height: 1.4; color: var(--label); text-decoration: none; }
.alert-line + .alert-line { border-top: 0.5px solid var(--sep); }
.alert-line small { color: var(--label2); }
a.ext { color: var(--tint); }
.attrib { text-align: center; margin: 14px 6px 4px; line-height: 1.4; }
.attrib.intro-date { text-align: left; margin: -8px 4px 14px; font-size: 0.88rem; }   /* official list: right under the intro line */
.official { margin-top: 8px; }
.fold { position: relative; }
.fold.folded .rich { max-height: 300px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.fold-btn { display: block; margin: 8px auto 0; border: 0; border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--tone, var(--tint)); background: color-mix(in srgb, var(--tone, var(--tint)) 12%, transparent); }
.rcp-src { text-align: left; margin: -2px 6px 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* desktop: centre the app like a phone */
@media (min-width: 700px) {
  body { background: #e8e0d3; }
  #app { left: 50%; width: 430px; transform: translateX(-50%); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 20px 60px rgba(0, 0, 0, 0.15); }
  .viewer, .splash { left: 50%; width: 430px; transform: translateX(-50%); }
}
/* ♂ / ♀ icons (see util.js sexHtml) */
svg.sex { width: 0.95em; height: 0.95em; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.sex + svg.sex { margin-left: 0.05em; }

/* ---------- written documents (Perfusions…) ---------- */
.rich .red { color: var(--red); }
.rich .pink { color: #b0306e; }
.rich li.l2 { list-style: circle; margin-left: 1.3em; }
.doc-box { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--label3); border-radius: 14px; background: var(--bg2); }
.doc-box > :last-child { margin-bottom: 0; }
.doc-table { margin: 4px 0 16px; overflow-x: auto; border-radius: 14px; box-shadow: var(--card-shadow); }
.doc-table table { width: 100%; border-collapse: collapse; background: var(--bg2); font-size: 0.95rem; line-height: 1.35; }
.doc-table th, .doc-table td { border: 1px solid var(--sep, rgba(60,60,67,.18)); padding: 9px 10px; text-align: left; vertical-align: top; }
.doc-table thead th { background: var(--fill2); font-weight: 700; }
.doc-table .rowhead tbody td:first-child:not(.span) { background: color-mix(in srgb, var(--tint) 14%, var(--bg2)); font-weight: 700; }
.doc-table th, .doc-table td { overflow-wrap: normal; word-break: normal; -webkit-hyphens: auto; hyphens: auto; }
.doc-table .rowhead td:first-child:not(.span), .doc-table .rowhead th:first-child { width: 36%; }
.doc-table td[rowspan] { vertical-align: middle; font-weight: 700; }
.doc-table td.span { text-align: center; font-weight: 600; }
.doc-alert { margin: 4px 0 16px; padding: 12px 14px; border: 1.5px solid var(--red); border-radius: 14px; color: var(--red); font-weight: 700; text-align: center; background: color-mix(in srgb, var(--red) 5%, var(--bg2)); }
.doc { font-size: 1.02rem; line-height: 1.55; padding: 0 4px; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 14px; }
.doc li { margin: 6px 0; }
.doc-hero { margin: 0 -4px 22px; padding: 22px 18px 18px; border-radius: 22px; background: color-mix(in srgb, var(--tint) 8%, var(--bg2)); text-align: center; border-bottom: 3px solid var(--tint); }
.doc-hero .doc-fig { margin: 0 auto 12px; background: none; box-shadow: none; padding: 0; pointer-events: none; }
.doc-hero .doc-fig img { width: 96px; height: 96px; object-fit: contain; mix-blend-mode: multiply; }
.doc-hero.icon-only { padding: 18px; }
.doc-hero.icon-only .doc-fig { margin: 0 auto; }
.doc-hero h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
.doc .doc-h { color: var(--label2); font-size: 1.15rem; line-height: 1.35; font-weight: 700; margin: 24px 0 10px; }
.doc h4.doc-h { font-size: 1.05rem; margin-top: 20px; }
.doc-fig { margin: 4px 0 16px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--card-shadow); text-align: center; cursor: zoom-in; }
.doc-fig img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }
.doc-fig figcaption { font-size: 0.85rem; color: var(--label2); margin-top: 8px; }
/* document list: chapter icon on a lavender tile */
.icon-sq.doc-ico { background: color-mix(in srgb, var(--tint) 9%, var(--bg2)); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tint) 22%, transparent); }
.icon-sq.doc-ico img { width: 88%; height: 88%; object-fit: contain; display: block; margin: auto; }

/* Pense-bête: one card per question, answer shown directly */
.qa-card { background: var(--bg2); border-radius: 20px; padding: 13px 16px 14px; margin-bottom: 10px; box-shadow: var(--card-shadow); -webkit-user-select: text; user-select: text; }
.qa-q { font-weight: 600; line-height: 1.3; }
.qa-a { margin-top: 5px; color: var(--label2); font-size: 0.96rem; line-height: 1.42; }
.qa-a p { margin: 0; }

/* official medicines list: compact intro line */
.bdpm-intro { font-size: 0.88rem; line-height: 1.4; color: var(--label2); margin: -2px 4px 14px; }

/* Accueil: large title with the update notice on its right */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 13px; }
.title-row .large-title { margin: 0; min-width: 0; }
.title-action:empty { display: none; }
.update-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; color: var(--tint); font-size: 15px; font-weight: 600; white-space: nowrap; transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.update-pill svg { width: 20px; height: 20px; }
.update-pill:is(.pressed) { transform: scale(0.95); }
.update-pill.plain { color: var(--label); padding: 0 14px; }   /* Favoris: « Modifier » / « OK » */

/* select whose closed state shows a short label over it (full names only in the open list) */
.select-box { position: relative; flex: none; width: 42%; max-width: 180px; }
.field-row .select-box select { width: 100%; max-width: none; color: transparent; }
.field-row .select-box select option { color: var(--label); }
.select-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; font-size: 17px; pointer-events: none; white-space: nowrap; overflow: hidden; }

.atc { margin-top: 4px; font-size: 0.86rem; color: var(--label2); font-variant-numeric: tabular-nums; }

/* round glass buttons in the top bar (back, favoris…): same small swell + icon fade as the search button.
   In a capsule holding several buttons only the icon fades (the shared capsule and its dividers stay put). */
.nav-left .nav-btn, .nav-right:has(> .nav-btn:not(.hidden)) { transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), background 0.2s; }
.nav-left .nav-btn svg { transition: opacity 0.2s; }
.nav-left .nav-btn:is(.pressed) { transform: scale(1.06); }
.nav-left .nav-btn:is(.pressed) svg { opacity: 0.55; }
.nav-right:has(> .nav-btn.pressed):not(:has(> .nav-btn:not(.hidden) ~ .nav-btn:not(.hidden))) { transform: scale(1.06); }

/* segmented controls can be dragged: the lens follows the finger closely */
.segmented { touch-action: pan-y; }
.segmented.dragging .seg-lens { transition: width 0.15s ease-out; will-change: transform; }   /* follows the finger frame by frame */

/* passage found by a search, briefly highlighted */
.doc-hit { background: color-mix(in srgb, var(--tint) 16%, transparent); border-radius: 8px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--tint) 16%, transparent); transition: background 0.6s, box-shadow 0.6s; }

/* Perfusions: written documents laid out like the fiches (banner + one card per section) */
.doc.doc-cards { padding: 0; }
.doc-banner { display: flex; justify-content: center; padding: 18px; background: var(--bg2); }
.doc-banner .doc-fig { margin: 0; padding: 0; background: none; box-shadow: none; pointer-events: none; }
.doc-banner .doc-fig img { width: 96px; height: 96px; object-fit: contain; }
.doc-cards .card-head { align-items: flex-start; line-height: 1.35; }
.doc-cards .card-head span { padding-top: 4px; }
.doc-cards .card .doc-h { font-size: 1.02rem; margin: 18px 0 8px; }
.doc-cards .card .doc-h:first-child { margin-top: 0; }
.doc-cards .card .doc-fig { box-shadow: none; border: 0.5px solid var(--sep, rgba(0,0,0,.1)); }
.doc-cards .card > .rich > :last-child { margin-bottom: 0; }
/* tables in a card use part of the card's side padding so columns keep their width */
.doc-cards .card .doc-table { margin: 4px -10px 16px; box-shadow: none; border-radius: 12px; }
.doc-cards .card .doc-table table { font-size: 0.92rem; }
.doc-cards .card .doc-table th, .doc-cards .card .doc-table td { padding: 8px 9px; }
.doc-banner { padding: 14px; }
.doc-banner .doc-fig img { width: 84px; height: 84px; }
/* two-column tables: equal columns (otherwise a long first header squeezes the second into one word per line) */
.doc-table table:not(.rowhead):has(thead th:nth-child(2):last-child) { table-layout: fixed; }
/* Perfusions cards use the fiche sizes: small-capitals head, 17px text, same paragraph and list spacing */
.doc-card .card-head { margin-bottom: 10px; }
.doc-cards .card .rich p { margin: 0 0 8px; }
.doc-cards .card .rich ul, .doc-cards .card .rich ol { margin: 0 0 8px; }
.doc-cards .card .rich li { margin: 4px 0; }
.doc-cards .card .doc-h { font-size: 1rem; font-weight: 600; color: var(--label); line-height: 1.5; margin: 12px 0 4px; }
.doc-cards .card .doc-h:first-child { margin-top: 0; }

/* Médicaments: galenic form icon (terracotta glyph on a light tile) */
.icon-sq.form-ico { background: color-mix(in srgb, var(--tint) 9%, var(--bg2)); color: var(--tint); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tint) 22%, transparent); }
.icon-sq.form-ico svg { width: 21px; height: 21px; }

/* Calcul de dose · Débit: hours and minutes in one "Durée" row */
.field-row.duration { gap: 6px; }
/* the two boxes together are as wide as one normal box */
.field-row.duration .num-box { width: calc((var(--field-w) - 6px) / 2); padding: 0 7px; gap: 2px; }
.field-row.duration .unit { font-size: 13px; }

/* Calcul: every number box and drop-down has the same width, right-aligned */
.field-row { --field-w: 128px; }
.field-row > select, .select-box { flex: none; width: var(--field-w); max-width: none; }
.field-row > select { padding: 9px 12px; }
.select-box.small .select-label { font-size: 15px; }
/* calculated value shown in a field (Seringue · Concentration): not editable, tinted */
.num-box.readonly { cursor: default; justify-content: flex-end; background: color-mix(in srgb, var(--tint) 8%, var(--bg2)); }
.num-box.readonly .calc-value { padding: 9px 0; font-size: 15px; font-weight: 600; color: var(--tint); white-space: nowrap; }
.result .r-grid > div:only-child { grid-column: 1 / -1; }


/* opened in an iPhone browser: « add to Home Screen » instructions instead of the download */
.splash.install p { margin-bottom: 22px; }
.inst-steps { list-style: none; margin: 0; padding: 16px 18px; max-width: 340px; text-align: left; background: var(--bg2); border-radius: var(--r-card); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 14px; }
.inst-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.4; }
.inst-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--tint); margin-top: 1px; }
.inst-ico { display: inline-grid; place-items: center; vertical-align: -6px; color: var(--tint); }
.inst-ico svg { width: 24px; height: 24px; }
/* official RCP tables (side effects…): the frequency column keeps its words whole */
.fold .doc-table td:first-child:not(:only-child), .fold .doc-table th:first-child:not(:only-child) { width: 30%; min-width: 6.4em; -webkit-hyphens: none; hyphens: none; }
.fold .doc-table th.span, .fold .doc-table td.span { background: var(--fill2); }

/* ---------- official medicine fiche: RCP digest ---------- */
.rcp-list { margin: 0; padding-left: 1.2em; font-size: 0.98rem; line-height: 1.42; }
.rcp-list li { margin: 5px 0; padding-left: 2px; }
.rcp-list li::marker { color: var(--tone, var(--tint)); }
.rcp-intro { margin: 0 0 6px; color: var(--label2); font-size: 0.95rem; }
.rcp-poso-g + .rcp-poso-g { margin-top: 10px; }
.rcp-ind + .rcp-ind { margin-top: 10px; }
.rcp-more { margin: 8px 0 0; color: var(--label2); font-size: 0.95rem; }
.rcp-sub { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.ei-group + .ei-group { margin-top: 12px; }
.ei-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.ei-freq { font-weight: 650; font-size: 0.95rem; }
.ei-hint { font-size: 12px; color: var(--label2); }
.ei-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ei-tag { display: inline-block; padding: 4px 10px; border-radius: calc(0.65em + 4px);   /* half a one-line tag: a pill on one line, a rounded card when the text wraps */ font-size: 14px; line-height: 1.3; background: color-mix(in srgb, var(--tone, var(--tint)) 9%, var(--bg2)); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tone, var(--tint)) 25%, transparent); }
.ei-tf .ei-tag { background: color-mix(in srgb, var(--tone, var(--tint)) 20%, var(--bg2)); }
.ei-r .ei-tag, .ei-tr .ei-tag, .ei-nd .ei-tag { background: var(--fill); box-shadow: none; }
.ei-more, .ei-rare { border: 0; border-radius: 999px; padding: 4px 11px; font-size: 14px; font-weight: 600; color: var(--tone, var(--tint)); background: color-mix(in srgb, var(--tone, var(--tint)) 12%, transparent); }
.ei-rare { display: block; margin-top: 12px; padding: 7px 14px; }
.rcp-full-box { margin-top: 12px; padding-top: 10px; border-top: 0.5px solid var(--sep); }
.rcp-full-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 0; font-size: 14px; font-weight: 600; color: var(--tone, var(--tint)); }
.rcp-full-btn svg { width: 8px; height: 12px; transition: transform 0.25s; }
.rcp-full-btn.open svg { transform: rotate(90deg); }
.rcp-full { margin-top: 10px; }

/* iOS switch (Safari 17.4+ draws a native one for <input type=checkbox switch>); other browsers get a drawn one */
input.switch { flex: none; margin: 0 0 0 10px; accent-color: var(--green); }
@supports not selector(::thumb) {
  input.switch { -webkit-appearance: none; appearance: none; position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill2); transition: background 0.2s; cursor: pointer; }
  input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.25s cubic-bezier(0.3, 1.3, 0.5, 1); }
  input.switch:checked { background: var(--green); }
  input.switch:checked::after { transform: translateX(20px); }
  input.switch:disabled { opacity: 0.45; }
}

/* update progress: the toast pill with a thin bar under its text */
.toast.with-bar { min-width: 250px; padding: 11px 20px 12px; font-variant-numeric: tabular-nums; }
.toast.with-bar .toast-text { white-space: nowrap; }
.toast-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.toast-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--tint); transition: width 0.25s ease; }
.row.busy { opacity: 0.55; }

/* first launch: offer to turn on the « nouveau contenu » notifications */
.splash-offer { margin-top: 26px; max-width: 300px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-offer .offer-text { font-size: 15px; color: var(--label2); line-height: 1.4; }
.splash-offer .btn { margin-top: 0; display: inline-flex; align-items: center; gap: 8px; }
.splash-offer .btn svg { width: 19px; height: 19px; }
.splash-offer .offer-done { font-size: 15px; font-weight: 600; color: var(--green); }
.offer-later { border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--label2); padding: 6px 12px; }
.searchbar.ghost { visibility: hidden; pointer-events: none; }

/* Réglages actions: coloured icon in a pale tinted circle (option B) */
.icon-sq.soft { --c: var(--tint); border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--bg2)); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--c) 22%, transparent); }
.icon-sq.soft.green { --c: var(--green); }
.icon-sq.soft svg { width: 19px; height: 19px; }
.bdpm-nofav { margin: 2px 18px 14px; }
/* calculators: result card already at its final size, values shown as « — » until filled */
.result.pending .r-value, .result.pending .r-grid b { color: var(--label3); }
.result .r-warn { grid-column: 1 / -1; font-size: 14px; font-weight: 600; color: var(--red); }
.result { line-height: 1.3; }   /* fixed: the empty and filled cards keep exactly the same height */
.result .r-value { line-height: 1.15; }
.result .r-grid b { height: 1.3em; }   /* « — » is taller than digits: fixed line so the row never grows */
/* scores: « … » placeholder in the same light grey as the calculators, centred on the digits' height */
.score-total .ph { color: var(--label3); display: inline-block; transform: translateY(-0.3em); }

/* ---------- Médicaments: tabs + interaction checker ---------- */
.med-tabs { margin: 0 0 14px; }
.badge.amber { background: color-mix(in srgb, #c9962a 18%, transparent); color: color-mix(in srgb, #c9962a 70%, var(--label)); }
.add-ico { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); font-size: 20px; font-weight: 500; line-height: 1; }
.inter-ico { background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); }
.inter-ico.cls { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.inter-row .row-text { cursor: pointer; }
.inter-del { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-right: -4px; padding: 0; border: 0; background: none; color: var(--label3); cursor: pointer; }
.inter-del svg { width: 22px; height: 22px; }
.inter-clear { margin-top: 12px; }
.inter-pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 1.02rem; line-height: 1.3; }
.inter-plus { color: var(--label3); font-weight: 600; }
.inter-badges { margin: 10px 0 8px; }
.inter-via { font-size: 0.86rem; color: var(--label2); line-height: 1.35; }
.inter-sec { margin-top: 10px; }
.inter-sec p, .inter-rcp p { margin: 2px 0 0; line-height: 1.45; }
.inter-lbl { font-weight: 600; color: var(--label); margin-top: 8px; }
.inter-none p { margin: 6px 0 0; color: var(--label2); line-height: 1.4; }
.inter-rcp-title { font-weight: 600; margin-bottom: 6px; }
.inter-rcp-hits p + p { margin-top: 8px; }
.inter-rcp .btn { margin-top: 12px; }
.inter-rcp-full { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--sep); font-size: 0.92rem; color: var(--label2); }
.inter-rcp-full p + p { margin-top: 8px; }
.inter-muted { color: var(--label2); }
.inter-source { margin-top: 18px; }
.inter-ul { margin: 2px 0 6px; padding-left: 20px; }
.inter-ul li { line-height: 1.4; margin: 2px 0; }
.inter-sec p.inter-sub { margin-top: 8px; font-style: italic; color: var(--label2); }
