/* ============================================================
   Simulateur Impôt — Shadcn/ui-inspired design system
   ============================================================ */

/* ---------- CSS Variables (shadcn/ui tokens) ---------- */
:root {
  /* Colors — zinc palette */
  --background:         0 0% 100%;
  --foreground:         240 10% 3.9%;

  --card:               0 0% 100%;
  --card-foreground:    240 10% 3.9%;

  --muted:              240 4.8% 95.9%;
  --muted-foreground:   240 3.8% 46.1%;

  --border:             240 5.9% 90%;
  --input:              240 5.9% 90%;

  --primary:            240 10% 3.9%;
  --primary-foreground: 0 0% 98%;

  --secondary:          240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;

  --accent:             240 4.8% 95.9%;
  --accent-foreground:  240 5.9% 10%;

  --destructive:        0 40% 44%;
  --destructive-fg:     0 0% 98%;

  --ring:               209 54% 36%;

  /* Featured (impôt) */
  --featured-bg:        240 5.9% 10%;
  --featured-fg:        0 0% 98%;

  /* Green for décote */
  --green-bg:           73 38% 42%;
  --green-fg:           0 0% 100%;
  --green-muted:        73 30% 93%;
  --green-muted-fg:     73 38% 22%;

  /* Couleurs sémantiques inline */
  --blue-muted-fg:  209 54% 36%;
  --amber-muted-fg: 25 80% 38%;

  /* Barre de répartition */
  --bar-cotis: 220 13% 69%;
  --bar-impot: 220 9% 46%;
  --bar-net:   240 10% 3.9%;

  /* Radius */
  --radius: 0.5rem;

  /* Misc */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Menlo', 'Consolas', monospace;
}

/* ---------- Dark mode ---------- */
html.dark {
  --background:         240 10% 3.9%;
  --foreground:         0 0% 98%;

  --card:               240 10% 6%;
  --card-foreground:    0 0% 98%;

  --muted:              240 6% 12%;
  --muted-foreground:   240 5% 58%;

  --border:             240 6% 18%;
  --input:              240 6% 18%;

  --primary:            0 0% 98%;
  --primary-foreground: 240 5.9% 10%;

  --secondary:          240 6% 14%;
  --secondary-foreground: 0 0% 98%;

  --accent:             240 6% 14%;
  --accent-foreground:  0 0% 98%;

  --ring:               240 5% 65%;

  --featured-bg:        0 0% 98%;
  --featured-fg:        240 10% 3.9%;

  --green-muted:        73 28% 16%;
  --green-muted-fg:     73 38% 58%;

  /* Couleurs sémantiques inline — dark */
  --blue-muted-fg:  209 60% 65%;
  --amber-muted-fg: 38 92% 65%;

  /* Destructive — dark */
  --destructive:    0 50% 55%;
  --destructive-fg: 0 0% 98%;

  /* Barre de répartition — dark */
  --bar-cotis: 220 14% 27%;
  --bar-impot: 220 9% 62%;
  --bar-net:   210 40% 96%;
}

/* ---------- Compatibilité shared.css (variables de pont) ---------- */
/* shared.css utilise --bg, --text, --border, --muted comme couleurs directes.
   style.css les écrase avec des valeurs HSL nues. Ce bloc les remappe
   pour que les composants de shared.css restent fonctionnels sur les pages
   qui chargent les deux feuilles de style (index.html, budget.html, etc.). */
:root {
  --bg:      hsl(var(--background));
  --surface: hsl(var(--card));
  --text:    hsl(var(--foreground));
}
html.dark {
  --bg:      hsl(var(--background));
  --surface: hsl(var(--card));
  --text:    hsl(var(--foreground));
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

html { overflow-x: hidden; }

body {
  font-family: var(--font);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Surcharges composants shared.css ---------- */
/* index.html, budget.html, etc. utilisent des composants de shared.css
   (.site-nav, .bottom-nav, .theme-toggle, .page-footer, etc.).
   style.css écrase --border / --muted / --accent avec des valeurs HSL nues,
   ce qui casse les composants shared.css qui les utilisent directement.
   On surcharge ici avec les bonnes couleurs via les variables de style.css. */

/* -- Nav principale -- */
.site-nav {
  background: hsl(var(--background));
  border-bottom-color: hsl(var(--border));
}

.site-nav__logo { color: hsl(var(--foreground)); }

.site-nav__links { border-color: hsl(var(--border)); }

.site-nav__link { color: hsl(var(--muted-foreground)); }

.site-nav__link:hover,
.site-nav__link.active { color: hsl(var(--foreground)); }

.nav-sep { background: hsl(var(--border)); }

.nav-tool { color: hsl(var(--muted-foreground)); }

.nav-indicator { background: hsl(var(--muted)); }

.nav-indicator::before,
.nav-indicator::after { background: hsl(var(--foreground)); }

/* -- Nav mobile bas -- */
.bottom-nav {
  background: hsl(var(--background));
  border-top-color: hsl(var(--border));
}

.bottom-nav__link { color: hsl(var(--muted-foreground)); }

.bottom-nav__link.active { color: hsl(var(--foreground)); font-weight: 600; }

.bottom-nav__link:hover { color: hsl(var(--foreground)); }

/* -- Page footer (shared.css) -- */
.page-footer {
  color: hsl(var(--muted-foreground));
  border-top-color: hsl(var(--border));
}
.page-footer a { color: hsl(var(--muted-foreground)); }

/* ---------- Navbar ---------- */
.navbar {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-decoration: none;
}

.navbar-brand svg {
  color: hsl(var(--muted-foreground));
}

.nav-back-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  padding: 3px;
  border: 1px solid hsl(var(--border));
  border-radius: 100px;
  overflow: visible;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 100px;
  transition: color 0.15s;
  position: relative;
  z-index: 1;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background: none;
  text-decoration: none;
}

.nav-link--active,
.nav-link.active {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* Indicateur glissant */
.nav-links .nav-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 100px;
  background: hsl(var(--secondary));
  pointer-events: none;
  z-index: 0;
  transition: left  0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-links .nav-indicator::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: hsl(var(--primary));
}

.nav-links .nav-indicator::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 22px;
  border-radius: 50%;
  background: hsl(var(--primary));
  filter: blur(10px);
  opacity: 0.12;
}

.nav-divider {
  width: 1px;
  height: 16px;
  background: hsl(var(--border));
  flex-shrink: 0;
  margin: 0 4px;
}

@media (max-width: 480px) {
  .nav-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    flex-shrink: 1;
    min-width: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 0.75rem; padding: 4px 8px; white-space: nowrap; }
}

