:root {
  --font-sans: "Inter", "Roobert", "SF Pro Display", system-ui, -apple-system, sans-serif;
  --font-display: "Roobert", "SF Pro Display", system-ui, sans-serif;
  
  /* Palette Vibrante & Fun */
  --bg: #fdfcfe;
  --bg-alt: #f0f4ff;
  --surface: #ffffff;
  --surface-soft: #f9faff;
  
  --primary: #6366f1; /* Indigo */
  --primary-soft: #eef2ff;
  --secondary: #ec4899; /* Pink/Fuchsia */
  --secondary-soft: #fdf2f8;
  --accent: #f59e0b; /* Amber */
  --accent-soft: #fffbeb;
  --success: #10b981; /* Emerald */
  --success-soft: #ecfdf5;
  --danger: #ef4444; /* Rose/Red */
  --danger-soft: #fef2f2;
  
  --text: #1e293b;
  --text-soft: #475569;
  --text-muted: #94a3b8;
  
  --line: rgba(99, 102, 241, 0.1);
  --line-strong: rgba(99, 102, 241, 0.2);
  
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(99, 102, 241, 0.12);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-in {
  animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--text);
  background: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.08), transparent 40%),
    var(--bg);
  line-height: 1.6;
}

body::before {
  display: none; /* Nettoyage de l'ancienne grille */
}

