/* =====================================================================
   Haqia.ma — design system
   Émeraude (droit, confiance) · terracotta (chaleur, terre marocaine)
   Motif : étoile à huit branches (khatam), géométrie zellige.
   ===================================================================== */

:root {
  --bg: #F7F3EA;
  --surface: #FFFDF8;
  --surface-2: #EFE8D8;
  --surface-3: #E7DEC9;
  --ink: #10201B;
  --ink-2: #4B5B55;
  --ink-3: #7A8781;
  --line: #E2D8C3;
  --line-2: #D3C7AE;
  --brand: #0B5D4B;
  --brand-ink: #073E33;
  --brand-soft: #DDEBE3;
  --accent: #C4532D;
  --accent-soft: #F6E0D3;
  --gold: #B48A3C;
  --on-brand: #F7F3EA;
  --deep: #0B2F28;
  --shadow-1: 0 1px 2px rgba(16, 32, 27, .06), 0 2px 8px rgba(16, 32, 27, .05);
  --shadow-2: 0 2px 6px rgba(16, 32, 27, .06), 0 18px 48px -12px rgba(16, 32, 27, .22);
  --radius: 14px;
  --radius-lg: 22px;
  --f-display: "Fraunces", "Noto Kufi Arabic", Georgia, serif;
  --f-body: "Instrument Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09130F; --surface: #0E1B17; --surface-2: #12241F; --surface-3: #17302A;
    --ink: #ECF1EB; --ink-2: #A3B4AC; --ink-3: #74867E; --line: #1E332D; --line-2: #29443C;
    --brand: #43B694; --brand-ink: #7CD3B6; --brand-soft: #123129; --accent: #E58358; --accent-soft: #3A2218;
    --gold: #D2AC62; --on-brand: #06120F; --deep: #061310;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 24px 60px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09130F; --surface: #0E1B17; --surface-2: #12241F; --surface-3: #17302A;
  --ink: #ECF1EB; --ink-2: #A3B4AC; --ink-3: #74867E; --line: #1E332D; --line-2: #29443C;
  --brand: #43B694; --brand-ink: #7CD3B6; --brand-soft: #123129; --accent: #E58358; --accent-soft: #3A2218;
  --gold: #D2AC62; --on-brand: #06120F; --deep: #061310;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 24px 60px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

[dir="rtl"] {
  --f-display: "Noto Kufi Arabic", "Fraunces", serif;
  --f-body: "IBM Plex Sans Arabic", "Instrument Sans", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;   /* « clip » et non « hidden » : ne crée pas de conteneur de défilement (sinon position: sticky ne marche plus) */
}
[dir="rtl"] body { line-height: 1.75; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand); color: var(--on-brand); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 780px; }