.nav-back-link:hover {
  color: hsl(var(--foreground));
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

/* Affichage des icônes selon le mode */
.theme-icon--moon { display: none; }
.theme-icon--sun  { display: block; }

html.dark .theme-icon--moon { display: block; }
html.dark .theme-icon--sun  { display: none; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  letter-spacing: 0.02em;
}

.inline-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.inline-badge.green {
  background: hsl(var(--green-muted));
  color: hsl(var(--green-muted-fg));
}

/* ---------- Page ---------- */
.page {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  width: 100%;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: clamp(1.2rem, 4vw + 0.4rem, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.page-desc {
  margin-top: 8px;
  font-size: clamp(0.82rem, 2vw + 0.4rem, 0.9rem);
  color: hsl(var(--muted-foreground));
  max-width: 520px;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.layout-col--form {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 72px;
  align-self: flex-start;
}

.layout-col--results {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* form-card remplit sa colonne (alignement bas géré via minHeight JS) */
.form-card {
  flex: 1;
}

.results-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Card ---------- */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 16px;
}

.card-title {
  font-size: clamp(0.88rem, 2vw + 0.4rem, 0.95rem);
  font-weight: 600;
  color: hsl(var(--card-foreground));
  line-height: 1.3;
}

.card-desc {
  margin-top: 4px;
  font-size: clamp(0.75rem, 1.5vw + 0.4rem, 0.8rem);
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.card-content {
  padding: 20px 24px 24px;
}

.separator {
  height: 1px;
  background: hsl(var(--border));
}

/* ---------- Form ---------- */
.field {
  margin-bottom: 20px;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  margin-top: -2px;
}

/* Input */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 12px;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: textfield;
  -moz-appearance: textfield;
}

.input::-webkit-outer-spin-button,
.input::-webkit-inner-spin-button { -webkit-appearance: none; }

.input::placeholder { color: hsl(var(--muted-foreground)); }

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.input.error {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.12);
}

.input-adornment {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.error-msg {
  font-size: 0.78rem;
  color: hsl(var(--destructive));
  margin-top: 6px;
}

.error-msg.hidden { display: none; }

/* Tabs (radio) */
.tabs {
  display: flex;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.tab {
  flex: 1;
  cursor: pointer;
}

.tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tab span {
  display: block;
  text-align: center;
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.82rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab input[type="radio"]:checked + span {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.08), 0 1px 2px hsl(0 0% 0% / 0.04);
}

.tab:hover input:not(:checked) + span {
  color: hsl(var(--foreground));
}

.tab input:focus-visible + span {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}

.stepper-btn {
  width: 44px;
  height: 40px;
  flex-shrink: 0;
  background: var(--surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}

.stepper-btn:hover { background: var(--border); }
.stepper-btn:active { background: var(--text); color: var(--surface); }

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper-value {
  flex: 1;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 16px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.btn-primary:hover { opacity: 0.82; }
.btn-primary:active { opacity: 0.68; }

/* ---------- Section "Affiner le calcul" ---------- */

.detail-toggle-row {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.detail-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: var(--font);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.detail-toggle-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.detail-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.detail-toggle-btn[aria-expanded="true"] .detail-chevron {
  transform: rotate(180deg);
}

.detail-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.detail-panel.open {
  grid-template-rows: 1fr;
}

.detail-panel-inner {
  overflow: hidden;
}

/* ---------- Net en banque ---------- */

.net-banque-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.net-banque-label {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.net-banque-value {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
}

.net-banque-total .net-banque-label,
.net-banque-total .net-banque-value {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ---------- Results column ---------- */
.results-top,
.results-bottom {
  animation: fadeUp 0.25s ease;
}

.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- KPI grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kpi-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.kpi-card.kpi-featured {
  background: hsl(var(--featured-bg));
  border-color: hsl(var(--featured-bg));
}

.kpi-card.kpi-muted {
  background: hsl(var(--card));
  border-color: hsl(var(--border));
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.kpi-featured .kpi-label { color: hsl(0 0% 60%); }

.kpi-value {
  font-size: clamp(0.95rem, 3.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  line-height: 1.2;
  margin-top: 4px;
  word-break: break-word;
  max-width: 100%;
}

.kpi-featured .kpi-value { color: hsl(var(--featured-fg)); }

.kpi-sub {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.kpi-featured .kpi-sub { color: hsl(0 0% 55%); }

/* ---------- Net card ---------- */
.net-card {}

.net-grid {
  display: flex;
  align-items: center;
}

.net-item {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.net-sep {
  width: 1px;
  height: 52px;
  background: hsl(var(--border));
}

.net-period {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.net-amount {
  font-size: clamp(1rem, 4.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
  word-break: break-word;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  font-size: 0.82rem;
}
.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.1s;
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: hsl(var(--muted) / 0.4); }

.data-table td {
  padding: 10px 16px;
  color: hsl(var(--foreground));
  white-space: nowrap;
}
.data-table td:last-child { text-align: right; }

.data-table td.muted { color: hsl(var(--muted-foreground)); }

.align-right { text-align: right !important; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.data-table tfoot tr {
  border-top: 2px solid hsl(var(--border));
}

.data-table tfoot td {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.82rem;
  background: hsl(var(--muted) / 0.5);
}

.tfoot-decote td { color: hsl(var(--green-muted-fg)); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid hsl(var(--border));
  padding: 20px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ---------- Result tabs (underline style) ---------- */
.result-tabs-bar {
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 16px;
  gap: 0;
}

.result-tab {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s, border-color 0.15s;
}

.result-tab:hover { color: hsl(var(--foreground)); }

.result-tab.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--foreground));
  font-weight: 600;
}

/* ---------- Tab panels ---------- */
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Charges person tabs ---------- */
.charges-person-tabs {
  margin-bottom: 4px;
}

/* ---------- KPI 3 columns ---------- */
.kpi-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ---------- Charges table accordion ---------- */

/* Category rows */
.charges-table .cat-row {
  cursor: pointer;
  user-select: none;
  background: hsl(var(--muted) / 0.35);
  transition: background 0.12s;
}

.charges-table .cat-row:hover {
  background: hsl(var(--muted) / 0.65);
}

.charges-table .cat-row td {
  border-top: 1px solid hsl(var(--border));
  padding: 10px 16px;
}

.charges-table .cat-row:first-child td {
  border-top: none;
}

.cat-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.cat-chevron {
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.cat-row.open .cat-chevron {
  transform: rotate(180deg);
}

.cat-total {
  font-size: 0.84rem;
  font-weight: 600;
}

/* Detail rows */
.charges-table .detail-row {
  display: none;
}

.charges-table .detail-row.visible {
  display: table-row;
  animation: fadeUp 0.15s ease;
}

.charges-table .detail-row td {
  padding: 7px 16px 7px 40px;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  font-size: 0.8rem;
}

.charges-table .detail-row:last-of-type td {
  border-bottom: none;
}

.detail-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.detail-name {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.detail-base {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}

.detail-rate {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  margin-right: 4px;
}

.detail-monthly {
  display: block;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  margin-top: 1px;
}

.cat-monthly {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  margin-top: 1px;
}

.kpi-monthly {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  font-family: var(--font-mono);
}

.kpi-featured .kpi-monthly {
  color: hsl(0 0% 60%);
}

/* ---------- Charges category blocks ---------- */
.charges-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cat-block {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cat-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid hsl(var(--border));
}

.cat-block-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.cat-block-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  transition: color 0.12s;
}

.cat-block-btn:hover { color: hsl(var(--foreground)); }

.cat-block-btn .cat-chevron {
  transition: transform 0.18s ease;
}

.cat-block-amounts {
  display: flex;
  align-items: stretch;
  flex: 1;
  padding: 14px 0 12px;
}

.cat-block-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
}

.cat-block-sep {
  width: 1px;
  background: hsl(var(--border));
  margin: 0;
}

.cat-block-role {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

.cat-block-value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  font-family: var(--font-mono);
  margin-top: 2px;
}

.cat-block-value.muted {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.cat-block-monthly {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}

/* Detail section */
.cat-block-details {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.15s ease;
}

.cat-block-details.hidden { display: none !important; }

.cat-detail-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 16px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.cat-detail-item:last-child { border-bottom: none; }

.cat-detail-name {
  font-size: 0.76rem;
  color: hsl(var(--foreground));
}

.cat-detail-sal,
.cat-detail-pat {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 600px) {
  .charges-cat-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Charges disclaimer ---------- */
.charges-disclaimer {
  font-size: 0.73rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  padding: 12px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.3);
}

/* ---------- Period toggle ---------- */
.period-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.period-toggle {
  display: flex;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.period-opt {
  cursor: pointer;
}

.period-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.period-opt span {
  display: block;
  padding: 4px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.78rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.period-opt input[type="radio"]:checked + span {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.08);
}

.period-opt:hover input:not(:checked) + span {
  color: hsl(var(--foreground));
}

/* Screen-reader only label */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---------- Conjoint field ---------- */
.conjoint-field {
  animation: fadeUp 0.2s ease;
}

/* ---------- Declarants card ---------- */
.declarants-grid {
  display: flex;
  gap: 0;
  padding: 20px 24px;
}

.declarant-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.declarants-vsep {
  width: 1px;
  background: hsl(var(--border));
  margin: 0 24px;
  flex-shrink: 0;
}

.declarant-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.declarant-name-hint {
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.declarant-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.declarant-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

.declarant-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.declarant-stat-value.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.rate-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  width: fit-content;
}

.rate-pill.alt {
  background: hsl(var(--featured-bg));
  color: hsl(var(--featured-fg));
}

/* ---------- Empty table row ---------- */
.empty-row {
  text-align: center;
  padding: 16px !important;
  color: hsl(var(--muted-foreground));
}

/* ---------- label-hint ---------- */
.label-hint {
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .layout {
    flex-direction: column;
  }

  .layout-col--form,
  .layout-col--results {
    width: 100%;
    flex: none;
    position: static;
  }

  .form-card { flex: none; }

  .page {
    padding: 20px 16px 48px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .results-top,
  .results-bottom {
    min-width: 0;
    max-width: 100%;
  }

  /* KPIs en colonne dès mobile */
  .kpi-grid { grid-template-columns: 1fr; }

  /* Inputs et boutons plus grands pour le touch */
  .input        { height: 44px; font-size: 1rem; }
  .btn-primary  { height: 48px; font-size: 0.95rem; }
  .stepper-btn  { width: 48px; height: 44px; }
  .stepper-value { height: 44px; font-size: 1rem; }

  /* Tableau */
  .data-table { font-size: 0.75rem; }
  .data-table td, .data-table th { padding: 8px 8px; white-space: normal; }

  /* Cards */
  .card-header { padding: 16px 16px 12px; }
  .card-content { padding: 16px; }

  /* Net card */
  .net-item { padding: 16px; }

  /* Toggle période : empile label + toggle */
  .period-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Déclarants en colonne */
  .declarants-grid {
    flex-direction: column;
    gap: 20px;
    padding: 16px;
  }

  .declarants-vsep {
    width: 100%;
    height: 1px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .page { padding: 16px 12px 40px; }
  .navbar-inner { padding: 0 12px; }
}

/* Très petits écrans (360px et moins) */
@media (max-width: 360px) {
  .page { padding: 12px 10px 32px; }
  .navbar-inner { padding: 0 10px; }
  .navbar-brand span { font-size: 0.82rem; }

  .card-header { padding: 12px 12px 10px; }
  .card-content { padding: 12px; }

  .bar-card { padding: 14px 12px; }
  .bar-track { height: 16px; }

  .data-table { font-size: 0.68rem; }
  .data-table td, .data-table th { padding: 6px 6px; }

  .kpi-card { padding: 12px 14px; }

  .net-item { padding: 12px; }

  .footer { padding: 14px 12px; font-size: 0.68rem; }

  .btn-primary { height: 44px; font-size: 0.9rem; }
}

/* ---------- Barre de répartition ---------- */
.bar-card {
  padding: 16px 20px;
}

/* Barre cliquable */
.bar-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: hsl(var(--muted));
  margin-bottom: 12px;
  cursor: pointer;
}

.bar-track:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.bar-seg {
  height: 100%;
  width: 0%;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-seg--cotis { background: hsl(var(--bar-cotis)); }
.bar-seg--impot { background: hsl(var(--bar-impot)); }
.bar-seg--net   { background: hsl(var(--bar-net)); }

/* Dot */
.bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bar-dot--cotis { background: hsl(var(--bar-cotis)); }
.bar-dot--impot { background: hsl(var(--bar-impot)); }
.bar-dot--net   { background: hsl(var(--bar-net)); }

html.dark .bar-dot--cotis { background: #374151; }
html.dark .bar-dot--impot { background: #9ca3af; }
html.dark .bar-dot--net   { background: #f1f5f9; }

/* Légende compacte — toujours visible */
.bar-pills {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.bar-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.bar-pill--hint {
  margin-left: auto;
  color: hsl(var(--muted-foreground));
  opacity: 0.7;
  cursor: pointer;
  user-select: none;
}

.bar-hint-chevron {
  transition: transform 0.25s ease;
}

.bar-card.open .bar-hint-chevron {
  transform: rotate(180deg);
}

/* Panneau détail — fermé par défaut */
.bar-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease, margin-top 0.25s ease;
  margin-top: 0;
}

.bar-detail-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Panneau ouvert */
.bar-card.open .bar-detail {
  grid-template-rows: 1fr;
  margin-top: 14px;
}

/* Ligne du détail : dot | label | montant | % */
.bar-detail-row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: hsl(var(--muted) / 0.5);
}

.bar-detail-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.bar-detail-amount {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

.bar-detail-pct {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
  min-width: 38px;
}

/* ---------- Article cards (guides.html) ---------- */
.article-card:hover {
  border-color: hsl(var(--foreground) / 0.25) !important;
  box-shadow: 0 2px 12px hsl(0 0% 0% / 0.06) !important;
}

/* ---------- SEO Article ---------- */
.seo-article {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  width: 100%;
}

.seo-section {
  margin-bottom: 48px;
}

.seo-section h2 {
  font-size: clamp(1rem, 3vw + 0.4rem, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid hsl(var(--border));
}

.seo-section p,
.seo-section li {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
  margin-bottom: 8px;
}

.seo-section ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.seo-section strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.seo-section em {
  font-style: italic;
}

/* Tableau barème */
.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.seo-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
}

.seo-table tbody tr {
  border-bottom: 1px solid hsl(var(--border));
}

.seo-table tbody tr:last-child {
  border-bottom: none;
}

.seo-table tbody td {
  padding: 10px 16px;
  color: hsl(var(--foreground));
}

.seo-table tbody tr:hover {
  background: hsl(var(--muted) / 0.3);
}

/* FAQ details/summary */
.seo-faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-faq details {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.seo-faq details[open] {
  background: hsl(var(--muted) / 0.2);
}

.seo-faq summary {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seo-faq summary::-webkit-details-marker { display: none; }

.seo-faq summary::after {
  content: "+";
  font-size: 1.1rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.seo-faq details[open] summary::after {
  content: "−";
}

.seo-faq dd {
  padding: 0 16px 16px;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 820px) {
  .seo-article {
    padding: 32px 16px 48px;
  }

  /* seo-section h2 géré par clamp() */

  .seo-table {
    font-size: 0.8rem;
  }

  .seo-table thead th,
  .seo-table tbody td {
    padding: 8px 12px;
  }
}

/* ---------- Mode paysage (téléphones) ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  /* Navbar plus compacte */
  .navbar-inner {
    height: 44px;
  }

  /* Réduction des espaces verticaux */
  .page {
    padding: 16px 20px 32px;
  }

  /* Titres moins hauts */
  .page-header {
    margin-bottom: 16px;
  }

  /* Cards plus compactes */
  .card-header {
    padding: 12px 20px 10px;
  }

  .card-content {
    padding: 12px 20px 16px;
  }

  /* Net card */
  .net-item {
    padding: 12px 20px;
  }

  /* KPI cards */
  .kpi-card {
    padding: 12px 14px;
  }

  /* Barre */
  .bar-card {
    padding: 12px 20px;
  }

  .bar-track {
    height: 22px;
    margin-bottom: 10px;
  }

  /* Results gap */
  .results-top,
  .results-bottom {
    gap: 12px;
  }
}

/* Paysage sur grands téléphones (> 820px) : layout 2 colonnes mais espacements réduits */
@media (orientation: landscape) and (min-width: 821px) and (max-height: 600px) {
  .page {
    padding: 16px 24px 32px;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .navbar-inner {
    height: 44px;
  }

  .card-header {
    padding: 12px 20px 10px;
  }

  .card-content {
    padding: 12px 20px 16px;
  }

  .results-col {
    gap: 12px;
  }

  .kpi-card {
    padding: 12px 14px;
  }

  .net-item {
    padding: 12px 20px;
  }

  .bar-card {
    padding: 12px 20px;
  }

  .bar-track {
    height: 22px;
    margin-bottom: 10px;
  }
}

/* ─── Section "Et maintenant ?" ─────────────────────────────────────────── */

.next-steps {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.next-steps-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.next-steps-sub {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: -6px;
}

.next-steps-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-next--default {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: 1px solid transparent;
}
.btn-next--default:hover { opacity: 0.82; }

.btn-next--outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}
.btn-next--outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* ─── Page Budget — Bandeau revenu net ──────────────────────────────────── */

.revenu-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: hsl(var(--accent) / 0.08);
  border: 1px solid hsl(var(--accent) / 0.25);
  font-size: 0.8125rem;
  color: hsl(var(--accent));
}

/* Point pulsant — même animation que .import-banner dans shared.css */
.revenu-banner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: hsl(var(--accent)); flex-shrink: 0;
  animation: revenu-dot-pulse 2s ease-in-out infinite;
}
@keyframes revenu-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.revenu-banner-label {
  font-weight: 500;
  color: hsl(var(--accent));
}

.revenu-banner-value {
  font-weight: 700;
  font-family: var(--font-mono);
  color: hsl(var(--accent));
}

.revenu-banner-hint {
  color: hsl(var(--accent));
  opacity: 0.75;
}

/* ─── Page Budget — Tabs (shadcn/ui TabsList / TabsTrigger) ─────────────── */

.budget-tabs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.budget-tabs-list {
  display: inline-flex;
  align-items: center;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 4px;
  gap: 2px;
  width: 100%;
}

.budget-tab-trigger {
  flex: 1;
  padding: 7px 14px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
}

.budget-tab-trigger:hover {
  color: hsl(var(--foreground));
}

.budget-tab-trigger.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.08), 0 1px 2px hsl(0 0% 0% / 0.04);
}

.budget-tab-trigger:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}

/* ─── Page Budget — Placeholders ────────────────────────────────────────── */

.placeholder-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
  color: hsl(var(--muted-foreground));
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  color: hsl(var(--muted-foreground));
}

.placeholder-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.placeholder-desc {
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  max-width: 380px;
  line-height: 1.6;
}

/* Mobile tabs */
@media (max-width: 520px) {
  .budget-tabs-list {
    flex-direction: column;
    width: 100%;
  }
  .budget-tab-trigger {
    width: 100%;
    text-align: left;
  }
}

/* ─── Page Budget — Layout 2 colonnes ───────────────────────────────────── */

.budget-grid {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.budget-col-inputs {
  flex: 0 0 360px;
}

.budget-col-summary {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 72px;
  align-self: flex-start;
}

/* Onglet Investissements : formulaire long → c'est la colonne droite (résultats) qui est sticky */
.budget-grid--invest .budget-col-inputs {
  position: static;
  align-self: auto;
}

/* ─── Page Budget — Résumé mensuel ──────────────────────────────────────── */

.budget-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.budget-summary-row--total {
  padding-top: 4px;
}

.budget-summary-label {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.budget-summary-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.budget-summary-value--total {
  font-size: 1rem;
}

.value-positive { color: hsl(73 38% 32%); }
html.dark .value-positive { color: hsl(73 38% 48%); }

.value-negative { color: hsl(var(--destructive)); }

.budget-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
}

/* ─── Page Budget — Badge taux d'épargne ────────────────────────────────── */

.badge-savings {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-savings--green {
  background: hsl(73 30% 92%);
  color: hsl(73 38% 20%);
  border-color: hsl(73 30% 76%);
}
html.dark .badge-savings--green {
  background: hsl(73 28% 16%);
  color: hsl(73 38% 58%);
  border-color: hsl(73 28% 26%);
}

.badge-savings--orange {
  background: hsl(35 45% 92%);
  color: hsl(32 80% 30%);
  border-color: hsl(35 45% 73%);
}
html.dark .badge-savings--orange {
  background: hsl(35 35% 18%);
  color: hsl(35 45% 62%);
  border-color: hsl(35 35% 28%);
}

.badge-savings--red {
  background: hsl(0 35% 94%);
  color: hsl(0 40% 35%);
  border-color: hsl(0 35% 76%);
}
html.dark .badge-savings--red {
  background: hsl(0 40% 18%);
  color: hsl(0 40% 60%);
  border-color: hsl(0 40% 28%);
}

.invest-cta-link {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.invest-cta-link:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--foreground) / 0.25);
}

/* ─── Page Budget — Responsive ──────────────────────────────────────────── */

@media (max-width: 820px) {
  .budget-grid {
    flex-direction: column;
  }
  .budget-col-inputs,
  .budget-col-summary {
    flex: none;
    width: 100%;
    position: static;
  }
}

/* ─── Page Investissements — Slider ─────────────────────────────────────── */

.inv-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: hsl(var(--muted-foreground) / 0.25);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  margin: 8px 0 4px;
  display: block;
}

.inv-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  cursor: pointer;
  border: 2px solid hsl(var(--background));
  box-shadow: 0 0 0 3px hsl(var(--foreground) / 0.18);
  transition: box-shadow 0.15s;
}

.inv-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  cursor: pointer;
  border: 2px solid hsl(var(--background));
  box-shadow: 0 0 0 3px hsl(var(--foreground) / 0.18);
}

.inv-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px hsl(var(--ring) / 0.3);
}

.inv-slider-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

.inv-duree-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

/* ─── Page Investissements — Comparatifs ────────────────────────────────── */

.inv-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.inv-compare-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inv-compare-card--featured {
  border-color: hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

.inv-compare-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.inv-compare-rate {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.inv-compare-capital {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin-top: 6px;
  word-break: break-word;
}

.inv-compare-gains {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

@media (max-width: 600px) {
  .inv-compare-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Tableau de bord : barres de progression 50/30/20 ─────────────────────── */

.db-progress-row {
  margin-bottom: 18px;
}

.db-progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.db-progress-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.db-progress-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.db-progress-nums {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.db-progress-target {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

.db-progress-pct {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 34px;
  text-align: right;
  color: hsl(var(--foreground));
}

.db-progress-track {
  position: relative;
  height: 8px;
  border-radius: 9999px;
  background: hsl(var(--muted));
  overflow: visible;
}

.db-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.35s ease;
  background: hsl(var(--primary));
}

.db-progress-fill.fill--good { background: hsl(73 38% 32%); }
.db-progress-fill.fill--warn { background: hsl(35 53% 54%);  }
.db-progress-fill.fill--bad  { background: hsl(0 40% 44%);   }

.dark .db-progress-fill.fill--good { background: hsl(73 38% 48%); }
.dark .db-progress-fill.fill--warn { background: hsl(35 53% 59%);  }
.dark .db-progress-fill.fill--bad  { background: hsl(0 40% 54%);   }

/* Marqueur de cible (trait vertical sur la barre) */
.db-progress-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: hsl(var(--muted-foreground) / 0.4);
  transform: translateX(-50%);
  pointer-events: none;
}

/* ─── Tableau de bord : alert recommandation ────────────────────────────────── */

.db-alert {
  display: none; /* caché par défaut tant que pas rempli par JS */
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  font-size: 0.82rem;
}

.db-alert[class*="db-alert--"] {
  display: flex;
}

.db-alert--danger {
  border-color: hsl(0 40% 44% / 0.3);
  background: hsl(0 40% 44% / 0.06);
}

.db-alert--warning {
  border-color: hsl(35 53% 54% / 0.35);
  background: hsl(35 53% 54% / 0.07);
}

.db-alert--success {
  border-color: hsl(73 38% 32% / 0.3);
  background: hsl(73 38% 32% / 0.07);
}

.dark .db-alert--danger  { border-color: hsl(0 40% 54% / 0.3);  background: hsl(0 40% 44% / 0.1); }
.dark .db-alert--warning { border-color: hsl(35 53% 59% / 0.35); background: hsl(35 53% 54% / 0.1); }
.dark .db-alert--success { border-color: hsl(73 38% 48% / 0.3); background: hsl(73 38% 32% / 0.1); }

.db-alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.db-alert--danger  .db-alert-icon { color: hsl(0 40% 44%); }
.db-alert--warning .db-alert-icon { color: hsl(35 53% 54%); }
.db-alert--success .db-alert-icon { color: hsl(73 38% 32%); }

.dark .db-alert--danger  .db-alert-icon { color: hsl(0 40% 54%); }
.dark .db-alert--warning .db-alert-icon { color: hsl(35 53% 59%); }
.dark .db-alert--success .db-alert-icon { color: hsl(73 38% 48%); }

.db-alert-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: hsl(var(--foreground));
  margin: 0 0 3px;
}

.db-alert-desc {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.55;
}

/* ─── Bouton Tout réinitialiser ─────────────────────────────────────────────── */

.btn-reset-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-reset-all:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.dark .btn-reset-all {
  color: hsl(0 40% 54%);
  border-color: hsl(0 40% 54% / 0.3);
}

.dark .btn-reset-all:hover {
  background: hsl(0 40% 44% / 0.12);
  border-color: hsl(0 40% 54% / 0.5);
}

/* ─── Texte SEO discret sous chaque onglet ──────────────────────────────────── */

.seo-note {
  margin-top: 28px;
  font-size: 0.75rem;
  line-height: 1.65;
  color: hsl(var(--muted-foreground) / 0.7);
  max-width: 110ch;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ─── CTA Investissements ───────────────────────────────────────────────────── */
.invest-cta-card {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 20px;
  background: hsl(var(--muted));
  text-align: center;
  margin-top: 12px;
  animation: fadeInUp 0.25s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.invest-cta-icon { font-size: 1.4rem; margin-bottom: 8px; }
.invest-cta-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}
.invest-cta-desc {
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  margin-bottom: 14px;
}
.invest-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  height: 38px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
}
.invest-cta-btn:hover { opacity: 0.82; }

/* ─── Maillage interne index ────────────────────────────────────────────────── */
.seo-links-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid hsl(var(--border));
}
.seo-links-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 16px;
}
.seo-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.seo-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.seo-link-card:hover {
  border-color: hsl(var(--foreground) / 0.2);
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.05);
}
.seo-link-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.seo-link-desc {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

/* ─── Section SEO page principale ──────────────────────────────────────────── */

.seo-section {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.seo-block {
  max-width: 72ch;
  margin: 0 auto;
  text-align: center;
}

.seo-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 10px;
}

.seo-text {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.seo-text strong {
  color: hsl(var(--foreground));
  font-weight: 500;
}

/* ─── Barres horizontales — Répartition des dépenses ────────────────────────── */

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.bar-label {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.budget-bar-track {
  height: 5px;
  background: hsl(var(--muted));
  border-radius: 9999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: hsl(var(--foreground) / 0.35);
  border-radius: 9999px;
  transition: width 0.35s ease;
}

.bar-meta {
  display: flex;
  gap: 7px;
  align-items: baseline;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  white-space: nowrap;
}

.bar-pct {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

/* ─── Onglet Investissements — Répartiteur ──────────────────────────────────── */

/* Banner bilan épargne */
.inv-epargne-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: hsl(var(--muted));
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 14px;
}

.inv-epargne-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inv-epargne-row strong {
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.inv-epargne-row--sub {
  opacity: 0.75;
}

.inv-epargne-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: 3px 0;
}

/* Répartiteur */
.rp-header-row {
  display: grid;
  grid-template-columns: 1fr 96px 66px;
  gap: 8px;
  margin-bottom: 4px;
}

.rp-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-row {
  display: grid;
  grid-template-columns: 1fr 96px 66px;
  align-items: center;
  gap: 8px;
}

.rp-name {
  font-size: 0.82rem;
  color: hsl(var(--foreground));
}

.rp-rate-wrap {
  width: 66px !important;
  flex-shrink: 0;
}

.rp-rate-input {
  font-size: 0.78rem !important;
  font-weight: 600;
  padding-left: 6px !important;
  padding-right: 2px !important;
  font-variant-numeric: tabular-nums;
}

.rp-footnote {
  margin-top: 10px;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  opacity: 0.8;
}

.rp-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.rp-footer-row strong {
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

/* ─── Bouton "remplir Livret A" ─────────────────────────────────────────────── */

.rp-fill-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  font-size: 0.7rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.rp-fill-btn:hover:not(:disabled) {
  background: hsl(var(--muted));
}

.rp-fill-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.dark .rp-fill-btn {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.rp-fill-btn[data-state="negative"] {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.rp-fill-btn[data-state="negative"]:hover {
  background: hsl(var(--muted));
}
.dark .rp-fill-btn[data-state="negative"] {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.dark .rp-fill-btn:hover:not(:disabled) {
  background: hsl(73 28% 20%);
}

/* ── Panneaux véhicules dépliables (PER + tous véhicules) ──────────────── */

.vehicle-toggle-btn, .per-affiner-btn {
  background: none;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.vehicle-toggle-btn:hover, .per-affiner-btn:hover { color: hsl(var(--foreground)); }
.vehicle-toggle-btn[aria-expanded="true"],
.per-affiner-btn[aria-expanded="true"] { transform: rotate(180deg); color: hsl(var(--foreground)); }

.vehicle-panel, .per-panel {
  display: none;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  margin: 0 0 4px;
  animation: per-slide-in 0.18s ease;
}
.dark .vehicle-panel, .dark .per-panel { background: hsl(240 6% 11%); }

@keyframes per-slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vehicle-panel-inner, .per-panel-inner {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vehicle-result-row, .per-import-row, .per-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  gap: 8px;
}
.vehicle-result-row strong, .per-import-row strong, .per-result-row strong {
  color: hsl(var(--foreground)); font-variant-numeric: tabular-nums;
}
.vehicle-result-row strong.green, .per-result-row strong.green { color: hsl(73 38% 32%); }
.dark .vehicle-result-row strong.green, .dark .per-result-row strong.green { color: hsl(73 38% 52%); }
.vehicle-result-row strong.warn { color: hsl(0 40% 44%); }
.dark .vehicle-result-row strong.warn { color: hsl(0 40% 58%); }

.per-import-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  background: hsl(73 38% 32% / 0.08);
  border: 1px solid hsl(73 38% 32% / 0.18);
  border-radius: 6px;
  padding: 7px 10px;
}
.dark .per-import-banner { background: hsl(73 38% 20% / 0.15); border-color: hsl(73 38% 20% / 0.25); }

.vehicle-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 0.76rem;
  color: hsl(var(--muted-foreground));
}
.vehicle-info-grid strong { color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }

.vehicle-note {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.8;
  line-height: 1.45;
}

.per-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.per-progress-label, .vehicle-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}
.per-progress-bar, .vehicle-progress-bar {
  height: 6px;
  background: hsl(var(--border));
  border-radius: 99px;
  overflow: hidden;
}
.per-progress-fill, .vehicle-progress-fill {
  height: 100%;
  background: hsl(258 28% 52%);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.per-progress-fill.over, .vehicle-progress-fill.over { background: hsl(0 40% 44%); }

.per-compare-table, .vehicle-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}
.per-compare-table th, .vehicle-compare-table th {
  text-align: right;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  padding: 0 0 4px;
  border-bottom: 1px solid hsl(var(--border));
}
.per-compare-table th:first-child, .vehicle-compare-table th:first-child { text-align: left; }
.per-compare-table td, .vehicle-compare-table td {
  padding: 4px 0;
  text-align: right;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}
.per-compare-table td:first-child, .vehicle-compare-table td:first-child { text-align: left; color: hsl(var(--foreground)); }
.per-compare-table td.highlight, .vehicle-compare-table td.highlight { color: hsl(73 38% 32%); font-weight: 600; }
.dark .per-compare-table td.highlight, .dark .vehicle-compare-table td.highlight { color: hsl(73 38% 52%); }
.per-compare-table tr:last-child td, .vehicle-compare-table tr:last-child td { border-bottom: none; }

.per-no-data-hint, .vehicle-no-data-hint {
  font-size: 0.74rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  padding: 4px 0 2px;
}
.per-no-data-hint a, .vehicle-no-data-hint a { color: hsl(258 28% 52%); text-decoration: none; }
.per-no-data-hint a:hover, .vehicle-no-data-hint a:hover { text-decoration: underline; }

/* ── SCPI — bloc patrimoine hero ─────────────────────────────────────────── */
.scpi-patrimoine-hero {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 16px 18px;
  text-align: center;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.scpi-patrimoine-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin: 0;
}
.scpi-patrimoine-value {
  font-size: clamp(0.95rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.scpi-patrimoine-sub {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  margin: 2px 0 0;
}

/* Livret A — taux non modifiable */
.rp-rate-input--livret {
  pointer-events: none;
  opacity: 0.6;
  cursor: default;
}


/* ============================================================
   Barre sticky mobile — résultats clés fixés en bas d'écran
   ============================================================ */

.mobile-sticky {
  display: none;
}

@media (max-width: 820px) {
  .mobile-sticky {
    display: flex;
    align-items: center;
    gap: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    padding: 10px 16px;
    z-index: 200;
    box-shadow: 0 -2px 16px hsl(0 0% 0% / 0.08);
  }

  .mobile-sticky.hidden {
    display: none;
  }

  .mobile-sticky-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }

  .mobile-sticky-label {
    font-size: 0.68rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-sticky-value {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.2;
  }

  .mobile-sticky-sep {
    width: 1px;
    height: 32px;
    background: hsl(var(--border));
    margin: 0 16px;
    flex-shrink: 0;
  }

  .mobile-sticky-cta {
    font-size: 0.78rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    flex-shrink: 0;
  }

  /* Padding pour que le contenu ne passe pas sous la barre sticky */
  body.has-sticky-results {
    padding-bottom: 64px;
  }
}

/* ============================================================
   Histogramme comparatif salaires France
   ============================================================ */

.compare-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.compare-row:last-child { margin-bottom: 0; }

.compare-label {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.compare-label--you {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.compare-bar-wrap {
  background: hsl(var(--muted));
  border-radius: 4px;
  overflow: hidden;
  height: 8px;
}
.compare-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.compare-bar--you { background: hsl(73 38% 40%); }
.compare-bar--ref { background: hsl(var(--muted-foreground) / 0.3); }
.dark .compare-bar--you { background: hsl(73 38% 55%); }

.compare-value {
  font-size: 0.79rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .compare-row {
    grid-template-columns: 90px 1fr auto;
    gap: 8px;
  }
  .compare-label { font-size: 0.74rem; }
  .compare-value { font-size: 0.74rem; }
}

/* ============================================================
   Panneau calcul inversé (discret, hors formulaire)
   ============================================================ */

.reverse-trigger {
  margin-top: 10px;
  text-align: center;
}

.reverse-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dashed;
  padding: 4px 0;
  transition: color 0.15s;
}
.reverse-link:hover { color: hsl(var(--foreground)); }

.reverse-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--accent));
}

.reverse-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.reverse-panel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.reverse-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.reverse-close:hover { background: hsl(var(--muted)); }

.reverse-result {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.82rem;
}
.reverse-result strong { font-size: 0.95rem; }

/* ============================================================
   Percentile salaires France
   ============================================================ */

.percentile-display {
  text-align: center;
}

.percentile-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.percentile-number {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  color: hsl(73 38% 38%);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dark .percentile-number { color: hsl(73 38% 60%); }

.percentile-pct-sign {
  font-size: 1.4rem;
  font-weight: 600;
  color: hsl(73 38% 38%);
}
.dark .percentile-pct-sign { color: hsl(73 38% 60%); }

.percentile-label {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  margin: 0 0 16px;
  line-height: 1.4;
}

.percentile-track {
  position: relative;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 6px;
}

.percentile-fill {
  height: 100%;
  border-radius: 4px;
  background: hsl(73 38% 40%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .percentile-fill { background: hsl(73 38% 55%); }

.percentile-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: hsl(73 38% 40%);
  border: 2px solid hsl(var(--card));
  box-shadow: 0 1px 4px hsl(0 0% 0% / 0.15);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .percentile-dot { background: hsl(73 38% 55%); }

.percentile-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

/* ============================================================
   Net card inline edit (calcul inversé contextuel)
   ============================================================ */

.net-item--editable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.net-item--editable:hover {
  background: hsl(var(--accent));
}
.net-item--editable:active {
  background: hsl(var(--muted));
}
.net-item--editable:focus-visible {
  outline: 2px solid hsl(var(--foreground) / 0.4);
  outline-offset: 2px;
}

.net-edit-hint {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin: 6px 0 0;
  padding: 0 16px 12px;
  opacity: 0;
  transition: opacity 0.2s;
}
.net-card:hover .net-edit-hint { opacity: 1; }

/* Sur écran tactile : affordance toujours visible */
@media (hover: none) {
  .net-edit-hint {
    opacity: 1;
  }
  .net-item--editable {
    border: 1px dashed hsl(var(--border));
  }
  .net-edit-actions .btn-primary,
  .net-edit-cancel-btn {
    height: 44px;
    font-size: 0.88rem;
  }
}

.net-edit-panel {
  padding: 12px 16px 16px;
}

.net-edit-input-row { margin-bottom: 10px; }

.net-edit-result {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.net-edit-result strong { font-size: 0.95rem; }
.net-edit-sep {
  color: hsl(var(--muted-foreground));
  margin: 0 3px;
}

.net-edit-actions {
  display: flex;
  gap: 8px;
}

.net-edit-cancel-btn {
  flex: 1;
  height: 36px;
  background: none;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  transition: background 0.15s;
}
.net-edit-cancel-btn:hover { background: hsl(var(--muted)); }

.net-edit-actions .btn-primary { flex: 2; }

/* ─── FAQ Section (index.html) ─────────────────────────────────────────── */
.faq-section {
  max-width: 860px;
  margin: 48px auto 0;
  padding: 0 16px;
}

.faq-title {
  font-size: clamp(1.1rem, 3vw + 0.4rem, 1.4rem);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 24px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--card));
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 16px;
  color: hsl(var(--muted-foreground));
  font-size: 0.88rem;
  line-height: 1.65;
}

.faq-answer p { margin: 0; }

@media (max-width: 820px) {
  .faq-section { margin-top: 32px; }
  .faq-question { padding: 14px 16px; font-size: 0.9rem; }
  .faq-answer { padding: 0 16px 14px; }
}

/* ─── Utilitaires inline → CSS (migration styles inline) ───────────────── */

/* Navbar logo */
.navbar-logo { border-radius: 5px; display: block; }

/* Hints de formulaire */
.field-hint--top { margin-top: 4px; }
.field-hint--xs  { margin-top: 2px; }

/* Label période sans margin-bottom */
.period-salary-label { margin-bottom: 0; }

/* Champ salaire avec margin-top */
.field--salary { margin-top: 8px; }

/* Input-wrap avec margin-top (champs detail panel) */
.field-input-wrap--sm { margin-top: 6px; }

/* Bouton "Appliquer" compact */
.btn-primary--sm { height: 36px; font-size: 0.82rem; }

/* Card-content avec padding fixe */
.card-content--padded { padding: 20px; }

/* KPI featured pleine largeur */
.kpi-featured--full { grid-column: 1 / -1; }

/* Centrer la dernière KPI card si elle est seule sur sa ligne (nombre impair) */
.kpi-grid > .kpi-card:last-child:nth-child(even) {
  grid-column: 1 / -1;
  max-width: calc(50% - 6px);
  justify-self: center;
}

/* Source hint percentile */
.percentile-source-hint { margin-top: 10px; text-align: center; }

/* Statut display (cadre/non-cadre) dans bar-card */
.statut-display-hint { text-align: center; margin-top: 6px; }


/* ============================================================
   ARTICLE PAGES — styles partagés entre tous les articles
   Préfixe .article-page requis sur <body> des articles
   pour isoler les sélecteurs génériques (p, h2, table, etc.)
   ============================================================ */

/* ── Layout ── */
.article-wrap,
.article-page .page {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Fil d'Ariane (breadcrumb) ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: hsl(var(--muted-foreground)); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.breadcrumb a:hover { color: hsl(var(--foreground)); }

/* ── Méta article (badges + date) ── */
.article-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.badge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ── Badge (variantes articles) ── */
.badge-green { background: hsl(var(--green-muted)); color: hsl(var(--green-muted-fg)); border-color: hsl(var(--green-muted-fg) / 0.2); }
.badge-amber, .badge-orange { background: hsl(38 92% 50% / 0.12); color: hsl(32 95% 40%); }
html.dark .badge-amber, html.dark .badge-orange { background: hsl(38 92% 50% / 0.18); color: hsl(38 92% 65%); }
.badge-red { background: hsl(0 40% 94%); color: hsl(0 50% 38%); }
html.dark .badge-red { background: hsl(0 40% 18%); color: hsl(0 50% 65%); }
.badge-date { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: 0.72rem; font-weight: 500; padding: 3px 9px; border-radius: 99px; }

/* ── Header article ── */
.article-header { border-bottom: 1px solid hsl(var(--border)); padding-bottom: 24px; margin-bottom: 32px; }
.article-title { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 700; letter-spacing: -0.028em; line-height: 1.2; margin-bottom: 10px; }
.article-desc,
.article-intro { font-size: 0.95rem; color: hsl(var(--muted-foreground)); line-height: 1.75; }

/* ── Typographie générale (scopée .article-page) ── */
.article-page h2,
.section-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.015em; color: hsl(var(--foreground)); margin: 32px 0 12px; padding-top: 4px; }
.article-page p { font-size: 0.9rem; color: hsl(var(--muted-foreground)); line-height: 1.75; margin-bottom: 12px; }
.article-page ul { padding-left: 20px; margin-bottom: 12px; }
.article-page ul li { font-size: 0.9rem; color: hsl(var(--muted-foreground)); line-height: 1.7; margin-bottom: 6px; }
.article-page strong { color: hsl(var(--foreground)); }
.section-subtitle { font-size: 0.9rem; font-weight: 600; color: hsl(var(--foreground)); margin: 16px 0 8px; }
.section { margin-bottom: 36px; }

/* ── TOC (table des matières) ── */
.toc { background: hsl(var(--muted)); border-radius: calc(var(--radius) + 2px); padding: 16px 20px; margin-bottom: 32px; }
.toc-title { font-size: 0.8rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.toc ol { padding-left: 18px; }
.toc li { font-size: 0.875rem; line-height: 1.6; }
.toc a { color: hsl(var(--primary)); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ── Callout ── */
.callout { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 12px 16px; margin: 16px 0; display: flex; gap: 10px; align-items: flex-start; background: hsl(var(--muted)); }
.callout-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.6; }
.callout p { margin: 0; font-size: 0.85rem; }

/* ── Tranches visuelles (barème) ── */
.tranches-visual { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); overflow: hidden; margin: 20px 0; background: hsl(var(--card)); }
.tranche-row { display: grid; grid-template-columns: 1fr 80px 80px; align-items: center; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); gap: 12px; }
.tranche-row:last-child { border-bottom: none; }
.tranche-row.header { background: hsl(var(--muted)); padding: 8px 16px; }
.tranche-row.header span { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); }
.tranche-range { font-size: 0.875rem; font-family: var(--font-mono); color: hsl(var(--foreground)); font-weight: 500; }
.tranche-rate { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; text-align: center; }
.tranche-rate.t0 { color: hsl(var(--muted-foreground)); }
.tranche-rate.t11 { color: hsl(209 54% 42%); }
.tranche-rate.t30 { color: hsl(209 54% 36%); }
.tranche-rate.t41 { color: hsl(25 80% 44%); }
.tranche-rate.t45 { color: hsl(0 50% 44%); }
html.dark .tranche-rate.t11 { color: hsl(209 60% 68%); }
html.dark .tranche-rate.t30 { color: hsl(var(--blue-muted-fg)); }
html.dark .tranche-rate.t41 { color: hsl(var(--amber-muted-fg)); }
html.dark .tranche-rate.t45 { color: hsl(0 50% 65%); }
.tranche-bar-col { display: flex; align-items: center; }
.tranche-bar-track { flex: 1; height: 6px; background: hsl(var(--muted)); border-radius: 9999px; overflow: hidden; }
.tranche-bar-fill { height: 100%; border-radius: 9999px; }

/* ── Stack bar (répartition) ── */
.stack-bar { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 20px; margin: 20px 0; background: hsl(var(--card)); }
.stack-bar-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin-bottom: 14px; }
.stack-track { height: 32px; border-radius: 6px; display: flex; overflow: hidden; gap: 2px; margin-bottom: 16px; }
.stack-seg { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; transition: flex 0.3s; white-space: nowrap; overflow: hidden; }
.stack-legend { display: flex; flex-direction: column; gap: 8px; }
.stack-legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; gap: 8px; }
.stack-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.stack-legend-label { flex: 1; color: hsl(var(--muted-foreground)); }
.stack-legend-value { font-family: var(--font-mono); font-weight: 600; color: hsl(var(--foreground)); font-size: 0.82rem; }

/* ── Calc chain (étapes de calcul — famille A) ── */
.calc-chain { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); overflow: hidden; margin: 20px 0; background: hsl(var(--card)); }
.calc-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); gap: 12px; }
.calc-row:last-child { border-bottom: none; }
.calc-op { width: 28px; height: 28px; border-radius: 50%; border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
.calc-label strong { display: block; font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); }
.calc-label span { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.calc-value { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; text-align: right; white-space: nowrap; color: hsl(var(--muted-foreground)); }
.calc-row.result { background: hsl(var(--featured-bg)); }
.calc-row.result .calc-label strong,
.calc-row.result .calc-value { color: hsl(var(--featured-fg)); }
.calc-row.result .calc-label span { color: hsl(var(--featured-fg) / 0.6); }

/* ── Calc chain (famille B — steps numérotés) ── */
.calc-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); }
.calc-step:last-child { border-bottom: none; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.step-content { flex: 1; }
.step-label { font-size: 0.82rem; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 2px; }
.step-detail { font-size: 0.78rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.step-amount { font-size: 0.875rem; font-weight: 700; color: hsl(var(--primary)); white-space: nowrap; padding-left: 12px; }
html.dark .step-amount { color: hsl(var(--foreground)); }

/* ── Table (scopée .article-page) ── */
.article-page .table-wrap { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; }
.article-page table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: hsl(var(--card)); min-width: 420px; }
.article-page thead,
.article-page thead th { padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
.article-page tbody td { padding: 10px 14px; border-bottom: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); vertical-align: middle; }
.article-page tbody tr:last-child td { border-bottom: none; }
.article-page tbody tr:hover td,
.article-page tr:hover td { background: hsl(var(--muted) / 0.5); }
.article-page td strong { color: hsl(var(--foreground)); font-weight: 500; }
.article-page td.mono { font-family: var(--font-mono); color: hsl(var(--foreground)); font-weight: 600; }
.article-page .row-total td { background: hsl(var(--muted)); font-weight: 600; color: hsl(var(--foreground)); }
.article-page th { padding: 10px 14px; text-align: left; font-size: 0.78rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.article-page td { padding: 10px 14px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); vertical-align: middle; }
.td-key { font-weight: 600; color: hsl(var(--foreground)); }
.td-good { color: hsl(142 70% 38%); font-weight: 600; }
.td-bad { color: hsl(0 72% 51%); font-weight: 600; }
.td-warn { color: hsl(32 95% 44%); font-weight: 600; }
.td-neutral { color: hsl(var(--muted-foreground)); }
html.dark .td-good { color: hsl(142 60% 52%); }
html.dark .td-bad { color: hsl(0 72% 65%); }
html.dark .td-warn { color: hsl(38 92% 65%); }
.row-section td { background: hsl(var(--muted)); font-size: 0.75rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 14px; }

/* ── FAQ (scopée .article-page) ── */
.article-page details { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); margin: 6px 0; overflow: hidden; background: hsl(var(--card)); }
.article-page summary { padding: 12px 16px; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: background 0.12s; user-select: none; min-height: 44px; }
.article-page summary::-webkit-details-marker { display: none; }
.article-page summary:hover { background: hsl(var(--muted)); }
.article-page summary::after { content: '+'; font-size: 1.1rem; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
.article-page details[open] summary::after { content: '−'; }
.article-page details[open] summary { border-bottom: 1px solid hsl(var(--border)); }
.article-page .faq-list { gap: 6px; margin: 12px 0; }
.faq-body { padding: 12px 16px; font-size: 0.86rem; color: hsl(var(--muted-foreground)); line-height: 1.7; }
.faq-body strong { color: hsl(var(--foreground)); }
.details-body { padding: 12px 16px 14px; font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.7; border-top: 1px solid hsl(var(--border)); }
.article-page .faq-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid hsl(var(--border)); }
.article-page .faq-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

/* ── CTA bloc ── */
.cta { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 24px; text-align: center; background: hsl(var(--muted)); margin: 32px 0; }
.cta h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.cta p { font-size: 0.85rem; color: hsl(var(--muted-foreground)); margin-bottom: 16px; }
.cta-block { background: hsl(var(--featured-bg)); border-radius: calc(var(--radius) + 4px); padding: 28px 24px; text-align: center; margin: 40px 0 0; }
html.dark .cta-block { background: hsl(240 6% 10%); }
.cta-title { font-size: 1.05rem; font-weight: 700; color: hsl(var(--featured-fg)); margin-bottom: 6px; }
.cta-sub { font-size: 0.85rem; color: hsl(0 0% 65%); margin-bottom: 18px; }
html.dark .cta-sub { color: hsl(var(--muted-foreground)); }

/* ── Encadré déficit foncier (article spécifique) ── */
.deficit-box { background: hsl(var(--featured-bg)); color: hsl(var(--featured-fg)); border-radius: calc(var(--radius) + 2px); padding: 20px 24px; margin: 16px 0; text-align: center; }
html.dark .deficit-box { background: hsl(240 6% 12%); }
.deficit-main { font-size: 1rem; font-weight: 700; line-height: 1.6; }
.deficit-sub { font-size: 0.8rem; color: hsl(0 0% 65%); margin-top: 6px; }
html.dark .deficit-sub { color: hsl(var(--muted-foreground)); }

/* ── Footer (scopé .article-page) ── */
.article-page footer { border-top: 1px solid hsl(var(--border)); padding: 20px 24px; text-align: center; font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.article-page footer a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.article-page footer a:hover { color: hsl(var(--foreground)); }

/* ── Highlight numbers ── */
.highlight-row { display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.highlight-card { flex: 1; min-width: 140px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 14px 16px; background: hsl(var(--card)); text-align: center; }
.hl-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; color: hsl(var(--primary)); }
html.dark .hl-num { color: hsl(var(--foreground)); }
.hl-label { font-size: 0.78rem; color: hsl(var(--muted-foreground)); margin-top: 4px; line-height: 1.4; }

/* ── Formula box ── */
.formula-box { background: hsl(var(--featured-bg)); color: hsl(var(--featured-fg)); border-radius: calc(var(--radius) + 2px); padding: 20px 24px; margin: 16px 0; text-align: center; }
html.dark .formula-box { background: hsl(240 6% 12%); }
.formula-main { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.7; }
.formula-sub { font-size: 0.8rem; color: hsl(0 0% 68%); margin-top: 6px; }
html.dark .formula-sub { color: hsl(var(--muted-foreground)); }

/* ── Info cards ── */
.info-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 14px 18px; background: hsl(var(--card)); margin: 14px 0; }
.info-card.amber { border-left: 3px solid hsl(38 92% 50%); }
.info-card.blue { border-left: 3px solid hsl(209 54% 50%); }
.info-card.green { border-left: 3px solid hsl(142 70% 38%); }
.info-card.red { border-left: 3px solid hsl(0 72% 51%); }
.info-title { font-size: 0.82rem; font-weight: 700; color: hsl(var(--foreground)); margin-bottom: 4px; }
.info-body { font-size: 0.82rem; color: hsl(var(--muted-foreground)); line-height: 1.6; }

/* ── Checklist ── */
.checklist { list-style: none; margin: 12px 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.6; padding: 6px 0; border-bottom: 1px solid hsl(var(--border) / 0.6); }
.checklist li:last-child { border-bottom: none; }
.check-icon { flex-shrink: 0; margin-top: 2px; }
.check-yes { color: hsl(142 70% 38%); }
.check-no { color: hsl(0 72% 51%); }
html.dark .check-yes { color: hsl(142 60% 52%); }
html.dark .check-no { color: hsl(0 72% 65%); }

/* ── PFU Split bar ── */
.split-bar-wrap { margin: 16px 0; }
.split-bar { display: flex; border-radius: calc(var(--radius) + 2px); overflow: hidden; height: 44px; }
.split-seg { display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 700; color: #fff; gap: 4px; }
.seg-ir { background: hsl(209 54% 36%); flex: 12.8; }
.seg-ps { background: hsl(209 54% 56%); flex: 17.2; }
html.dark .seg-ir { background: hsl(209 54% 45%); }
html.dark .seg-ps { background: hsl(209 54% 62%); }
.split-labels { display: flex; margin-top: 6px; gap: 16px; flex-wrap: wrap; }
.split-label { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.split-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dot-ir { background: hsl(209 54% 36%); }
.dot-ps { background: hsl(209 54% 56%); }

/* ── Compare grid ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.compare-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 16px 18px; background: hsl(var(--card)); }
.compare-card.featured { background: hsl(var(--featured-bg)); border-color: transparent; }
.compare-card.featured .card-title { color: hsl(var(--featured-fg)); }
.compare-card.featured .card-body { color: hsl(0 0% 75%); }
html.dark .compare-card.featured { background: hsl(240 6% 10%); }
.card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; color: hsl(var(--foreground)); }
.card-rate { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: hsl(var(--primary)); margin-bottom: 6px; }
.card-body { font-size: 0.82rem; color: hsl(var(--muted-foreground)); line-height: 1.6; }
.card-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid hsl(var(--border) / 0.6); font-size: 0.82rem; }
.card-row:last-child { border-bottom: none; }
.cr-label { color: hsl(var(--muted-foreground)); }
.cr-val { font-weight: 600; color: hsl(var(--foreground)); }

/* ── Levier cards (optimisation fiscale) ── */
.levier-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.levier-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); overflow: hidden; background: hsl(var(--card)); }
.levier-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.5); }
.levier-num { width: 28px; height: 28px; border-radius: 50%; background: hsl(var(--primary)); color: #fff; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.levier-name { font-size: 0.95rem; font-weight: 700; color: hsl(var(--foreground)); flex: 1; }
.levier-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.lb-deduction { background: hsl(209 54% 36% / 0.12); color: hsl(209 54% 36%); }
.lb-reduction { background: hsl(142 70% 38% / 0.12); color: hsl(142 60% 32%); }
.lb-credit { background: hsl(38 92% 50% / 0.12); color: hsl(32 95% 40%); }
html.dark .lb-deduction { background: hsl(209 54% 50% / 0.2); color: hsl(209 54% 72%); }
html.dark .lb-reduction { background: hsl(142 60% 38% / 0.2); color: hsl(142 60% 55%); }
html.dark .lb-credit { background: hsl(38 92% 50% / 0.2); color: hsl(38 92% 65%); }
.levier-body { padding: 14px 18px; }
.levier-desc { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.7; margin-bottom: 10px; }
.levier-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.lm-item { font-size: 0.78rem; }
.lm-key { color: hsl(var(--muted-foreground)); display: block; margin-bottom: 1px; }
.lm-val { font-weight: 600; color: hsl(var(--foreground)); }

/* ── Impact bars ── */
.impact-section { margin: 16px 0; }
.impact-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.impact-label { font-size: 0.8rem; color: hsl(var(--muted-foreground)); width: 130px; flex-shrink: 0; text-align: right; }
.impact-bar-wrap { flex: 1; background: hsl(var(--muted)); border-radius: 4px; height: 24px; overflow: hidden; }
.impact-bar { height: 100%; background: hsl(var(--primary)); border-radius: 4px; display: flex; align-items: center; padding-left: 8px; }
html.dark .impact-bar { background: hsl(209 54% 45%); }
.impact-val { font-size: 0.75rem; font-weight: 700; color: #fff; white-space: nowrap; }
.impact-saving { font-size: 0.78rem; font-weight: 600; color: hsl(142 70% 38%); width: 60px; text-align: right; }
html.dark .impact-saving { color: hsl(142 60% 52%); }

/* ── Articles liés (maillage interne) ── */
.related-articles { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 20px 24px; margin: 32px 0; background: hsl(var(--card)); }
.related-articles h3 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin-bottom: 14px; }
.related-links { display: flex; flex-direction: column; gap: 8px; }
.related-link { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: hsl(var(--primary)); text-decoration: none; padding: 6px 0; border-bottom: 1px solid hsl(var(--border) / 0.6); }
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: hsl(var(--foreground)); }
.related-link::before { content: '→'; font-size: 0.8rem; opacity: 0.6; flex-shrink: 0; }

/* ── Responsive articles ── */
@media (max-width: 600px) {
  .article-wrap,
  .article-page .page { padding: 24px 16px 60px; }
  .tranche-row { grid-template-columns: 1fr 60px; }
  .tranche-bar-col { display: none; }
  .calc-row { grid-template-columns: 28px 1fr; }
  .calc-value { display: none; }
  .article-page summary { min-height: 44px; }
  .compare-grid { grid-template-columns: 1fr; }
  .formula-main { font-size: 0.95rem; }
  .split-seg { font-size: 0.75rem; }
  .impact-label { width: 90px; font-size: 0.72rem; }
  .levier-meta { gap: 12px; }
  .taux-grid { grid-template-columns: 1fr; }
}

/* =============================================
   MUTUELLE-ENTREPRISE — composants spécifiques
   ============================================= */

/* Schéma répartition mutuelle (variante simple) */
.split-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 20px; background: hsl(var(--card)); margin: 20px 0; }
.split-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin-bottom: 16px; }
.split-legend { display: flex; gap: 20px; flex-wrap: wrap; }
.split-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: hsl(var(--muted-foreground)); }

/* Flux réintégration fiscale */
.reint-flow { display: flex; flex-direction: column; gap: 0; margin: 20px 0; }
.reint-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); margin-bottom: -1px; }
.reint-row:first-child { border-radius: calc(var(--radius) + 2px) calc(var(--radius) + 2px) 0 0; }
.reint-row:last-child { border-radius: 0 0 calc(var(--radius) + 2px) calc(var(--radius) + 2px); border-bottom: 1px solid hsl(var(--border)); }
.reint-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
.reint-label { flex: 1; }
.reint-label strong { display: block; font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); }
.reint-label span { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.reint-tag { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 9999px; white-space: nowrap; }
.tag-green { background: hsl(var(--green-muted)); color: hsl(var(--green-muted-fg)); }
.tag-red { background: hsl(0 40% 94%); color: hsl(0 50% 38%); }
html.dark .tag-red { background: hsl(0 40% 18%); color: hsl(0 50% 65%); }
.tag-neutral { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

/* Cellules tableau yes/no/green */
.article-page td.yes { color: hsl(var(--green-muted-fg)); font-weight: 600; }
.article-page td.no { color: hsl(var(--destructive)); font-weight: 500; }
.article-page td.green { color: hsl(var(--green-muted-fg)); font-weight: 500; }

/* =============================================
   EPARGNE-SALARIALE — composants spécifiques
   ============================================= */

/* Comparatif PEE vs PER (variante epargne) */
.compare-key { color: hsl(var(--muted-foreground)); }
.compare-val { font-weight: 600; color: hsl(var(--foreground)); text-align: right; }

/* Barre abondement employeur */
.abond-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 20px; background: hsl(var(--card)); margin: 20px 0; }
.abond-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin-bottom: 16px; }
.abond-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.abond-label { font-size: 0.82rem; color: hsl(var(--muted-foreground)); width: 100px; flex-shrink: 0; }
.abond-bar-track { flex: 1; height: 22px; background: hsl(var(--muted)); border-radius: 4px; overflow: hidden; }
.abond-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 0.72rem; font-weight: 600; color: white; }
.abond-amount { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: hsl(var(--foreground)); width: 60px; text-align: right; flex-shrink: 0; }

/* =============================================
   PRELEVEMENT-A-LA-SOURCE — composants spécifiques
   ============================================= */

/* Timeline annuelle PAS */
.timeline { position: relative; margin: 20px 0; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: hsl(var(--border)); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-dot { position: absolute; left: -20px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: hsl(var(--card)); border: 2px solid hsl(var(--border)); }
.tl-dot.active { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.tl-month { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); margin-bottom: 2px; }
.tl-text { font-size: 0.875rem; color: hsl(var(--foreground)); font-weight: 500; }
.tl-sub { font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-top: 2px; }

/* Cartes taux PAS (3 colonnes) */
.taux-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.taux-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 14px; background: hsl(var(--card)); }
.taux-card-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); margin-bottom: 8px; }
.taux-card-title { font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 6px; }
.taux-card-desc { font-size: 0.78rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }

/* ─── Maillage interne articles (related-articles) ──────────────────────── */
.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid hsl(var(--border));
}

.related-title {
  font-size: clamp(0.95rem, 2vw + 0.4rem, 1.1rem);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 16px;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
  background: hsl(var(--card));
  transition: background 0.15s, border-color 0.15s;
}

.related-link:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--muted-foreground) / 0.3);
}

