/* Freev Valeur 4.2 — graphiques, planificateur, recherche et installation. */
.v4-new-badge {
  margin-left: auto;
  padding: .15rem .4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #2563eb);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.v4-new-badge.maintenance { background: linear-gradient(135deg, #d97706, #ea580c); }
#planner-view > [hidden] { display: none !important; }

.v4-maintenance {
  display: flex;
  min-height: min(34rem, calc(100dvh - 9rem));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .75rem;
  padding: clamp(2rem, 7vw, 5rem) 1.25rem;
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: 1.25rem;
  background: radial-gradient(circle at top, rgba(245, 158, 11, .13), transparent 42%), var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  text-align: center;
}
.v4-maintenance[hidden] { display: none; }
.v4-maintenance-icon { display: grid; width: 4.5rem; height: 4.5rem; place-items: center; border-radius: 1.25rem; background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; box-shadow: 0 14px 30px rgba(234, 88, 12, .2); font-size: 1.75rem; }
.v4-maintenance h2 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.25rem); }
.v4-maintenance > p { max-width: 40rem; margin: 0; color: var(--text-muted, #64748b); font-size: .9rem; line-height: 1.65; }
.v4-maintenance-note { display: flex; max-width: 36rem; align-items: center; gap: .55rem; margin: .35rem 0 .5rem; padding: .7rem .9rem; border: 1px solid rgba(37, 99, 235, .2); border-radius: .75rem; background: rgba(37, 99, 235, .06); color: var(--text-secondary, #475569); font-size: .72rem; line-height: 1.45; }
.v4-maintenance-note i { color: #2563eb; }

.dashboard-chart-card { min-width: 0; }
.dashboard-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.dashboard-chart-head h3 { margin: 0; }
.dashboard-chart-head p { margin: .2rem 0 0; color: var(--text-muted, #64748b); font-size: .7rem; line-height: 1.4; }
.dashboard-chart-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.dashboard-chart-segment { display: flex; padding: .2rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .65rem; background: var(--bg-input, #f8fafc); }
.dashboard-chart-segment button { padding: .38rem .58rem; border: 0; border-radius: .45rem; background: transparent; color: var(--text-muted, #64748b); cursor: pointer; font: 700 .65rem/1 Inter, sans-serif; }
.dashboard-chart-segment button.active { background: var(--bg-card, #fff); color: #2563eb; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.dashboard-chart-toggle { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; color: var(--text-secondary, #475569); cursor: pointer; font-size: .65rem; font-weight: 600; }
.dashboard-chart-toggle input { width: 1rem; height: 1rem; accent-color: #2563eb; }
.dashboard-chart-summary { min-height: 1rem; margin: .55rem 0 0; color: var(--text-muted, #64748b); font-size: .65rem; line-height: 1.4; }
.dashboard-chart-empty { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; flex-direction: column; gap: .45rem; padding: 1rem; color: var(--text-muted, #64748b); text-align: center; }
.dashboard-chart-empty.hidden { display: none; }
.dashboard-chart-empty > i { color: #94a3b8; font-size: 2rem; }
.dashboard-chart-empty strong { color: var(--text-primary, #0f172a); font-size: .8rem; }
.dashboard-chart-empty span { max-width: 22rem; font-size: .68rem; line-height: 1.45; }
.dashboard-chart-card .chart-container { position: relative; min-height: 18rem; }

.v4-search-trigger kbd,
.v4-search-box kbd {
  padding: .15rem .35rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: .35rem;
  background: var(--bg-card, #fff);
  color: var(--text-muted, #64748b);
  font: 600 .65rem/1.2 Inter, sans-serif;
}

.v4-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(20, 184, 166, .24), transparent 30%),
    radial-gradient(circle at 10% 100%, rgba(37, 99, 235, .18), transparent 36%),
    var(--bg-card, #fff);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.v4-hero::after {
  content: '';
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 17rem;
  height: 17rem;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5rem rgba(20, 184, 166, .05), 0 0 0 5rem rgba(37, 99, 235, .04);
  pointer-events: none;
}

.v4-eyebrow {
  display: inline-block;
  margin-bottom: .55rem;
  color: #0d9488;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.v4-hero h2,
.v4-dialog h2 {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.v4-hero p,
.v4-dialog > p {
  max-width: 48rem;
  margin: .75rem 0 0;
  color: var(--text-muted, #64748b);
  line-height: 1.65;
}

.v4-hero-actions { display: flex; gap: .65rem; z-index: 1; }

.v4-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.v4-summary-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 1rem;
  background: var(--bg-card, #fff);
}

.v4-summary-icon {
  display: grid;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: .8rem;
  background: rgba(37, 99, 235, .1);
  color: #2563eb;
}

.v4-summary-card.success .v4-summary-icon { background: rgba(16, 185, 129, .12); color: #059669; }
.v4-summary-card.warning .v4-summary-icon { background: rgba(245, 158, 11, .14); color: #d97706; }
.v4-summary-card.danger .v4-summary-icon { background: rgba(244, 63, 94, .12); color: #e11d48; }
.v4-summary-card div { display: flex; min-width: 0; flex-direction: column; }
.v4-summary-card div > span { color: var(--text-muted, #64748b); font-size: .75rem; font-weight: 600; }
.v4-summary-card strong { overflow: hidden; color: var(--text-primary, #0f172a); font-size: 1.22rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-summary-card small { overflow: hidden; color: var(--text-muted, #64748b); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

.v4-intelligence-grid {
  display: grid;
  grid-template-columns: 1.15fr .9fr .9fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.v4-intelligence-grid > .card { min-width: 0; margin: 0; }
.v41-live { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .5rem; border-radius: 999px; background: rgba(16, 185, 129, .1); color: #059669; font-size: .6rem; font-weight: 700; white-space: nowrap; }
.v41-live i { font-size: .4rem; }
.v41-health-overview { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.v41-score-ring { --ring-color: #f59e0b; display: grid; flex: 0 0 5.5rem; width: 5.5rem; height: 5.5rem; place-items: center; border-radius: 50%; background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), var(--border-color, #e2e8f0) 0); position: relative; }
.v41-score-ring::after { content: ''; position: absolute; inset: .52rem; border-radius: inherit; background: var(--bg-card, #fff); }
.v41-score-ring > div { display: flex; z-index: 1; align-items: baseline; flex-direction: column; text-align: center; }
.v41-score-ring strong { color: var(--text-primary, #0f172a); font-size: 1.45rem; line-height: 1; }
.v41-score-ring span { color: var(--text-muted, #64748b); font-size: .58rem; }
.v41-score-ring.excellent { --ring-color: #10b981; }
.v41-score-ring.solid { --ring-color: #14b8a6; }
.v41-score-ring.warning { --ring-color: #f59e0b; }
.v41-score-ring.danger { --ring-color: #e11d48; }
.v41-health-copy { display: flex; min-width: 0; flex-direction: column; }
.v41-health-copy > span { color: #0d9488; font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.v41-health-copy strong { color: var(--text-primary, #0f172a); font-size: .88rem; }
.v41-health-copy small { color: var(--text-muted, #64748b); font-size: .65rem; line-height: 1.4; }
.v41-breakdown { display: grid; gap: .5rem; }
.v41-breakdown article { padding-top: .5rem; border-top: 1px solid var(--border-color, #e2e8f0); }
.v41-metric-head,
.v41-metric-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.v41-metric-head strong { color: var(--text-primary, #0f172a); font-size: .67rem; }
.v41-metric-head span { color: #2563eb; font-size: .62rem; font-weight: 800; }
.v41-breakdown .v4-progress { height: .3rem; margin: .35rem 0; }
.v41-metric-foot > span { flex: 0 0 auto; color: var(--text-secondary, #475569); font-size: .62rem; font-weight: 700; }
.v41-metric-foot small { color: var(--text-muted, #64748b); font-size: .57rem; line-height: 1.3; text-align: right; }


.v41-action { display: grid; grid-template-columns: 1.45rem 1.75rem minmax(0, 1fr); align-items: center; gap: .5rem; padding: .65rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .7rem; background: var(--bg-input, #f8fafc); }
.v41-action-index { display: grid; width: 1.35rem; height: 1.35rem; place-items: center; border-radius: 50%; background: rgba(37, 99, 235, .1); color: #2563eb; font-size: .58rem; font-weight: 800; }
.v41-action > i { color: #2563eb; text-align: center; }
.v41-action.urgent > i { color: #e11d48; }
.v41-action.urgent .v41-action-index { background: rgba(225, 29, 72, .1); color: #e11d48; }
.v41-action.important > i { color: #d97706; }
.v41-action.important .v41-action-index { background: rgba(245, 158, 11, .14); color: #b45309; }
.v41-action > div { display: flex; min-width: 0; flex-direction: column; }
.v41-action strong { color: var(--text-primary, #0f172a); font-size: .68rem; }
.v41-action div span { color: var(--text-muted, #64748b); font-size: .59rem; line-height: 1.35; }

/* Tableau de bord : une hiérarchie calme et des indicateurs qui s'animent sans masquer les données. */
.v4-summary-card,.v4-intelligence-grid>.card,.v4-intelligence-grid .v41-action {box-shadow:0 3px 8px rgba(20,36,62,.025),0 18px 44px rgba(20,36,62,.035);transition:transform .24s ease,box-shadow .24s ease,border-color .24s ease;}
.v4-summary-card:hover,.v4-intelligence-grid>.card:hover {transform:translateY(-3px);box-shadow:0 8px 18px rgba(20,36,62,.045),0 24px 56px rgba(20,36,62,.075);}
.v4-summary-card {position:relative;overflow:hidden;min-height:6.4rem;border-radius:1.15rem;padding:1.15rem;}
.v4-summary-card::after {content:'';position:absolute;inset:auto 1.15rem 0;height:2px;background:linear-gradient(90deg,#2563eb,#16b896);transform:scaleX(0);transform-origin:left;animation:v4-indicator-in .8s .18s ease-out forwards;}
.v4-intelligence-grid {grid-template-columns:minmax(0,1.25fr) minmax(0,.85fr);align-items:start;gap:1.1rem;}
.v4-intelligence-grid>.card {border-radius:1.25rem;padding:1.4rem;}
.v41-health-card {grid-row:span 1;}
.v41-score-ring {width:6.3rem;height:6.3rem;flex-basis:6.3rem;animation:v4-score-in .85s cubic-bezier(.2,.8,.2,1) both;}
.v41-score-ring strong {font-size:1.65rem;font-variant-numeric:tabular-nums;}
.v41-breakdown .v4-progress {height:.38rem;overflow:hidden;border-radius:999px;}
.v41-breakdown .v4-progress>* {transform-origin:left;animation:v4-indicator-in .8s .12s ease-out both;}
.v41-action {grid-template-columns:1.6rem 2rem minmax(0,1fr);min-height:4.25rem;padding:.85rem;border-radius:.85rem;background:var(--bg-card,#fff);}
.v41-action:hover {transform:translateY(-2px);border-color:rgba(37,99,235,.22);box-shadow:0 10px 24px rgba(20,36,62,.07);}
.v41-action strong {font-size:.76rem;line-height:1.35;text-wrap:balance;}
.v41-action div span {font-size:.66rem;line-height:1.45;text-wrap:pretty;}
.v4-section-head h3 {font-size:1.1rem;letter-spacing:-.025em;text-wrap:balance;}
.v4-section-head p {font-size:.78rem;line-height:1.45;text-wrap:pretty;}
@keyframes v4-indicator-in {from {transform:scaleX(0)}to {transform:scaleX(1)}}
@keyframes v4-score-in {from {opacity:.35;transform:scale(.88)}to {opacity:1;transform:scale(1)}}
@media (max-width:850px){.v4-intelligence-grid{grid-template-columns:1fr;}.v4-intelligence-grid>.card{padding:1.1rem;}}
@media (prefers-reduced-motion:reduce){.v4-summary-card,.v4-intelligence-grid>.card,.v4-intelligence-grid .v41-action{transition:none;}.v4-summary-card::after,.v41-score-ring,.v41-breakdown .v4-progress>*{animation:none;transform:none;}.v4-summary-card::after{transform:scaleX(1);}}

.v4-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, .75fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.v4-layout-three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.v4-layout .card { min-width: 0; margin: 0; }
.v4-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v4-section-head h3 { margin: 0; color: var(--text-primary, #0f172a); font-size: 1rem; }
.v4-section-head p { margin: .2rem 0 0; color: var(--text-muted, #64748b); font-size: .75rem; }
.v4-count { display: grid; min-width: 2rem; height: 2rem; place-items: center; border-radius: 999px; background: rgba(245, 158, 11, .15); color: #b45309; font-size: .78rem; font-weight: 800; }

.v43-forecast-controls { display: flex; align-items: flex-end; gap: .65rem; }
.v43-projection-scope { display: flex; min-width: 16rem; flex-direction: column; gap: .25rem; color: var(--text-secondary, #475569); font-size: .62rem; font-weight: 700; }
.v43-projection-scope .form-input { width: 100%; min-height: 2rem; padding: .4rem 2rem .4rem .55rem; font-size: .68rem; }
.v4-horizon { display: flex; padding: .2rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .7rem; background: var(--bg-input, #f8fafc); }
.v4-horizon button { padding: .38rem .6rem; border: 0; border-radius: .5rem; background: transparent; color: var(--text-muted, #64748b); cursor: pointer; font: 700 .68rem/1 Inter, sans-serif; }
.v4-horizon button.active { background: var(--bg-card, #fff); color: #2563eb; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }

@media (min-width: 769px) and (max-width: 1050px) {
  .v4-forecast-card .v4-section-head { align-items: stretch; flex-direction: column; gap: .75rem; }
  .v4-forecast-card .v43-forecast-controls {
    width: 100%; align-items: flex-start; flex-wrap: wrap; gap: .75rem;
  }
  .v4-forecast-card .v43-projection-scope { min-width: 0; max-width: 100%; flex: 1 1 14rem; }
  .v4-forecast-card .v43-projection-scope .form-input { min-width: 0; }
  .v4-forecast-card .v4-horizon { max-width: 100%; flex: 0 1 auto; flex-wrap: wrap; }
}

.v4-simulator { display: block; margin-bottom: 1rem; padding: .85rem; border: 1px dashed rgba(37, 99, 235, .3); border-radius: .8rem; background: rgba(37, 99, 235, .035); }
.v4-simulator > span { display: block; margin-bottom: .45rem; color: var(--text-primary, #0f172a); font-size: .78rem; font-weight: 700; }
.v4-simulator > div { display: flex; align-items: center; gap: .45rem; }
.v4-simulator input { max-width: 9rem; }
.v4-simulator small { display: block; margin-top: .4rem; color: var(--text-muted, #64748b); font-size: .65rem; }

.v42-simulator { margin-bottom: 1rem; padding: 1rem; border: 1px solid rgba(37, 99, 235, .25); border-radius: 1rem; background: linear-gradient(135deg, rgba(37, 99, 235, .055), rgba(20, 184, 166, .04)); }
.v42-simulator-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.v42-simulator-head > div:first-child { display: flex; flex-direction: column; }
.v42-simulator-head strong { color: var(--text-primary, #0f172a); font-size: .82rem; }
.v42-simulator-head span { color: var(--text-muted, #64748b); font-size: .65rem; }
.v42-presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.v42-presets button { padding: .38rem .52rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: 999px; background: var(--bg-card, #fff); color: var(--text-secondary, #475569); cursor: pointer; font: 700 .58rem/1 Inter, sans-serif; }
.v42-presets button:hover,
.v42-presets button:focus-visible { border-color: #2563eb; color: #2563eb; outline: 0; }
.v42-simulator-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
.v42-simulator-grid label { display: flex; min-width: 0; flex-direction: column; gap: .3rem; color: var(--text-secondary, #475569); font-size: .61rem; font-weight: 700; }
.v42-simulator-grid label > div { display: flex; align-items: center; gap: .25rem; }
.v42-simulator-grid label > div > span { flex: 0 0 auto; color: var(--text-muted, #64748b); font-size: .57rem; }
.v42-simulator-grid .form-input { width: 100%; min-width: 0; padding: .52rem; font-size: .68rem; }
.v42-simulator-grid small { color: var(--text-muted, #64748b); font-size: .53rem; font-weight: 400; line-height: 1.3; }

.v42-forecast-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-bottom: .75rem; }
.v42-forecast-insights article { display: flex; align-items: center; gap: .55rem; padding: .65rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .75rem; background: var(--bg-input, #f8fafc); }
.v42-forecast-insights article > i { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; border-radius: .6rem; background: rgba(22, 131, 107, .1); color: #16836b; }
.v42-forecast-insights article.success > i { background: rgba(16, 185, 129, .12); color: #059669; }
.v42-forecast-insights article.warning > i { background: rgba(245, 158, 11, .14); color: #d97706; }
.v42-forecast-insights article.danger > i { background: rgba(225, 29, 72, .1); color: #e11d48; }
.v42-forecast-insights article div { display: flex; min-width: 0; flex-direction: column; }
.v42-forecast-insights span,
.v42-forecast-insights small { color: var(--text-muted, #64748b); font-size: .56rem; }
.v42-forecast-insights strong { overflow: hidden; color: var(--text-primary, #0f172a); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

.v43-forecast-breakdown { margin-bottom: .9rem; padding: .8rem; border: 1px solid rgba(22, 131, 107, .2); border-radius: .85rem; background: rgba(22, 131, 107, .035); }
.v43-forecast-breakdown[hidden] { display: none; }
.v43-recurring-costs { margin-bottom: .9rem; padding: .8rem; border: 1px solid rgba(20, 184, 166, .28); border-radius: .85rem; background: rgba(20, 184, 166, .045); }
.v43-recurring-costs[hidden] { display: none; }
.v43-recurring-costs-head { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.v43-recurring-costs-head > div { display: flex; flex-direction: column; gap: .15rem; }
.v43-recurring-costs-head strong { color: var(--text-primary, #0f172a); font-size: .75rem; }
.v43-recurring-costs-head span { color: var(--text-muted, #64748b); font-size: .61rem; line-height: 1.4; }
.v43-recurring-costs-list { display: grid; gap: .4rem; }
.v43-recurring-costs-list article { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .45rem; border-top: 1px solid rgba(20, 184, 166, .18); }
.v43-recurring-costs-list article > div { display: flex; min-width: 0; flex-direction: column; }
.v43-recurring-costs-list strong { color: var(--text-primary, #0f172a); font-size: .67rem; }
.v43-recurring-costs-list small { color: var(--text-muted, #64748b); font-size: .58rem; }
.v43-recurring-costs-list b { flex: 0 0 auto; color: #0f766e; font-size: .72rem; white-space: nowrap; }
.v43-breakdown-head { margin-bottom: .65rem; }
.v43-breakdown-head > div { display: flex; flex-direction: column; gap: .18rem; }
.v43-breakdown-head strong { color: var(--text-primary, #0f172a); font-size: .875rem; }
.v43-breakdown-head span { color: var(--text-muted, #64748b); font-size: .75rem; line-height: 1.45; }
.v43-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.v43-breakdown-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .65rem; margin: 0; padding: .58rem .65rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .7rem; background: var(--bg-card, #fff); }
.v43-breakdown-row dt { display: flex; min-width: 0; align-items: center; gap: .5rem; }
.v43-breakdown-row dt > i { display: grid; flex: 0 0 1.75rem; width: 1.75rem; height: 1.75rem; place-items: center; border-radius: .55rem; background: rgba(22, 131, 107, .1); color: #16836b; font-size: .68rem; }
.v43-breakdown-row dt > span { display: flex; min-width: 0; flex-direction: column; gap: .12rem; }
.v43-breakdown-row strong { color: var(--text-primary, #0f172a); font-size: .78rem; }
.v43-breakdown-row small { color: var(--text-muted, #64748b); font-size: .7rem; line-height: 1.4; }
.v43-breakdown-row dd { flex: 0 0 auto; margin: 0; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.v43-breakdown-row.total { grid-column: 1 / -1; border-color: rgba(22, 131, 107, .32); background: rgba(22, 131, 107, .06); }
.v43-breakdown-row.total dt > i { background: #16836b; color: #fff; }
.v43-breakdown-row.total strong,
.v43-breakdown-row.total dd { font-size: .85rem; }
.v43-breakdown-row.excluded { opacity: .58; }
.v43-breakdown-row.excluded dd { color: var(--text-muted, #64748b) !important; }

.v42-forecast-visual { margin-bottom: .9rem; padding: .75rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .85rem; background: var(--bg-input, #f8fafc); }
.v42-chart-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; color: var(--text-primary, #0f172a); font-size: .7rem; }
.v42-chart-head .v4-text-button { margin: 0; color: #16836b; }
.v42-forecast-chart { min-height: 11rem; }
.v42-forecast-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.v42-forecast-chart text { fill: var(--text-muted, #64748b); font: 600 10px Inter, sans-serif; text-transform: capitalize; }
.v42-forecast-line { fill: none; stroke: #16836b; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; }
.v42-forecast-area { fill: url(#v42ForecastGradient); }
.v42-forecast-chart circle { fill: var(--bg-card, #fff); stroke: #16836b; stroke-width: 3; }
.v42-zero-line { stroke: #e11d48; stroke-dasharray: 5 5; stroke-opacity: .4; }

.v4-forecast { display: grid; gap: .55rem; }
.v4-forecast-row { display: grid; grid-template-columns: 4.2rem minmax(4rem, 1fr) 6.7rem 5.7rem; align-items: center; gap: .65rem; font-size: .7rem; }
.v4-forecast-row > span { color: var(--text-muted, #64748b); text-transform: capitalize; }
.v4-forecast-row > strong { color: var(--text-primary, #0f172a); text-align: right; }
.v4-forecast-row > small { text-align: right; }
.v4-forecast-track { overflow: hidden; height: .5rem; border-radius: 999px; background: var(--bg-input, #f1f5f9); }
.v4-forecast-track span { display: block; height: 100%; border-radius: inherit; transition: width .35s ease; }
.v4-forecast-track .positive { background: linear-gradient(90deg, #16836b, #61b991); }
.v4-forecast-track .negative { background: linear-gradient(90deg, #fb7185, #e11d48); }
.positive-text { color: #059669 !important; }
.negative-text { color: #e11d48 !important; }

.v4-list { display: grid; gap: .65rem; }
.v4-alert { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .75rem; background: var(--bg-input, #f8fafc); }
.v4-alert > i { margin-top: .12rem; }
.v4-alert.danger > i { color: #e11d48; }
.v4-alert.warning > i { color: #d97706; }
.v4-alert.info > i { color: #2563eb; }
.v4-alert div { display: flex; min-width: 0; flex-direction: column; }
.v4-alert strong { color: var(--text-primary, #0f172a); font-size: .75rem; }
.v4-alert span { color: var(--text-muted, #64748b); font-size: .68rem; }

.v4-inline-form { display: grid; grid-template-columns: 1fr .7fr .8fr auto; gap: .45rem; margin-bottom: 1rem; }
.v4-inline-form-short { grid-template-columns: 1fr .7fr auto; }
.v4-inline-form .form-input { min-width: 0; padding: .6rem; font-size: .7rem; }
.v4-inline-form .btn { padding: .6rem .7rem; font-size: .68rem; }

.v4-goal,
.v4-envelope { padding: .8rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .8rem; background: var(--bg-input, #f8fafc); }
.v4-goal-head,
.v4-envelope-head,
.v4-goal-numbers { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.v4-goal-head > div { display: flex; min-width: 0; flex-direction: column; }
.v4-goal-head strong,
.v4-envelope-head strong { color: var(--text-primary, #0f172a); font-size: .76rem; }
.v4-goal-head span,
.v4-envelope-head span { color: #2563eb; font-size: .68rem; font-weight: 800; }
.v4-goal-head div span { color: var(--text-muted, #64748b); font-weight: 400; }
.v4-progress { overflow: hidden; height: .45rem; margin: .65rem 0 .45rem; border-radius: 999px; background: var(--border-color, #e2e8f0); }
.v4-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #14b8a6); }
.v4-progress.warning > span { background: #f59e0b; }
.v4-progress.danger > span { background: #e11d48; }
.v4-goal-numbers { color: var(--text-muted, #64748b); font-size: .65rem; }
.v4-goal > small { display: block; margin-top: .3rem; color: #0d9488; font-size: .65rem; font-weight: 600; }
.v4-row-actions { display: flex; justify-content: flex-end; gap: .35rem; margin-top: .6rem; }
.v4-text-button { display: block; margin: .5rem 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--text-muted, #64748b); cursor: pointer; font-size: .62rem; text-decoration: underline; }

.v4-calendar { max-height: 29rem; overflow: auto; overscroll-behavior: contain; }
.v4-calendar-item { display: grid; grid-template-columns: 2.45rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .58rem 0; border-bottom: 1px solid var(--border-color, #e2e8f0); }
.v4-calendar-item:last-child { border-bottom: 0; }
.v4-calendar-item time { display: grid; height: 2.45rem; place-content: center; border-radius: .65rem; background: rgba(37, 99, 235, .09); color: #2563eb; text-align: center; }
.v4-calendar-item time strong { font-size: .78rem; line-height: 1; }
.v4-calendar-item time span { font-size: .56rem; text-transform: uppercase; }
.v4-calendar-item > div { display: flex; min-width: 0; flex-direction: column; }
.v4-calendar-item > div strong { overflow: hidden; color: var(--text-primary, #0f172a); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-calendar-item > div span { overflow: hidden; color: var(--text-muted, #64748b); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-calendar-item > b { font-size: .67rem; }

.v4-empty { margin: 0; padding: 1rem; border: 1px dashed var(--border-color, #e2e8f0); border-radius: .75rem; color: var(--text-muted, #64748b); font-size: .72rem; line-height: 1.5; text-align: center; }
.v4-empty-success { display: flex; align-items: center; flex-direction: column; gap: .25rem; padding: 2rem 1rem; }
.v4-empty-success i { color: #10b981; font-size: 1.6rem; }
.v4-empty-success strong { color: var(--text-primary, #0f172a); }
.transaction-load-more { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; color: var(--text-muted, #64748b); font-size: .75rem; }

.v4-overlay[hidden] { display: none !important; }
.v4-overlay {
  display: grid;
  position: fixed;
  z-index: 10000;
  inset: 0;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(8px);
  animation: v4Fade .18s ease;
}
.v4-dialog { width: min(46rem, 100%); max-height: min(90vh, 54rem); overflow: auto; padding: 1.5rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: 1.2rem; background: var(--bg-card, #fff); box-shadow: 0 30px 80px rgba(2, 6, 23, .3); animation: v4Pop .22s ease; }
.v4-search-dialog { width: min(42rem, 100%); padding: 1rem; }
.v4-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v4-dialog-head h2 { font-size: 1.35rem; }
.v4-search-box { display: flex; align-items: center; gap: .65rem; padding: .75rem .85rem; border: 1.5px solid rgba(22, 131, 107, .48); border-radius: .8rem; background: var(--bg-input, #f8fafc); color: #16836b; box-shadow: 0 0 0 3px rgba(22, 131, 107, .06); }
.v4-search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text-primary, #0f172a); font: 500 .85rem/1.4 Inter, sans-serif; }
.v4-search-results { display: grid; max-height: 26rem; margin-top: .75rem; overflow: auto; }
.v4-search-result { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .72rem; border: 0; border-bottom: 1px solid var(--border-color, #e2e8f0); background: transparent; color: inherit; cursor: pointer; text-align: left; }
.v4-search-result:hover,
.v4-search-result:focus-visible { background: var(--bg-input, #f8fafc); outline: 0; }
.v4-search-result-icon { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border-radius: .65rem; background: rgba(37, 99, 235, .1); color: #2563eb; }
.v4-search-result > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.v4-search-result strong { overflow: hidden; color: var(--text-primary, #0f172a); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-search-result small { overflow: hidden; color: var(--text-muted, #64748b); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-search-result b { font-size: .7rem; }

.v4-whats-new { position: relative; overflow-x: hidden; text-align: center; }
.v4-release-icon { display: grid; width: 4rem; height: 4rem; margin: 0 auto 1rem; place-items: center; border-radius: 1.2rem; background: linear-gradient(135deg, #2563eb, #14b8a6); color: #fff; box-shadow: 0 12px 30px rgba(37, 99, 235, .25); font-size: 1.5rem; }
.v4-whats-new > p { margin-right: auto; margin-left: auto; }
.v4-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1.35rem 0; text-align: left; }
.v4-feature-grid article { display: flex; align-items: flex-start; gap: .7rem; padding: .85rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .8rem; background: var(--bg-input, #f8fafc); }
.v4-feature-grid article > i { width: 1.1rem; margin-top: .15rem; color: #2563eb; text-align: center; }
.v4-feature-grid article div { display: flex; flex-direction: column; }
.v4-feature-grid strong { color: var(--text-primary, #0f172a); font-size: .72rem; }
.v4-feature-grid span { color: var(--text-muted, #64748b); font-size: .65rem; line-height: 1.45; }
.v4-dialog-actions { display: flex; justify-content: center; }
.v4-modal-open { overflow: hidden; }

.pwa-install-nav { width: 100%; border: 0; font: inherit; text-align: left; }
.pwa-install-nav.is-installed { opacity: .72; }
.pwa-install-dialog { position: relative; width: min(31rem, 100%); text-align: center; }
.pwa-install-close { position: absolute; top: 1rem; right: 1rem; }
.pwa-install-icon { display: block; margin: 0 auto .9rem; border-radius: 1.35rem; box-shadow: 0 12px 28px rgba(30, 58, 138, .25); }
.pwa-install-steps { display: grid; gap: .6rem; margin: 1.1rem 0; padding: 0; counter-reset: pwa-step; list-style: none; text-align: left; }
.pwa-install-steps li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: .7rem; padding: .75rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .8rem; background: var(--bg-input, #f8fafc); color: var(--text-secondary, #475569); font-size: .74rem; line-height: 1.45; }
.pwa-install-steps li::before { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .6rem; background: #2563eb; color: #fff; content: counter(pwa-step); counter-increment: pwa-step; font-weight: 800; }
.pwa-install-banner { display: grid; position: fixed; z-index: 9000; right: 1.1rem; bottom: 1.1rem; grid-template-columns: 3rem minmax(0, 1fr) auto auto; align-items: center; gap: .7rem; width: min(31rem, calc(100vw - 2rem)); padding: .75rem; border: 1px solid rgba(37, 99, 235, .24); border-radius: 1rem; background: var(--bg-card, #fff); box-shadow: 0 20px 55px rgba(15, 23, 42, .22); animation: v4Pop .22s ease; }
.pwa-install-banner[hidden] { display: none; }
.pwa-install-banner img { border-radius: .75rem; }
.pwa-install-banner > div { display: flex; min-width: 0; flex-direction: column; }
.pwa-install-banner strong { color: var(--text-primary, #0f172a); font-size: .72rem; }
.pwa-install-banner span { color: var(--text-muted, #64748b); font-size: .6rem; line-height: 1.35; }

body.dark-mode .v4-hero,
body.dark-mode .v4-summary-card,
body.dark-mode .v4-dialog { background-color: var(--bg-card); border-color: var(--border-color); }
body.dark-mode .v4-alert,
body.dark-mode .v4-goal,
body.dark-mode .v4-envelope,
body.dark-mode .v4-feature-grid article,
body.dark-mode .v4-search-result:hover { background-color: var(--bg-input); }
body.dark-mode .v41-score-ring::after { background: var(--bg-card); }
body.dark-mode .v41-action { background: var(--bg-input); }
body.dark-mode .v42-simulator,
body.dark-mode .v42-forecast-visual,
body.dark-mode .v42-forecast-insights article,
body.dark-mode .v43-forecast-breakdown,
body.dark-mode .pwa-install-steps li { background-color: var(--bg-input); }
body.dark-mode .v43-breakdown-row { background-color: var(--bg-card); }
body.dark-mode .v43-breakdown-row.total { background-color: rgba(37, 99, 235, .12); }

@keyframes v4Fade { from { opacity: 0; } }
@keyframes v4Pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

@media (max-width: 1180px) {
  .v4-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-layout-three { grid-template-columns: 1fr 1fr; }
  .v4-layout-three > :last-child { grid-column: 1 / -1; }
  .v4-inline-form { grid-template-columns: 1fr 1fr; }
  .v4-intelligence-grid { grid-template-columns: 1fr 1fr; }
  .v41-health-card { grid-row: span 2; }
  .v42-simulator-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  #planner-view { content-visibility: auto; contain-intrinsic-size: 900px; }
  .v4-search-trigger span,
  .v4-search-trigger kbd { display: none; }
  .v4-hero { align-items: stretch; flex-direction: column; gap: 1rem; padding: 1.15rem; }
  .v4-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .v4-hero-actions .btn { justify-content: center; min-height: 2.75rem; padding: .65rem; font-size: .68rem; }
  .v4-summary-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .v4-summary-card { align-items: flex-start; flex-direction: column; gap: .55rem; padding: .8rem; }
  .v4-summary-icon { width: 2.25rem; height: 2.25rem; flex-basis: 2.25rem; }
  .v4-summary-card strong { font-size: 1rem; }
  .v4-layout,
  .v4-layout-three { grid-template-columns: 1fr; }
  .v4-intelligence-grid { grid-template-columns: 1fr; }
  .v41-health-card { grid-row: auto; }
  .v4-layout-three > :last-child { grid-column: auto; }
  .v4-section-head { align-items: stretch; flex-direction: column; }
  .v43-forecast-controls { align-items: stretch; flex-direction: column; }
  .v43-projection-scope { min-width: 0; }
  .v4-horizon { align-self: flex-start; }
  .v4-forecast-row { grid-template-columns: 3.6rem minmax(3rem, 1fr) 5.7rem; gap: .4rem; }
  .v4-forecast-row small { display: none; }
  .v4-inline-form,
  .v4-inline-form-short { grid-template-columns: 1fr; }
  .v4-inline-form .form-input,
  .v4-inline-form .btn { min-height: 2.65rem; font-size: .78rem; }
  .v4-overlay { align-items: end; padding: 0; }
  .v4-dialog { width: 100%; max-height: 92dvh; padding: 1.1rem; border-width: 1px 0 0; border-radius: 1.25rem 1.25rem 0 0; }
  .v4-feature-grid { grid-template-columns: 1fr; }
  .v4-search-result { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .v4-search-result > b { grid-column: 2; }
  .transaction-load-more { flex-direction: column; }
  .dashboard-chart-toolbar { align-items: stretch; }
  .dashboard-chart-segment { flex: 1; }
  .dashboard-chart-segment button { flex: 1; }
  .dashboard-chart-toggle { width: 100%; margin-left: 0; padding: .3rem 0; }
  .dashboard-chart-card .chart-container { min-height: 16rem; }
  .v42-simulator-head { flex-direction: column; }
  .v42-presets { width: 100%; }
  .v42-presets button { min-height: 2.25rem; flex: 1 1 auto; }
  .v42-simulator-grid { grid-template-columns: 1fr 1fr; }
  .v42-forecast-insights { grid-template-columns: 1fr; }
  .v43-breakdown-grid { grid-template-columns: 1fr; }
  .v43-breakdown-row.total { grid-column: auto; }
  .v42-forecast-chart { min-height: 7.5rem; overflow: visible; }
  .v42-forecast-chart svg { width: 100%; max-width: 100%; transform: none; }
  .pwa-install-banner { right: .6rem; bottom: calc(4.8rem + env(safe-area-inset-bottom)); grid-template-columns: 2.6rem minmax(0, 1fr) auto; width: calc(100vw - 1.2rem); }
  .pwa-install-banner img { width: 42px; height: 42px; }
  .pwa-install-banner > .btn-icon { position: absolute; top: -.55rem; right: -.25rem; }
}

@media (max-width: 430px) {
  .v4-maintenance { min-height: calc(100dvh - 7rem); }
  .v42-simulator-grid { grid-template-columns: 1fr; }
  .pwa-install-banner > .btn { padding: .55rem .65rem; }
  .pwa-install-banner span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .v4-overlay,
  .v4-dialog,
  .v4-forecast-track span,
  .pwa-install-banner { animation: none; transition: none; }
}

/* Planificateur 4.3 : conseils de sécurité et fourchette de risque. */
.v43-planner-intelligence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.v43-planner-intelligence article {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .8rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: .85rem;
  background: var(--bg-card, #fff);
}
.v43-planner-intelligence article > i {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: .7rem;
  background: rgba(37, 99, 235, .1);
  color: #2563eb;
}
.v43-planner-intelligence article > div { display: flex; min-width: 0; flex-direction: column; }
.v43-planner-intelligence span { color: var(--text-muted, #64748b); font-size: .58rem; }
.v43-planner-intelligence strong { color: var(--text-primary, #0f172a); font-size: .72rem; }
.v43-planner-intelligence small { color: var(--text-muted, #64748b); font-size: .55rem; line-height: 1.35; }
.v43-planner-intelligence .success > i { background: rgba(16, 185, 129, .12); color: #059669; }
.v43-planner-intelligence .warning > i { background: rgba(245, 158, 11, .14); color: #b45309; }
.v43-planner-intelligence .danger > i { background: rgba(225, 29, 72, .1); color: #e11d48; }
.v43-risk-band { fill: rgba(245, 158, 11, .13); stroke: rgba(245, 158, 11, .3); stroke-width: 1; }
.v4-goal.overdue { border-color: rgba(225, 29, 72, .32); background: rgba(225, 29, 72, .045); }
.v4-goal.overdue > small { color: #e11d48; }

body.dark-mode .v43-planner-intelligence article { background-color: var(--bg-card); border-color: var(--border-color); }

@media (max-width: 1180px) {
  .v43-planner-intelligence { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
}

@media (max-width: 600px) {
  .v43-planner-intelligence { grid-template-columns: 1fr; gap: .55rem; }
  .v43-planner-intelligence article { padding: .7rem; }
}

/* REC 01 à REC 03 : recherche unique interprétée */
.v4-search-scope { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; color: var(--text-muted, #64748b); font-size: .7rem; }
.v4-search-scope-toggle { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; color: var(--text-primary, #0f172a); }
.v4-search-label { margin: .25rem 0; color: var(--text-muted, #64748b); font-size: .68rem; font-weight: 600; }
.v4-search-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.v4-search-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .3rem .25rem .65rem; border-radius: 999px; background: rgba(37, 99, 235, .1); color: #1d4ed8; font-size: .7rem; font-weight: 600; }
.v4-search-chip-remove { display: grid; width: 1.4rem; height: 1.4rem; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; }
.v4-search-chip-remove:hover, .v4-search-chip-remove:focus-visible { background: rgba(37, 99, 235, .2); outline: 0; }
.v4-search-editors { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; }
.v4-search-editor { display: flex; flex-direction: column; gap: .15rem; color: var(--text-muted, #64748b); font-size: .65rem; }
.v4-search-editor input, .v4-search-editor select { min-height: 2rem; padding: .2rem .5rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: .5rem; background: var(--bg-input, #f8fafc); color: var(--text-primary, #0f172a); font-size: .75rem; }
.v4-search-editor input[type="number"] { width: 6.5rem; }
.v4-search-note, .v4-search-count { margin: .4rem 0; color: var(--text-muted, #64748b); font-size: .7rem; }
.v4-search-heading { margin: .75rem 0 .25rem; font-size: .72rem; font-weight: 700; color: var(--text-primary, #0f172a); }
.v4-search-section { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.v4-search-section > .v4-search-result { width: 100%; }
.v4-search-suggestion { white-space: normal; text-align: left; }
.v4-search-result small.v4-search-status { color: var(--text-muted, #64748b); }
.v4-search-result small.v4-search-explain { color: #b45309; white-space: normal; }
.v4-search-result > span:nth-child(2) small { white-space: normal; }

/* Planner redesign: visual narrative, not a wall of equally weighted cards. */
#planner-view .v4-hero {min-height:15rem;align-items:center;padding:clamp(1.5rem,3vw,2.8rem);border:1px solid rgba(255,255,255,.12);border-radius:1.65rem;background:radial-gradient(circle at 78% 16%,rgba(42,203,174,.22),transparent 30%),radial-gradient(circle at 12% 92%,rgba(71,113,255,.23),transparent 38%),linear-gradient(130deg,#101d35,#172b48 65%,#123a42);box-shadow:0 18px 48px rgba(17,34,58,.19);overflow:hidden;}
#planner-view .v4-hero::after {content:'';position:absolute;right:-5rem;bottom:-12rem;width:29rem;height:29rem;border:1px solid rgba(255,255,255,.11);border-radius:50%;box-shadow:0 0 0 4rem rgba(255,255,255,.025),0 0 0 8rem rgba(255,255,255,.018);pointer-events:none;}
#planner-view .v4-hero h2 {max-width:15ch;font-size:clamp(2rem,3.4vw,3.4rem);line-height:1.08;letter-spacing:-.055em;color:#fff;text-wrap:balance;}
#planner-view .v4-hero p {max-width:50ch;font-size:.95rem;line-height:1.65;color:#cbd9e7;}
#planner-view .v4-hero .v4-eyebrow {color:#73e4d2;}
#planner-view .v4-hero-actions {align-self:flex-end;flex-wrap:wrap;}
#planner-view .v4-hero-actions .btn {border-color:rgba(255,255,255,.24);border-radius:.8rem;}
#planner-view .v4-hero-actions #v4HelpButton,#planner-view .v4-hero-actions .btn-primary {display:none;}
.v4-story-heading {display:flex;align-items:end;justify-content:space-between;gap:1rem;margin:2rem 0 1rem;}
.v4-story-heading .v4-eyebrow {color:#0e9685;font-size:.68rem;letter-spacing:.14em;}
.v4-story-heading h3 {margin:.3rem 0 0;color:var(--text-primary,#142338);font-size:clamp(1.3rem,2vw,1.85rem);letter-spacing:-.035em;text-wrap:balance;}
.v4-story-heading p {max-width:25rem;color:var(--text-muted,#64748b);font-size:.82rem;text-align:right;}
#planner-view .v4-summary-grid {gap:.85rem;}
#planner-view .v4-summary-card {min-height:8.4rem;align-items:flex-start;flex-direction:column;justify-content:space-between;padding:1.15rem 1.25rem;border-radius:1.15rem;background:linear-gradient(160deg,var(--bg-card,#fff),var(--bg-input,#f6f9fc));}
#planner-view .v4-summary-card:first-child {background:linear-gradient(145deg,#205de2,#1744ac);border-color:#1d55c5;color:#fff;box-shadow:0 16px 32px rgba(31,88,200,.2);}
#planner-view .v4-summary-card:first-child .v4-summary-icon {background:rgba(255,255,255,.17);color:#fff;}
#planner-view .v4-summary-card:first-child :is(span,strong,small) {color:#fff;}
#planner-view .v4-summary-card strong {font-size:clamp(1.25rem,1.8vw,1.75rem);font-variant-numeric:tabular-nums;}
#planner-view .v43-planner-intelligence {grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;}
#planner-view .v43-planner-intelligence article {min-height:8.7rem;align-items:flex-start;padding:1.1rem;border-radius:1.1rem;background:var(--bg-card,#fff);box-shadow:0 9px 26px rgba(20,36,62,.035);}
#planner-view .v43-planner-intelligence article:nth-child(n+4) {min-height:7.2rem;}
#planner-view .v43-planner-intelligence article:nth-child(4) {grid-column:span 1;}
#planner-view .v43-planner-intelligence article:nth-child(5) {grid-column:span 2;}
#planner-view .v43-planner-intelligence span {font-size:.7rem;font-weight:650;}
#planner-view .v43-planner-intelligence strong {font-size:1rem;line-height:1.25;letter-spacing:-.02em;}
#planner-view .v43-planner-intelligence small {font-size:.68rem;line-height:1.48;}
#planner-view .v4-intelligence-grid {margin-top:1.35rem;}
#planner-view .v4-forecast-card {border-radius:1.3rem;box-shadow:0 14px 42px rgba(18,37,65,.06);}
#planner-view .v42-forecast-chart svg {filter:drop-shadow(0 8px 12px rgba(22,131,107,.09));}
@media (max-width:1050px){#planner-view .v43-planner-intelligence{grid-template-columns:repeat(2,minmax(0,1fr));}#planner-view .v43-planner-intelligence article:nth-child(5){grid-column:span 2;}}
@media (max-width:650px){#planner-view .v4-hero{min-height:0;padding:1.5rem;}#planner-view .v4-hero h2{font-size:2.15rem;}#planner-view .v4-hero-actions{align-self:auto;}#planner-view .v4-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}#planner-view .v4-summary-card{min-height:7.5rem;padding:.9rem;}#planner-view .v43-planner-intelligence{grid-template-columns:1fr;}#planner-view .v43-planner-intelligence article:nth-child(5){grid-column:auto;}.v4-story-heading{align-items:flex-start;flex-direction:column;}.v4-story-heading p{text-align:left;}}
@media (prefers-reduced-motion:reduce){#planner-view .v4-summary-card::after{animation:none;transform:scaleX(1);}}

/* The rest of the planner follows the same visual system. */
#planner-view .v4-layout:not(.v4-layout-three) {grid-template-columns:minmax(0,1fr);gap:1.1rem;}
#planner-view .v4-layout:not(.v4-layout-three)>.card:last-child {max-width:none;}
#planner-view .v4-forecast-card {padding:clamp(1.1rem,2.4vw,2rem);}
#planner-view .v4-forecast-card>.v4-section-head {align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--border-color,#e2e8f0);}
#planner-view .v4-forecast-card>.v4-section-head h3 {font-size:clamp(1.35rem,2vw,1.8rem);}
#planner-view .v4-horizon {gap:.15rem;padding:.25rem;border-radius:999px;}
#planner-view .v4-horizon button {min-width:3.6rem;border-radius:999px;font-size:.75rem;transition:background .18s ease,transform .18s ease;}
#planner-view .v4-horizon button:active {transform:scale(.95);}
#planner-view .v42-forecast-insights {grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem;margin:1.2rem 0;}
#planner-view .v42-forecast-insights article {min-height:5.2rem;padding:1rem;border-radius:1rem;background:var(--bg-card,#fff);}
#planner-view .v42-forecast-insights strong {font-size:.92rem;}
#planner-view .v42-forecast-insights :is(span,small) {font-size:.68rem;}
#planner-view .v42-forecast-visual {padding:clamp(1rem,2vw,1.5rem);border-radius:1.2rem;background:linear-gradient(180deg,var(--bg-card,#fff),var(--bg-input,#f6f9fc));}
#planner-view .v42-chart-head {align-items:center;margin-bottom:1.1rem;}
#planner-view .v42-chart-head strong {font-size:1.05rem;letter-spacing:-.02em;}
#planner-view .v42-forecast-chart {min-height:16rem;}
#planner-view .v42-forecast-line {stroke-width:4.5;}
#planner-view .v4-detail-panel {margin:1.1rem 0;padding:clamp(1rem,2vw,1.5rem);border:1px solid var(--border-color,#e2e8f0);border-radius:1.2rem;background:var(--bg-card,#fff);box-shadow:0 9px 28px rgba(20,36,62,.035);}
#planner-view .v4-detail-panel :is(h3,h4) {letter-spacing:-.025em;}
#planner-view .v4-detail-panel table {font-variant-numeric:tabular-nums;}
#planner-view .v4-simulator-disclosure {margin:1rem 0;padding:0;border:1px solid var(--border-color,#dce5ef);border-radius:1rem;background:var(--bg-input,#f7fafc);overflow:hidden;}
#planner-view .v4-simulator-disclosure>summary {display:flex;align-items:center;gap:.8rem;padding:1rem 1.2rem;cursor:pointer;list-style:none;}
#planner-view .v4-simulator-disclosure>summary::-webkit-details-marker {display:none;}
#planner-view .v4-simulator-disclosure>summary>i:first-child {display:grid;width:2.4rem;height:2.4rem;place-items:center;border-radius:.75rem;background:rgba(37,99,235,.1);color:#2563eb;}
#planner-view .v4-simulator-disclosure>summary>span {display:flex;flex:1;flex-direction:column;gap:.15rem;}
#planner-view .v4-simulator-disclosure>summary strong {font-size:.9rem;color:var(--text-primary,#142338);}
#planner-view .v4-simulator-disclosure>summary small {font-size:.7rem;color:var(--text-muted,#64748b);}
#planner-view .v4-simulator-disclosure>summary>i:last-child {color:var(--text-muted,#64748b);transition:transform .2s ease;}
#planner-view .v4-simulator-disclosure[open]>summary>i:last-child {transform:rotate(180deg);}
#planner-view .v4-simulator-disclosure .v42-simulator-head,#planner-view .v4-simulator-disclosure .v42-simulator-grid {margin-inline:1.2rem;}
#planner-view .v4-simulator-disclosure .v42-simulator-grid {margin-bottom:1.2rem;}
#planner-view .v4-layout-three {grid-template-columns:repeat(3,minmax(0,1fr));gap:1.1rem;}
#planner-view .v4-layout-three>.card,#planner-view .v4-layout:not(.v4-layout-three)>.card:last-child {padding:clamp(1.1rem,2vw,1.5rem);border-radius:1.2rem;box-shadow:0 10px 32px rgba(20,36,62,.04);}
#planner-view .v4-layout-three .v4-section-head {padding-bottom:.85rem;border-bottom:1px solid var(--border-color,#e2e8f0);}
#planner-view .v4-layout-three .v4-section-head h3 {font-size:1.12rem;}
#planner-view .v4-inline-form {gap:.55rem;margin-bottom:1.2rem;}
#planner-view .v4-inline-form .form-input {min-height:2.65rem;border-radius:.75rem;}
#planner-view .v4-inline-form .btn {min-height:2.65rem;border-radius:.75rem;}
#planner-view .v4-goal,#planner-view .v4-envelope {padding:1rem;border-radius:.9rem;}
#planner-view .v4-calendar-item {padding:.8rem .2rem;}
#planner-view .v4-calendar-item time {border-radius:.8rem;}
@media (max-width:1050px){#planner-view .v4-layout-three{grid-template-columns:repeat(2,minmax(0,1fr));}#planner-view .v4-layout-three>.card:last-child{grid-column:1/-1;}}
@media (max-width:700px){#planner-view .v4-layout-three{grid-template-columns:1fr;}#planner-view .v4-layout-three>.card:last-child{grid-column:auto;}#planner-view .v42-forecast-insights{grid-template-columns:1fr;}#planner-view .v42-forecast-chart{min-height:9rem;}#planner-view .v42-chart-head{flex-wrap:wrap;gap:.5rem;}#planner-view .v43-forecast-controls{width:100%;flex-wrap:wrap;}#planner-view .v4-horizon{max-width:100%;overflow-x:auto;}}
@media (prefers-reduced-motion:reduce){#planner-view .v4-simulator-disclosure>summary>i:last-child,#planner-view .v4-horizon button{transition:none;}}

#planner-view .v4-forecast-details {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:1.15rem 0;align-items:start;}
#planner-view .v4-detail-disclosure {min-width:0;border:1px solid var(--border-color,#dce5ef);border-radius:1rem;background:var(--bg-card,#fff);box-shadow:0 8px 25px rgba(20,36,62,.035);overflow:hidden;transition:border-color .2s ease,box-shadow .2s ease;}
#planner-view .v4-detail-disclosure[open] {grid-column:1/-1;border-color:rgba(37,99,235,.32);box-shadow:0 14px 34px rgba(20,36,62,.065);}
#planner-view .v4-detail-disclosure>summary {display:flex;align-items:center;gap:.85rem;min-height:5.1rem;padding:1rem 1.15rem;cursor:pointer;list-style:none;}
#planner-view .v4-detail-disclosure>summary::-webkit-details-marker {display:none;}
#planner-view .v4-detail-disclosure>summary:focus-visible {outline:2px solid #2563eb;outline-offset:-3px;border-radius:1rem;}
#planner-view .v4-detail-icon {display:grid;flex:0 0 2.6rem;width:2.6rem;height:2.6rem;place-items:center;border-radius:.8rem;background:rgba(37,99,235,.09);color:#2563eb;}
#planner-view .v4-detail-disclosure:nth-child(2) .v4-detail-icon {background:rgba(20,184,166,.11);color:#078e7b;}
#planner-view .v4-detail-disclosure>summary>span:nth-child(2) {display:flex;flex:1;min-width:0;flex-direction:column;gap:.15rem;}
#planner-view .v4-detail-disclosure>summary strong {color:var(--text-primary,#142338);font-size:.85rem;text-wrap:balance;}
#planner-view .v4-detail-disclosure>summary small {color:var(--text-muted,#64748b);font-size:.68rem;line-height:1.35;text-wrap:pretty;}
#planner-view .v4-detail-disclosure>summary>i {color:var(--text-muted,#64748b);transition:transform .2s ease;}
#planner-view .v4-detail-disclosure[open]>summary>i {transform:rotate(180deg);}
#planner-view .v4-detail-disclosure .v4-detail-panel {margin:0 .85rem .85rem;box-shadow:none;border-radius:.8rem;background:var(--bg-input,#f8fafc);}
#planner-view .v4-detail-disclosure .v4-detail-panel :is(table,.table-container) {max-width:100%;}
#planner-view .v4-detail-disclosure .v4-detail-panel .table-container {overflow-x:auto;}
@media (max-width:700px){#planner-view .v4-forecast-details{grid-template-columns:1fr;}#planner-view .v4-detail-disclosure[open]{grid-column:auto;}}
@media (prefers-reduced-motion:reduce){#planner-view .v4-detail-disclosure,#planner-view .v4-detail-disclosure>summary>i{transition:none;}}
#planner-view .v4-forecast-list-disclosure {margin:1rem 0;}
#planner-view .v4-forecast-list-disclosure .v4-forecast {margin:.15rem .85rem .85rem;padding:.5rem .75rem;border:1px solid var(--border-color,#dce5ef);border-radius:.8rem;background:var(--bg-input,#f8fafc);}
/* Les totaux ne mélangent jamais des devises de base différentes. */
.v4-currency-scope-notice {
  margin: 12px 0;
  padding: 12px 16px;
  border: 1px solid #f5d68c;
  border-radius: 14px;
  background: #fff9e9;
  color: #78520c;
  font-size: 13px;
  line-height: 1.5;
}
.v4-currency-scope-notice[hidden] { display: none; }
body.dark-mode .v4-currency-scope-notice {
  border-color: #8b6a30;
  background: #302919;
  color: #f7d99d;
}