a {
  color: inherit;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

#app {
  position: relative;
  z-index: 1;
}
  svg,
  img,
  video,
  canvas {
  max-width: 100%;
  display: block;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-card {
  width: min(560px, 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 150px; height: 150px;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.brand-block {
  display: flex;
  gap: 20px;
  align-items: center;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 24px -6px rgba(99, 102, 241, 0.4);
  transform: rotate(-3deg);
  transition: var(--transition);
}

.brand-mark:hover {
  transform: rotate(3deg) scale(1.1);
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  background: linear-gradient(to right, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 100;
}

.nav-link {
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-link.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3);
}

.button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

.button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

.button-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.panel {
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

/* Educational Cards */
.edu-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border-left: 6px solid var(--primary);
  background: var(--primary-soft);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.edu-card::before {
  content: "🎓";
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 80px;
  opacity: 0.1;
  pointer-events: none;
}

.edu-card h4 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 800;
}

.edu-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.tip-card {
  border-left-color: var(--success);
  background: var(--success-soft);
}

.tip-card h4 {
  color: var(--success);
}

.tip-card::before {
  content: "💡";
}

/* Method Section Styles */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.method-item {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.professional-source h4 {
  margin: 1rem 0;
  font-size: 1.2rem;
  color: var(--primary);
}

.professional-source p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.professional-source strong {
  color: var(--text);
}

.professional-source .button {
  margin-top: 1rem;
  width: 100%;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
  .section-heading h2,
  .section-heading h3 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.section-intro {
  margin: 0.45rem 0 0;
  max-width: 56rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 20px;
}

.bento-hero { grid-column: span 8; grid-row: span 2; }
  .bento-stats { grid-column: span 4; grid-row: span 2; }
  .bento-tips { grid-column: span 5; grid-row: span 1; }
  .bento-nav { grid-column: span 7; grid-row: span 1; }

.bento-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 1rem 0;
}

.emoji-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.emoji-list li {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.feature-link {
  display: block;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}

.feature-link:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

@media (max-width: 1024px) {
  html {
    color-scheme: light;
    --bg: #f3f6fd;
    --bg-alt: #e8eef9;
    --surface: #ffffff;
    --surface-soft: #f1f5fb;
    --text: #0f172a;
    --text-soft: #24364a;
    --text-muted: #475569;
    --line: rgba(15, 23, 42, 0.16);
    --line-strong: rgba(15, 23, 42, 0.24);
    --primary-soft: rgba(36, 87, 240, 0.14);
    --secondary-soft: rgba(236, 72, 153, 0.14);
    --accent-soft: rgba(245, 158, 11, 0.16);
    --success-soft: rgba(16, 185, 129, 0.16);
    --danger-soft: rgba(239, 68, 68, 0.16);
  }

  html body {
    background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%) !important;
    color: var(--text) !important;
  }
  html .site-header,
  html .site-nav,
  html .panel,
  html .summary-card,
  html .mini-card,
  html .info-card,
  html .status-card,
  html .feature-link,
  html .source-card,
  html .glossary-card,
  html .method-item,
  html .legend-item,
  html .notice,
  html .table-scroll,
  html .control-block,
  html .landing-story-card,
  html .landing-understand-card,
  html .landing-limit-card,
  html .faq-card,
  html .page-footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 248, 253, 0.98)) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1) !important;
  }

  html .site-header {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%) !important;
  }

  html .site-header::after {
    opacity: 0.12 !important;
  }

  html .brand-copy h1 {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: var(--text) !important;
    text-shadow: none !important;
  }
  html .site-header .brand-subtitle,
  html .site-header .eyebrow,
  html .site-header .runtime-line {
    color: var(--text-soft) !important;
    text-shadow: none !important;
  }

  html .site-header .eyebrow {
    color: var(--primary) !important;
  }

  html .header-meta {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
  }

  html .runtime-line {
    background: rgba(36, 87, 240, 0.08) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text) !important;
  }

  html .site-nav {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
  }

  html .nav-link {
    background: rgba(255, 255, 255, 0.99) !important;
    color: var(--text) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
  }

  html .nav-link:hover {
    background: rgba(36, 87, 240, 0.1) !important;
    color: var(--primary) !important;
  }

  html .nav-link.is-active {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 12px 24px -10px rgba(36, 87, 240, 0.42) !important;
  }

  html .button-secondary {
    background: #fff !important;
    color: var(--text) !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08) !important;
  }

  html .button {
    box-shadow: 0 12px 22px -10px rgba(36, 87, 240, 0.34) !important;
  }

  html .button:hover {
    box-shadow: 0 16px 28px -12px rgba(36, 87, 240, 0.42) !important;
  }
  html .section-intro,
  html .summary-meta,
  html .control-note,
  html .header-note,
  html .runtime-line,
  html .source-publisher,
  html .source-use,
  html .source-limit,
  html .source-date,
  html .category-card-meta,
  html .page-footer,
  html .page-footer-note,
  html .legend-item {
    color: var(--text-soft) !important;
  }
  html .section-intro strong,
  html .summary-meta strong,
  html .control-note strong,
  html .page-footer strong,
  html .legend-item strong {
    color: var(--text) !important;
  }
  html .text-input,
  html .expense-input {
    background: #fff !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
    color: var(--text) !important;
  }
  html .text-input::placeholder,
  html .expense-input::placeholder {
    color: var(--text-muted) !important;
  }
  html .text-input:focus,
  html .expense-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(36, 87, 240, 0.18) !important;
  }
  html .tag,
  html .summary-status-pill,
  html .expense-source-badge,
  html .course-nav-pill {
    border-color: rgba(15, 23, 42, 0.14) !important;
  }

  html .tag-manual {
    background: rgba(15, 23, 42, 0.08) !important;
    color: var(--text) !important;
  }
  html .tag-official,
  html .tag-besoin {
    background: rgba(36, 87, 240, 0.16) !important;
    color: var(--primary) !important;
  }
  html .tag-estimate,
  html .tag-envie {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #92400e !important;
  }
  html .tag-success,
  html .tag-epargne {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #065f46 !important;
  }

  html .tag-danger {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #991b1b !important;
  }
  html .summary-card,
  html .mini-card,
  html .info-card,
  html .status-card,
  html .source-card,
  html .glossary-card,
  html .method-item,
  html .legend-item,
  html .notice,
  html .control-block,
  html .landing-story-card,
  html .landing-understand-card,
  html .landing-limit-card,
  html .faq-card,
  html .table-scroll {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 247, 252, 0.97)) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1) !important;
  }
  html .simulation-shell .simulation-live-summary,
  html .simulation-shell .simulation-summary-panel .summary-card,
  html .simulation-shell .simulation-summary-panel .summary-status,
  html .simulation-shell .expense-breakdown-row,
  html .simulation-shell .expense-row,
  html .simulation-shell .expense-ledger tfoot tr {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 247, 252, 0.97)) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
  }

  html .simulation-shell .expense-breakdown-track {
    background: rgba(36, 87, 240, 0.12) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
  }

  html .simulation-shell .expense-group-row th {
    background: rgba(36, 87, 240, 0.12) !important;
    color: var(--primary) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
  }
  html .simulation-shell .expense-row th[data-label]::before,
  html .simulation-shell .expense-row td[data-label]::before {
    color: var(--text-muted) !important;
  }
  html .simulation-shell .expense-row .expense-poste small,
  html .simulation-shell .expense-breakdown-block .control-note,
  html .simulation-shell .inline-note {
    color: var(--text-soft) !important;
  }

  html .data-table thead th {
    background: linear-gradient(180deg, rgba(236, 241, 252, 0.99), rgba(227, 235, 248, 0.98)) !important;
    color: var(--text) !important;
  }

  html .data-table tbody tr:nth-child(even) {
    background: rgba(36, 87, 240, 0.04) !important;
  }

  html .page-footer {
    border-top-color: rgba(15, 23, 42, 0.14) !important;
  }

  html .page-footer-links a {
    color: var(--text) !important;
  }

  .animate-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === Product redesign 2026: light dashboard theme === */
