/* ============================================================
   style.css — SVAG3 Gold Theme (CLEANED & FIXED)
   ============================================================ */

/* ========== Theme variables ========== */
:root {
  --primary: #B58E0F;
  --accent:  #8A6E00;
  --light:   #FFF9E8;
  --dark:    #2A2412;
  --tab-act: #FEF3C7;

  --bg:     #fafafa;
  --card:   #ffffff;
  --ink:    #0f172a;
  --muted:  #6b7280;
  --border: #e5e7eb;
  --shadow: 0 6px 28px rgba(15,23,42,.08);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius:    14px;

  --gap: 14px;

  --income-bg: #eef2ff; --income-fg: #1e3a8a;
  --expense-bg:#fff1f2; --expense-fg:#be123c;
  --net-bg:    #ecfdf5; --net-fg:    #065f46;

  --accent-ink:#1b1b1b;
}

/* ========== Base ========== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink);
  background: var(--bg);
}
.shell { max-width: 1200px; margin: 32px auto; padding: 0 16px; }

/* ========== Header ========== */
.header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.header__brand { display:flex; align-items:center; gap:12px; }
.logo {
  width:44px; height:44px; border-radius:14px; display:grid; place-content:center;
  color:#fff; font-weight:800; background: var(--primary); box-shadow: var(--shadow);
}
.header h1 { margin:0; font-size:24px; color: var(--primary); }
.header small { color: var(--muted); }
.pdfmode { color: var(--muted); font-size: .92rem; display:flex; align-items:center; gap:10px; }
.pdfmode label { display:inline-flex; align-items:center; gap:6px; }
.pdfmode.is-hidden { display:none; }

/* ========== Tabs ========== */
.tabs { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.tab {
  background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: 12px; border:1px solid var(--border);
  cursor:pointer; transition:.15s ease;
}
.tab:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tab.active { border-color: var(--primary); color: var(--accent); background: var(--tab-act); }

/* ========== Panels / cards ========== */
.panel {
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:18px 18px 20px;
  box-shadow: var(--shadow);
}
.section-title { font-weight:700; margin:6px 0 12px; color: var(--primary); }

/* ========== Grid helpers ========== */
.row { display:grid; gap:12px; }
@media (min-width:768px){
  .row-2 { grid-template-columns:1fr 1fr; }
  .row-3 { grid-template-columns:2fr 1fr 1fr; }
  .row-4 { grid-template-columns:1.2fr 1fr 1fr 1fr; }
  .row-5 { grid-template-columns:2fr 1fr 1fr 1fr auto; }
}

/* ========== Forms ========== */
label { font-size:.92rem; color: var(--ink); display:block; font-weight:600; margin:2px 0 6px; }
input, select, textarea, canvas {
  width:100%; padding:.6rem .7rem; background:#fff; color:var(--ink);
  border:1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height:120px; resize:vertical; }
input::placeholder, textarea::placeholder{ color:#a0a7b1; }
input:focus, select:focus, textarea:focus{
  border-color:#f0c14b;
  box-shadow:0 0 0 4px rgba(240,193,75,.22);
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7a6400 50%),
    linear-gradient(135deg, #7a6400 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px), calc(100% - 42px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 44px;
  background-repeat:no-repeat;
}
.money { text-align:right; }

/* Validation */
.error, .input-error { font-size:.82rem; color:#b91c1c; margin-top:4px; }
.invalid{
  border-color:#b91c1c !important;
  box-shadow:0 0 0 4px rgba(185,28,28,.12) !important;
}
.hidden { display:none !important; }

/* ========== Dynamic blocks ========== */
.dyn { border:1px dashed var(--border); padding:12px; border-radius: var(--radius-md); background:#fff; }
.line { display:grid; gap:8px; align-items:end; }

/* ========== Summary cards ========== */
.sum { padding:12px; border-radius: var(--radius-md); border:1px solid var(--border); }
.sum.income { background: var(--income-bg); color: var(--income-fg); }
.sum.expense{ background: var(--expense-bg); color: var(--expense-fg); }
.sum.net    { background: var(--net-bg);    color: var(--net-fg); }

/* ========== Buttons & links ========== */
.actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:.65rem 1rem; border-radius:12px; border:1px solid var(--border);
  font-weight:700; background:#fff; color:var(--ink);
  cursor:pointer; transition: all .16s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow:0 10px 20px rgba(15,23,42,.06); }
.btn-primary{
  background: linear-gradient(180deg, #ffd166, #f4b41a);
  border-color:#e6a90a; color:#1e1b04;
}
.btn-primary:hover{ box-shadow:0 10px 24px rgba(244,180,26,.28); }
.btn-green { background: linear-gradient(90deg, #0ea5e9, #10b981); color:#fff; border-color:transparent; }
.link-danger { color:#be123c; text-decoration:underline; cursor:pointer; }

/* ========== Signature ========== */
#signatureCanvas { height:160px; display:block; cursor:crosshair; touch-action:none; }

/* ========== Segmented control (Monsieur/Madame/Couple) ========== */
#idTypeSwitcher{
  display:inline-flex; gap:0; background:#f6f6f6; border:1px solid var(--border);
  padding:4px; border-radius:999px; box-shadow: inset 0 1px 0 rgba(0,0,0,.03);
}
.seg-btn{
  background:transparent; border:0; border-radius:999px; padding:.5rem .8rem;
  font-weight:600; color: var(--muted); transition: all .18s ease;
}
.seg-btn:hover{ color: var(--ink); }
.seg-btn.active{
  background: linear-gradient(180deg, #ffe9a6, #ffd97a);
  color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 14px rgba(180,138,0,.18);
}
.person-block.hidden { display: none; }
.req { color:#be123c; }

/* ========== Employeur rows ========== */
.employeur-row { transition: opacity .2s ease; }
.employeur-row.hidden { display:none; }

/* ========== Children containers ========== */
#childrenContainerInfo,
#childrenContainer{
  background: linear-gradient(180deg, #fff, #fffef7);
  border: 1px solid #f1e5b6;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 18px rgba(180,138,0,.08);
  transition: all .15s ease;
}
#childrenContainerInfo:empty,
#childrenContainer:empty,
#childrenContainerInfo.is-empty,
#childrenContainer.is-empty{
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: none;
}
.row.is-empty > label { opacity:.5; }

/* ========== Objectifs matrix ========== */
#objectifsPanel .obj-matrix{
  display: grid;
  grid-template-columns: 1fr 40px 40px;   /* Texte | M | Mme */
  column-gap: 16px; row-gap: 0;
  align-items: center;
}
#objectifsPanel .obj-head,
#objectifsPanel .obj-text,
#objectifsPanel .obj-cell{
  min-height: 36px;
  display: flex; align-items: center;
}
#objectifsPanel .obj-head{
  justify-content: center;
  border-bottom: 1px solid var(--border);
  padding: 0 0 6px 0; margin: 0;
  font-weight: 700; color: #6b5e20;
}
#objectifsPanel .obj-head.obj-head-text{ justify-content:flex-start; }
#objectifsPanel .obj-text{ line-height: 1.4; padding:0; }
#objectifsPanel .obj-cell{ justify-content:center; padding:0; }
#objectifsPanel .obj-cell input[type="checkbox"]{
  width:18px; height:18px; margin:0; padding:0; vertical-align:middle; accent-color:#b48a00;
}
#objectifsPanel.only-m  .col-f,
#objectifsPanel.only-m  .obj-head.col-f{ display:none; }
#objectifsPanel.only-f  .col-m,
#objectifsPanel.only-f  .obj-head.col-m{ display:none; }
#objectifsPanel.only-m  .obj-matrix,
#objectifsPanel.only-f  .obj-matrix{ grid-template-columns: 1fr 40px; }

/* ========== Santé layout ========== */
#santePanel .health-columns{ display:grid; grid-template-columns: 1fr 1fr; gap:18px; }
#santePanel .health-card{
  background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px;
}
#santePanel .health-title{
  font-weight:700; color:#6b5e20; margin:0 0 10px; position:relative;
}
#santePanel .health-title::after{ content:""; display:block; height:1px; background:var(--border); margin-top:6px; }

/* Santé : matrice préférences en 3 colonnes larges : Texte | M | Mme */
#santePanel .health-matrix{
  display: grid;
  grid-template-columns: 1fr minmax(180px, 1fr) minmax(180px, 1fr);
  column-gap: 16px; row-gap: 0; align-items: center;
}
#santePanel .h-cell{ justify-content: stretch; }
#santePanel .h-cell .thermo{ width: 100%; }
#santePanel.only-m  .health-matrix,
#santePanel.only-f  .health-matrix{ grid-template-columns: 1fr minmax(220px,1fr); }

