:root {
  --navy: #1a2a4a;
  --navy-mid: #243660;
  --navy-light: #2e4480;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-pale: #f5edd8;
  --cream: #f5f0e8;
  --cream-dark: #ede5d5;
  --border: #d4c9b0;
  --text: #2c2c2c;
  --text-light: #5a5a5a;
  --white: #ffffff;
  --red-soft: #8b2020;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  background: var(--cream);
}

header {
  background: var(--navy);
  padding: 1.25rem 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(201, 168, 76, 0.04) 40px,
    rgba(201, 168, 76, 0.04) 41px
  );
}

.header-hebrew {
  font-family: 'David Libre', serif;
  font-size: 2.15rem;
  color: var(--gold);
  direction: rtl;
  display: block;
  letter-spacing: 0.05em;
  position: relative;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  font-style: italic;
  margin-top: 0.15rem;
  position: relative;
}

.header-sub {
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.2rem;
  position: relative;
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  position: relative;
}

.header-ornament::before,
.header-ornament::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.star {
  color: var(--gold);
  font-size: 0.95rem;
}

nav {
  background: var(--navy-mid);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 0;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

nav a,
nav button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  padding: 0.65rem 1.45rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  letter-spacing: 0.05em;
  text-decoration: none;
}

nav a:hover,
nav button:hover { color: var(--gold-light); }

nav a.active,
nav button.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}

nav .nav-print {
  margin-left: auto;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.nav-links {
  display: flex;
  align-items: stretch;
  flex: 1;
  justify-content: center;
}

.nav-hamburger { display: none; }

section { display: none; }
section.active { display: block; }

#section-texte,
#section-faq {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
}

#section-simulateur {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
}

#section-quoi-qui {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.qq-page { padding-top: 1rem; }

.qq-hero {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.qq-hero .hebrew,
.sim-header .hebrew {
  font-family: 'David Libre', serif;
  color: var(--gold);
  direction: rtl;
  font-size: 1.7rem;
  display: block;
  margin-bottom: 0.35rem;
}

.qq-hero h1 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  font-size: 2.35rem;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.qq-hero p {
  max-width: 740px;
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.7;
}

.qq-rule {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  padding: 1.4rem;
  margin-bottom: 3rem;
}

.qq-rule h2,
.qq-card h3,
.qq-case h3,
.qq-no-grid h3 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  line-height: 1.25;
}