:root {
  --bg: #f4f7fb;
  --bg-alt: #edf2f7;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-soft: #f7f9fc;
  --surface-strong: #ffffff;
  --primary: #12324f;
  --primary-soft: rgba(18, 50, 79, 0.08);
  --secondary: #0f6172;
  --secondary-soft: rgba(15, 97, 114, 0.08);
  --accent: #c77811;
  --accent-soft: rgba(199, 120, 17, 0.12);
  --success: #16815f;
  --success-soft: rgba(22, 129, 95, 0.12);
  --danger: #b93b2e;
  --danger-soft: rgba(185, 59, 46, 0.12);
  --warning: #a86412;
  --warning-soft: rgba(168, 100, 18, 0.14);
  --text: #162235;
  --text-soft: #425066;
  --text-muted: #6e7b8e;
  --line: rgba(18, 34, 53, 0.12);
  --line-strong: rgba(18, 34, 53, 0.2);
  --shadow-sm: 0 10px 24px rgba(18, 34, 53, 0.06);
  --shadow-md: 0 18px 44px rgba(18, 34, 53, 0.09);
  --shadow-lg: 0 28px 60px rgba(18, 34, 53, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --transition: 180ms cubic-bezier(0.2, 0, 0, 1);
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 97, 114, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(199, 120, 17, 0.08), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #f2f5f9 42%, #edf2f7 100%);
}

body::before {
  display: block;
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 34, 53, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 34, 53, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 70%);
  opacity: 0.65;
}

::selection {
  background: rgba(15, 97, 114, 0.2);
  color: var(--text);
}

a {
  color: inherit;
}

a:hover {
  text-decoration: none;
}

code {
  background: rgba(18, 34, 53, 0.06);
  border: 1px solid rgba(18, 34, 53, 0.08);
  border-radius: 999px;
}

#app {
  position: relative;
  z-index: 1;
}

svg,
img,
video,
canvas {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.main-content,
.page-section,
.section-block {
  display: grid;
  gap: 22px;
}

.page-section {
  margin: 0;
}

.panel,
.site-header,
.site-nav,
.page-footer,
.summary-card,
.feature-link,
.source-card,
.glossary-card,
.method-item,
.notice,
.control-block,
.legend-item,
.landing-story-card,
.landing-understand-card,
.landing-limit-card,
.table-scroll {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.94));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.site-header,
.panel,
.page-footer,
.summary-card,
.feature-link,
.source-card,
.glossary-card,
.method-item,
.notice,
.control-block,
.landing-story-card,
.landing-understand-card,
.landing-limit-card,
.table-scroll {
  border-radius: var(--radius-xl);
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 22px;
  align-items: start;
  padding: 30px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.site-header::before {
  inset: auto -40px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 97, 114, 0.14) 0%, transparent 70%);
}