.related-link--cta {
  color: hsl(var(--muted-foreground));
  border-style: dashed;
}

/* ── Article date visible ── */
.article-date {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* ── Encadré "En bref" (answer box) ── */
.answer-box {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 1rem 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  margin-bottom: 2rem;
  font-size: 0.97rem;
  line-height: 1.6;
}

/* ── Section sources officielles ── */
.sources-officielles {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.9rem;
}
.sources-officielles ul {
  list-style: none;
  padding: 0;
}
.sources-officielles li::before {
  content: "↗ ";
  color: hsl(var(--muted-foreground));
}

/* ── Emprunt — spécifiques ──────────────────────────────────────── */
:root {
  --bar-emprunt: 209 39% 44%;
  --bar-ravie:   73 38% 35%;
}
html.dark {
  --bar-emprunt: 209 39% 58%;
  --bar-ravie:   73 38% 50%;
}
.bar-seg--emprunt { background: hsl(var(--bar-emprunt)); }
.bar-seg--ravie   { background: hsl(var(--bar-ravie)); }
.bar-dot--emprunt { background: hsl(var(--bar-emprunt)); }
.bar-dot--ravie   { background: hsl(var(--bar-ravie)); }

.charges-toggle-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 20px; background: none; border: none;
  cursor: pointer; font-family: var(--font); text-align: left;
}
.charges-toggle-title {
  font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground));
}
.charges-toggle-desc {
  font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 2px;
}
.charges-chevron { transition: transform 0.2s ease; flex-shrink: 0; color: hsl(var(--muted-foreground)); }
.charges-toggle-btn[aria-expanded="true"] .charges-chevron { transform: rotate(180deg); }