#santePanel .h-cell input.thermo-src{ display: none !important; }
#santePanel .h-cell{ justify-content:stretch; }
#santePanel .h-cell .thermo{ width:100%; }

#santePanel.only-m  .col-f,
#santePanel.only-m  .h-head.col-f{ display:none; }
#santePanel.only-f  .col-m,
#santePanel.only-f  .h-head.col-m{ display:none; }
#santePanel.only-m  .health-matrix,
#santePanel.only-f  .health-matrix{ grid-template-columns: 1fr 1fr; }

#santePanel .h-head, #santePanel .h-text, #santePanel .h-cell{
  min-height:36px; display:flex; align-items:center;
}
#santePanel .h-head{ justify-content:center; border-bottom:1px solid var(--border); padding:0 0 6px; margin:0; font-weight:700; color:#6b5e20; }
#santePanel .h-head.h-head-text{ justify-content:flex-start; }
#santePanel .h-text{ line-height:1.4; }
#santePanel .h-cell input[type="checkbox"]{ width:18px; height:18px; margin:0; accent-color:#b48a00; }

/* Santé top champs */
#santePanel .health-top{
  display:grid; grid-template-columns: 1fr 1fr 1fr; column-gap:16px; row-gap:10px; align-items:center; margin-bottom:14px;
}
#santePanel .health-top .h-head,
#santePanel .health-top .h-text,
#santePanel .health-top .h-cell{
  min-height:36px; display:flex; align-items:center;
}
#santePanel .health-top .h-head{
  justify-content:center; border-bottom:1px solid var(--border); padding-bottom:6px; font-weight:700; color:#6b5e20;
}
#santePanel .health-top .h-head.h-head-text{ justify-content:flex-start; }
#santePanel .health-top .h-cell input,
#santePanel .health-top .h-cell select{ width:100%; }
#santePanel.only-m  .col-f, #santePanel.only-m  .h-head.col-f{ display:none; }
#santePanel.only-f  .col-m, #santePanel.only-f  .h-head.col-m{ display:none; }
#santePanel.only-m  .health-top,
#santePanel.only-f  .health-top{ grid-template-columns: 1fr 1fr; }

