/* Simulateurs.ma · feuille de style principale (reprise de la maquette) */
/* Mise en page : barre latérale fixe (bureau) / tiroir (mobile) + contenu ; tout en propriétés logiques pour FR (ltr) et AR (rtl) */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --ink: #141b3d;
  --muted: #5a5f7d;
  --line: #dcdeea;
  --accent: #4b3fd1;
  --accent-ink: #ffffff;
  --accent-soft: #e9e7fb;
  --ochre: #f4a51c;
  --ochre-ink: #3b2600;
  --c-fisc: #e9e7fb;   --c-fisc-ink: #3a30a8;
  --c-sal:  #e3edf9;   --c-sal-ink:  #1d4e89;
  --c-ind:  #fde6dc;   --c-ind-ink:  #9a3412;
  --c-fin:  #fdf0d5;   --c-fin-ink:  #7a4b00;
  --c-isl:  #f1e6fa;   --c-isl-ink:  #6b2a8f;
  --c-imm:  #f3ebe1;   --c-imm-ink:  #7c4a1e;
  --c-ret:  #e0f2fe;   --c-ret-ink:  #075985;
  --c-fam:  #fbe4e8;   --c-fam-ink:  #8c1d40;
  --c-auto: #eceef3;   --c-auto-ink: #334155;
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-logo: "Readex Pro", system-ui, sans-serif;
  --side-w: 288px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1126; --surface: #171b36; --ink: #e8e9f5; --muted: #a3a7c4; --line: #2a2f52;
    --accent: #8b82ff; --accent-ink: #0e1126; --accent-soft: #24224a; --ochre: #f4b740; --ochre-ink: #2a1a00;
    --c-fisc: #24224a; --c-fisc-ink: #c4beff;  --c-sal: #1a2a44; --c-sal-ink: #9cc3f0;
    --c-ind: #3a2016; --c-ind-ink: #f6ad8c;    --c-fin: #36290c; --c-fin-ink: #f4c46a;
    --c-isl: #2f1f3d; --c-isl-ink: #d4a8f0;    --c-imm: #33261a; --c-imm-ink: #e2b98f;
    --c-ret: #0f2a3b; --c-ret-ink: #8fd0f5;    --c-fam: #3a1a25; --c-fam-ink: #f2a3bc;
    --c-auto: #232838; --c-auto-ink: #c3cad8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1126; --surface: #171b36; --ink: #e8e9f5; --muted: #a3a7c4; --line: #2a2f52;
  --accent: #8b82ff; --accent-ink: #0e1126; --accent-soft: #24224a; --ochre: #f4b740; --ochre-ink: #2a1a00;
  --c-fisc: #24224a; --c-fisc-ink: #c4beff;  --c-sal: #1a2a44; --c-sal-ink: #9cc3f0;
  --c-ind: #3a2016; --c-ind-ink: #f6ad8c;    --c-fin: #36290c; --c-fin-ink: #f4c46a;
  --c-isl: #2f1f3d; --c-isl-ink: #d4a8f0;    --c-imm: #33261a; --c-imm-ink: #e2b98f;
  --c-ret: #0f2a3b; --c-ret-ink: #8fd0f5;    --c-fam: #3a1a25; --c-fam-ink: #f2a3bc;
  --c-auto: #232838; --c-auto-ink: #c3cad8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
