/* CATMATE — feuille de style unique, pensée d'abord pour le téléphone. */

:root {
  --ink: #1d3a42;
  --ink-2: #3d565d;
  --muted: #5b737a;
  --faint: #7b8f94;
  --line: #dde8e8;
  --line-2: #edf3f3;
  --bg: #f3f7f7;
  --card: #ffffff;
  --field: #c9dada;
  --soft: #eef4f4;
  --brand: #109bb3;
  --teal: #0c7f93;
  --teal-ink: #0a6b7c;
  --teal-soft: #e3f3f6;
  --amber-soft: #fff4e5;
  --amber-ink: #7a4608;
  --amber-line: #f2d5a8;
  --red: #a12f2f;
  --red-soft: #fdecec;
  --red-line: #f1c6c6;
  --green: #1f6b47;
  --green-soft: #e4f4ec;
  --purple: #6e3f99;
  --purple-soft: #f3ecfb;
  --radius: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--teal-ink); }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hint { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 520px; }
.version { text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- Cartes, champs, boutons ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.small-title { font-size: 14px; font-weight: 800; margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), input[type=time] {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--field); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px; /* 16px : pas de zoom iOS */
}
input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #0c7f9333; }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--teal); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border: 0; border-radius: 14px;
  font: inherit; font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:active { background: #176a80; }
.btn-secondary { background: var(--soft); color: var(--ink); }
.btn-danger-outline { background: #fff; color: var(--red); border: 1px solid var(--red-line); }
.btn-text {
  min-height: 44px; padding: 0 6px; border: 0; background: none; font: inherit; font-size: 14px;
  font-weight: 700; color: var(--teal-ink); cursor: pointer;
}
.btn-text-danger { color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.link-center { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 15px; font-weight: 700; text-decoration: none; text-align: center; }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border-radius: 12px; background: var(--soft); color: var(--ink);
}

.round-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.round-icon-teal { background: var(--teal-soft); color: var(--teal-ink); }
.round-icon-amber { background: var(--amber-soft); color: var(--amber-ink); }

/* Notifications : par-dessus le contenu, en haut, disparaissent après 5 s (barre de progression).
   Fonctionne sans JavaScript ; le script ajoute la fermeture au toucher et la pause. */
.toasts {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  width: 100%; max-width: 520px; display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 8px 15px 14px; border-radius: 14px; font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(16, 38, 45, .22);
  animation: toast-in .25s ease-out, toast-out .3s ease-in 5s forwards;
}
.toast svg { margin-top: 1px; }
.toast-text { flex: 1; min-width: 0; }
.toast-success { background: #e9f7ef; color: var(--green); border: 1px solid #bfe3cd; }
.toast-error { background: #fdf0f0; color: var(--red); border: 1px solid var(--red-line); }
.toast-close {
  flex: none; width: 32px; height: 32px; margin: -6px 0 -6px 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7; cursor: pointer;
}
.toast-bar {
  position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: currentColor; opacity: .45;
  transform-origin: left; animation: toast-bar 5s linear forwards;
}
.toast:hover, .toast:hover .toast-bar, .toast.is-paused, .toast.is-paused .toast-bar { animation-play-state: paused; }
.toast.is-leaving { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); visibility: hidden; } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: toast-out .01s linear 5s forwards; }
}

/* ---------- Pages sans menu (connexion…) ---------- */

.page-bare { min-height: 100vh; min-height: 100dvh; }
.bare {
  width: 100%; max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: 32px 20px calc(32px + var(--safe-b));
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand-mark { display: block; width: 72px; height: 72px; border-radius: 16px; }
.brand-name { font-size: 30px; font-weight: 900; letter-spacing: 3px; color: #3c4347; line-height: 1; padding-bottom: 8px; border-bottom: 3px solid var(--brand); }
.brand-tagline { font-size: 15px; color: #5b6468; letter-spacing: .3px; margin-top: -2px; }
.bare-lead { text-align: center; color: var(--muted); margin-top: -8px; margin-bottom: 4px; }
.bare-note { text-align: center; color: var(--muted); font-size: 14px; padding: 0 8px; }

/* ---------- Application éleveur ---------- */

.app { min-height: 100vh; min-height: 100dvh; }
.app-main {
  max-width: 640px; margin: 0 auto;
  padding: 0 0 calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 14px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.page-head .icon-btn:first-child { margin-left: -4px; }
.page-kicker { font-size: 13px; color: var(--muted); }
.page-title { font-size: 23px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.page-title-inline { flex: 1; font-size: 20px; }
.page-body { padding: 16px; }

.section-label {
  margin: 8px 4px -4px; font-size: 13px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
}

.roadmap { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
.tab {
  min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.tab.is-active { color: var(--teal-ink); font-weight: 800; }
.tab.is-active svg { stroke-width: 2.4; }

/* Panneaux dépliables (paramètres) */
.panel-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel, .panel-group > .row + .row { border-top: 1px solid var(--line-2); }
.panel summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 10px 16px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.panel summary::-webkit-details-marker { display: none; }
.panel[open] summary { background: #fafcfc; border-bottom: 1px solid var(--line-2); }
.panel-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.panel-text strong { font-size: 16px; overflow-wrap: anywhere; }
.panel-text small { font-size: 13px; color: var(--muted); }
.panel-action { font-size: 14px; font-weight: 700; color: var(--teal-ink); white-space: nowrap; }
.panel[open] .panel-action { color: var(--faint); }
.panel-body { padding: 16px; }
.panel-empty { padding: 16px; color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; min-height: 60px; }
.row-icon { color: var(--muted); }

/* Double curseur min / max */
.range2 { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: #f7f4fb; }
.range2-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.range2-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.range2-value { font-size: 18px; font-weight: 800; color: #4d2a6e; white-space: nowrap; }
.range2-track { position: relative; height: 44px; }
.range2-rail, .range2-fill { position: absolute; top: 19px; height: 6px; border-radius: 3px; }
.range2-rail { left: 13px; right: 13px; background: #e2d8ee; }
.range2-fill { background: #7a4fb0; left: 13px; width: 0; }
.range2 input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; padding: 0;
  background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range2 input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 44px; }
.range2 input[type=range]::-moz-range-track { background: transparent; height: 44px; }
.range2 input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 28px; height: 28px; margin-top: 8px;
  border-radius: 50%; background: #fff; border: 3px solid #7a4fb0; box-shadow: 0 2px 6px #1d3a4240; cursor: grab;
}
.range2 input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 28px; height: 28px; box-sizing: border-box;
  border-radius: 50%; background: #fff; border: 3px solid #7a4fb0; box-shadow: 0 2px 6px #1d3a4240; cursor: grab;
}
.range2 input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--teal); outline-offset: 2px; }
.range2 input[type=range].is-top { z-index: 2; }
.range2-scale { display: flex; justify-content: space-between; padding: 0 4px; font-size: 12px; color: var(--muted); }

/* ---------- Administration ---------- */

.page-admin { background: #eef1f3; }
.admin-bar { background: var(--ink); color: #fff; }
.admin-bar-inner {
  max-width: 960px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.admin-brand { display: flex; flex-direction: column; color: #fff; text-decoration: none; }
.admin-kicker { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #9fd3df; }
.admin-brand strong { font-size: 18px; letter-spacing: 1px; }
.admin-nav { display: flex; align-items: center; gap: 4px; }
.admin-nav a, .admin-nav .link-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  color: #d4e6ea; text-decoration: none; font-size: 14px; font-weight: 700; border-radius: 10px;
}
.admin-nav a:hover, .admin-nav .link-button:hover { background: #ffffff1a; color: #fff; }
.admin-main { max-width: 960px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head .page-title-inline { min-width: 0; }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 600; }
.notice-amber { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid var(--amber-line); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.stat strong { font-size: 24px; }
.stat span { font-size: 13px; color: var(--muted); }

.toolbar { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid #d3e2e2; background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 700; text-decoration: none;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; min-height: 64px; color: var(--ink); text-decoration: none;
}
.list-row + .list-row { border-top: 1px solid var(--line-2); }
.list-row:hover { background: #fafcfc; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-invited { background: var(--amber-soft); color: var(--amber-ink); }
.badge-disabled { background: #eceff1; color: #4f585c; }

.grid-2 { display: grid; gap: 14px; }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.link-card { border: 2px solid #e6b45a; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.danger-zone { border-color: var(--red-line); }
.plain-list { margin: 0; padding-left: 20px; }

@media (min-width: 760px) {
  .toolbar { flex-direction: row; align-items: center; }
  .toolbar input { max-width: 360px; }
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; }
}

/* Codes à 6 chiffres */
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 28px !important; font-weight: 800; letter-spacing: 8px; text-align: center; min-height: 60px !important;
}
.code-input::placeholder { color: #c9d6d8; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; }
.panel-body-tight { padding-top: 0; }

/* ---------- Lot 2 : chats ---------- */

[hidden] { display: none !important; }
.center { text-align: center; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }

select, textarea, input[type=date] {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--field); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px;
}
textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=date] { display: block; -webkit-appearance: none; appearance: none; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.field-error { color: var(--red); font-size: 13px; font-weight: 700; }
.grid-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.page-head-stack { flex-direction: column; align-items: stretch; gap: 12px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search input { background: var(--bg); }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 0 -20px; padding: 0 16px 2px 20px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; gap: 6px; }
.chip-count { font-size: 12px; opacity: .75; }

/* Segments (choix exclusif) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #e3eded; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; border-radius: 9px;
  font-weight: 700; font-size: 15px; color: var(--ink-2); text-align: center;
}
.segmented input:checked + span { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 3px #1d3a4222; }
.segmented input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 1px; }

/* Avatars et lignes de la liste */
.avatar { flex: none; display: grid; place-items: center; border-radius: 14px; object-fit: cover; font-weight: 800; color: #fff; }
.avatar-m { width: 48px; height: 48px; font-size: 20px; }
.avatar-l { width: 72px; height: 72px; font-size: 30px; border-radius: 18px; }
.avatar-f-sex { background: #b88aa8; }
.avatar-m-sex { background: #6f8c99; }
.cat-row { justify-content: flex-start; gap: 12px; }
.cat-row .panel-text { flex: 1; }
.tag { flex: none; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.tag-teal { background: var(--teal-soft); color: var(--teal-ink); }
.tag-purple { background: var(--purple-soft); color: var(--purple); }
.tag-grey { background: #eceff1; color: #4f585c; }

/* Fiche d'un chat */
.cat-hero { position: relative; background: var(--card); border-bottom: 1px solid var(--line); padding: 72px 20px 18px; }
.cat-hero.has-photo { padding: 0; min-height: 280px; background: #2a3a3f; display: flex; flex-direction: column; justify-content: flex-end; }
.cat-hero.has-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-hero.has-photo::after { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.cat-hero-bar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; z-index: 2; }
.icon-btn-float { background: rgba(255,255,255,.92); }
.btn-float { min-height: 44px; padding: 0 16px; border-radius: 12px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 15px; }
.cat-hero-text { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.cat-hero.has-photo .cat-hero-text { padding: 0 20px 18px; color: #fff; }
.cat-name { font-size: 28px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; }
.cat-sub { color: var(--muted); font-weight: 600; }
.cat-hero.has-photo .cat-sub { color: rgba(255,255,255,.9); }

.inline-edit summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 44px; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit summary .panel-text strong { font-size: 18px; }
.inline-edit[open] summary { margin-bottom: 14px; }
.inline-edit[open] .panel-action { color: var(--faint); }
.inline-edit > form + form { margin-top: 6px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; }
.field-grow { flex: 1; }

/* Photo dans le formulaire */
.photo-field { display: flex; flex-direction: column; gap: 10px; }
.photo-current { display: flex; align-items: center; gap: 14px; }
.photo-pick {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  border: 1px dashed #9fc0c6; border-radius: 12px; background: #f5fafb; color: var(--teal-ink); font-weight: 700; cursor: pointer;
}
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-pick:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.photo-preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; }
.form-actions { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5; }
.form-actions .btn { box-shadow: 0 8px 20px #0c7f9344; }
.archive-row { flex-wrap: wrap; }
.archive-row .panel-text { min-width: 200px; }
.stat-link { color: var(--ink); text-decoration: none; }

/* ---------- Lot 3 : portées ---------- */

.ink { color: var(--ink); }
.top-gap { margin-top: 8px; }
.tag-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tag-rose { background: #fbeaf2; color: #8d2f5f; }
.tag-start { align-self: flex-start; }
.page-title-block { display: flex; flex-direction: column; min-width: 0; }
.kicker-purple { color: var(--purple); font-weight: 800; }
.section-link { color: inherit; text-decoration: none; }
.section-link:hover { text-decoration: underline; }
.list-flat { margin: 0 -20px -20px; border-top: 1px solid var(--line-2); }
.info-box { padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-ink); font-size: 14px; }
.btn-tiny { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.icon-btn-small { width: 36px; height: 36px; }
.form-actions-split { display: flex; gap: 10px; }
.form-actions-split .btn { flex: 1; }

/* Colliers : couleur portée par une classe (pas de style en ligne, CSP). */
.collar { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: #c7d2d4; box-shadow: inset 0 0 0 1px #00000018; }
.collar-lg { width: 22px; height: 22px; }
.collar-xl { width: 34px; height: 34px; }
.collar-rouge { background: #d23c3c; }
.collar-bleu { background: #2f6fd0; }
.collar-vert { background: #2f9a55; }
.collar-jaune { background: #f0c419; }
.collar-violet { background: #8048b8; }
.collar-orange { background: #f08a24; }
.collar-rose { background: #ec7fb3; }
.collar-noir { background: #222; }
.collar-blanc { background: #fff; box-shadow: inset 0 0 0 2px #b9c7ca; }
.collar-gris { background: #8b979a; }
.collar-none { background: repeating-linear-gradient(45deg, #e3eaeb 0 4px, #f6f9f9 4px 8px); }
.collar.is-faded { opacity: .3; }
.collar-row { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.avatar-collar { background: var(--soft); }

.collar-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.collar-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.collar-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.collar-choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.collar-choice:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 1px; }
.collar-choice.is-taken { opacity: .4; cursor: not-allowed; }
.collar-name { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.2; }

/* Liste des portées */
.litter-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; text-decoration: none; color: inherit; }
.litter-card:hover { border-color: var(--field); }
.litter-name { font-size: 17px; font-weight: 800; }
.progress { display: block; width: 100%; height: 8px; }
.progress-bg { fill: #e8eeef; }
.progress-fill { fill: var(--purple); }
.litter-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; text-decoration: none; color: inherit; }

.sticky-action { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; margin-top: 8px; }
.sticky-action .btn { pointer-events: auto; }
.btn-raised { box-shadow: 0 8px 20px #0c7f9355; border-radius: 99px; padding: 0 20px; }

/* Fiche portée : gestation */
.gestation-card { display: flex; align-items: center; gap: 18px; }
.ring { width: 104px; height: 104px; flex: none; }
.ring-bg { fill: none; stroke: var(--purple-soft); stroke-width: 10; }
.ring-fill { fill: none; stroke: var(--purple); stroke-width: 10; stroke-linecap: round; }
.ring-day { font-size: 26px; font-weight: 800; fill: var(--ink); }
.ring-sub { font-size: 11px; fill: var(--muted); }
.gestation-countdown { display: block; font-size: 18px; font-weight: 800; color: var(--purple); }
.gestation-countdown.is-late { color: var(--amber-ink); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--field); }
.timeline li.is-done::before { background: var(--purple); border-color: var(--purple); }

/* Fiche portée : naissance et chatons */
.litter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.litter-big { font-size: 19px; font-weight: 800; }
.cat-row.is-faded { opacity: .6; }
.reorder-list { list-style: none; margin: 0; padding: 0; }
.reorder-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; background: #fff; border-bottom: 1px solid var(--line-2); touch-action: pan-y; }
.reorder-row.is-dragging { background: var(--teal-soft); box-shadow: 0 6px 16px #1d3a4222; position: relative; z-index: 2; }
.reorder-row .panel-text { flex: 1; }
.drag-handle { display: grid; place-items: center; width: 36px; height: 44px; color: var(--faint); cursor: grab; touch-action: none; border: 0; background: none; }
.reorder-arrows { display: flex; gap: 4px; }

/* Formulaires du lot 3 */
.steps { display: flex; gap: 4px; padding: 0 16px 4px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.is-on { background: var(--teal); }
.counter { display: flex; align-items: center; gap: 8px; }
.counter .panel-text { flex: 1; }
.counter input { width: 56px; height: 48px; text-align: center; font-size: 20px; font-weight: 800; border: 1px solid var(--field); border-radius: 12px; }
.counter-btn { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--field); background: #fff; font-size: 24px; font-weight: 700; color: var(--ink); cursor: pointer; }
.counter-btn-plus { background: var(--teal); border-color: var(--teal); color: #fff; }
.due-preview { padding: 12px 14px; border-radius: 12px; background: var(--purple-soft); color: var(--purple); font-weight: 700; font-size: 14px; }
.stud-box { padding: 14px; border-radius: 12px; background: var(--soft); }
.timeline li > strong { display: block; font-size: 14px; }
.timeline li > span { display: block; color: var(--ink-2); font-size: 15px; }
.timeline li form { margin-top: 2px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 4px -4px; }
.section-head .section-label { margin: 0; }
.sticky-action { padding: 0 16px; }
.sticky-action .btn-block { width: 100%; }
.page-head .page-title-block { flex: 1; }
.reorder-arrows .icon-btn-small { border: 1px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 10px; }

/* ---------- Lot 4 : pesées ---------- */
.toast-undo { margin: 0; }
.toast-undo button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: #1f6b4714; color: inherit; text-decoration: underline; font: inherit; font-weight: 800; cursor: pointer; }
.weigh-form [hidden], .weigh-form[hidden] { display: none !important; }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-orange { background: #fff0e0; color: #9a4a00; }
.alert-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.notice-teal { background: var(--teal-soft); color: var(--teal-ink); border: 1px solid #cfe5e8; font-weight: 500; }
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.alert-red { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.alert-orange { background: #fff0e0; color: #9a4a00; border: 1px solid #f3cf9f; }

.tabs3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: #e3eded; }
.tabs3 a { display: grid; place-items: center; min-height: 40px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.tabs3 a[aria-current] { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 3px #1d3a4222; }

.weigh-row, .history-row, .recap-row { gap: 12px; justify-content: flex-start; }
.weigh-row .panel-text, .history-row .panel-text, .recap-row .panel-text { flex: 1; min-width: 0; }
.weigh-row.is-loss { background: #fff6f6; box-shadow: inset 4px 0 0 var(--red); }
.weigh-row.is-stagnation { background: #fffaf2; box-shadow: inset 4px 0 0 #e08a1e; }
.weigh-value { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.weigh-value strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.weigh-value small { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-gain { color: var(--green); }
.delta-loss { color: var(--red); }
.delta-stagnation { color: #9a4a00; }
.delta-none { color: var(--muted); }
.spark { width: 60px; height: 22px; flex: none; }
.spark polyline { fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.is-loss .spark polyline { stroke: var(--red); }
.is-stagnation .spark polyline { stroke: #e08a1e; }

.history-card { padding-top: 14px; }
.history-when { font-size: 15px; font-weight: 800; margin-bottom: 8px; }

.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--line-2); stroke-width: 1; }
.chart-axis { stroke: var(--field); stroke-width: 1; }
.chart-label { font-size: 10px; fill: var(--muted); }
.chart-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: #fff; stroke-width: 1; }
.stroke-rouge { stroke: #d23c3c; } .chart-dot.stroke-rouge { fill: #d23c3c; }
.stroke-bleu { stroke: #2f6fd0; } .chart-dot.stroke-bleu { fill: #2f6fd0; }
.stroke-vert { stroke: #2f9a55; } .chart-dot.stroke-vert { fill: #2f9a55; }
.stroke-jaune { stroke: #d9a900; } .chart-dot.stroke-jaune { fill: #d9a900; }
.stroke-violet { stroke: #8048b8; } .chart-dot.stroke-violet { fill: #8048b8; }
.stroke-orange { stroke: #f08a24; } .chart-dot.stroke-orange { fill: #f08a24; }
.stroke-rose { stroke: #e0609c; } .chart-dot.stroke-rose { fill: #e0609c; }
.stroke-noir { stroke: #222; } .chart-dot.stroke-noir { fill: #222; }
.stroke-blanc { stroke: #9fb0b4; } .chart-dot.stroke-blanc { fill: #fff; stroke: #7f9195; }
.stroke-gris { stroke: #8b979a; } .chart-dot.stroke-gris { fill: #8b979a; }
.stroke-none { stroke: var(--ink-2); } .chart-dot.stroke-none { fill: var(--ink-2); }

/* Saisie */
.weigh-steps { padding-top: 0; }
.when-card { padding: 12px 16px; }
.when-card summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; min-height: 32px; }
.when-card summary::-webkit-details-marker { display: none; }
.when-card summary > span:first-of-type { flex: 1; }
.weigh-step { display: flex; flex-direction: column; gap: 14px; }
.weigh-count { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.weigh-who { display: flex; align-items: center; gap: 14px; }
.weigh-name { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.weigh-input { display: flex; align-items: baseline; gap: 8px; padding: 6px 16px; border: 2px solid var(--teal); border-radius: 16px; background: #fff; }
.weigh-input input { flex: 1; min-width: 0; border: 0; padding: 0; min-height: 64px; font: inherit; font-size: 44px; font-weight: 800; color: var(--ink); background: transparent; font-variant-numeric: tabular-nums; }
.weigh-input input:focus { box-shadow: none; outline: none; }
.weigh-input:focus-within { box-shadow: 0 0 0 4px #0c7f9333; }
.weigh-unit { font-size: 22px; font-weight: 800; color: var(--muted); }
.weigh-prev { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 15px; }
.weigh-delta { font-size: 17px; font-variant-numeric: tabular-nums; }
.weigh-nav { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.weigh-nav .btn { padding: 0 8px; }
.guard { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-ink); }
.guard p { color: var(--ink-2); }
.recap-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.recap-row.is-skipped .weigh-value strong { color: var(--muted); font-size: 15px; }
a.alert { text-decoration: none; }
.weigh-delta { white-space: nowrap; }
.recap-list { margin: 0 -20px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.recap-list .recap-row + .recap-row { border-top: 1px solid var(--line-2); }
.history-card .list { border: 0; border-radius: 0; background: none; margin: 0 -20px -20px; border-top: 1px solid var(--line-2); }

/* ---------- Correctifs iOS Safari ---------- */
/* Pas de zoom au double tap (le pincement reste possible). */
html { touch-action: manipulation; }
a, button, input, select, textarea, label, summary { touch-action: manipulation; }

/* Le haut de l'écran (heure, encoche, île) ne recouvre plus l'en-tête. */
.page-head { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.bare { padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
.admin-bar { padding-top: env(safe-area-inset-top, 0px); }
.page-head, .page-head-stack { padding-left: calc(20px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }

/* Sélecteurs de date et d'heure : même hauteur et même alignement que les autres champs. */
input[type=date], input[type=time] {
  display: block; -webkit-appearance: none; appearance: none;
  box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  height: 50px; min-height: 50px; padding: 0 14px; margin: 0;
  border: 1px solid var(--field); border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; font-size: 16px; line-height: 48px; text-align: left;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; line-height: 48px; }
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit { padding: 0; }
.grid-fields > * { min-width: 0; }
.counter input { line-height: normal; }

/* Bande opaque sous l'heure et l'île dynamique : le contenu qui défile passe dessous
   au lieu d'apparaître flouté par iOS (surtout depuis l'icône sur l'écran d'accueil). */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: env(safe-area-inset-top, 0px); background: var(--card); pointer-events: none;
}
body.page-bare::before { background: var(--bg); }
body.page-admin::before { background: var(--ink); }

/* ---------- Lot 5 : tableau de bord ---------- */
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.todo-item .panel-text { flex: 1; min-width: 0; }
.todo-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.todo-red { border-color: var(--red-line); background: #fff7f7; box-shadow: inset 4px 0 0 var(--red); }
.todo-red .todo-icon { background: var(--red-soft); color: var(--red); }
.todo-orange { border-color: #f3cf9f; background: #fffaf3; box-shadow: inset 4px 0 0 #e08a1e; }
.todo-orange .todo-icon { background: #fff0e0; color: #9a4a00; }
.todo-amber .todo-icon { background: var(--amber-soft); color: var(--amber-ink); }
.todo-teal .todo-icon { background: var(--teal-soft); color: var(--teal-ink); }
.upcoming-row { justify-content: flex-start; }
.upcoming-row .panel-text { flex: 1; min-width: 0; }
.day-badge { display: grid; place-items: center; flex: none; min-width: 48px; height: 40px; padding: 0 6px; border-radius: 10px; background: var(--purple-soft); color: var(--purple); font-weight: 800; font-size: 15px; }
.upcoming-row.is-now .day-badge { background: var(--purple); color: #fff; }
.upcoming-row.is-late { background: #fffaf3; box-shadow: inset 4px 0 0 #e08a1e; }
.upcoming-row.is-late .day-badge { background: #fff0e0; color: #9a4a00; }
.upcoming-row.is-late small { color: #9a4a00; font-weight: 700; }
@media (display-mode: standalone) { .install-card { display: none; } }

/* ---------- Lot 6 : ouverture publique ---------- */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 18px 0 4px; font-size: 14px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { text-decoration: underline; color: var(--ink-2); }
.request-card { margin-top: 14px; gap: 10px; }
.center-block { margin: 0 auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-danger { background: var(--red); color: #fff; border: 1px solid var(--red); }
.notice-red { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.deletion-banner { border: 2px solid var(--red-line); background: #fff7f7; }
.deletion-banner .card-title { color: var(--red); }
.request-row { flex-wrap: wrap; gap: 10px; }
.request-row .panel-text { flex: 1 1 260px; }
.request-msg { font-style: italic; color: var(--ink-2); }

.page-legal .legal { max-width: 720px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 40px; }
.legal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 2px; color: #3c4347; text-decoration: none; }
.legal-brand img { border-radius: 8px; }
.legal-body { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; line-height: 1.6; }
.legal-body h1 { font-size: 24px; font-weight: 800; margin-bottom: 14px; line-height: 1.25; }
.legal-body h2 { font-size: 17px; font-weight: 800; margin: 22px 0 6px; }
.legal-body p, .legal-body ul { margin: 0 0 10px; color: var(--ink-2); }
.legal-body ul { padding-left: 20px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--teal-ink); }
.check input { flex: none; }

/* ---------- Lot 7 : Premium (accent doré) ---------- */
:root { --gold: #f2b01e; --gold-2: #e8901a; --gold-soft: #fff6dd; --gold-line: #f1d38a; --gold-ink: #6b4500; }
.tabbar { grid-template-columns: repeat(5, 1fr); }
.tab-premium { color: var(--gold-2); }
.tab-premium svg { color: var(--gold); }
.tab-premium.is-active { color: var(--gold-ink); background: var(--gold-soft); }
.tab-premium.is-active svg { color: var(--gold-2); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3d2600; border: 0; font-weight: 800; }
.btn-gold:hover { filter: brightness(1.04); }
.notice-gold { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); text-decoration: none; }
.notice-gold svg { color: var(--gold-2); flex: none; }
.tag-gold { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); display: inline-flex; align-items: center; gap: 4px; }
.toast-premium { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); }
.premium-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-2); font-weight: 800; }
.premium-card { border: 2px solid var(--gold-line); background: linear-gradient(160deg, #fffaf0, #fff); }
.premium-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3d2600; font-weight: 800; }
.premium-big { font-size: 22px; font-weight: 800; }
.lock-tag { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2); flex: none; vertical-align: middle; }
.usage { display: flex; flex-direction: column; gap: 8px; }
.usage-row { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.usage-row strong { font-variant-numeric: tabular-nums; }
.usage-row strong.is-full { color: var(--gold-ink); background: var(--gold-soft); padding: 2px 10px; border-radius: 99px; }
.compare { padding: 6px 16px; }
.compare-head, .compare-row { display: grid; grid-template-columns: 1fr 70px 86px; gap: 8px; align-items: center; padding: 10px 0; text-align: center; }
.compare-row { border-top: 1px solid var(--line-2); }
.compare-head > :first-child, .compare-row > :first-child { text-align: left; }
.compare-row > :first-child { font-size: 15px; }
.compare-row small { display: block; }
.compare-premium { color: var(--gold-ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.compare-head .compare-premium svg, .compare-row .compare-premium svg { color: var(--gold-2); }
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.price { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 6px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.price strong { font-size: 21px; font-weight: 900; color: var(--ink); }
.price span { font-size: 13px; color: var(--muted); }
.price.is-best { border: 2px solid var(--gold); background: var(--gold-soft); }
.price-flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #3d2600 !important; font-size: 11px !important; font-weight: 800; }
.prices-compact .price { padding: 10px 4px; }
.prices-compact .price strong { font-size: 18px; }
.premium-dialog { width: min(92vw, 420px); border: 0; border-radius: 22px; padding: 26px 20px 16px; box-shadow: 0 20px 60px #1d3a4244; text-align: center; }
.premium-dialog::backdrop { background: #1d3a4266; }
.premium-dialog h2 { font-size: 21px; font-weight: 800; margin: 10px 0 8px; line-height: 1.25; }
.premium-dialog > * + * { margin-top: 12px; }
.premium-dialog-close { position: absolute; top: 8px; right: 8px; margin: 0 !important; }
.premium-crown { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; }
.plan-card .btn-row form { margin: 0; }
.price.is-mine { border: 2px solid var(--teal); background: var(--teal-soft); }
.price-flag-mine { background: var(--teal); color: #fff !important; }

/* ---------- Onglet actif plus visible ---------- */
.tab { position: relative; transition: background-color .2s ease, color .2s ease; }
.tab.is-active { background: var(--teal-soft); color: var(--teal-ink); }
.tab.is-active svg { color: var(--teal); }
.tab-premium:not(.is-active) { background: none; }
.tab-premium.is-active { background: var(--gold-soft); color: var(--gold-ink); }
.tab-premium.is-active svg { color: var(--gold-2); }

/* ---------- Transitions entre les pages ---------- */
/* Navigateurs récents (Safari 18.2+, Chrome 126+) : fondu enchaîné natif entre deux pages,
   la barre d'onglets restant immobile. */
@view-transition { navigation: auto; }
.tabbar { view-transition-name: tabbar; }
.toasts { view-transition-name: toasts; }
::view-transition-old(root) { animation: page-out .16s ease-in both; }
::view-transition-new(root) { animation: page-in .24s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
/* Autres navigateurs : simple apparition du contenu à l'arrivée sur la page. */
@supports not (view-transition-name: none) {
  .app-main, .bare, .legal { animation: page-in .24s cubic-bezier(.2, .7, .3, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .app-main, .bare, .legal { animation: none !important; }
  .tab { transition: none; }
}
.choose-label { font-weight: 800; text-align: center; margin-bottom: 4px; }
.price-choice { cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.price-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.price-choice:has(input:checked) { border: 2px solid var(--gold-2); background: var(--gold-soft); transform: translateY(-2px); box-shadow: 0 6px 16px #e8901a33; }
.price-choice:has(input:checked) strong { color: var(--gold-ink); }
.price-choice:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-gold:disabled { filter: grayscale(.6); opacity: .6; cursor: not-allowed; }

/* ---------- Page vitrine (visiteurs non connectés) ---------- */
.page-landing { background: #fff; }
.lp-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.lp-narrow { max-width: 720px; }
.lp-top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-2); padding-top: env(safe-area-inset-top, 0px); }
.lp-top-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; letter-spacing: 2.5px; color: #3c4347; text-decoration: none; }
.lp-brand img { border-radius: 9px; }
.lp-login { min-height: 42px; padding: 0 16px; font-size: 15px; }
.lp-kicker { color: var(--brand); font-weight: 800; font-size: 14px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 10px; }
.page-landing h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.08; font-weight: 900; letter-spacing: -.8px; color: #23292c; }
.page-landing h2 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; font-weight: 900; letter-spacing: -.4px; color: #23292c; margin-bottom: 16px; }
.page-landing h3 { font-size: 19px; font-weight: 800; color: #23292c; }
.lp-lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 18px 0 24px; max-width: 560px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-btn { min-height: 54px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.lp-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.lp-note svg { color: var(--green); }

.lp-hero { padding: 40px 0 56px; background: radial-gradient(1200px 500px at 85% 10%, #e3f5f8 0, rgba(227,245,248,0) 60%), #fff; overflow: hidden; }
.lp-hero-in { display: grid; gap: 40px; align-items: center; }
.lp-phone { position: relative; width: min(300px, 78vw); margin: 0 auto; padding: 10px; border-radius: 42px; background: #1f2528; box-shadow: 0 30px 60px #1d3a4233, 0 0 0 1px #00000022; }
.lp-phone img { display: block; width: 100%; height: auto; border-radius: 32px; background: #f3f7f7; }
.lp-phone-hero { transform: rotate(2deg); }

.lp-feature { padding: 64px 0; }
.lp-feature-alt { background: #f4f8f9; }
.lp-feature-in { display: grid; gap: 36px; align-items: center; }
.lp-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.lp-points li { position: relative; padding-left: 30px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.lp-points li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c7f93' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 13px no-repeat; }

.lp-band { padding: 56px 0; background: #23292c; }
.lp-cards { display: grid; gap: 16px; }
.lp-card { padding: 24px; border-radius: 18px; background: #2c3438; color: #cfd8db; }
.lp-card h3 { color: #fff; margin: 12px 0 6px; }
.lp-card p { line-height: 1.5; }
.lp-card-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; }

.lp-pricing { padding: 64px 0; }
.lp-plans { display: grid; gap: 16px; margin: 28px auto 16px; max-width: 760px; }
.lp-plan { display: flex; flex-direction: column; gap: 12px; padding: 26px 22px; border-radius: 20px; border: 1px solid var(--line); background: #fff; }
.lp-plan h3 { display: inline-flex; align-items: center; gap: 8px; }
.lp-plan .lp-points { flex: 1; }
.lp-plan-premium { border: 2px solid var(--gold); background: linear-gradient(170deg, #fff8e6, #fff 60%); }
.lp-plan-premium h3 svg { color: var(--gold-2); }
.lp-price strong { font-size: 36px; font-weight: 900; color: #23292c; }
.lp-price span { color: var(--muted); }
.lp-price-alt { margin-top: -8px; color: var(--muted); font-size: 15px; }

.lp-faq { padding: 56px 0; background: #f4f8f9; }
.lp-faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; margin-top: 10px; }
.lp-faq summary { cursor: pointer; padding: 16px 0; font-weight: 800; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--brand); }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq details p { padding: 0 0 16px; line-height: 1.55; color: var(--ink-2); }

.lp-final { padding: 64px 0 72px; }
.lp-final-icon { border-radius: 16px; margin-bottom: 14px; }
.lp-foot { padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-2); text-align: center; }
.lp-brand-small { font-size: 15px; }
.lp-copy { margin-top: 8px; font-size: 13px; color: var(--muted); }
.lp-copy a { color: inherit; }

@media (min-width: 860px) {
  .lp-hero { padding: 72px 0 88px; }
  .lp-hero-in { grid-template-columns: 1.15fr .85fr; }
  .lp-feature-in { grid-template-columns: .8fr 1.2fr; gap: 64px; }
  .lp-reverse > :first-child { order: 2; }
  .lp-cards { grid-template-columns: repeat(3, 1fr); }
  .lp-plans { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 859px) { .lp-cta .lp-btn { flex: 1 1 100%; } }

/* ---------- Carnet de santé ---------- */
.health-card .card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.health-card .card-title svg { color: var(--teal); }
.health-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); }
.health-next.is-late { background: #fff0e0; }
.health-next.is-late small { color: #9a4a00; font-weight: 700; }
.health-event { display: block; color: inherit; text-decoration: none; }
.health-event:hover strong { text-decoration: underline; }
.health-event small { display: block; color: var(--muted); }
.health-timeline li.is-done::before { background: var(--teal); border-color: var(--teal); }
.health-item { padding: 0; gap: 0; }
.health-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 12px 6px 12px 14px; color: inherit; text-decoration: none; }
.health-main .panel-text { min-width: 0; }
.health-dismiss { margin: 0 8px 0 0; }
.health-dismiss .icon-btn { color: var(--muted); }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.type-choice { position: relative; }
.type-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.type-choice span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--field); background: #fff; font-weight: 700; font-size: 15px; text-align: center; }
.type-choice input:checked + span { border: 2px solid var(--teal); background: var(--teal-soft); color: var(--teal-ink); }
.type-choice input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.kitten-checks { display: flex; flex-direction: column; gap: 6px; }
.kitten-check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-weight: 700; }
.kitten-check input { width: 22px; height: 22px; flex: none; }
.kitten-check:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.age-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.plan-row { justify-content: flex-start; gap: 10px; }
.plan-row .panel-text { flex: 1; min-width: 0; }
.plan-row form { margin: 0; }
.plan-age { min-width: 92px; background: var(--teal-soft); color: var(--teal-ink); font-size: 14px; }
.plan-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.plan-tile .panel-text { flex: 1; min-width: 0; }
.plan-tile .todo-icon { background: var(--teal-soft); color: var(--teal); }
.plan-tile.is-locked { border-color: var(--gold-line); background: linear-gradient(160deg, #fffaf0, #fff); }
.plan-tile.is-locked .todo-icon { background: var(--gold-soft); color: var(--gold-2); }
.health-event strong, .health-event span { display: block; }
.health-event span { color: var(--ink-2); font-size: 15px; }
.health-dismiss .icon-btn { border: 0; background: none; box-shadow: none; }