/* ========== Prévoyance matrix ========== */
#prevoyancePanel .prev-matrix{
  display:grid; grid-template-columns: 1fr 1fr 1fr; column-gap:16px; row-gap:10px; align-items:center;
}
#prevoyancePanel .p-head, #prevoyancePanel .p-text, #prevoyancePanel .p-cell{
  min-height:36px; display:flex; align-items:center;
}
#prevoyancePanel .p-head{
  justify-content:center; border-bottom:1px solid var(--border); padding-bottom:6px; margin:0; font-weight:700; color:#6b5e20;
}
#prevoyancePanel .p-head.p-head-text{ justify-content:flex-start; }
#prevoyancePanel .p-text{ line-height:1.4; }
#prevoyancePanel .p-cell{ justify-content:center; }
#prevoyancePanel .p-cell input, #prevoyancePanel .p-cell select{ width:100%; }
#prevoyancePanel.only-m  .col-f, #prevoyancePanel.only-m  .p-head.col-f{ display:none; }
#prevoyancePanel.only-f  .col-m, #prevoyancePanel.only-f  .p-head.col-m{ display:none; }
#prevoyancePanel.only-m  .prev-matrix,
#prevoyancePanel.only-f  .prev-matrix{ grid-template-columns: 1fr 1fr; }

/* ========== Misc ========== */
input[list]::-webkit-calendar-picker-indicator{ display:none !important; }
.tel-label.star::after{ content:" *"; color:#b91c1c; margin-left:4px; font-weight:700; }

/* ============================================================
   THERMOMÈTRE 1→10 (Version finale, bulbe doré à 100% uniquement)
   ============================================================ */
#santePanel .health-matrix{
  grid-template-columns: 1fr minmax(220px,1fr) minmax(220px,1fr);
}
#santePanel .h-cell{ justify-content: stretch !important; }
#santePanel .h-cell > .thermo{ width: 100% !important; }
#santePanel .h-cell input.thermo-src{ display:none !important; }

/* Tube doré */
#santePanel .thermo-fill{
  background: linear-gradient(90deg, #ffe08a, #b58e0f) !important;
}
#santePanel .thermo:focus-within .thermo-track{
  box-shadow: 0 0 0 4px rgba(181,142,15,.22) !important;
}

/* Masque tout texte parasite à droite (ex: "0") */
#santePanel .h-cell { position: relative; }
#santePanel .h-cell::after,
#santePanel .h-cell::before { content: none !important; }
#santePanel .h-cell > span,
#santePanel .h-cell > output,
#santePanel .h-cell > .thermo + * { display: none !important; }
#santePanel .h-cell { color: transparent !important; }
#santePanel .h-cell .thermo { color: initial !important; }

/* --- Base thermo (unifiée, sans doublons) --- */
.thermo {
  --tube-h: 14px;           /* hauteur du tube */
  --bulb: 28px;             /* diamètre du bulbe */
  --glass: #f3f4f6;         /* verre (par défaut) */
  --gline: #e5e7eb;         /* bord du verre */
  --grid:  #e5e7eb;         /* ticks */
  position: relative;
  user-select: none;
  height: max(36px, var(--bulb) + 8px);
  display: grid;
  align-items: center;
}

/* Tube en verre */
.thermo-track {
  position: relative;
  height: var(--tube-h);
  margin-right: calc(var(--bulb) / 2);     /* espace avant le bulbe */
  background: var(--glass);
  border: 1px solid var(--gline);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.04);
  z-index: 1;
}

/* Remplissage du tube (doré) */
.thermo-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: var(--tube-h);
  width: 0%;                               /* ← piloté par JS */
  background: linear-gradient(90deg, #ffe08a, #b58e0f);
  border-radius: 999px;
  transition: width .25s ease;
  z-index: 2;
}

/* Graduations décalées (avant le bulbe) */
.thermo-ticks {
  position: absolute;
  inset: 0;
  margin-right: calc(var(--bulb) / 2);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  pointer-events: none;
}
.thermo-ticks span {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 20%, var(--grid) 20% 80%, transparent 80%);
  margin-left: -1px;
  justify-self: end;
}

/* Tooltip */
.thermo-tip {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  padding: 2px 6px;
  background: #111827; color: #fff; border-radius: 6px;
  font-size: 12px; line-height: 1.2;
  white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
.thermo:active .thermo-tip,
.thermo:focus-within .thermo-tip { opacity: 1; visibility: visible; }

/* Bulbe en verre (OPAQUE par défaut → masque le tube) */
.thermo::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: var(--bulb); height: var(--bulb);
  transform: translateY(-50%);
  background: var(--glass);                /* ← verre (opaque) */
  border: 1px solid var(--gline);
  border-radius: 50%;
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,.06),
    0 0 0 2px rgba(255,255,255,.6);
  z-index: 3;                              /* au-dessus du tube/fill */
}