.site-header::after {
  top: -60px;
  right: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 120, 17, 0.12) 0%, transparent 72%);
  opacity: 1;
}

.brand-block {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 24px rgba(18, 34, 53, 0.16);
}

.brand-copy {
  max-width: 50rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 800;
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.7vw, 4rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: var(--primary);
  background: linear-gradient(90deg, var(--primary), #163f5c 54%, var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  margin: 0.9rem 0 0;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.header-meta {
  align-self: center;
  justify-self: end;
  max-width: 24rem;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 97, 114, 0.05);
  border: 1px solid rgba(15, 97, 114, 0.12);
}

.runtime-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.site-nav {
  position: sticky;
  top: 12px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin: 0 0 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.nav-link:hover {
  background: rgba(15, 97, 114, 0.08);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-link.is-active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 12px 24px rgba(18, 34, 53, 0.16);
}

.nav-link:focus-visible,
.button:focus-visible,
.button-secondary:focus-visible,
.segmented-button:focus-visible,
.text-input:focus-visible,
.expense-active-toggle:focus-visible {
  outline: 3px solid rgba(15, 97, 114, 0.22);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.85rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(18, 34, 53, 0.15);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.button:hover {
  transform: translateY(-1px);
  filter: saturate(1.02);
  box-shadow: 0 16px 32px rgba(18, 34, 53, 0.18);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  border-color: rgba(18, 34, 53, 0.14);
  box-shadow: 0 10px 24px rgba(18, 34, 53, 0.08);
}

.button-secondary:hover {
  background: rgba(15, 97, 114, 0.06);
  color: var(--primary);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.panel {
  position: relative;
  padding: 28px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(18, 50, 79, 0.85), rgba(15, 97, 114, 0.65), rgba(199, 120, 17, 0.45));
  pointer-events: none;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--primary);
}

.section-intro {
  margin: 0.55rem 0 0;
  max-width: 58rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.section-intro strong {
  color: var(--text);
}

.notice {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
  background: linear-gradient(180deg, rgba(245, 249, 253, 0.98), rgba(239, 244, 250, 0.96));
}

.notice p {
  margin: 0;
  color: var(--text-soft);
}

.notice strong {
  color: var(--text);
}

.notice-warning {
  border-left-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.98), rgba(255, 244, 226, 0.96));
}

.notice-success {
  border-left-color: var(--success);
  background: linear-gradient(180deg, rgba(243, 251, 247, 0.98), rgba(236, 249, 242, 0.96));
}

.control-block {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.control-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.control-note,
.control-help,
.inline-note,
.page-footer,
.page-footer-note,
.source-publisher,
.source-use,
.source-limit,
.source-date,
.summary-meta,
.legend-item,
.header-note,
.category-card-meta {
  color: var(--text-soft);
}

.control-note,
.control-help,
.inline-note {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.text-input,
.expense-input {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(18, 34, 53, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(18, 34, 53, 0.04);
}

.text-input::placeholder,
.expense-input::placeholder {
  color: var(--text-muted);
}

.text-input:focus,
.expense-input:focus {
  border-color: rgba(15, 97, 114, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 97, 114, 0.12);
  outline: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.segmented-button {
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(18, 34, 53, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-soft);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(18, 34, 53, 0.05);
  transition: transform var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.segmented-button:hover {
  transform: translateY(-1px);
  color: var(--primary);
}

.segmented-button.is-active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(18, 34, 53, 0.16);
}

.tag,
.summary-status-pill,
.expense-source-badge,
.course-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(18, 34, 53, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.tag-official,
.tag-besoin {
  background: rgba(18, 50, 79, 0.08);
  color: var(--primary);
}

.tag-estimate,
.tag-envie {
  background: rgba(199, 120, 17, 0.12);
  color: #8b4f09;
}

.tag-success,
.tag-epargne {
  background: rgba(22, 129, 95, 0.12);
  color: var(--success);
}

.tag-danger {
  background: rgba(185, 59, 46, 0.12);
  color: var(--danger);
}

.tag-manual {
  background: rgba(18, 34, 53, 0.06);
  color: var(--text);
}

.summary-grid,
.mini-grid,
.source-grid,
.source-summary-grid,
.glossary-grid,
.landing-kpis,
.landing-tag-row,
.legend-list {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.mini-grid,
.source-summary-grid,
.glossary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.source-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.landing-tag-row,
.legend-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
}

.summary-card,
.feature-link,
.source-card,
.glossary-card,
.method-item,
.landing-story-card,
.landing-understand-card,
.landing-limit-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.summary-card::before,
.feature-link::before,
.source-card::before,
.glossary-card::before,
.method-item::before,
.landing-story-card::before,
.landing-understand-card::before,
.landing-limit-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: rgba(18, 50, 79, 0.12);
}

.summary-card-official::before {
  background: linear-gradient(90deg, var(--primary), rgba(18, 50, 79, 0.3));
}

.summary-card-estimate::before {
  background: linear-gradient(90deg, var(--accent), rgba(199, 120, 17, 0.3));
}

.summary-card-danger::before {
  background: linear-gradient(90deg, var(--danger), rgba(185, 59, 46, 0.3));
}

.summary-card-danger {
  background: linear-gradient(180deg, rgba(255, 245, 242, 0.99), rgba(255, 237, 233, 0.94));
  border-color: rgba(185, 59, 46, 0.16);
}

.summary-card-danger .summary-value {
  color: var(--danger);
}

.summary-card-success::before {
  background: linear-gradient(90deg, var(--success), rgba(22, 129, 95, 0.3));
}

.summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 251, 0.96));
}

.summary-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.summary-value {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--primary);
}