.qq-rule h2 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.qq-rule p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.qq-logic {
  display: grid;
  grid-template-columns: minmax(140px, 0.75fr) 1fr;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.qq-logic span,
.qq-logic strong {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.qq-logic span:nth-last-child(-n + 2),
.qq-logic strong:nth-last-child(-n + 2) { border-bottom: none; }

.qq-logic span {
  background: var(--cream);
  color: var(--text-light);
}

.qq-logic strong {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
}

.qq-section { margin-bottom: 3rem; }

.qq-priority-grid,
.qq-decision-grid,
.qq-cases,
.qq-no-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.qq-decision-grid,
.qq-cases,
.qq-no-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.qq-card,
.qq-case,
.qq-no-grid > div {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.qq-priority {
  position: relative;
  padding-top: 3rem;
}

.qq-rank {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: var(--gold-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.qq-card h3,
.qq-case h3,
.qq-no-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.qq-check {
  display: inline-block;
  margin-right: 0.35rem;
  font-family: 'Source Serif 4', Georgia, serif;
}

.qq-no {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--red-soft);
  font-weight: 600;
}

.qq-card p,
.qq-case p,
.qq-no-grid li {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

.qq-no-grid ul { margin-left: 1.1rem; }
.qq-no-grid li { margin-bottom: 0.35rem; }

.qq-table-wrap { overflow-x: auto; }

.qq-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.qq-table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 0.8rem 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.qq-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.9rem;
}

.qq-table tr:last-child td { border-bottom: none; }

.qq-status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  white-space: nowrap;
}

.qq-status.yes {
  background: rgba(46, 98, 70, 0.12);
  color: #24533a;
}

.qq-status.partial {
  background: var(--gold-pale);
  color: #6d5520;
}

.qq-footer-note {
  background: var(--gold-pale);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.2rem;
  color: var(--navy);
  font-size: 0.95rem;
}

.qq-footer-note span {
  display: block;
  margin-top: 0.7rem;
  color: var(--text-light);
  font-size: 0.82rem;
  font-style: italic;
}

.chapter {
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.chapter:last-child { border-bottom: none; }

.chapter-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.chapter-letter {
  font-family: 'David Libre', serif;
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  min-width: 3rem;
  text-align: center;
  direction: rtl;
}

.chapter-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.chapter-title em {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter p {
  margin-bottom: 1.1rem;
  text-align: justify;
}

.chapter p:last-child { margin-bottom: 0; }
.chapter strong { color: var(--navy); font-weight: 600; }
.chapter em { font-style: italic; }

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--gold-pale);
  border-left: 4px solid var(--gold);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--navy);
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.hebrew-citation {
  direction: rtl;
  text-align: right;
  font-family: 'David Libre', serif;
  font-size: 1.25rem;
  background: var(--navy);
  color: var(--gold-light);
  padding: 1.2rem 1.8rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  line-height: 1.9;
}

.hebrew-citation .ref {
  display: block;
  font-family: 'Source Serif 4', serif;
  font-size: 0.78rem;
  color: rgba(232, 201, 122, 0.6);
  direction: ltr;
  text-align: right;
  margin-top: 0.4rem;
  letter-spacing: 0.08em;
  font-style: italic;
}

.source-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: var(--navy);
  color: var(--gold);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.three-voices {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.voice {
  padding: 1rem 1.3rem;
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.voice.shammai { border-left-color: #8b6914; background: rgba(139, 105, 20, 0.06); }
.voice.hillel { border-left-color: var(--navy); background: rgba(26, 42, 74, 0.06); }
.voice.akiva { border-left-color: var(--gold); background: var(--gold-pale); }
.voice strong { display: block; margin-bottom: 0.3rem; }

.deficit-block {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: 0 0 6px 6px;
}

.deficit-block h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.conclusion-box {
  background: var(--navy);
  color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  font-style: italic;
  line-height: 1.9;
}

.conclusion-box p { margin-bottom: 0.6rem; color: rgba(255, 255, 255, 0.9); }
.conclusion-box strong { color: var(--gold-light); font-style: normal; }

.dyn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
  color: var(--navy);
  background: var(--gold-pale);
  padding: 0 0.3em;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-style: normal;
}

.dyn.empty {
  color: var(--text-light);
  background: var(--cream-dark);
  font-style: italic;
  font-family: inherit;
}

.cta-block {
  margin: 2.5rem 0;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--gold);
}

.cta-block p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-style: italic;
}

.cta-block .cta-question {
  color: var(--gold-light);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: normal;
  margin-bottom: 1rem;
}

.btn-gold,
.btn-navy,
.btn-outline {
  display: inline-block;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 0.7rem 2rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.4);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 0.7rem 2rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-navy:hover { background: var(--navy-light); }

.btn-outline {
  background: none;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 0.65rem 1.8rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover { background: var(--cream-dark); }

.avertissement {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red-soft);
  padding: 1.2rem 1.5rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 2rem 0;
  line-height: 1.6;
}

.avertissement strong { color: var(--red-soft); display: block; margin-bottom: 0.3rem; }

.faq-section { margin-top: 0; }
.faq-intro { color: var(--text-light); font-size: 0.95rem; margin-bottom: 1.5rem; }

.faq-list {
  display: grid;
  gap: 0.9rem;
  counter-reset: faq-counter;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  counter-increment: faq-counter;
}

.faq-item[open] {
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(26, 42, 74, 0.08);
}

.faq-item summary {
  position: relative;
  padding: 1rem 3.2rem 1rem 4.5rem;
  cursor: pointer;
  list-style: none;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.45;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.faq-item summary::before {
  content: counter(faq-counter, decimal-leading-zero) ".";
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.faq-item summary::after {
  content: '+';
  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
}

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

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-light);
}

.faq-answer p { margin-bottom: 0.9rem; text-align: left; }
.faq-answer p:last-child,
.faq-answer ul:last-child,
.faq-answer ol:last-child { margin-bottom: 0; }
.faq-answer ul,
.faq-answer ol { margin: 0.2rem 0 1rem 1.4rem; }
.faq-answer li { margin-bottom: 0.45rem; }

.faq-answer a {
  color: var(--navy-light);
  text-decoration-color: var(--gold);
  text-underline-offset: 0.12em;
}

.faq-answer a:hover { color: var(--navy); }

.sim-header {
  text-align: center;
  padding: 0.75rem 0 0.9rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sim-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  color: var(--navy);
}

.sim-header .hebrew {
  font-family: 'David Libre', serif;
  font-size: 1.2rem;
  color: var(--gold);
  direction: rtl;
  display: block;
  margin-bottom: 0.2rem;
}

.sim-header p {
  margin-top: 0.25rem !important;
}

.sim-header .btn-outline {
  padding: 0.45rem 1.2rem;
}

.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.3rem;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
  border-bottom: 3px solid var(--border);
  transition: all 0.2s;
}

.wizard-step.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.wizard-step.done {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.wizard-step.active .step-num { background: var(--gold); color: var(--navy); }
.wizard-step.done .step-num { background: var(--navy); color: var(--gold); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.profile-card {
  padding: 1.2rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  text-align: center;
}

.profile-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.profile-card.selected { border-color: var(--gold); background: var(--gold-pale); }
.profile-card .profile-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.profile-card .profile-name { font-family: 'Playfair Display', serif; font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.profile-card .profile-rfr { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }

.divider {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.form-group input[type="number"],
.form-group select {
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input[readonly] {
  background: var(--cream-dark);
  border-color: var(--gold);
  color: var(--navy);
  cursor: default;
}

.computed-hint {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-top: 0.1rem;
}

.form-section-title {
  grid-column: 1 / -1;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-top: 0.5rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.slider-group {
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.slider-group h4 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.slider-row label {
  font-size: 0.82rem;
  color: var(--text-light);
  flex: 1;
  min-width: 0;
}

.slider-row input[type="range"] {
  flex: 0 0 140px;
  accent-color: var(--gold);
}

.slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--navy);
  min-width: 3rem;
  text-align: right;
  font-weight: 500;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.results-avertissement {
  background: #fff8f0;
  border: 1px solid #e8c97a;
  border-left: 4px solid var(--red-soft);
  padding: 1rem 1.5rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.results-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
}

.summary-card .sc-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.summary-card .sc-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--navy);
}

.summary-card .sc-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

.approaches-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
}

.approaches-table th {
  background: var(--navy);
  color: var(--gold-light);
  padding: 0.7rem 0.8rem;
  text-align: left;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.approaches-table th:first-child { border-radius: 6px 0 0 0; }
.approaches-table th:last-child { border-radius: 0 6px 0 0; }

.approaches-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.approaches-table td:first-child {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  color: var(--navy);
  font-weight: 600;
}

.approaches-table tr:nth-child(even) td { background: var(--cream); }
.approaches-table tr:last-child td { border-bottom: none; }

.taux-bar {
  height: 6px;
  background: var(--cream-dark);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}

.taux-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gold), var(--gold-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.taux-fill.over { background: linear-gradient(to right, #2d7a4f, #3da66a); }

.projection-chart {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem 1.2rem;
  margin-bottom: 2rem;
}

.projection-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.projection-chart-head strong {
  display: block;
  color: var(--navy);
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
}

.projection-chart-head span {
  display: block;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.projection-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text);
}

.projection-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.projection-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.projection-chart canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.projection-canvas-wrap {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.35rem;
  align-items: stretch;
}

.projection-y-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  justify-self: center;
  color: var(--navy);
  font-family: 'Source Serif 4', serif;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.approach-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.approach-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.approach-card-header {
  background: var(--navy);
  color: var(--white);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approach-card-header .aph-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
}

.approach-card-header .aph-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--gold-light);
}

.approach-card-body {
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  font-size: 0.82rem;
}

.acb-item .acb-label { color: var(--text-light); font-size: 0.75rem; }
.acb-item .acb-val { font-family: 'JetBrains Mono', monospace; font-weight: 500; color: var(--navy); }

.approach-card-footer {
  background: var(--cream);
  padding: 0.8rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  border-top: 1px solid var(--border);
}

.approach-card-explanation {
  padding: 0.95rem 1.2rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.55;
}

.approach-card-explanation div + div {
  margin-top: 0.35rem;
}

.approach-card-explanation strong {
  color: var(--navy);
  font-weight: 700;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 10px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.modal-box p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1.5rem; }

.print-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.print-option {
  padding: 1rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.print-option:hover,
.print-option.selected { border-color: var(--gold); background: var(--gold-pale); }

.print-option strong { display: block; color: var(--navy); font-size: 0.95rem; }
.print-option span { font-size: 0.82rem; color: var(--text-light); }

.print-profile-select {
  margin-top: 0.8rem;
  display: none;
}

.print-profile-select.visible { display: block; }

.print-profile-select select {
  width: 100%;
  padding: 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'Source Serif 4', serif;
}

.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; }

.print-profile-name {
  text-align: center;
  font-style: italic;
  color: #555;
  margin-bottom: 1rem;
  font-size: 10pt;
}

@media (max-width: 680px) {
  .qq-priority-grid,
  .qq-decision-grid,
  .qq-cases,
  .qq-no-grid { grid-template-columns: 1fr; }
  .qq-hero h1 { font-size: 1.85rem; }
  .qq-logic { grid-template-columns: 1fr; }
  .qq-logic span,
  .qq-logic strong { border-bottom: none; }
  .qq-logic strong { border-bottom: 1px solid var(--border); }
  .qq-logic strong:last-child { border-bottom: none; }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .results-summary { grid-template-columns: 1fr; }
  .approach-card-body { grid-template-columns: 1fr 1fr; }
  .projection-chart-head { flex-direction: column; }
  .projection-legend { justify-content: flex-start; }
}

@media (max-width: 768px) {
  nav {
    justify-content: flex-end;
    align-items: center;
    overflow: visible;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    border-bottom: none;
    cursor: pointer;
    padding: 0.85rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.25s, opacity 0.2s;
    transform-origin: center;
  }

  nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
  nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy-mid);
    border-top: 1px solid rgba(201, 168, 76, 0.3);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  nav.nav-open .nav-links { display: flex; }

  nav .nav-links a,
  nav .nav-links button.nav-print {
    text-align: left;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid transparent;
    flex: none;
    width: 100%;
  }

  nav .nav-links a.active {
    border-bottom-color: rgba(255, 255, 255, 0.07);
    border-left-color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
  }

  nav .nav-links .nav-print {
    margin-left: 0;
    font-size: 0.85rem;
    border-bottom: none;
    color: rgba(255, 255, 255, 0.5);
  }
}

@media print {
  @page { margin: 2cm 2.5cm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  header {
    background: #fff !important;
    color: #000 !important;
    padding: 0 0 1rem !important;
    border-bottom: 2px solid #000;
  }

  .header-hebrew { color: #000 !important; }
  .header-title, .header-sub { color: #333 !important; }
  .header-ornament, header::before { display: none; }

  nav, .cta-block, .wizard-steps, .wizard-nav, .print-btn-area, .modal-overlay { display: none !important; }

  section,
  #section-simulateur { display: block !important; }

  body { background: white; font-size: 11pt; line-height: 1.6; }
  #section-texte, #section-faq, #section-simulateur, #section-quoi-qui { max-width: 100%; padding: 0; }

  .chapter { page-break-inside: avoid; margin-bottom: 2rem; padding-bottom: 1.5rem; }
  .chapter-letter { font-size: 2rem; color: #000 !important; }
  .chapter-title { color: #000 !important; }

  .hebrew-citation {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #ccc;
  }

  .hebrew-citation .ref { color: #555 !important; }
  blockquote { background: #f8f8f8 !important; border-left-color: #666 !important; }

  .faq-item {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  .faq-item summary { padding-right: 1.25rem; }
  .faq-item summary::after { display: none !important; }
  .faq-item:not([open]) .faq-answer { display: block !important; }

  .conclusion-box {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #ccc;
  }

  .conclusion-box p,
  .conclusion-box strong { color: #000 !important; }

  .sim-header { page-break-before: always; }
  .sim-header .hebrew { color: #000 !important; }
  .approaches-table th { background: #1a2a4a !important; color: #fff !important; }

  .approach-card-header { background: #1a2a4a !important; }
  .approach-card-header .aph-badge { color: #e8c97a !important; }
  .qq-card,
  .qq-case,
  .qq-rule,
  .qq-no-grid > div,
  .qq-table {
    break-inside: avoid;
    box-shadow: none !important;
  }
}