.i { width: 22px; height: 22px; flex: none; }
.i--sm { width: 18px; height: 18px; }
.i--xs { width: 14px; height: 14px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Buttons ---------- */
.btn {
  --bh: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--bh); padding: 0 1.25em; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s, box-shadow .25s var(--ease), color .2s;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--sm { --bh: 38px; font-size: .9rem; padding: 0 1em; }
.btn--lg { --bh: 56px; font-size: 1.05rem; padding: 0 1.6em; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn--primary:hover { background: var(--brand-ink); transform: translateY(-1px); }
:root[data-theme="dark"] .btn--primary:hover { background: var(--brand-ink); }
.btn--light { background: #F7F3EA; color: #0B2F28; }
.btn--light:hover { background: #fff; transform: translateY(-1px); }
.btn--google { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--google:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn .i { transition: transform .3s var(--ease); }
.btn:hover .i.flip, .btn:hover .i:last-child:not(:first-child) { transform: translateX(3px); }
[dir="rtl"] .btn:hover .i.flip { transform: scaleX(-1) translateX(3px); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; color: var(--brand); }
/* Logo Bab : le losange de lumière s'élève au survol */
.logo-mark .lm-d, .seal .lm-d, .cta__seal .lm-d { transform-box: view-box; transform-origin: 50px 43px; transition: transform .5s var(--ease); }
@keyframes babglow { 50% { transform: translateY(-3px) scale(1.3); opacity: .65; } }
.logo-mark--sm { width: 18px; height: 18px; }
.brand:hover .logo-mark .lm-d { transform: translateY(-7px) scale(1.25); }
.brand__word { font-family: "Fraunces", serif; font-size: 1.22rem; font-weight: 600; font-variation-settings: "opsz" 144; text-transform: uppercase; letter-spacing: .13em; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; transition: background-color .3s, box-shadow .3s, backdrop-filter .3s; }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.nav__links { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav__links a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: .95rem; transition: color .2s, background-color .2s; }
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav__burger { display: none; }

.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.lang__btn:hover { color: var(--ink); border-color: var(--line-2); }
.lang__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 170px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s var(--ease); z-index: 60; }
.lang.is-open .lang__menu, .lang:focus-within .lang__menu { opacity: 1; visibility: visible; transform: none; }
.lang__menu a { display: block; padding: 9px 12px; border-radius: 9px; font-weight: 500; }
.lang__menu a:hover { background: var(--surface-2); }
.lang__menu a[aria-current] { color: var(--brand); background: var(--brand-soft); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(28px, 5vw, 64px) 0 40px; overflow: hidden; }
.hero__bg { position: absolute; inset: -10% -5% auto auto; width: min(900px, 90vw); height: 760px; color: var(--brand); opacity: .14; pointer-events: none; }
[dir="rtl"] .hero__bg { inset: -10% auto auto -5%; }
.zellige { width: 100%; height: 100%; }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(32px, 5vw, 72px); align-items: center; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

.hero__title { margin-top: 22px; font-size: clamp(2.7rem, 6.4vw, 5.4rem); font-weight: 500; letter-spacing: -.035em; }
[dir="rtl"] .hero__title { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 700; }
.hero__title em { font-style: normal; font-weight: 500; color: var(--brand); position: relative; white-space: nowrap; }
[dir="rtl"] .hero__title em { font-style: normal; font-weight: 800; }
.hero__title em::after { content: ""; position: absolute; inset-inline: 0; bottom: .02em; height: .14em; background: var(--accent); opacity: .85; border-radius: 4px; transform-origin: inline-start; transform: scaleX(0); animation: underline 1.1s .7s var(--ease) forwards; }
@keyframes underline { to { transform: scaleX(1); } }
.hero__sub { margin-top: 20px; max-width: 34em; font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--ink-2); }

.ask { margin-top: 30px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 14px 14px 12px 18px; box-shadow: var(--shadow-2); transition: border-color .2s, box-shadow .3s; }
.ask:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-2); }
.ask textarea { display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; font-size: 1.08rem; line-height: 1.5; min-height: 54px; }
.ask textarea::placeholder { color: var(--ink-3); transition: opacity .35s; }
.ask textarea.is-fading::placeholder { opacity: 0; }
.ask__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.ask__hint { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: transparent; border: 1px solid var(--line-2); font-size: .86rem; font-weight: 500; color: var(--ink-2); transition: .2s; }
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* Demo */
.hero__demo { position: relative; }
.hero__seal { position: absolute; inset: -12% -14% auto auto; width: 120%; aspect-ratio: 1; z-index: -1; color: var(--gold); opacity: .22; pointer-events: none; }
[dir="rtl"] .hero__seal { inset: -12% auto auto -14%; }
.hero__seal .seal { width: 100%; height: 100%; }
.hero__seal .lm-d { animation: babglow 6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden; transform: rotate(-1.2deg); transition: transform .6s var(--ease); }
[dir="rtl"] .demo { transform: rotate(1.2deg); }
.demo:hover { transform: rotate(0) translateY(-4px); }
.demo__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; color: var(--ink-3); }
.demo__dots { display: flex; gap: 6px; }
.demo__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.demo__title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.demo__badge { margin-inline-start: auto; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.demo__body { display: flex; flex-direction: column; gap: 14px; padding: 22px; min-height: 380px; }

.bubble { max-width: 92%; padding: 12px 16px; border-radius: 18px; font-size: .95rem; line-height: 1.55; }
.bubble--user { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-end-end-radius: 6px; }
.bubble--bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-end-start-radius: 6px; }
.bubble--bot p + p { margin-top: 8px; }
.bubble__h { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
[dir="rtl"] .bubble__h { letter-spacing: 0; font-size: .85rem; }
.steps-mini { margin: 6px 0 4px; padding-inline-start: 20px; }
.steps-mini li { margin: 3px 0; }
.steps-mini li::marker { color: var(--brand); font-weight: 700; }
.source-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: .78rem; font-weight: 600; color: var(--brand); }
.demo__typing { display: none; align-items: center; gap: 4px; font-size: .82rem; color: var(--ink-3); }
.demo__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: dot 1.2s infinite; }
.demo__typing span:nth-child(2) { animation-delay: .15s; } .demo__typing span:nth-child(3) { animation-delay: .3s; margin-inline-end: 6px; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.js [data-demo].is-typing .demo__typing { display: flex; }
.js [data-demo] [data-demo-answer] > * { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js [data-demo].is-done [data-demo-answer] > * { opacity: 1; transform: none; }
.js [data-demo]:not(.is-done) [data-demo-answer] { visibility: hidden; }
[data-demo].is-done [data-demo-answer] > :nth-child(2) { transition-delay: .12s; }
[data-demo].is-done [data-demo-answer] > :nth-child(3) { transition-delay: .3s; }
[data-demo].is-done [data-demo-answer] > :nth-child(4) { transition-delay: .42s; }
[data-demo].is-done [data-demo-answer] > :nth-child(5) { transition-delay: .62s; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 56px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats > div { background: var(--bg); padding: 18px 22px; display: flex; align-items: baseline; gap: 12px; }
.stats dt { font-family: "Fraunces", serif; font-size: 2.1rem; font-weight: 500; color: var(--brand); font-variant-numeric: tabular-nums; }
.stats dd { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* ---------- Sources marquee ---------- */
.sources { padding: 28px 0 8px; }
.sources__title { text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
[dir="rtl"] .sources__title { letter-spacing: 0; font-size: .9rem; }
.marquee { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; width: max-content; gap: 40px; animation: marquee 60s linear infinite; }
[dir="rtl"] .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: 10px; font-family: "Fraunces", serif; font-size: 1.12rem; color: var(--ink-2); white-space: nowrap; }
.marquee__item .i { color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--tint { background: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--line-2) 60%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.section__head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section__head h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 500; }
[dir="rtl"] .section__head h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 700; }
.section__head > p:not(.kicker) { margin-top: 14px; color: var(--ink-2); font-size: 1.08rem; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
[dir="rtl"] .kicker { letter-spacing: 0; font-size: .92rem; }
.kicker::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.kicker--light { color: #F3B28F; }

/* Method */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.how__step { position: relative; padding: 30px 26px 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.how__step:not(:last-child)::after { content: ""; position: absolute; top: 50px; inset-inline-end: -21px; width: 22px; height: 1.5px; background: var(--line-2); }
.how__num { font-family: "Fraunces", serif; font-size: 3.2rem; line-height: 1; color: transparent; -webkit-text-stroke: 1.2px var(--brand); font-weight: 500; }
.how__step h3 { margin-top: 18px; font-size: 1.35rem; }
.how__step p { margin-top: 10px; color: var(--ink-2); }

/* Domains */
.domains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.domain { position: relative; display: flex; flex-direction: column; padding: 22px 20px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .35s var(--ease), border-color .25s, box-shadow .35s var(--ease); isolation: isolate; }
.domain::before { content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 30%; background: var(--brand-soft); transform: rotate(45deg) scale(.4); opacity: 0; transition: .5s var(--ease); z-index: -1; }
[dir="rtl"] .domain::before { inset: auto auto -60% -30%; }
.domain:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-2); }
.domain:hover::before { opacity: 1; transform: rotate(45deg) scale(1); }
.domain__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.domain__num { position: absolute; top: 20px; inset-inline-end: 20px; font-family: "Fraunces", serif; font-size: .9rem; color: var(--ink-3); }
.domain h3 { margin-top: 18px; font-size: 1.14rem; letter-spacing: -.01em; }
.domain p { margin-top: 6px; color: var(--ink-2); font-size: .9rem; flex: 1; }
.domain__refs { margin-top: 14px; font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.domain__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 600; font-size: .86rem; color: var(--brand); }

/* Tools */
.tools { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: start; }
.calc, .letters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); }
.calc h3, .letters h3 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.calc h3 .i, .letters h3 .i { color: var(--brand); }
.calc__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field--wide { grid-column: 1 / -1; }
.field > span, .field legend { font-size: .84rem; font-weight: 600; color: var(--ink-2); padding: 0; }
.field input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); font-size: 1.05rem; font-variant-numeric: tabular-nums; transition: border-color .2s, box-shadow .2s; width: 100%; }
.field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg legend { margin-bottom: 6px; grid-column: 1 / -1; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line-2); font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .2s; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.seg input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.calc__out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.calc__res { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.calc__res span { font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.calc__res strong { font-family: "Fraunces", serif; font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc__res--main { grid-column: 1 / -1; background: var(--deep); color: #F7F3EA; }
.calc__res--main span { color: #A9C7BC; }
.calc__detail { font-size: .78rem; color: #A9C7BC; font-variant-numeric: tabular-nums; }
.calc__detail:empty { display: none; }
.calc__res--main strong { font-size: clamp(1.9rem, 4vw, 2.6rem); color: #fff; }
.calc__note { grid-column: 1 / -1; font-size: .88rem; color: var(--accent); font-weight: 600; }
.calc__basis { margin: 14px 0 18px; font-size: .78rem; color: var(--ink-3); }
.letters ul { margin: 16px 0 0; padding: 0; list-style: none; }
.letters li + li { border-top: 1px solid var(--line); }
.letters a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-weight: 600; font-size: .95rem; transition: color .2s, padding .3s var(--ease); }
.letters a > span:nth-child(2) { flex: 1; }
.letters a:hover { color: var(--brand); padding-inline-start: 10px; }
.letters__ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }

/* Darija */
.darija { position: relative; background: var(--deep); color: #EDF2EC; overflow: hidden; }
.darija::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23F7F3EA' stroke-width='1'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='7'/%3E%3C/g%3E%3C/svg%3E"); }
.darija__grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.darija h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 500; }
[dir="rtl"] .darija h2 { font-weight: 700; }
.darija p { margin: 16px 0 28px; color: #B9CCC4; font-size: 1.08rem; max-width: 30em; }
.darija__chat { display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: var(--radius-lg); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); }
.darija .bubble--user { background: #E58358; color: #1A0E08; }
.darija .bubble--bot { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #EDF2EC; }
.wave { display: flex; align-items: center; gap: 4px; height: 34px; margin-top: 4px; }
.wave i { width: 4px; border-radius: 4px; background: #43B694; height: 30%; animation: wave 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.09s); }
@keyframes wave { 50% { height: 100%; } }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.feature { background: var(--bg); padding: 30px 28px; transition: background-color .3s; }
.feature:hover { background: var(--surface); }
.feature__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--brand); }
.feature h3 { margin-top: 18px; font-size: 1.2rem; }
.feature p { margin-top: 8px; color: var(--ink-2); font-size: .95rem; }

/* Cases */
.cases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.case { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.case:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.case__tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .76rem; font-weight: 700; }
.case blockquote { margin: 0; font-family: var(--f-display); font-size: 1.12rem; line-height: 1.35; flex: 1; }
.case__who { font-size: .84rem; color: var(--ink-3); }
.case__go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .86rem; color: var(--accent); }

/* Account */
.account { display: grid; grid-template-columns: 1fr .8fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(28px, 4vw, 48px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.account h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 500; }
.account > div > p:not(.kicker) { margin-top: 12px; color: var(--ink-2); }
.ticks { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ticks li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.ticks .i { color: var(--on-brand); background: var(--brand); border-radius: 50%; padding: 3px; }
.account__card { display: flex; flex-direction: column; gap: 18px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line); }
.account__mock { display: grid; gap: 8px; }
.account__mock span { height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.account__mock span::after { content: ""; position: absolute; inset: 14px auto 14px 14px; width: 55%; border-radius: 6px; background: var(--surface-3); }
[dir="rtl"] .account__mock span::after { inset: 14px 14px 14px auto; }
.account__mock span:nth-child(2)::after { width: 40%; } .account__mock span:nth-child(3)::after { width: 68%; }

/* FAQ */
.faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
.faq__list { display: grid; gap: 10px; }
.faq__item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.faq__item[open] { border-color: var(--line-2); }
.faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.02rem; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary .i { color: var(--brand); transition: transform .3s var(--ease); }
.faq__item[open] summary .i { transform: rotate(45deg); }
.faq__item p { padding: 0 20px 20px; color: var(--ink-2); }

/* CTA */
.cta { padding: 0 0 clamp(64px, 8vw, 110px); }
.cta__inner { position: relative; text-align: center; padding: clamp(48px, 7vw, 88px) var(--gutter); border-radius: 32px; background: radial-gradient(120% 140% at 50% 0%, #0F6B56 0%, #0B3D33 55%, #072822 100%); color: #F7F3EA; overflow: hidden; }
.cta__seal { position: absolute; width: 520px; height: 520px; inset: -180px auto auto 50%; margin-left: -260px; color: rgba(247, 243, 234, .08); }
.cta__seal .lm-d { fill: rgba(229, 131, 88, .35); animation: babglow 6s ease-in-out infinite; }
.cta h2 { position: relative; font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 500; max-width: 16em; margin-inline: auto; }
.cta p { position: relative; margin: 14px 0 30px; color: #B9CCC4; font-size: 1.1rem; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 56px 0 28px; background: var(--bg); }
/* Frise de portes Bab, juste sous la bordure du pied de page */
.footer::before { content: ""; display: block; height: 16px; margin: -40px 0 24px; background: url("/assets/img/frise-portes.svg") repeat-x left center / 14px 16px; opacity: .4; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px; }
.footer__brand p { margin-top: 14px; color: var(--ink-2); max-width: 22em; }
.footer h3 { font-family: var(--f-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 12px; }
[dir="rtl"] .footer h3 { letter-spacing: 0; font-size: .9rem; }
.footer__grid a:not(.brand) { display: block; padding: 4px 0; color: var(--ink-2); font-size: .94rem; }
.footer__grid a:not(.brand):hover { color: var(--brand); }
.footer__langs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; }
.footer__langs a { display: inline !important; }
.footer__langs a[aria-current] { color: var(--brand) !important; font-weight: 600; }
.footer__legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.footer__disclaimer { font-size: .82rem; color: var(--ink-3); max-width: 70em; }
.footer__copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--ink-3); }
.footer__made { display: inline-flex; align-items: center; gap: 6px; }
.footer__made .i { color: var(--accent); }
.footer__by { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; font-size: .8rem; letter-spacing: .02em; color: var(--ink-3); }
.by-bouda { white-space: nowrap; }
.footer__grid { grid-template-columns: 1.4fr repeat(4, 1fr); }
.footer__sister { margin-top: 10px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
[dir="rtl"] .footer__sister { letter-spacing: 0; font-size: .85rem; }
.footer__grid small { color: var(--ink-3); font-size: .78em; }

/* Legal / 404 */
.legal { padding-block: 56px 96px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 500; }
.legal__date { margin-top: 10px; color: var(--ink-3); font-size: .9rem; }
.prose { margin-top: 32px; color: var(--ink-2); }
.prose h2 { margin: 32px 0 10px; font-size: 1.35rem; color: var(--ink); }
.prose p, .prose ul { margin: 0 0 12px; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.notfound { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; padding-block: 64px; }
.notfound .seal { width: 90px; color: var(--brand); }
.notfound h1 { font-size: 2.6rem; }
.notfound p { color: var(--ink-2); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =====================================================================
   APP — Assistant
   ===================================================================== */
body.is-app { height: 100dvh; overflow: hidden; }
.app { display: grid; grid-template-columns: 290px 1fr; height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--surface-2); border-inline-end: 1px solid var(--line); min-height: 0; }
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px; }
.side__close { display: none; }
.side__label { margin-top: 6px; padding-inline: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
[dir="rtl"] .side__label { letter-spacing: 0; font-size: .85rem; }
.side__list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side__empty { padding: 10px 8px; color: var(--ink-3); font-size: .88rem; }
.side__item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.side__item a { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.side__item:hover a, .side__item.is-active a { background: var(--surface); color: var(--ink); }
.side__item.is-active a { box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .side__item.is-active a { box-shadow: inset -3px 0 0 var(--brand); }
.side__item button { position: absolute; inset-inline-end: 4px; width: 30px; height: 30px; opacity: 0; }
.side__item:hover button, .side__item button:focus-visible { opacity: 1; }
.side__foot { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.side__hint { font-size: .84rem; color: var(--ink-2); }
.side__quota { font-size: .78rem; color: var(--ink-3); text-align: center; }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.me__name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__scrim { display: none; }

.thread-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bar__menu { display: none; }
.bar__end { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.topic-select { position: relative; display: inline-flex; align-items: center; }
.topic-select__icon { position: absolute; inset-inline-start: 12px; color: var(--brand); pointer-events: none; display: grid; }
.topic-select select { appearance: none; height: 40px; padding-inline: 38px 34px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%237A8781' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; font-weight: 600; font-size: .9rem; cursor: pointer; max-width: 60vw; }
[dir="rtl"] .topic-select select { background-position: left 12px center; }

.thread { flex: 1; overflow-y: auto; padding: 28px var(--gutter) 24px; scroll-behavior: smooth; }
.empty { max-width: 680px; margin: 6vh auto 0; text-align: center; }
.empty__seal { display: grid; place-items: center; }
.empty__seal .seal { width: 64px; height: 64px; color: var(--brand); }
.seal--anim .lm-d { animation: babglow 3.2s ease-in-out infinite; }
.empty h1 { margin-top: 20px; font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 500; }
.empty > p { margin-top: 10px; color: var(--ink-2); }
.empty__label { margin-top: 28px !important; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3) !important; }
.empty__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.suggest { display: flex; align-items: flex-start; gap: 10px; padding: 14px; text-align: start; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem; color: var(--ink-2); transition: .2s var(--ease); }
.suggest .i { color: var(--brand); margin-top: 2px; }
.suggest:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-2px); }

.msg { max-width: 760px; margin: 0 auto 26px; animation: msgIn .45s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg--user { display: flex; justify-content: flex-end; }
.msg--user .msg__text { max-width: 85%; padding: 12px 16px; border-radius: 18px 18px 6px 18px; background: var(--brand); color: var(--on-brand); white-space: pre-wrap; overflow-wrap: anywhere; }
[dir="rtl"] .msg--user .msg__text { border-radius: 18px 18px 18px 6px; }
.msg--bot { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.msg__avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.msg__avatar .logo-mark { width: 22px; height: 22px; }
.msg.is-streaming .msg__avatar .lm-d { transform-box: view-box; transform-origin: 50px 43px; animation: babglow 1.1s ease-in-out infinite; }
.msg__body { min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-3); padding: 6px 0; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; box-shadow: 0 0 0 3px var(--accent-soft); }

.md { overflow-wrap: anywhere; }
.md > * + * { margin-top: .75em; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 700; letter-spacing: 0; line-height: 1.4; margin-top: 1.2em; color: var(--ink); }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p strong:only-child { display: block; margin-top: .6em; color: var(--brand); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
[dir="rtl"] .md p strong:only-child { letter-spacing: 0; font-size: .95rem; }
.md ul, .md ol { padding-inline-start: 1.3em; }
.md li + li { margin-top: .3em; }
.md li::marker { color: var(--brand); font-weight: 700; }
.md a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: .9em; }
.md blockquote { margin: 0; padding: 10px 14px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; }
.md hr { border: 0; border-top: 1px solid var(--line); }
.md table { width: 100%; border-collapse: collapse; font-size: .92rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: start; }
.md th { background: var(--surface-2); }
.cursor { display: inline-block; width: 8px; height: 1.05em; margin-inline-start: 2px; vertical-align: -2px; background: var(--brand); border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.srcs { margin-top: 18px; }
.srcs__title { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.srcs__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 8px; }
.src { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .84rem; transition: border-color .2s, transform .2s; animation: msgIn .4s var(--ease); }
.src:hover { border-color: var(--brand); transform: translateY(-1px); }
.src__host { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--brand); font-weight: 700; }
.src__title { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.acts { display: flex; gap: 2px; margin-top: 12px; }
.acts .icon-btn { width: 34px; height: 34px; border-radius: 9px; }
.acts .icon-btn.is-on { color: var(--brand); background: var(--brand-soft); }
.notice { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); }

.composer { padding: 10px var(--gutter) 14px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.composer__box { position: relative; max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-2); transition: border-color .2s, box-shadow .3s; }
[dir="rtl"] .composer__box { padding: 10px 16px 10px 10px; }
.composer__box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-2); }
.composer textarea { flex: 1; min-height: 26px; max-height: 220px; padding: 9px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 1.02rem; line-height: 1.5; }
.composer__actions { display: flex; align-items: center; gap: 4px; }
.send { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--brand); color: var(--on-brand); cursor: pointer; transition: transform .2s var(--ease), opacity .2s, background-color .2s; }
.send:hover { transform: scale(1.05); }
.send:disabled { opacity: .35; cursor: default; transform: none; }
.send--stop { background: var(--ink); color: var(--bg); }
[data-voice].is-listening { color: #fff; background: var(--accent); animation: pulse 1.2s infinite; }
.composer__note { max-width: 760px; margin: 8px auto 0; text-align: center; font-size: .74rem; color: var(--ink-3); }

.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 80; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .9rem; box-shadow: var(--shadow-2); animation: msgIn .3s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .domains { grid-template-columns: repeat(3, 1fr); }
  .cases { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .nav__links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 2px; margin: 0; padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s var(--ease); }
  .nav.is-open .nav__links { transform: none; opacity: 1; visibility: visible; }
  .nav__links a { padding: 12px; font-size: 1.05rem; }
  .nav.is-open { background: var(--bg); }
  .nav__burger { display: inline-grid; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__demo { max-width: 560px; }
  .tools, .darija__grid, .account, .faq { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .how__step:not(:last-child)::after { display: none; }
  .features { grid-template-columns: 1fr 1fr; }
  .faq { gap: 0; }

  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 70; width: min(320px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-2); }
  [dir="rtl"] .side { transform: translateX(102%); }
  .app.side-open .side { transform: none; }
  .side__close, .bar__menu { display: inline-grid; }
  .side__scrim { position: fixed; inset: 0; z-index: 65; background: rgba(6, 18, 15, .45); opacity: 0; visibility: hidden; transition: .3s; display: block; }
  .app.side-open .side__scrim { opacity: 1; visibility: visible; }
}
@media (max-width: 640px) {
  .nav__cta { display: none; }
  .domains, .cases, .features, .empty__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { padding: 14px 18px; }
  .calc__fields, .calc__out { grid-template-columns: 1fr; }
  .ask__hint { display: none; }
  .ask__bar { justify-content: flex-end; }
  .footer__grid { grid-template-columns: 1fr; }
  .demo__body { min-height: 0; padding: 16px; }
  .bar { padding: 8px 10px; }
  .bar__end .lang { display: none; }
  .msg--bot { grid-template-columns: 1fr; }
  .msg__avatar { display: none; }
  .hero__seal { display: none; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .side, .bar, .composer, .acts, .nav, .footer, .toast { display: none !important; }
  body.is-app, .app { height: auto; overflow: visible; display: block; }
  .thread { overflow: visible; padding: 0; }
  .msg--user .msg__text { background: none; color: #000; border: 1px solid #999; }
  body { background: #fff; color: #000; }
}

/* ---------- Modes Flash / Pro + questions de suite ---------- */
.modebar { max-width: 760px; margin: 0 auto 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mode { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.mode__btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: .86rem; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.mode__btn:hover { color: var(--ink); }
.mode__btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.mode__btn[data-mode-value="flash"].is-on { color: var(--accent); }
.mode__btn[data-mode-value="pro"].is-on { color: var(--brand); }
.mode__hint { font-size: .8rem; color: var(--ink-3); }
.follow { margin-top: 18px; display: grid; gap: 8px; }
.follow__title { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
[dir="rtl"] .follow__title { letter-spacing: 0; font-size: .88rem; }
.follow__btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .93rem; text-align: start; cursor: pointer; transition: border-color .2s, transform .2s var(--ease), background-color .2s; animation: msgIn .4s var(--ease) both; }
.follow__btn:nth-child(3) { animation-delay: .08s; } .follow__btn:nth-child(4) { animation-delay: .16s; }
.follow__btn .i { color: var(--brand); flex: none; }
.follow__btn:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateX(3px); }
[dir="rtl"] .follow__btn:hover { transform: translateX(-3px); }
@media (max-width: 640px) { .mode__hint { display: none; } .modebar { justify-content: center; } }

/* ---------- Recommandation partenaire ---------- */
.sponsor { display: grid; gap: 4px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface); transition: border-color .2s, transform .2s var(--ease); }
.sponsor:hover { border-color: var(--gold); transform: translateY(-1px); }
.sponsor__tag { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
[dir="rtl"] .sponsor__tag { letter-spacing: 0; font-size: .8rem; }
.sponsor strong { font-size: .98rem; }
.sponsor__body { font-size: .88rem; color: var(--ink-2); }
.sponsor__cta { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--brand); }

/* ---------- Chat agrandi, menus Exporter / Partager, en-tête d'impression ---------- */
.bar__wide { display: inline-grid; }
.app.is-wide { grid-template-columns: 1fr; }
.app.is-wide .side { display: none; }
.app.is-wide .msg, .app.is-wide .composer__box, .app.is-wide .composer__note, .app.is-wide .modebar { max-width: 1080px; }
@media (max-width: 920px) { .bar__wide { display: none; } .app.is-wide { grid-template-columns: 1fr; } .app.is-wide .side { display: flex; } }
.xwrap { position: relative; display: inline-flex; }
.xmenu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 80; min-width: 230px; display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); animation: msgIn .2s var(--ease); }
.xmenu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: .9rem; text-align: start; cursor: pointer; }
.xmenu button:hover, .xmenu button:focus-visible { background: var(--surface-2); outline: none; }
.xmenu button span { width: 1.4em; text-align: center; }
.print-head { display: none; }
@media print {
  .print-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid #999; font-size: 10pt; }
  .xwrap, .jobs, .follow, .sponsor, .think, .empty, .print-head + .empty { display: none !important; }
  .msg, .app.is-wide .msg { max-width: none; }
}
.footer__grid a.footer__social { display: flex; align-items: center; gap: 6px; }

/* Tutoriel vidéo (accueil FR) */
.tuto { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.tuto__lead { margin-top: 12px; color: var(--ink-2); font-size: 1.08rem; }
.tuto__list { margin: 20px 0 26px; padding: 0; list-style: none; display: grid; gap: 10px; }
.tuto__list li { position: relative; padding-inline-start: 26px; color: var(--ink-2); }
.tuto__list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.tuto__media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); background: #0b1f1a; aspect-ratio: 16 / 9; }
.tuto__media video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .tuto { grid-template-columns: minmax(0, 1fr); } .tuto__media { order: -1; } }

/* Textes de référence par domaine (maillage vers les codes officiels) */
.domains__codes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; }
.domains__codes strong { width: 100%; font-size: .9rem; color: var(--ink-2); }
.domains__codes a { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .86rem; text-decoration: none; }
.domains__codes a span { font-weight: 600; color: var(--brand); }
.domains__codes a:hover { border-color: var(--brand); }
.domains__codes .domains__all { font-weight: 600; color: var(--brand); }

/* ---------- Footer (17/11/2026) : newsletter, 4 colonnes de liens, barre basse ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footer { padding: 48px 0 28px; }
.fnl { display: grid; grid-template-columns: 1fr minmax(0, 1.1fr); gap: 20px 40px; align-items: center; margin: -1px 0 48px; padding: 28px 32px;
  background: var(--deep); color: #F3EFE4; border-radius: var(--radius-lg); }
.fnl__title { font-family: var(--f-display); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.2; color: #fff; }
.fnl__txt p { margin-top: 6px; color: rgba(243, 239, 228, .78); font-size: .95rem; max-width: 34em; }
.fnl__row { display: flex; gap: 8px; }
.fnl__row input[type=email] { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; }
.fnl__row input[type=email]::placeholder { color: rgba(243, 239, 228, .55); }
.fnl__row input[type=email]:focus { outline: 2px solid var(--gold); outline-offset: 1px; background: rgba(255,255,255,.12); }
.fnl__row .btn { height: 46px; white-space: nowrap; flex: none; }
.fnl__hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.fnl__consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .8rem; color: rgba(243, 239, 228, .72); line-height: 1.45; }
.fnl__consent input { margin-top: 3px; accent-color: var(--gold); flex: none; }
.fnl__consent a { color: #fff; text-decoration: underline; }
.fnl__msg { min-height: 1.2em; margin-top: 6px; font-size: .85rem; }
.fnl__msg.is-ok { color: #9BE3C6; } .fnl__msg.is-err { color: #FFB59A; }
.footer__grid { grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 32px; }
.footer__grid nav a { display: block; padding: 5px 0; line-height: 1.35; }
.footer__follow { display: grid; gap: 2px; margin-top: 14px; }
.footer__follow a.footer__social { font-size: .88rem; overflow-wrap: anywhere; }
.footer__sister { margin-top: 14px; }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; font-size: .82rem; color: var(--ink-3); }
.footer__bottom .footer__copy { display: block; }
.footer__bottom .footer__langs { margin: 0; gap: 2px 14px; }
.footer__bottom .footer__langs a { color: var(--ink-2); font-size: .82rem; padding: 2px 0; }
.footer__bottom .footer__langs a:hover { color: var(--brand); }
@media (max-width: 1080px) { .footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .fnl { grid-template-columns: 1fr; padding: 24px 20px; margin-bottom: 36px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) { .fnl__row { flex-direction: column; } .fnl__row input[type=email] { flex: none; width: 100%; } .fnl__row .btn { width: 100%; } }
/* Maintenance : en-tête réduit et bandeau d'information (seuls les documents sont ouverts) */
.mnav--docs { display: flex !important; }
.maintbar { background: var(--brand-soft); color: var(--brand-ink); font-size: .9rem; border-bottom: 1px solid var(--line); }
.maintbar .wrap { display: flex; gap: 8px; align-items: center; justify-content: center; padding-block: 9px; text-align: center; }
.footer__grid--slim { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 760px) { .footer__grid--slim { grid-template-columns: 1fr 1fr; } .footer__grid--slim .footer__brand { grid-column: 1 / -1; } }

/* En-tête réduit (maintenance) sur téléphone : le logo suffit, le bandeau d'annonce reste lisible */
@media (max-width: 520px) {
  .mnav--docs { display: none !important; }
  .maintbar { font-size: .82rem; }
  .maintbar .wrap { justify-content: flex-start; align-items: flex-start; text-align: start; padding-block: 8px; }
  .maintbar .wrap > svg { margin-top: 4px; flex: none; }
}

.dorder__cgv { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; font-size: .82rem; line-height: 1.45; color: var(--ink-2); }
.dorder__cgv input { margin-top: 3px; flex: none; }
.dorder__cgv a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .lm-d { animation: none !important; transition: none !important; } }