.summary-meta {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.feature-link {
  text-align: left;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.94));
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.feature-link:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 97, 114, 0.22);
  box-shadow: var(--shadow-md);
}

.feature-link strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.25;
}

.feature-link span {
  display: block;
  color: var(--text-soft);
  line-height: 1.55;
}

.landing-shell {
  display: grid;
  gap: 20px;
}

.landing-hero {
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 251, 0.95));
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: center;
}

.landing-hero-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--primary);
}

.landing-visual {
  margin: 0;
  padding: 12px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.96));
  border: 1px solid rgba(18, 50, 79, 0.08);
  box-shadow: 0 24px 48px rgba(18, 34, 53, 0.12);
}

.landing-visual img {
  width: 100%;
  border-radius: 18px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f8fbff;
}

.landing-visual figcaption {
  margin-top: 0.65rem;
  color: var(--text-soft);
  font-size: 0.85rem;
  text-align: center;
}

.landing-note {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-story-card {
  background: linear-gradient(135deg, rgba(18, 50, 79, 0.98), rgba(15, 97, 114, 0.94));
  color: #eef4fa;
  box-shadow: 0 22px 44px rgba(18, 34, 53, 0.18);
}

.landing-story-card::before,
.landing-understand-card::before,
.landing-limit-card::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.18));
}

.landing-story-card .eyebrow,
.landing-understand-card .eyebrow,
.landing-limit-card .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.landing-story-card p,
.landing-understand-card p,
.landing-limit-card p {
  margin: 0;
  line-height: 1.6;
}

.landing-understand-card,
.landing-limit-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.95));
}

.landing-understand-card {
  border-left: 4px solid var(--secondary);
}

.landing-limit-card {
  border-left: 4px solid var(--accent);
}

.landing-section {
  padding: 26px 28px;
}

.landing-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.96));
}

.source-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 0.9rem;
}

.source-card h4,
.glossary-card h4,
.method-item h4 {
  margin: 0 0 0.55rem;
  color: var(--primary);
  font-size: 1.06rem;
  line-height: 1.25;
}

.professional-source {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.professional-source .button {
  margin-top: auto;
  align-self: flex-start;
}

.source-date {
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: rgba(18, 34, 53, 0.06);
  border: 1px solid rgba(18, 34, 53, 0.08);
  font-size: 0.78rem;
}

.source-publisher,
.source-use,
.source-limit {
  margin: 0.35rem 0 0;
  font-size: 0.93rem;
  line-height: 1.55;
}

.source-limit {
  color: var(--text-soft);
}

.glossary-index {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.glossary-index-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.glossary-index-link span {
  color: var(--text-soft);
  font-weight: 700;
}

.glossary-index-link strong {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(15, 97, 114, 0.08);
  color: var(--secondary);
}

.glossary-index-link:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 97, 114, 0.22);
  box-shadow: var(--shadow-md);
}