/* Bulbe DORÉ UNIQUEMENT à 100% (is-full posé par le JS) */
#santePanel .thermo.is-full::after {
  background:
    radial-gradient(circle at 40% 35%, #fff7c7 0 35%, transparent 36%),
    linear-gradient(145deg, #ffec9f, #b58e0f);
}

/* Accessibilité focus */
.thermo[aria-disabled="true"] { opacity:.5; pointer-events:none; }
.thermo:focus-within .thermo-track { box-shadow: 0 0 0 4px rgba(181,142,15,.22); }

/* Élément du bulbe doré derrière le verre */
.thermo-bulb{
  position:absolute;
  right:0; top:50%;
  width:var(--bulb); height:var(--bulb);
  transform: translateY(-50%);
  border-radius:50%;
  z-index:2; /* sous le verre (::after) */
  /* Doré plein, mais masqué en % depuis la gauche */
  background: linear-gradient(145deg,#ffec9f,#b58e0f);
  /* Masque progressif contrôlé par --bulbPct (0% → 100%) */
  -webkit-mask: linear-gradient(90deg, #000 var(--bulbPct,0%), transparent 0);
          mask: linear-gradient(90deg, #000 var(--bulbPct,0%), transparent 0);
  transition: -webkit-mask .25s ease, mask .25s ease;
}

/* Le verre du bulbe (déjà défini) reste au-dessus */
.thermo::after{
  z-index:3;
}


/* Le verre du bulbe reste dans ::after (déjà présent chez toi) */
.thermo::after{
  /* ...tes styles existants... */
  z-index:3;                                   /* au-dessus du doré */
  background: var(--glass);                    /* reste l’aspect “verre” */
  /* facultatif: petit highlight */
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,.06),
    0 0 0 2px rgba(255,255,255,.6);
}

/* Option : si valeur = 0, on “éteint” visuellement le bulbe doré */
.thermo[data-value="0"] .thermo-bulb{ visibility:hidden; }

/* === Alignement M / Mme identique pour Préférences & Questions === */
/* Une variable, même largeur partout */
#santePanel { --colW: 220px; }           /* ajuste 200–240 si tu veux */

/* Applique la même grille aux deux cartes */
#santePanel .health-matrix,
#santePanel .questions-matrix{
  display: grid;
  grid-template-columns: 1fr var(--colW) var(--colW);  /* Texte | M | Mme */
  column-gap: 16px;
  align-items: center;
}

/* Centre parfaitement les en-têtes et cases */
#santePanel .questions-matrix .h-head.col-m,
#santePanel .questions-matrix .h-head.col-f,
#santePanel .questions-matrix .h-cell.col-m,
#santePanel .questions-matrix .h-cell.col-f{
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Neutralise les décalages natifs des checkboxes */
#santePanel .questions-matrix .h-cell input[type="checkbox"]{
  width: 18px;
  height: 18px;
  margin: 0;                /* pas de marge UA */
  vertical-align: middle;   /* sécurité */
}

/* ===== ALIGNEMENT QUESTIONS : cases pile sous "M" et "Mme" ===== */
#santePanel { --colW: 220px; } /* adapte si besoin */

#santePanel .questions-matrix{
  display: grid;
  grid-template-columns: 1fr var(--colW) var(--colW); /* Texte | M | Mme */
  column-gap: 16px;
  align-items: center;
  justify-items: center;                 /* centre TOUT ce qui est en col 2–3 */
}

/* Colonne texte à gauche (sinon elle aussi serait centrée) */
#santePanel .questions-matrix .h-text,
#santePanel .questions-matrix .h-head.h-head-text{
  justify-self: start;
}

/* Sécurités : l’input est centré dans sa cellule, sans marges parasites */
#santePanel .questions-matrix .h-cell{ display:block; min-height:36px; }
#santePanel .questions-matrix .h-cell input[type="checkbox"]{
  display:block;
  margin:0 auto;        /* centre l’élément remplacé */
  width:18px; height:18px;
}

/* ===== QUESTIONS: alignement M / Mme + modes ===== */

/* Grille par défaut : Texte | M | Mme */
#santePanel .questions-matrix{
  display:grid;
  grid-template-columns: 1fr var(--colW) var(--colW);
  column-gap:16px;
  align-items:center;
  justify-items:center; /* centre les cellules M/Mme */
}
/* Le texte à gauche reste à gauche */
#santePanel .questions-matrix .h-text,
#santePanel .questions-matrix .h-head.h-head-text{ justify-self:start; }

/* Neutralise les marges des checkboxes */
#santePanel .questions-matrix .h-cell{ display:block; min-height:36px; }
#santePanel .questions-matrix .h-cell input[type="checkbox"]{
  display:block; margin:0 auto; width:18px; height:18px;
}

/* Mode MONSIEUR : on cache la colonne Mme et on passe à 2 colonnes */
#santePanel.only-m  .questions-matrix .col-f,
#santePanel.only-m  .questions-matrix .h-head.col-f{ display:none; }
#santePanel.only-m  .questions-matrix{ grid-template-columns: 1fr var(--colW); }

/* Mode MADAME : on cache la colonne M et on passe à 2 colonnes */
#santePanel.only-f  .questions-matrix .col-m,
#santePanel.only-f  .questions-matrix .h-head.col-m{ display:none; }
#santePanel.only-f  .questions-matrix{ grid-template-columns: 1fr var(--colW); }

/* Thermomètres mini pour les Objectifs */
.obj-cell .mini-thermo {
  width: 26px;
  height: 120px;
  margin: auto;
  border-radius: 26px;
  position: relative;
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, #fff, #fff7da);
  box-shadow: inset 0 0 6px rgba(0,0,0,0.15);
}

.obj-cell .mini-thermo::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 30% 30%, #ffea8a, #b58e0f);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.obj-cell .mini-thermo .thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(180deg, #f4b41a, #b58e0f);
  border-radius: inherit;
  transition: height 0.6s ease;
}

/* Objectifs : mêmes largeurs de colonnes que Santé (Texte | M | Mme) */
#objectifsPanel .obj-matrix{
  grid-template-columns: 1fr minmax(220px,1fr) minmax(220px,1fr);
}
#objectifsPanel .obj-cell{ justify-content: stretch; }

/* Cacher les champs source comme en Santé */
#objectifsPanel .obj-cell input.thermo-src{ display: none !important; }

/* Appliquer le même doré et bulbe quand 100% */
#objectifsPanel .thermo-fill{
  background: linear-gradient(90deg, #ffe08a, #b58e0f) !important;
}
#objectifsPanel .thermo.is-full::after{
  background:
    radial-gradient(circle at 40% 35%, #fff7c7 0 35%, transparent 36%),
    linear-gradient(145deg, #ffec9f, #b58e0f);
}

/* Mode M ou Mme seul : garder la 2e colonne */
#objectifsPanel.only-m  .obj-matrix,
#objectifsPanel.only-f  .obj-matrix{ grid-template-columns: 1fr minmax(220px,1fr); }
#objectifsPanel.only-m  .col-f,
#objectifsPanel.only-f  .col-m{ display:none; }

/* Objectifs : la piste doit prendre toute la cellule */
#objectifsPanel .obj-cell .thermo{
  width: 100% !important;
}