.result-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; gap: 10px;
}
.result-empty-icon { opacity: 0.4; }
.result-empty-text { font-size: 0.875rem; color: hsl(var(--muted-foreground)); max-width: 280px; line-height: 1.55; }

.toggle-amort-full { margin-top: 14px; width: 100%; justify-content: center; }

.seo-faq details p {
  padding: 0 16px 14px; font-size: 0.84rem;
  color: hsl(var(--muted-foreground)); line-height: 1.65; margin: 0;
}

.import-banner-clear {
  margin-left: auto; background: none; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 2px 8px; font-size: 0.75rem;
  font-family: var(--font); color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.import-banner-clear:hover { color: hsl(var(--foreground)); border-color: hsl(var(--foreground)); }

select.input { padding-right: 12px; cursor: pointer; }

.data-table tr.td-green td { color: hsl(var(--bar-ravie)); font-weight: 600; }

.layout-col--results { position: sticky; top: 72px; align-self: flex-start; }

/* ── Bottom nav mobile (style.css pages) ────────────────────────── */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
@media (max-width: 480px) {
  .bottom-nav-bar { display: flex; }
  .nav-links { display: none; }
}
.bottom-nav-bar__link {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4px 2px; gap: 2px;
  font-size: 0.65rem; color: hsl(var(--muted-foreground));
  text-decoration: none; line-height: 1.2;
}
.bottom-nav-bar__link.active { color: hsl(var(--foreground)); font-weight: 600; }
.bottom-nav-bar__link:hover { color: hsl(var(--foreground)); }