.glossary-section {
  padding: 26px 28px;
}

.glossary-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.glossary-section-count {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 97, 114, 0.08);
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.glossary-section-groups,
.glossary-group,
.glossary-grid {
  display: grid;
  gap: 14px;
}

.glossary-group-title {
  margin: 0;
  color: var(--secondary);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.glossary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95));
}

.glossary-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.glossary-card small {
  display: block;
  margin-top: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.legend-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 248, 252, 0.93));
  border: 1px solid var(--line);
}

.legend-item strong {
  color: var(--text);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  margin-top: 0.2rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 4px rgba(18, 34, 53, 0.06);
}

.simulation-shell {
  gap: 22px;
}

.simulation-line-page,
.simulation-line-section {
  position: relative;
}

.salary-picker,
.simulation-city-grid {
  display: grid;
  gap: 14px;
}

.simulation-city-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.simulation-summary-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.simulation-live-summary {
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), #173e5d 48%, var(--secondary));
  color: #eef4fa;
  box-shadow: 0 24px 48px rgba(18, 34, 53, 0.2);
}

.simulation-live-summary-danger {
  background: linear-gradient(135deg, #8f2d28, #b2402f 48%, #d26a2b);
}

.simulation-live-summary-warning {
  background: linear-gradient(135deg, #8d5700, #b56b12 48%, #d69b22);
}

.simulation-live-summary-success {
  background: linear-gradient(135deg, #13583d, #14704d 48%, #17916a);
}

.simulation-live-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.simulation-live-summary-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.simulation-live-summary-value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
}

.simulation-live-summary-separator {
  color: rgba(255, 255, 255, 0.4);
}

.simulation-live-summary-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.simulation-live-summary .inline-note {
  margin-top: 0.7rem;
  color: rgba(255, 255, 255, 0.82);
}

.simulation-summary-grid {
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simulation-summary-grid .summary-card {
  min-height: 136px;
}

.simulation-summary-grid .summary-value {
  white-space: nowrap;
}

.expense-category-filter,
.expense-breakdown-block {
  margin-bottom: 16px;
}

.expense-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.expense-breakdown-total {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  color: var(--primary);
}

.expense-breakdown-chart {
  display: grid;
  gap: 14px;
}

.expense-breakdown-row {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.94));
  border: 1px solid var(--line);
}

.expense-breakdown-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.expense-breakdown-row-label {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  color: var(--text);
}

.expense-breakdown-dot,
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.expense-breakdown-dot-besoin {
  background: var(--primary);
}

.expense-breakdown-dot-envie {
  background: var(--accent);
}

.expense-breakdown-dot-epargne {
  background: var(--success);
}

.expense-breakdown-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: flex-end;
  color: var(--text-soft);
}

.expense-breakdown-values strong {
  color: var(--text);
}

.expense-breakdown-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 34, 53, 0.08);
}

.expense-breakdown-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 200ms ease;
}