/* ===== Situation actuelle (2 questions, 1 colonne thermo) ===== */
#objectifsPanel .situ-matrix{
  display:grid;
  grid-template-columns: 1fr minmax(220px,1fr); /* Texte | Thermo */
  column-gap:16px; row-gap:8px; align-items:center;
  margin-bottom:14px;
}
#objectifsPanel .situ-text{ min-height:36px; display:flex; align-items:center; }
#objectifsPanel .situ-cell{ min-height:36px; display:flex; align-items:center; }
#objectifsPanel .situ-cell .thermo{ width:100% !important; }  /* pleine largeur */
#objectifsPanel .situ-cell input.thermo-src{ display:none !important; } /* on masque la source comme ailleurs */

/* ===== Rêves principaux : + colonne image ===== */
#objectifsPanel .dreams-matrix{
  display:grid;
  grid-template-columns: 122px 1fr var(--colW,220px) var(--colW,220px); /* IMG | Texte | M | Mme */
  column-gap:16px; row-gap:10px; align-items:center; margin-top:8px;
}
#objectifsPanel .dreams-matrix .h-head,
#objectifsPanel .dreams-matrix .h-text,
#objectifsPanel .dreams-matrix .h-cell,
#objectifsPanel .dreams-matrix .h-img{
  min-height:64px; display:flex; align-items:center;
}
#objectifsPanel .dreams-matrix .h-head{
  justify-content:center; border-bottom:1px solid var(--border);
  padding:0 0 6px; margin:0; font-weight:700; color:#6b5e20;
}
#objectifsPanel .dreams-matrix .h-head.h-head-text{ justify-content:flex-start; }
#objectifsPanel .dreams-matrix .h-text{ line-height:1.4; }
#objectifsPanel .dreams-matrix .h-cell{ justify-content:center; }
#objectifsPanel .dreams-matrix input[type="checkbox"]{ width:18px; height:18px; margin:0; accent-color:#b48a00; }

/* vignettes */
#objectifsPanel .dreams-matrix .h-img{ justify-content:center; }
#objectifsPanel .dreams-matrix .h-img img{
  width:112px; height:72px; object-fit:cover;
  border-radius:12px; border:1px solid var(--border); box-shadow: var(--shadow);
  background:#fff;
}

/* Modes M / Mme seuls */
#objectifsPanel.only-m  .dreams-matrix .col-f,
#objectifsPanel.only-m  .dreams-matrix .h-head.col-f{ display:none; }
#objectifsPanel.only-f  .dreams-matrix .col-m,
#objectifsPanel.only-f  .dreams-matrix .h-head.col-m{ display:none; }
#objectifsPanel.only-m  .dreams-matrix,
#objectifsPanel.only-f  .dreams-matrix{ grid-template-columns: 122px 1fr var(--colW,220px); }

/* Responsive */
@media (max-width:720px){
  #objectifsPanel .dreams-matrix{
    grid-template-columns: 92px 1fr 80px 80px;
  }
  #objectifsPanel .dreams-matrix .h-img img{ width:88px; height:60px; }
}

.compl-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  margin-bottom:14px;
}
.check{ display:inline-flex; align-items:center; gap:8px; font-weight:600; }

/* --- Complément d'info: ligne radio + champ --- */
.ci-line{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.ci-who{
  max-width: 280px;
}
.ci-who:disabled{
  opacity:.55; background:#f9fafb;
}

/* Segmented control réutilisable (plus petit que #idTypeSwitcher) */
.seg{
  display:inline-flex; gap:0; background:#f6f6f6; border:1px solid var(--border);
  padding:4px; border-radius:999px; box-shadow: inset 0 1px 0 rgba(0,0,0,.03);
}
.seg.seg-small .seg-btn{ padding:.4rem .75rem; font-size:.92rem; }
.seg input[type="radio"]{ position:absolute; opacity:0; pointer-events:none; }
.seg .seg-btn{
  background:transparent; border:0; border-radius:999px; font-weight:600; color:var(--muted);
  cursor:pointer; transition:all .18s ease;
}
.seg .seg-btn:hover{ color:var(--ink); }
.seg .seg-btn.active{
  background:linear-gradient(180deg, #ffe9a6, #ffd97a);
  color:var(--accent-ink); box-shadow:0 6px 14px rgba(180,138,0,.18);
}

/* Petit ajustement de la carte */
.compl-card .row + .row{ margin-top:8px; }

/* Diviseur de section : bordure + espace (sous-blocs) */
.panel .section-title.slice{
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 14px;
}

/* Optionnel: un peu plus d'air quand un bloc suit une carte complète */
.panel .compl-card + .section-title.slice{
  margin-top: 16px;
}

/* Cartes d'objectifs : même style que Complément d'info */
.obj-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  box-shadow: 0 4px 18px rgba(180,138,0,.08);
  margin-bottom:14px;
}

/* Titre interne avec petite ligne de séparation */
.obj-card .section-title{
  margin: 0 0 10px;
  position: relative;
}
.obj-card .section-title::after{
  content:"";
  display:block;
  height:1px;
  background: var(--border);
  margin-top:6px;
}

/* Ajustements du contenu à l’intérieur des cartes */
.obj-card .situ-matrix{ margin-bottom: 0; }
.obj-card .dreams-matrix{ margin-top: 0; }

/* Ligne montant dans Complément d'info */
.ci-amount{
  display:flex;
  align-items:center;
  gap:12px;
}
.ci-amount input{
  max-width: 260px;        /* largeur raisonnable */
  text-align: right;       /* aligné comme les montants */
}

.risk-line{
  grid-template-columns: 1.3fr 1.1fr 1fr 1fr;
  column-gap: 10px;
}
.risk-line label{ margin-bottom: 4px; }

/* Santé > Préférences : cacher toute mini-jauge qui se trouverait dans un en-tête */
#santePanel .health-card .health-matrix .h-head .mini-meter,
#santePanel .health-card .health-title::after {
  display: none !important;
  content: none !important;
}

