:root{
  --bg:#f6f4ef; --text:#1e1e1e; --muted:#666; --card:#fff; --line:#ddd;
  --buy:#dbeafe; --rent:#dcfce7; --hybrid:#fef3c7; --accent:#111827;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
.hero{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:36px 48px;background:#111827;color:white}
.eyebrow{letter-spacing:.12em;text-transform:uppercase;color:#c7d2fe;font-weight:700;margin:0 0 8px}
h1{font-size:42px;margin:0 0 10px}
.subtitle{margin:0;color:#d1d5db;font-size:18px}
button{border:0;border-radius:12px;padding:12px 18px;background:#111827;color:white;font-weight:800;cursor:pointer}
.hero button{background:white;color:#111827}
button.secondary{background:#374151;color:white}
.tabs{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:14px 28px;background:#fff;border-bottom:1px solid #ddd;position:sticky;top:0;z-index:5}
.fieldNote{display:block;margin-top:6px;font-weight:400;font-size:12px;color:#6b7280;line-height:1.45}
.fieldNote a{color:#1d4ed8;font-weight:700;cursor:pointer;text-decoration:none;border-bottom:1px solid #bfdbfe}
.fieldNote a:hover{border-bottom-color:#1d4ed8}
.formulaLine{background:#f1f5f9;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;font-size:16px}
.quickFacts{margin-top:16px;display:grid;gap:10px;background:#eff6ff;border:1px solid #bfdbfe;border-left:5px solid #2563eb;border-radius:14px;padding:14px 16px}
.quickFacts p{margin:0;color:#1e3a5f;line-height:1.5}
.calcSteps{margin:0;padding-left:22px;display:grid;gap:12px}
.calcSteps li{line-height:1.5}
.formulaInline{background:#f1f5f9;border-radius:6px;padding:1px 6px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:14px}

/* Options (cases à cocher qui affichent/masquent des paramètres) */
.paramOptions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.paramOptions label{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:14px;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:999px;padding:9px 14px;cursor:pointer;user-select:none}
.paramOptions input{width:16px;height:16px;accent-color:#111827;cursor:pointer}
.paramOptions label:has(input:checked){background:#111827;color:#fff;border-color:#111827}
.optHidden{display:none!important}
.paramGroup{margin-bottom:22px}
.paramGroup:last-child{margin-bottom:0}
.paramGroupTitle{margin:0 0 14px;font-size:15px;font-weight:800;color:#374151;border-bottom:2px solid #e5e7eb;padding-bottom:8px}

/* Sans placement : masque la stratégie hybride, la colonne et les lignes « épargne placée » */
body.no-invest .strategy.hybrid{display:none}
body.no-invest .summary{grid-template-columns:repeat(2,1fr)}
body.no-invest .col-hybrid,
body.no-invest .row-invest{display:none}
.tab{background:#e5e7eb;color:#111827}
.tab.active{background:#111827;color:white}
main{padding:28px;max-width:1500px;margin:auto}
.tabPage{display:none}.tabPage.active{display:block}
.panel,.strategy{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:22px;box-shadow:0 10px 30px rgba(0,0,0,.04);margin-bottom:22px}
.sectionTitle{display:flex;justify-content:space-between;gap:18px;align-items:center}
.sectionTitle p{margin-top:4px;color:var(--muted)}
.badge{border-radius:999px;padding:12px 16px;background:#111827;color:white;font-weight:900;cursor:help}
.badgeHelp{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:rgba(255,255,255,.25);color:#fff;font-size:12px;font-weight:700;margin-left:6px}
.grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:16px}
label{font-weight:700;font-size:14px;color:#333}
input{width:100%;margin-top:6px;padding:12px;border:1px solid #ccc;border-radius:12px;font-size:16px;background:white}
.grid.inputs select{width:100%;margin-top:6px;padding:12px;border:1px solid #ccc;border-radius:12px;font-size:16px;background:white;cursor:pointer}
.help{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#111827;color:white;font-size:12px;cursor:help;user-select:none}
.customTooltip{position:fixed;display:none;z-index:9999;max-width:320px;padding:10px 12px;border-radius:12px;background:#111827;color:white;font-size:13px;line-height:1.35;box-shadow:0 12px 30px rgba(0,0,0,.25);pointer-events:none}
.customTooltip.visible{display:block}
.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}
.strategy.buy{background:linear-gradient(180deg,var(--buy),white)}
.strategy.rent{background:linear-gradient(180deg,var(--rent),white)}
.strategy.hybrid{background:linear-gradient(180deg,var(--hybrid),white)}
.cards{display:grid;gap:10px}
.card{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:13px 0;border-bottom:1px solid rgba(0,0,0,.08)}
.card span:first-child{color:#555}
.card strong{font-size:18px;text-align:right}
.score{font-size:36px!important}
table{width:100%;border-collapse:collapse;overflow:hidden;border-radius:14px}
th,td{padding:13px;border-bottom:1px solid #e5e7eb;text-align:right}
th:first-child,td:first-child{text-align:left}
thead th{background:#111827;color:white}
.charts{display:grid;grid-template-columns:1fr;gap:22px}
canvas{width:100%;background:white;border-radius:16px;border:1px solid #e5e7eb}
.note{color:var(--muted)}
.resultText{font-size:18px;font-weight:800}
.analysisBox{display:grid;gap:10px}
.analysisItem{padding:14px;border-radius:14px;background:#f9fafb;border:1px solid #e5e7eb}
.analysisItem strong{display:block;margin-bottom:3px}
.glossary{display:grid;grid-template-columns:220px 1fr;gap:12px}
dt{font-weight:800}
dd{margin:0;color:#555}
.housesList{display:grid;gap:14px}
.houseForm{display:grid;grid-template-columns:1.2fr repeat(4,1fr) auto;gap:12px;align-items:end;padding:14px;border:1px solid #e5e7eb;border-radius:16px;background:#f9fafb}
.houseForm button{background:#b91c1c}
.smallMuted{color:#666;font-size:12px}
footer{text-align:center;padding:24px;color:#666}
footer .credit{margin-top:6px;font-size:13px}
footer .credit a{color:#111827;font-weight:700;text-decoration:none;border-bottom:1px solid #cbd5e1}
footer .credit a:hover{border-bottom-color:#111827}
@media(max-width:1100px){.grid,.summary,.charts{grid-template-columns:1fr}.hero,.sectionTitle{display:block;padding:28px}.houseForm{grid-template-columns:1fr}h1{font-size:32px}}


/* V2.4 — audit des calculs */
.calculated{
  cursor:help;
  border-bottom:1px dotted rgba(17,24,39,.55);
  border-radius:6px;
  padding:1px 3px;
}
.calculated:hover{
  background:#fff7ed;
}
.inputHighlight{
  outline:3px solid var(--linkColor,#f97316)!important;
  outline-offset:1px;
  border-radius:12px;
}
.labelHighlight{
  color:#9a3412!important;
}
.calcInspector{
  position:fixed;
  right:22px;
  bottom:22px;
  width:min(420px, calc(100vw - 44px));
  background:#111827;
  color:white;
  border-radius:18px;
  padding:18px;
  box-shadow:0 20px 50px rgba(0,0,0,.28);
  z-index:50;
}
.calcInspector h3{
  margin:0 0 8px;
}
.calcInspector p{
  margin:0;
  color:#e5e7eb;
  line-height:1.45;
  font-size:14px;
}
.calcFormula{
  display:block;
  margin-top:8px;
  color:#fde68a;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}
.calcValues{
  display:block;
  margin-top:8px;
  color:#bfdbfe;
}
@media(max-width:900px){
  .calcInspector{position:static;width:auto;margin:0 28px 28px}
}


/* V2.5 — moteur d'audit plus lisible */
.calcFormula code,
.calcStep code{
  color:#fde68a;
  white-space:normal;
}
.calcStep{
  display:block;
  margin-top:7px;
  color:#e5e7eb;
}
.calcStep strong{
  color:#fff;
}
.calcValues{
  border-top:1px solid rgba(255,255,255,.18);
  padding-top:8px;
}
.calculated{
  transition:background .12s ease, box-shadow .12s ease;
}

.calcRef{
  display:inline-block;
  padding:1px 5px;
  border-radius:6px;
  background:transparent;
  border:1.5px solid var(--tc,#fde68a);
  color:var(--tc,#fde68a);
  font-weight:700;
  cursor:pointer;
}
.calcRef:hover{
  background:rgba(253,230,138,.32);
}
.calcRefHighlight{
  box-shadow:0 0 0 3px var(--linkColor,#f59e0b)!important;
}


/* V2.7 — pédagogie mensualité crédit */
.amortMini{
  display:grid;
  gap:8px;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.18);
}
.amortRow{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:8px;
  align-items:center;
}
.amortLabel{
  color:#bfdbfe;
  font-size:12px;
}
.amortBar{
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.14);
  display:flex;
}
.amortInterest{
  background:#f97316;
}
.amortCapital{
  background:#22c55e;
}
.amortNumbers{
  font-size:12px;
  color:#e5e7eb;
}
.calcExplanation{
  display:block;
  margin-top:8px;
  color:#ddd6fe;
}


/* Onglet Comprendre le crédit */
.creditSummary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0 32px;
}
.interestText{color:#c2410c}
.capitalText{color:#15803d}
.sliderRow{
  display:flex;
  align-items:center;
  gap:16px;
  margin:10px 0 6px;
}
.sliderRow input[type=range]{
  flex:1;
  accent-color:#111827;
  height:6px;
}
.sliderRow output{
  font-weight:800;
  white-space:nowrap;
  background:#111827;
  color:white;
  padding:9px 14px;
  border-radius:999px;
  font-size:14px;
}
.monthDetail{margin-top:12px}
.amortBar.big{
  height:30px;
  background:#f1f5f9;
}
.monthLegend{
  display:flex;
  gap:28px;
  flex-wrap:wrap;
  margin-top:12px;
  font-size:15px;
  font-weight:600;
}
.monthLegend .dot{
  display:inline-block;
  width:13px;
  height:13px;
  border-radius:4px;
  margin-right:7px;
  vertical-align:middle;
}
.dot.interest{background:#f97316}
.dot.capital{background:#22c55e}
.monthNumbers{margin-top:18px}
.rowHighlight td{
  background:#fff7ed;
  font-weight:700;
}
.tableScroll{
  max-height:70vh;
  overflow:auto;
  border-radius:14px;
  border:1px solid #e5e7eb;
}
.tableScroll table{
  border-radius:0;
  border-collapse:separate;
  border-spacing:0;
  overflow:visible;
}
.tableScroll thead th{
  position:sticky;
  top:0;
  z-index:1;
}
/* Mode débutant */
.noobToggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1d4ed8;
  padding:9px 14px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer;
  user-select:none;
}
.noobToggle input{
  width:18px;
  height:18px;
  accent-color:#2563eb;
  cursor:pointer;
}
.noobHelp{
  display:none;
}
body.noob .noobHelp{
  display:block;
  margin-top:16px;
  padding:16px 18px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  border-left:5px solid #2563eb;
  border-radius:14px;
  line-height:1.55;
  color:#1e3a5f;
}
body.noob .strategy .noobHelp{
  margin:4px 0 14px;
}
.noobHelp h4{
  margin:0 0 8px;
  font-size:15px;
  color:#1d4ed8;
}
.noobHelp p{
  margin:0 0 8px;
}
.noobHelp p:last-child{
  margin-bottom:0;
}
.noobHelp ul{
  margin:0 0 8px;
  padding-left:20px;
  display:grid;
  gap:7px;
}
.noobHelp .miniTip{
  background:#dbeafe;
  border-radius:10px;
  padding:9px 12px;
  margin-top:8px;
}
.noobOnly{display:none}
body.noob .noobOnly{display:block}
.noobCoachPanel h2{margin-top:0}
#noobCoach{display:grid;gap:12px;margin-top:12px}
.coachLine{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding:14px 16px;
  border-radius:14px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-left:5px solid #9ca3af;
  line-height:1.5;
}
.coachLine p{margin:4px 0 0;color:#374151}
.coachLine strong{color:#111827}
.coachEmoji{font-size:24px;line-height:1.1}
.coachLine.good{background:#f0fdf4;border-color:#bbf7d0;border-left-color:#16a34a}
.coachLine.ok,.coachLine.info{background:#eff6ff;border-color:#bfdbfe;border-left-color:#2563eb}
.coachLine.warn{background:#fffbeb;border-color:#fde68a;border-left-color:#d97706}
.coachLine.bad{background:#fef2f2;border-color:#fecaca;border-left-color:#dc2626}

.smallBtn{
  margin-top:12px;
  padding:9px 14px;
  font-size:14px;
}

.intro{
  border-left:5px solid #111827;
}
.intro > p{
  color:#374151;
  line-height:1.55;
  margin:0 0 12px;
}
.introList{
  margin:0 0 12px;
  padding-left:0;
  list-style:none;
  display:grid;
  gap:10px;
}
.introList li{
  position:relative;
  padding:12px 14px 12px 40px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:14px;
  line-height:1.5;
  color:#374151;
}
.introList li::before{
  content:"→";
  position:absolute;
  left:15px;
  top:12px;
  color:#111827;
  font-weight:900;
}
.paramStrip{
  position:sticky;
  top:var(--tabsH, 64px);
  z-index:3;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:10px 12px;
  margin-bottom:22px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  visibility:hidden;
  opacity:0;
  transition:opacity .15s ease;
}
.paramStrip.show{
  visibility:visible;
  opacity:1;
}
.paramChip{
  font-size:12px;
  padding:5px 9px;
  border-radius:999px;
  background:#f3f4f6;
  color:#6b7280;
  white-space:nowrap;
  cursor:help;
  transition:background .12s ease, box-shadow .12s ease, color .12s ease;
}
.paramChip b{color:#111827;font-weight:800}
.paramChipHighlight{
  background:#fff;
  color:#111827;
  box-shadow:0 0 0 2px var(--linkColor,#f97316);
}
#calcArrows{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  pointer-events:none;
  overflow:visible;
  z-index:60;
}
.calcValueItem{
  display:inline-block;
  padding:1px 6px;
  margin:2px 4px 2px 0;
  border-radius:6px;
  border:1.5px solid var(--tc,#f97316);
  color:var(--tc,#fed7aa);
  background:transparent;
  white-space:nowrap;
  font-weight:700;
}
.arrowToggle{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.18);
  font-size:13px;
  font-weight:700;
  color:#e5e7eb;
  cursor:pointer;
}
.arrowToggle input{
  width:16px;
  height:16px;
  accent-color:#f97316;
  cursor:pointer;
}
.calcArrowPath{
  fill:none;
  stroke-width:2;
  opacity:.7;
  stroke-dasharray:5 4;
  stroke-linecap:round;
}
.calcArrowDot{
  opacity:.9;
}

.stickyMonthBar{
  position:sticky;
  top:var(--tabsH, 64px);
  z-index:4;
  background:#111827;
  color:white;
  border-radius:16px;
  padding:14px 20px;
  margin-bottom:22px;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.stickyMonthBar .sliderRow{
  margin:0;
}
.stickyMonthBar .sliderCaption{
  font-weight:800;
  color:#c7d2fe;
}
.stickyMonthBar input[type=range]{
  accent-color:#f97316;
}
.stickyMonthBar output{
  background:white;
  color:#111827;
}
@media(max-width:1100px){
  .creditSummary{grid-template-columns:1fr}
}