.expense-breakdown-fill-envie {
  background: linear-gradient(90deg, var(--accent), #e28c27);
}

.expense-breakdown-fill-epargne {
  background: linear-gradient(90deg, var(--success), #1da874);
}

.expense-breakdown-legend {
  margin-top: 10px;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(18, 50, 79, 0.98), rgba(15, 97, 114, 0.96));
  color: #fff;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table tbody th,
.data-table tbody td,
.data-table tfoot th,
.data-table tfoot td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.data-table tbody tr:hover td,
.data-table tbody tr:hover th {
  background: rgba(15, 97, 114, 0.04);
}

.data-table tbody tr.is-danger-row td,
.data-table tbody tr.is-danger-row th {
  background: rgba(185, 59, 46, 0.06);
}

.expense-table-scroll .data-table,
.comparison-table {
  min-width: 1020px;
}

.expense-table {
  min-width: 1180px;
}

.expense-ledger tfoot th,
.comparison-table tfoot th {
  font-weight: 800;
}

.expense-group-row th {
  background: rgba(15, 97, 114, 0.1);
  color: var(--secondary);
  border-bottom: 1px solid rgba(18, 34, 53, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.expense-active-cell {
  text-align: center;
  width: 54px;
}

.expense-active-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--secondary);
  cursor: pointer;
}

.expense-poste {
  display: grid;
  gap: 0.22rem;
}

.expense-name {
  font-weight: 800;
  color: var(--text);
}

.expense-poste small {
  color: var(--text-soft);
  line-height: 1.45;
}

.expense-base-value,
.expense-percent-value {
  font-variant-numeric: tabular-nums;
}

.expense-input {
  max-width: 120px;
  text-align: right;
}

.comparison-table th[scope="row"] div {
  font-weight: 800;
  color: var(--text);
}

.comparison-table th[scope="row"] small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.comparison-table td,
.comparison-table th {
  font-variant-numeric: tabular-nums;
}

.is-danger-row th[scope="row"] {
  box-shadow: inset 4px 0 0 var(--danger);
}

.page-footer {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 22px 24px;
  text-align: center;
}

.page-footer p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.page-footer strong {
  color: var(--text);
}

.page-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 0;
  margin: 0;
}

.page-footer-links a,
.page-footer-note a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.page-footer-links a:hover,
.page-footer-note a:hover {
  text-decoration: underline;
}

.no-print {
  display: block;
}

@media print {
  .no-print {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: calc(100% - 18px);
    padding: 12px 0 32px;
  }

  .site-header {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .brand-copy h1 {
    font-size: clamp(1.78rem, 7.8vw, 2.35rem);
  }

  .brand-subtitle {
    margin-top: 0.5rem;
    font-size: 0.9rem;
  }

  .brand-block {
    gap: 12px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.35rem;
  }

  .header-meta {
    width: 100%;
    justify-self: stretch;
    max-width: none;
  }

  .site-nav {
    padding: 8px;
    border-radius: 20px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .nav-link {
    min-height: 38px;
    width: 100%;
    font-size: 0.86rem;
  }

  .panel,
  .summary-card,
  .source-card,
  .glossary-card,
  .method-item,
  .notice,
  .control-block,
  .landing-story-card,
  .landing-understand-card,
  .landing-limit-card {
    padding: 16px;
    border-radius: 22px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-heading h2,
  .section-heading h3 {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

  .landing-hero-grid,
  .simulation-city-grid,
  .source-grid,
  .source-summary-grid,
  .glossary-grid,
  .summary-grid,
  .mini-grid,
  .legend-list {
    grid-template-columns: 1fr;
  }

  .simulation-summary-grid,
  .landing-kpis {
    grid-template-columns: 1fr !important;
  }

  .landing-hero,
  .landing-section,
  .glossary-section {
    padding: 16px;
  }

  .landing-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .landing-hero-copy .eyebrow {
    order: 1;
    margin: 0;
  }

  .landing-hero-copy h2 {
    order: 2;
    margin: 0;
  }

  .landing-hero-copy .action-row {
    order: 3;
    margin-top: 0.4rem;
  }

  .landing-hero-copy .section-intro {
    order: 4;
    margin-top: 0.15rem;
  }

  .landing-hero-copy .inline-note {
    order: 5;
  }

  .landing-visual {
    display: none;
  }

  .landing-visual {
    padding: 10px;
    border-radius: 22px;
  }

  .landing-hero-copy h2 {
    font-size: clamp(1.72rem, 8.8vw, 2.2rem);
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button,
  .button-secondary {
    width: 100%;
  }

  .segmented {
    grid-template-columns: 1fr 1fr;
  }

  .summary-value {
    font-size: clamp(1.35rem, 8vw, 1.9rem);
  }

  .simulation-shell {
    gap: 18px;
  }

  .simulation-shell .header-meta {
    max-width: none;
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .simulation-shell .runtime-line {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .simulation-shell .header-meta .action-row {
    width: auto;
    margin-top: 8px;
  }

  .simulation-shell .header-meta .button,
  .simulation-shell .header-meta .button-secondary {
    width: auto;
    min-height: 34px;
    padding: 0.5rem 0.85rem;
    font-size: 0.84rem;
  }

  .simulation-shell .landing-hero-grid {
    grid-template-columns: 1fr;
  }

  .simulation-shell .landing-story-main {
    order: -1;
  }

  .simulation-shell .landing-hero {
    padding: 14px;
  }

  .simulation-shell .landing-hero-copy {
    gap: 0.35rem;
  }

  .simulation-shell .landing-hero-copy h2 {
    font-size: clamp(1.64rem, 7.2vw, 2.1rem);
  }

  .simulation-shell .landing-hero-copy .section-intro,
  .simulation-shell .landing-hero-copy .inline-note {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .simulation-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .simulation-summary-grid .summary-card {
    min-height: 112px;
    padding: 14px;
  }

  .simulation-summary-grid .summary-title {
    font-size: 0.78rem;
  }

  .simulation-summary-grid .summary-meta {
    font-size: 0.78rem;
  }

  .source-card-head,
  .expense-breakdown-head,
  .expense-breakdown-row-head,
  .simulation-live-summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .expense-breakdown-values {
    justify-content: flex-start;
  }

  .page-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .page-footer-links a {
    display: inline-flex;
    justify-content: center;
    padding: 0.35rem 0.2rem;
    background: rgba(15, 97, 114, 0.05);
    border-radius: 999px;
  }

  .table-scroll {
    overflow: visible;
  }

  .expense-table-scroll .data-table,
  .comparison-table {
    min-width: 0;
    width: 100%;
  }

  .expense-table thead,
  .comparison-table thead {
    display: none;
  }

  .expense-table tbody,
  .comparison-table tbody {
    display: grid;
    gap: 12px;
  }

  .expense-group-row,
  .comparison-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95));
    box-shadow: var(--shadow-sm);
  }

  .expense-group-row th {
    grid-column: 1 / -1;
    margin: 0;
    border-radius: 14px;
  }

  .expense-row,
  .comparison-table tr[data-row-key] {
    align-items: start;
  }

  .expense-row th[data-label],
  .expense-row td[data-label],
  .comparison-table td,
  .comparison-table th {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .expense-row th[data-label]::before,
  .expense-row td[data-label]::before,
  .comparison-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .comparison-table td:nth-of-type(1)::before { content: "Brut"; }
  .comparison-table td:nth-of-type(2)::before { content: "Net estimé"; }
  .comparison-table td:nth-of-type(3)::before { content: "Impôt"; }
  .comparison-table td:nth-of-type(4)::before { content: "Net après"; }
  .comparison-table td:nth-of-type(5)::before { content: "Dépenses"; }
  .comparison-table td:nth-of-type(6)::before { content: "Reste"; }
  .comparison-table td:nth-of-type(7)::before { content: "Lecture"; }

  #glossary-search {
    order: -1;
  }

  .expense-row th[data-label="Poste"],
  .expense-row td[data-label="Modifier"],
  .expense-row td[data-label="Source"] {
    grid-column: 1 / -1;
  }

  .expense-row th[data-label="Poste"] .expense-poste {
    gap: 0.35rem;
  }

  .expense-input {
    max-width: 100%;
  }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .page-shell {
    width: min(1240px, calc(100% - 28px));
  }

  .site-header {
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
    padding: 24px;
  }

  .site-nav {
    border-radius: 26px;
    padding: 10px 12px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-link {
    min-height: 42px;
    padding-inline: 0.95rem;
  }

  .landing-hero-grid,
  .simulation-city-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-grid,
  .source-summary-grid,
  .glossary-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-footer-links {
    gap: 10px 16px;
  }

  .expense-table-scroll,
  .comparison-table {
    overflow-x: auto;
  }
}

@media (min-width: 1025px) {
  .site-header {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  }

  .landing-hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  }

  .simulation-live-summary-value {
    font-size: clamp(2rem, 4vw, 3.25rem);
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .simulation-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .page-shell {
    width: min(1280px, calc(100% - 40px));
  }
}