/* Sécurité : empêche tout débordement visuel dans la rangée d’en-tête */
#santePanel .health-card .health-matrix .h-head {
  overflow: hidden;
}

#santePanel .mini-meter,
#santePanel .mini-meter * {
  display: none !important;
}
/* Forcer une nouvelle ligne dans les grilles dynamiques */
.grid-break { grid-column: 1 / -1; }

/* ============================================
   SVAG3 Gold Pro — Soft polish (drop-in add-on)
   ============================================ */

/* Palette & rayons plus premium */
:root {
  --primary: #B08900;     /* or pâle plus chic */
  --accent:  #7A5E00;     /* contraste doux */
  --light:   #FFF7DF;
  --dark:    #1F1A0E;

  --ink:     #0e1726;
  --muted:   #7a8190;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --radius:    16px;

  --shadow-sm: 0 6px 18px rgba(15,23,42,.06);
  --shadow-md: 0 10px 26px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 42px rgba(15,23,42,.10);
}

/* Typo & rythmes */
body { letter-spacing:.1px; }
.section-title {
  font-weight:800;
  letter-spacing:.2px;
  color: #8B6A00;
  position:relative;
  padding-bottom: 6px;
}
.section-title::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-2px;
  height:2px;
  background: linear-gradient(90deg, #ffe08a, #b58e0f 60%, transparent);
  opacity:.6;
}

/* Header : logo plus “gemme” */
.logo{
  background: radial-gradient(circle at 30% 25%, #ffe8a6 0 48%, #b58e0f 70%);
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,.45),
    var(--shadow-md);
}