html[lang="ar"] body { font-size: 15.5px; line-height: 1.7; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Logo Simulateurs.ma : étoile à huit branches + « = » ---------- */
.logo { width: 40px; height: 40px; flex: none; display: block; }
.logo svg { width: 100%; height: 100%; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wordmark b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.wordmark b .tld { color: var(--ochre); }
html[lang="ar"] .wordmark b { line-height: 1.5; }
html[lang="ar"] .wordmark small { font-size: 12.5px; }
.wordmark small { color: var(--muted); font-size: 12px; }

/* ---------- Barre latérale ---------- */
.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 30;
  background: var(--surface); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side-close { margin-inline-start: auto; display: none; width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; cursor: pointer; }

.side nav { overflow-y: auto; padding: 4px 10px 20px; flex: 1; }
.nav-home {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; font-weight: 600; text-align: start;
}
.nav-home[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
html[lang="ar"] .nav-label { letter-spacing: 0; font-size: 12.5px; }

.cat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px;
  border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: start; font-weight: 500;
}
.cat-btn:hover, .nav-home:hover { background: var(--bg); }
.cat-btn .dot { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
html[lang="ar"] .cat-btn .dot { font-size: 14px; }
.cat-btn .count { margin-inline-start: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-btn .chev { transition: transform .15s; flex: none; color: var(--muted); }
html[dir="rtl"] .cat-btn .chev { transform: scaleX(-1); }
.cat-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.cat.active > .cat-btn { background: var(--accent-soft); color: var(--accent); }
.cat ul { list-style: none; margin: 0 0 6px; padding: 0; padding-inline-start: 48px; }
.cat li a {
  display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 8px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.35;
}
.cat li a:hover { background: var(--bg); }
.cat li .ok { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.scrim { display: none; }

/* ---------- Contenu ---------- */
.main {
  margin-inline-start: var(--side-w); min-height: 100vh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.wrap { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg);
  display: flex; align-items: center; gap: 10px; padding: 14px 0;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--bg); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; place-items: center; flex: none; }
.top-brand { display: none; align-items: center; gap: 8px; }
.top-brand .logo { width: 34px; height: 34px; }
.search { flex: 1; min-width: 0; position: relative; }
.search input {
  width: 100%; height: 46px; padding-block: 0; padding-inline: 42px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lang { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.lang button { min-width: 44px; height: 38px; border: 0; border-radius: 999px; background: none; cursor: pointer; font-weight: 600; color: var(--muted); }
.lang button[lang="ar"] { font-size: 17px; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.hero h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
html[lang="ar"] .hero h1 { line-height: 1.5; letter-spacing: 0; }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 52ch; }
.hero-text { display: flex; flex-direction: column; justify-content: center; }
.feature {
  background: #4b3fd1; color: #ffffff; border-radius: 18px; padding: 18px; text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
}
.feature .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feature .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #d9d5ff; }
html[lang="ar"] .feature .eyebrow { letter-spacing: 0; font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill.live { background: #f4a51c; color: #3b2600; }
.feature strong { font-size: 20px; line-height: 1.35; }
.feature .sub { color: #dedbff; font-size: 14px; }
.feature .bars { display: flex; align-items: flex-end; gap: 6px; height: 40px; }
.feature .bars i { width: 22px; border-radius: 4px; background: #f4a51c; }
.feature .bars i:first-child { background: #8f86ef; }
.feature .go { margin-inline-start: auto; font-weight: 600; }

.sec-head h2 { margin: 0; font-size: 19px; }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0;
  transition: border-color .12s;
}
.card:hover { border-color: var(--accent); }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code { min-width: 36px; height: 28px; padding: 0 8px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; direction: ltr; }
.card h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.card .law { margin-top: auto; font-size: 12px; color: var(--muted); padding-top: 6px; border-top: 1px dashed var(--line); }
.pill.soon { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.card[hidden] { display: none !important; }

.more { align-self: center; min-height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.more:hover { background: var(--accent-soft); }
.more svg { transition: transform .15s; }

.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cat-card {
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px; cursor: pointer; text-align: start;
  display: flex; gap: 12px; align-items: flex-start; min-height: 44px;
}
.cat-card:hover { border-color: var(--accent); }
.cat-card .dot { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
html[lang="ar"] .cat-card .dot { font-size: 18px; }
.cat-card b { display: block; font-size: 15px; }
.cat-card span span { font-size: 13px; color: var(--muted); }

.ad { border: 1px dashed var(--line); border-radius: 12px; min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumb button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; min-height: 32px; font-weight: 600; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; grid-column: 1 / -1; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }

footer { color: var(--muted); font-size: 13px; text-align: center; padding-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .grid, .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .side { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.18); width: min(88vw, 320px); }
  html[dir="rtl"] .side { transform: translateX(102%); }
  .side.open, html[dir="rtl"] .side.open { transform: none; }
  .side-close { display: grid; place-items: center; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 20, 15, .45); }
  .scrim[hidden] { display: none; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: grid; }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .grid, .cats { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; }
  .top-brand { display: flex; flex: 1; }
  .search { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .side, .cat-btn .chev, .more svg { transition: none; } }

/* ---------- Mobile : barre de navigation du bas + puces de catégories (voir docs/design.md) ---------- */
.bnav, .chips { display: none; }
@media (max-width: 899px) {
  .bnav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    height: calc(72px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .bnav a, .bnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px;
    border: 0; background: none; padding: 0; cursor: pointer; text-decoration: none;
    color: var(--muted); font: inherit; font-size: 12px; line-height: 1.2;
  }
  .bnav [aria-current="page"], .bnav button[aria-expanded="true"] { color: var(--accent); font-weight: 600; }
  .bnav a:focus-visible, .bnav button:focus-visible { outline-offset: -4px; border-radius: 12px; }
  .main { padding-bottom: calc(72px + 32px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .scrim { z-index: 25; }
  .side { z-index: 30; }

  .chips {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px;
    scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips a {
    flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px;
    white-space: nowrap; scroll-snap-align: start;
  }
  .chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
}

/* ---------- Écran simulateur ---------- */
.crumb .sep { color: var(--line); }
.sim-head { display: flex; gap: 14px; align-items: flex-start; }
.sim-head .code { height: 40px; min-width: 48px; font-size: 13px; border-radius: 10px; flex: none; }
.sim-head h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.3; text-wrap: balance; }
.sim-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.sim-head .src { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
.sim-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 14px; font-weight: 500; }
.field small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.field input {
  font: inherit; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; width: 100%; height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); direction: ltr; text-align: start;
}
html[dir="rtl"] .field input { text-align: right; }
.field input::placeholder { color: var(--muted); opacity: .5; font-weight: 400; }
.opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.sim-empty { background: var(--accent-soft); border-radius: 12px; padding: 16px; color: var(--ink); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { border-inline-start: 3px solid var(--line); padding-inline-start: 12px; }
.stat.good { border-color: var(--accent); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat.good .v { color: var(--accent); }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.num { direction: ltr; unicode-bidi: isolate; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tbl td.y { font-weight: 700; }
.tbl td.g { color: var(--accent); font-weight: 600; }
.tbl tr.base td { color: var(--muted); }
.tbl .bar { height: 7px; border-radius: 4px; background: var(--c-fin-ink); margin: 5px auto 0; max-width: 120px; }
.tbl tr.base .bar { background: var(--line); }
.calib { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.sim-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sim-details summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 32px; }
.ydet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.ycard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ycard h4 { margin: 0 0 6px; font-size: 14px; }
.ycard div { display: flex; justify-content: space-between; gap: 8px; }
.ycard .tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; font-weight: 600; }
.method { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }
@media (max-width: 860px) { .sim-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sections d'accueil, à propos, guides ---------- */
.home-sec { display: flex; flex-direction: column; gap: 14px; }
.about-band { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.about-band .logo { width: 56px; height: 56px; }
.about-band h2 { margin: 0 0 6px; font-size: 19px; }
.about-band p { margin: 0; color: var(--muted); max-width: 70ch; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; min-height: 40px; margin-top: 6px; }
.goals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.goal .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.goal b { font-size: 15px; }
.goal span { font-size: 13.5px; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: #141b3d; border-radius: 18px; overflow: hidden; }
.figure { padding: 22px 18px; color: #ffffff; display: flex; flex-direction: column; gap: 4px; border-inline-start: 1px solid rgba(255,255,255,.14); }
.figure:first-child { border-inline-start: 0; }
.figure b { color: #f4a51c; font-size: 2.2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure span { color: #d9d5ff; font-size: 13.5px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: st; }
.steps li { counter-increment: st; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
.steps li::before { content: counter(st); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: #f4a51c; color: #3b2600; font-weight: 700; display: grid; place-items: center; }
.steps b { font-size: 15px; }
.steps span { font-size: 13.5px; color: var(--muted); }
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.review { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.review .head { display: flex; justify-content: space-between; align-items: center; }
.stars { color: #f4a51c; letter-spacing: 2px; font-size: 15px; }
.ex { font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.review p { margin: 0; font-size: 14px; color: var(--muted); font-style: italic; }
.review .who { font-size: 13px; font-weight: 600; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.guide .panel h3 { display: flex; align-items: center; gap: 8px; }
.guide p { margin: 0 0 8px; }
.guide ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.guide ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.guide .wide { grid-column: 1 / -1; }
.soon-box { border: 1px dashed var(--line); border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); background: var(--surface); }
.soon-box b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.prose { max-width: 72ch; display: flex; flex-direction: column; gap: 6px; }
.prose h3 { margin: 18px 0 2px; font-size: 17px; }
.prose p { margin: 0; color: var(--ink); }
.prose .lead { font-size: 16.5px; color: var(--muted); }
.ph { color: #7a4f10; font-weight: 600; }

@media (max-width: 1100px) { .goals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figure:nth-child(3) { border-inline-start: 0; } .figure:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); } }
@media (max-width: 760px) { .steps, .reviews, .guide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .goals { grid-template-columns: minmax(0, 1fr); } .about-band { grid-template-columns: minmax(0, 1fr); } .figure b { font-size: 1.8rem; } }
@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .tbl th:nth-child(5), .tbl td:nth-child(5) { display: none; }
  .tbl th, .tbl td { padding: 9px 3px; }
}

/* ---------- Compléments du socle PHP (liens à la place des boutons de la maquette, recherche, formulaires) ---------- */
[hidden] { display: none !important; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }
.page { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page.home { gap: 28px; }
.muted { color: var(--muted); }

a.nav-home, a.cat-card, a.top-brand, .cat li a, .crumb a, .link-btn, .lang a { text-decoration: none; }
a.nav-home { color: var(--ink); }
a.nav-home[aria-current="page"] { color: var(--accent); }
a.nav-home:hover { background: var(--bg); }
a.cat-card { color: var(--ink); }
a.top-brand { color: var(--ink); }
.crumb a { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; min-height: 32px; }
.link-btn { display: inline-flex; align-items: center; }
footer a { color: var(--accent); }
.lang a { min-width: 44px; height: 38px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; color: var(--muted); }
.lang a[lang="ar"] { font-size: 17px; }
.lang a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }

.sim-head h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.3; text-wrap: balance; }
.sec-head h1.h-page, .prose h1.h-page { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.3; }
.prose h2.h3 { margin: 18px 0 2px; font-size: 17px; }
.sim-head .logo { width: 48px; height: 48px; }
.field select {
  font: inherit; font-size: 16px; font-weight: 600; width: 100%; height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.stat.warn { border-color: #c2410c; }
.stat.warn .v { color: #c2410c; }
#search-results { display: flex; flex-direction: column; gap: 14px; }
#search-results[hidden] { display: none; }
.soon-box a { margin-top: 6px; }

/* ---------- Page simulateur mobile : en-tête avec retour, résultat sombre, bouton partager (voir canvas Design) ---------- */
html[dir="rtl"] .flip { transform: scaleX(-1); }
.back-btn, .top-title { display: none; }
.share-btn {
  margin-top: 14px; width: 100%; min-height: 50px; padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.share-btn[hidden] { display: none; }
@media (max-width: 899px) {
  .is-sim .menu-btn, .is-sim .top-brand, .is-sim .search { display: none; }
  .is-sim .topbar { flex-wrap: nowrap; }
  .is-sim .back-btn {
    display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  }
  .is-sim .top-title { display: block; flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .is-sim .crumb { display: none; }
  .is-sim .sim-head .code { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
  .is-sim .sim-head .src { border: 0; background: none; padding: 0; font-size: 12px; }
  .is-sim .sim-head p { font-size: 13.5px; }
  .field input, .field select { height: 50px; border-radius: 12px; }
}
@media (max-width: 860px) {
  .panel.result { background: #141b3d; border-color: #141b3d; color: #ffffff; border-radius: 22px; padding: 18px; }
  .panel.result .sim-empty { background: #222a55; color: #e9e7fb; }
  .panel.result .stats { display: flex; flex-direction: column; gap: 10px; }
  .panel.result .stat { border-color: #2c3460; }
  .panel.result .stat .k, .panel.result .stat .v small, .panel.result .calib, .panel.result .method { color: #c9cce6; }
  .panel.result .stat.good { order: -1; border-color: #f4a51c; }
  .panel.result .stat.good .v { color: #f4a51c; }
  .panel.result .stat.good:not(.stat.good ~ .stat.good) .v { font-size: 2.2rem; line-height: 1.15; }
  .panel.result .stat.warn .v { color: #fdba74; }
  .panel.result .tbl th { color: #c9cce6; }
  .panel.result .tbl th, .panel.result .tbl td { border-bottom-color: #2c3460; }
  .panel.result .tbl td.g { color: #f4a51c; }
  .panel.result .tbl tr.base td { color: #c9cce6; }
  .panel.result .tbl .bar { background: #f4a51c; }
  .panel.result .tbl tr.base .bar { background: #3a4272; }
  .panel.result .sim-details { border-top-color: #2c3460; }
  .panel.result .sim-details summary { color: #f4a51c; }
  .panel.result .ycard { border-color: #2c3460; }
  .panel.result .ycard .tot { border-top-color: #2c3460; }
  .panel.result .share-btn { background: #f4a51c; color: #141b3d; }
}

/* ---------- Contenu de référence d'un simulateur (barèmes, règles) ---------- */
.ref { display: flex; flex-direction: column; gap: 18px; }
.ref h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.ref p { margin: 0 0 8px; }
.ref .ref-intro { color: var(--muted); max-width: 80ch; }
.ref-scales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.ref-scale h3 { margin: 0 0 4px; font-size: 15px; }
.ref-scale .tbl th, .ref-scale .tbl td { text-align: start; padding: 8px 6px; font-size: 14px; }
.ref-scale .tbl td:last-child, .ref-scale .tbl th:last-child { text-align: end; font-weight: 600; }
@media (max-width: 899px) { .ref-scales { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ref-scales { grid-template-columns: minmax(0, 1fr); } }
.ref h3 { margin: 12px 0 6px; font-size: 15px; }
.ref-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Bandeau de consentement (Google Analytics) ---------- */
.consent {
  position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 560px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  box-shadow: 0 10px 40px rgba(20, 27, 61, .22); display: grid; gap: 8px;
}
.consent p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.consent a { color: var(--accent); }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.consent button {
  min-height: 44px; min-width: 110px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); cursor: pointer;
  background: var(--surface); color: var(--accent); font-weight: 600;
}
.consent button.primary { background: var(--accent); color: var(--accent-ink); }
.link-btn.inline { min-height: 0; margin: 0; padding: 0; font: inherit; font-size: inherit; text-decoration: underline; }
@media (max-width: 899px) { .consent { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Onglets de résultats (SimMaroc.tabs) ---------- */
.tabs .tablist { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs [role="tab"] {
  min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline-offset: -3px; border-radius: 8px; }
.tabs [role="tabpanel"][hidden] { display: none; }