/* Tabs : pilules velours + soulignage animé */
.tabs{ gap:10px; }
.tab{
  border-radius: 999px;
  padding: 10px 16px;
  border-color: #eee7cc;
  background:
    linear-gradient(180deg, #ffffff, #fffdf3);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.tab:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.tab.active{
  background: linear-gradient(180deg, #fff2c6, #ffe597);
  border-color: #e3c45a;
  color: #3d2f00;
  position: relative;
}
.tab.active::after{
  content:"";
  position:absolute; left:14px; right:14px; bottom:7px;
  height:3px; border-radius:3px;
  background: linear-gradient(90deg,#ffec9f,#b58e0f);
  opacity:.8;
}

/* Cards : contour irisé + ombre douce */
.panel{
  border-radius: var(--radius-lg);
  border: 1px solid rgba(233,206,132,.45);
  background:
    linear-gradient(180deg, #ffffff, #fffdf6);
  box-shadow: var(--shadow-md);
}
.obj-card, .compl-card, .dyn{
  border-radius: var(--radius-md);
  border: 1px solid rgba(233,206,132,.38);
  background:
    linear-gradient(180deg, #ffffff, #fffdf8);
  box-shadow: var(--shadow-sm);
}

/* Inputs : bords satin + ring plus fin */
input, select, textarea, canvas{
  border-radius: 12px;
  border-color: #e9e3cf;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
input:focus, select:focus, textarea:focus{
  border-color:#e3b52e;
  box-shadow:
    0 0 0 3px rgba(240,193,75,.18),
    0 1px 0 rgba(255,255,255,.9) inset;
}
input::placeholder, textarea::placeholder{ color:#a9afba; }

/* Money align + micro-monospace agréable */
.money{ font-variant-numeric: tabular-nums; }

/* Segmented controls (idTypeSwitcher & .seg) plus polis */
#idTypeSwitcher, .seg{
  background: linear-gradient(180deg, #faf9f3, #f2efe3);
  border-color: #e9e3cf;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    0 1px 0 rgba(255,255,255,.5);
}
.seg .seg-btn, #idTypeSwitcher .seg-btn{
  color:#7b7f8b;
  padding:.48rem .9rem;
}
.seg .seg-btn.active, #idTypeSwitcher .seg-btn.active{
  background: linear-gradient(180deg, #ffefb9, #ffd975);
  color:#2a2412;
  box-shadow: 0 6px 16px rgba(181,142,15,.16);
}

/* Boutons : plus “clicky” */
.btn{
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #fffaf0);
  border-color:#ece2c2;
}
.btn:hover{ box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.btn-primary{
  background: linear-gradient(180deg, #ffe48f, #f4b41a);
  border-color:#e2a40c;
  color:#312407;
}
.btn-primary:hover{ box-shadow: 0 10px 26px rgba(244,180,26,.28); }
.btn-green{
  background: linear-gradient(90deg, #0fb0ff, #10b981);
  box-shadow: 0 10px 22px rgba(16,185,129,.24);
}

/* Sums : badges “pill” harmonisés */
.sum{
  border-radius: 14px;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.sum.income{ background: linear-gradient(180deg,#eef2ff,#e9efff); }
.sum.expense{ background: linear-gradient(180deg,#fff1f4,#ffe9ee); }
.sum.net{ background: linear-gradient(180deg,#ecfdf5,#e6fbf1); }

/* Health / Objectives matrices : alignements plus nets */
#santePanel .h-head, #objectifsPanel .obj-head{
  color:#7a641b;
  letter-spacing:.2px;
}
#santePanel .health-top .h-head,
#prevoyancePanel .p-head{
  color:#7a641b;
}

/* Checkboxes : accent or */
#santePanel input[type="checkbox"],
#objectifsPanel input[type="checkbox"]{
  accent-color:#B08900;
}

/* Thermomètres : lumière plus douce (conserve ton JS) */
.thermo-track{
  background: #f6f7fa;
  border-color: #e7e9ef;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
#santePanel .thermo-fill,
#objectifsPanel .thermo-fill{
  background: linear-gradient(90deg, #ffe8a6, #b58e0f) !important;
  filter: saturate(1.05);
}
.thermo-tip{
  background:#1b2433;
  box-shadow: 0 6px 16px rgba(15,23,42,.18);
}

/* Pédiatre card : mieux fondue quand affichée */
#pediatreCard.health-card{
  border-color:#efe5c7;
  background: linear-gradient(180deg,#fff,#fffdf4);
}

/* Tables (jspdf-autotable impression cohérente : visuel écran) */
table, .jspdf-autotable table {
  border-radius:10px;
  overflow:hidden;
}

/* Frais médicaux inline */
.amount-inline{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.amount-inline .money{
  max-width: 140px;
  text-align: right;
}
.amount-inline .suffix{
  color: var(--muted);
  font-size:.92rem;
}

/* ==== Modes globaux (affichage M / F / Couple) ==== */
body.mode-m  [data-person="f"] { display: none !important; }
body.mode-f  [data-person="m"] { display: none !important; }
/* en couple, on montre les deux */
body.mode-c  [data-person="m"],
body.mode-c  [data-person="f"] { display: revert !important; }

/* Optionnel : si tu veux aussi cacher les colonnes "col-m" / "col-f" 
   (matrices Santé/Obj/Prévoyance) quand on n’est pas en Couple : */
.only-m .col-f { display: none !important; }
.only-f .col-m { display: none !important; }

#budgetSheet .row > div > label { font-weight: 600; }
#budgetSheet input[readonly] { background: #f9fafb; color: #475569; }

/* Fiscalité helpers */
/* (No extra styles needed; money inputs inherit global styles) */

/* Active uniquement pendant l'export (body.pdf-export) */
.pdf-export input,
.pdf-export select,
.pdf-export textarea {
  line-height: 1.35;              /* force un line-height constant */
  padding-top: .72rem;            /* un poil plus d'air haut/bas */
  padding-bottom: .78rem;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0);       /* évite certains arrondis de raster */
}

/* Les inputs numériques/dates ont souvent la ligne la plus serrée */
.pdf-export input[type="date"],
.pdf-export input[inputmode="numeric"],
.pdf-export input[type="number"] {
  line-height: 1.45;
}

/* Au cas où le UA mettrait overflow: hidden sur les form controls */
.pdf-export input, .pdf-export select, .pdf-export textarea {
  overflow: visible;
}

/* Centrer le texte dans les champs (inputs + textarea) */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[list],
textarea {
  text-align: center;
}

/* Conserver l’alignement à droite pour les montants */
.money { text-align: right; }

/* (Optionnel) Centrer le libellé des <select> aussi */
select {
  text-align: center;       /* pour certains navigateurs */
  text-align-last: center;  /* Chrome/Edge */
}

/* Pendant l’export PDF, garder le centrage également */
.pdf-export input,
.pdf-export select,
.pdf-export textarea {
  text-align: center;
}
.pdf-export .money { text-align: right; }
/* ====== Agrandit la hauteur des champs ====== */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[list],
textarea,
select {
  min-height: 44px;         /* hauteur confortable */
  line-height: 1.4;         /* évite le texte coupé */
  padding: 10px 12px;       /* plus d’espace intérieur */
  font-size: 15px;          /* texte un peu plus lisible */
  text-align: center;       /* reste centré */
  box-sizing: border-box;   /* évite débordement */
}

/* Conserve alignement à droite pour les montants */
.money {
  text-align: right;
}

/* Améliore aussi les menus déroulants */
select {
  text-align: center;
  text-align-last: center;
  height: 46px; /* harmonisé */
}

/* En PDF (capture), même hauteur */
.pdf-export input,
.pdf-export select,
.pdf-export textarea {
  min-height: 44px;
  line-height: 1.4;
  padding: 10px 12px;
}

/* === UNIFORMISATION TOTALE DE LA HAUTEUR DES CHAMPS === */
input,
select,
textarea {
  display: inline-block;
  width: 100%;
  min-height: 52px !important;    /* plus haut que tous les précédents */
  line-height: 1.5 !important;    /* espace vertical généreux */
  padding: 14px 14px !important;  /* air intérieur haut/bas */
  font-size: 16px !important;     /* texte plus lisible */
  vertical-align: middle;
  box-sizing: border-box;
}

/* Harmonise aussi les radios/checkbox pour qu’ils ne "tombent" pas */
input[type="checkbox"],
input[type="radio"] {
  min-height: auto !important;
  height: 20px;
  width: 20px;
  vertical-align: middle;
  transform: translateY(1px);
}

/* Ajuste les selects pour qu’ils gardent la même hauteur */
select {
  height: 52px !important;
  text-align: center;
  text-align-last: center;
  appearance: none;
  padding-right: 38px !important; /* pour garder la flèche visible */
}

/* Même règles pendant la génération PDF */
.pdf-export input,
.pdf-export select,
.pdf-export textarea {
  min-height: 52px !important;
  line-height: 1.5 !important;
  padding: 14px 14px !important;
  font-size: 16px !important;
}

/* Spécifique aux champs numériques et dates */
input[type="number"],
input[type="date"],
input[inputmode="numeric"] {
  text-align: center;
}

/* Les champs monétaires restent alignés à droite */
.money {
  text-align: right !important;
}
/* 3e pilier – visuel */
.pillar3-hero {
  margin: 10px 0 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
}

.pillar3-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}

.pillar3-hero figcaption {
  margin-top: 6px;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Optionnel : réduire un peu le visuel sur écrans étroits */
@media (max-width: 560px) {
  .pillar3-hero { padding: 6px; }
}

/* Visuel récap - juste avant "Note générale" (Prévoyance) */
.prev-summary-hero {
  margin: 8px 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  /* Pour le PDF */
  break-inside: avoid;
  page-break-inside: avoid;
}

.prev-summary-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}
/* ===== LOGEMENT: grille des 2 graphiques ===== */
.logement-graphs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  /* PDF-friendly */
  break-inside: avoid;
  page-break-inside: avoid;
}

@media (min-width: 900px) {
  .logement-graphs {
    grid-template-columns: 1fr 1fr;
  }
}

/* Carte image (cadre + ombre) */
.logement-graph {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.logement-graph img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}

/* ===== ILLUSTRATION LPP ===== */
.lpp-illustration {
  margin: 8px 0 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.lpp-illustration img {
  display: inline-block;
  width: 100%;
  max-width: 620px;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}
/* ===== ILLUSTRATION AVS (1er pilier) ===== */
.avsp-illustration {
  margin: 8px 0 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.avsp-illustration img {
  display: inline-block;
  width: 100%;
  max-width: 700px;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}
/* Cartes du Résumé plus aérées */
#resumePanel .obj-card {
  padding: 16px 16px 18px;
  border: 1px solid rgba(233,206,132,.38);
  background: linear-gradient(180deg, #ffffff, #fffdf8);
}

/* Titre de section un peu plus serré pour la zone "Résumé" */
#resumePanel .obj-card .section-title {
  margin: 0 0 8px;
}

/* Grille interne du Résumé généré (si tu y places des lignes) */
#resumeContent {
  display: grid;
  gap: 10px;
}

/* Labels et valeurs du résumé, si tu génères sous forme de lignes */
#resumeContent .row {
  grid-template-columns: 1fr 2fr; /* libellé | valeur */
  align-items: center;
}
#resumeContent .row > div:first-child {
  color: var(--muted);
  font-weight: 600;
}

/* ===== Résumé : toggle Oui / Non (look premium, compact) ===== */
#resumePanel .row .seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;                       /* plus compact */
  border-radius: 999px;
  border: 1px solid #e3c45a;
  background: linear-gradient(180deg, #fffaf0, #fff3cf);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 4px 14px rgba(181,142,15,.08);
}

#resumePanel .row .seg .seg-btn {
  min-width: 72px;                    /* largeur égale Oui/Non */
  padding: .34rem .9rem;              /* hauteur courte et nette */
  line-height: 1;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  color: #7b7f8b;
  transition: transform .12s ease, box-shadow .12s ease, background .18s ease, color .18s ease;
}
#resumePanel .row .seg .seg-btn:hover { color:#1f2937; transform: translateY(-1px); }

#resumePanel .row .seg .seg-btn.active{
  background: linear-gradient(180deg, #ffefb9, #ffd975);
  color:#2a2412;
  box-shadow: 0 6px 16px rgba(181,142,15,.18);
}

/* Alignements du conteneur de ligne pour éviter l’effet "perdu dans la carte" */
#resumePanel .obj-card .row.row-3 {
  grid-template-columns: auto;        /* la pastille prend sa largeur naturelle */
  justify-content: flex-start;        /* à gauche (ou center si tu préfères) */
}
@media (max-width: 720px) {
  #resumePanel .obj-card .row.row-3 { justify-content: center; }
}

/* Supprime toute marge top parasite autour du toggle */
#resumePanel .obj-card .row.row-3 > *:first-child { margin-top: 0 !important; }

/* =========================
   Toggle Oui/Non – global
   ========================= */

/* Conteneur du segment */
.seg{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px; border-radius:999px;
  border:1px solid #e3c45a;
  background: linear-gradient(180deg,#fffaf0,#fff3cf);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 4px 14px rgba(181,142,15,.08);
}

/* Boutons (labels) */
.seg .seg-btn{
  border:0; border-radius:999px;
  padding:.34rem .9rem; line-height:1;
  font-weight:700; font-size:.95rem;
  color:#7b7f8b; background:transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .18s ease, color .18s ease;
}
.seg .seg-btn:hover{ color:#1f2937; transform:translateY(-1px); }

/* État sélectionné (pas besoin de .active) */
.seg input[type="radio"]{ position:absolute; opacity:0; pointer-events:none; }
.seg input[type="radio"]:checked + .seg-btn{
  background: linear-gradient(180deg,#ffefb9,#ffd975);
  color:#2a2412;
  box-shadow:0 6px 16px rgba(181,142,15,.18);
}

/* Focus accessibilité (sur le label lié) */
.seg input[type="radio"]:focus-visible + .seg-btn{
  box-shadow:0 0 0 3px rgba(240,193,75,.22), 0 1px 0 rgba(255,255,255,.9) inset;
}

/* Désactivés */
.seg input[type="radio"][disabled] + .seg-btn{ opacity:.55; pointer-events:none; }

/* Hauteur/alignements cohérents partout */
.seg .seg-btn, .seg.seg-small .seg-btn{ padding:.34rem .9rem; }
.seg.seg-small .seg-btn{ font-size:.93rem; }

/* Largeurs égales AUTOMATIQUES pour les binaires (exactement 2 labels) */
.seg:has(label:nth-of-type(2)):not(:has(label:nth-of-type(3))) .seg-btn{
  min-width:72px;              /* ajuste si tu veux 68–80px */
  text-align:center;
}

/* Option : forcer un centrage parfait quand le groupe est dans une grille serrée */
.seg-wrap{ display:flex; justify-content:flex-start; }
@media (max-width:720px){ .seg-wrap{ justify-content:center; } }

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}
.lang-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-weight: 600;
    cursor: pointer;
  }
  .lang-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
  }
  select#langSelect {
    border: none;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
  }
  select#langSelect:focus {
    outline: none;
  }

  .civil-row > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.civil-date-wrap,
.civil-text-wrap,
.civil-copy-wrap {
  min-width: 140px;
}

.civil-copy-wrap .inline-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}
