    /* ── FONT FALLBACKS avec size-adjust (anti-CLS) ── */
    @font-face {
      font-family: 'Inter-fallback';
      src: local('Arial'), local('Helvetica Neue'), local('sans-serif');
      ascent-override: 90%;
      descent-override: 22%;
      line-gap-override: 0%;
      size-adjust: 107%;
    }
    @font-face {
      font-family: 'Outfit-fallback';
      src: local('Arial'), local('Helvetica Neue'), local('sans-serif');
      ascent-override: 105%;
      descent-override: 27%;
      line-gap-override: 0%;
      size-adjust: 96%;
    }
    @font-face {
      font-family: 'Heebo-fallback';
      src: local('Arial'), local('Helvetica Neue'), local('sans-serif');
      ascent-override: 92%;
      descent-override: 23%;
      line-gap-override: 0%;
      size-adjust: 105%;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; overflow-x: hidden; }
    body { font-family: 'Inter', 'Inter-fallback', sans-serif; color: var(--text-primary); background: var(--body-bg); -webkit-font-smoothing: antialiased; transition: background .4s, color .3s; overflow-x: hidden; }
    a { text-decoration: none; color: inherit; }
    [lang="he"], [dir="rtl"] { font-family: 'Heebo', 'Heebo-fallback', sans-serif; }
    [dir="rtl"] body { font-family: 'Frank Ruhl Libre', 'Heebo-fallback', serif; }
    [dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
    [dir="rtl"] .logo, [dir="rtl"] .hero-h1, [dir="rtl"] .msg-bubble,
    [dir="rtl"] .nav-links a, [dir="rtl"] .btn, [dir="rtl"] .lang-btn,
    [dir="rtl"] .chat-header, [dir="rtl"] .section-heading,
    [dir="rtl"] .step-title, [dir="rtl"] .pillar-title, [dir="rtl"] .faq-question span,
    [dir="rtl"] #chat-input, [dir="rtl"] .float-chat, [dir="rtl"] .float-wa { font-family: 'Heebo', sans-serif; }
    /* Forcer Outfit pour le logo RebSam même en RTL */
    [dir="rtl"] .font-logo, [dir="rtl"] .rebsam-logo, [dir="rtl"] .logo.font-logo { font-family: 'Outfit', 'Outfit-fallback', sans-serif !important; letter-spacing: -.04em; }
    :root {
      /* ── Charte Indigo — primitives (cf. design/indigo-tokens.css) ── */
      --indigo-900:#0F0E2A; --indigo-800:#1B1A50; --indigo-700:#2C2A6E; --indigo-100:#E8E4F5;
      --coral-700:#B43E2B; --coral-500:#E6573F; --coral-100:#FADBD3; --coral-50:#FFF1EC;
      --cream-50:#FAF8F2; --cream-100:#F5F2EC; --cream-150:#EDE8DE; --cream-200:#E2DCCC;
      --ink-900:#0F0E2A; --ink-800:#1B1A50; --ink-700:#2C2A6E; --ink-600:#4B4892;
      --ink-500:#6E6AB5; --ink-400:#9491C9; --ink-300:#B8B6D8; --ink-200:#D6D4E8; --ink-100:#ECEAF5;
      --line:rgba(15,14,42,.12); --line-soft:rgba(15,14,42,.06);
      --brand-blue:#2C2A6E; --brand-blue-deep:#1B1A50; --brand-lavender:#E8E4F5;
      --primary-deep:#B43E2B; --primary-soft:#FADBD3; --primary-pastel-coral:#FCE9E2;
      --gradient-brand-charter: linear-gradient(135deg, #1B1A50 0%, #2C2A6E 40%, #E6573F 100%);

      /* ── RebSam — tokens sémantiques mappés sur Indigo ── */
      --primary: var(--indigo-700); --primary-dark: var(--indigo-800); --primary-light: var(--ink-500);
      --primary-pastel: var(--ink-600); --primary-pastel-dark: var(--indigo-700);
      --secondary: var(--ink-700); --secondary-light: var(--ink-600); --secondary-dark: var(--ink-800);
      --hero-text: var(--ink-700);
      --coral: var(--coral-500);
      --gradient-brand: var(--gradient-brand-charter);
      --bg: #ffffff; --bg-soft: var(--cream-50);
      --surface: #ffffff; --surface-2: var(--cream-50); --surface-3: rgba(255,255,255,.88);
      --text-primary: var(--ink-800); --text-secondary: var(--ink-600); --text-muted: rgba(27,26,80,.65);
      --border: var(--line); --border-strong: rgba(44,42,110,.22);
      --body-bg: linear-gradient(180deg, #EDE8DE 0%, #F5F2EC 30%, #FAF8F2 60%, #FFFFFF 90%);
      --header-bg: rgba(255,255,255,.96);
      --card-bg: rgba(255,255,255,.88);
      --faq-bg: linear-gradient(160deg, #ECEAF5 0%, #F5F2EC 35%, #FAF8F2 65%, #ECEAF5 100%);
      --gold: #d4af37; --gold-dark: #b8952e; --gold-light: #e8c84a;
      --gold-glow: rgba(212,175,55,.3);
      --cat-blue:   var(--indigo-800);
      --cat-indigo: var(--indigo-700);
      --cat-purple: var(--ink-600);
      --green-wa:   #25D366;
      --amber-toggle: #fbbf24;
      --navy: var(--indigo-800); --navy-dark: var(--indigo-900); --navy-light: var(--indigo-700);
      --footer-bg: var(--indigo-900);
      --surface-warm:  var(--cream-50);
      --surface-hover: var(--cream-150);
      --radius-xl: 1.25rem; --radius-2xl: 1.5rem; --radius-full: 9999px;
      /* Breakpoints : 380px (xs) · 400px (xxs) · 480px (sm) · 600px (md) · 640px (md2) · 767px (lg) · 900px (nav) */
      --shadow-sm: 0 1px 3px rgba(15,14,42,.10); --shadow-md: 0 4px 16px rgba(15,14,42,.12);
      --shadow-lg: 0 10px 40px rgba(15,14,42,.15); --shadow-2xl: 0 25px 60px rgba(15,14,42,.20);
      --shadow-gold: 0 6px 28px rgba(212,175,55,.35);
    }
    /* ── DARK MODE ── */
    html.dark {
      --primary: var(--ink-500); --primary-dark: var(--ink-600); --primary-light: var(--ink-400);
      --primary-pastel: var(--ink-600); --primary-pastel-dark: var(--indigo-700);
      --secondary: var(--ink-400); --secondary-light: var(--ink-300); --secondary-dark: var(--ink-200);
      --hero-text: var(--ink-300);
      --bg: var(--indigo-900); --bg-soft: var(--indigo-800);
      --surface: var(--indigo-800); --surface-2: var(--indigo-800); --surface-3: rgba(27,26,80,.95);
      --text-primary: var(--ink-100); --text-secondary: var(--ink-300); --text-muted: rgba(184,182,216,.65);
      --border: rgba(184,182,216,.18); --border-strong: rgba(110,106,181,.4);
      --body-bg: linear-gradient(180deg, #0F0E2A 0%, #1B1A50 50%, #0F0E2A 100%);
      --header-bg: rgba(15,14,42,.97);
      --card-bg: rgba(27,26,80,.92);
      --faq-bg: linear-gradient(160deg, #0F0E2A 0%, #1B1A50 50%, #0F0E2A 100%);
      --gold: #e8c84a; --gold-dark: #d4af37; --gold-light: #f0d96a;
      --gold-glow: rgba(232,200,74,.25);
      --navy: var(--indigo-900); --navy-dark: #0A091F; --navy-light: var(--indigo-800);
      --shadow-sm: 0 1px 3px rgba(0,0,0,.45); --shadow-md: 0 4px 16px rgba(0,0,0,.55);
      --shadow-lg: 0 10px 40px rgba(0,0,0,.65); --shadow-2xl: 0 25px 60px rgba(0,0,0,.75);
      --shadow-gold: 0 6px 28px rgba(232,200,74,.2);
      --surface-warm:  var(--indigo-800);
      --surface-hover: var(--indigo-800);
    }
    /* Dark mode toggle button */
    #dark-toggle {
      width: 2.25rem; height: 2.25rem; border-radius: 50%;
      background: none; border: 1.5px solid var(--border);
      cursor: pointer; color: var(--secondary-dark); display: flex; align-items: center; justify-content: center;
      transition: all .25s; font-size: 1rem; flex-shrink: 0;
    }
    #dark-toggle:hover { background: rgba(44,42,110,.1); border-color: var(--primary); color: var(--primary); }
    html.dark #dark-toggle { color: var(--amber-toggle); border-color: rgba(251,191,36,.4); }
    html.dark #dark-toggle:hover { background: rgba(251,191,36,.1); }
    .font-logo { font-family: 'Outfit', 'Outfit-fallback', sans-serif; }
    h1,h2,h3,h4 { line-height: 1.2; }
    .container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

    /* HEADER */
    #header { position: fixed; top: 0; left: 0; right: 0; z-index: 500; padding: 1rem 0; background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: all .25s; }
    #header.scrolled { background: var(--header-bg); box-shadow: var(--shadow-sm); padding: .65rem 0; }
    .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    .logo { font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-size: 1.875rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
    .logo .reb { color: var(--primary); }
    .logo .sam { color: var(--secondary-dark); }
    .nav-links { display: flex; gap: 1.75rem; list-style: none; align-items: center; flex-shrink: 0; }
    .nav-links a { font-size: .875rem; font-weight: 500; color: var(--text-secondary); position: relative; padding-bottom: 4px; transition: color .25s; white-space: nowrap; }
    .nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: width .3s; }
    .nav-links a:hover { color: var(--primary); }
    .nav-links a:hover::after { width: 100%; }
    .lang-switcher { display: flex; gap: .35rem; align-items: center; }
    .lang-btn { padding: .25rem .6rem; border-radius: .375rem; font-size: .8rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all .2s; background: none; color: var(--secondary); }
    .lang-btn:hover { color: var(--primary); border-color: rgba(27,26,80,.3); }
    .lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .nav-cta { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary); color: #fff; padding: .5rem 1.25rem; border-radius: var(--radius-full); font-size: .875rem; font-weight: 600; transition: all .25s; }
    .nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }
    .nav-right { display: flex; align-items: center; gap: .75rem; }
    #hamburger { display: none; background: none; border: none; cursor: pointer; padding: .5rem; color: var(--secondary); border-radius: .625rem; transition: background .2s; }
    #hamburger:hover { background: rgba(44,42,110,.1); }
    .burger-box { width: 22px; height: 15px; display: flex; flex-direction: column; justify-content: space-between; }
    .burger-line { display: block; height: 2px; border-radius: 2px; background: var(--secondary-dark); transform-origin: center; transition: transform .32s cubic-bezier(.4,0,.2,1), opacity .2s, width .25s; }
    .burger-line:nth-child(2) { width: 65%; align-self: flex-end; }
    #hamburger.open .burger-line:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    #hamburger.open .burger-line:nth-child(2) { opacity: 0; width: 0; }
    #hamburger.open .burger-line:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

    /* Menu overlay */
    #menu-overlay {
      position: fixed; inset: 0; z-index: 399;
      background: rgba(15,14,42,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
      opacity: 0; pointer-events: none;
      transition: opacity .35s ease;
    }
    #menu-overlay.open { opacity: 1; pointer-events: auto; }

    /* Mobile menu */
    #mobile-menu {
      display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 400;
      background: var(--header-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
      transform: translateY(-110%); opacity: 0;
      transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .3s ease;
      border-radius: 0 0 1.5rem 1.5rem;
      box-shadow: 0 16px 48px rgba(0,0,0,.18);
      overflow: hidden;
    }
    #mobile-menu.open { transform: translateY(0); opacity: 1; }

    /* Gradient accent bar */
    .menu-gradient-bar { height: 3px; background: linear-gradient(90deg, #1B1A50 0%, #2C2A6E 50%, #E6573F 100%); }
    .menu-inner { padding: 4rem 1.25rem 1.25rem; }

    .mobile-nav-links { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .75rem; }
    #mobile-menu .mob-link {
      display: flex; align-items: center; gap: .75rem;
      font-size: .9375rem; font-weight: 500; color: var(--secondary-dark);
      padding: .6rem .875rem; border-radius: .75rem;
      transition: background .18s, color .18s, transform .18s;
      text-decoration: none;
    }
    #mobile-menu .mob-link:active { transform: scale(.98); }
    #mobile-menu .mob-link:hover { background: rgba(44,42,110,.08); color: var(--primary); transform: translateX(3px); }
    [dir="rtl"] #mobile-menu .mob-link:hover { transform: translateX(-3px); }
    #mobile-menu .mob-icon {
      width: 1.75rem; height: 1.75rem; border-radius: .5rem; flex-shrink: 0;
      background: linear-gradient(135deg, rgba(44,42,110,.12) 0%, rgba(44,42,110,.12) 100%);
      display: flex; align-items: center; justify-content: center;
      color: var(--primary);
    }
    #mobile-menu .mob-link-label { flex: 1; }
    #mobile-menu .mob-link-arrow { opacity: .3; transition: opacity .18s, transform .18s; }
    #mobile-menu .mob-link:hover .mob-link-arrow { opacity: .7; transform: translateX(2px); }
    [dir="rtl"] #mobile-menu .mob-link:hover .mob-link-arrow { transform: rotate(180deg) translateX(2px); }

    .mobile-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(44,42,110,.2), transparent); margin: .5rem 0; }

    .btn-primary-mobile {
      display: flex; align-items: center; justify-content: center; gap: .5rem;
      background: var(--gradient-brand);
      color: #fff; padding: .7rem 1.25rem; border-radius: var(--radius-full);
      font-weight: 600; font-size: .9rem; text-decoration: none;
      box-shadow: 0 4px 18px rgba(44,42,110,.3);
      transition: all .25s; margin-bottom: .875rem;
    }
    .btn-primary-mobile:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(44,42,110,.45); }

    .mobile-bottom { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
    .mobile-lang-tabs { display: flex; background: rgba(44,42,110,.07); border-radius: var(--radius-full); padding: .2rem; gap: .1rem; }
    .mobile-lang-tabs .lang-btn {
      padding: .3rem .75rem; border-radius: var(--radius-full); font-size: .8125rem; font-weight: 600;
      background: none; border: none; cursor: pointer; color: var(--text-muted);
      transition: all .2s;
    }
    .mobile-lang-tabs .lang-btn.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
    html.dark .mobile-lang-tabs .lang-btn.active { background: rgba(255,255,255,.15); }
    .mobile-dark-btn {
      width: 2.25rem; height: 2.25rem; border-radius: 50%;
      background: rgba(44,42,110,.08); border: 1.5px solid rgba(44,42,110,.2);
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      color: var(--secondary); transition: all .2s; flex-shrink: 0;
    }
    .mobile-dark-btn:hover { background: rgba(44,42,110,.15); border-color: var(--primary); color: var(--primary); }

    /* ── MEDIA QUERIES ──
       Breakpoints : 380px (xs) · 400px (xxs) · 480px (sm) · 600px (md) · 640px (md2) · 767px (lg) · 900px (nav)
       Tokens définis dans :root (--bp-*) pour référence — @media ne supporte pas var() sans PostCSS ── */
    @media (max-width: 900px) { .nav-links { display: none; } .nav-cta { display: none; } .lang-switcher { display: none; } #hamburger { display: block; } }

    /* BUTTONS */
    /* ── Focus visible (accessibilité clavier) ── */
    .btn:focus-visible,
    .lang-btn:focus-visible,
    .nav-cta:focus-visible,
    .faq-question:focus-visible,
    #dark-toggle:focus-visible,
    #chat-send:focus-visible,
    #hamburger:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 3px;
    }
    .btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; border-radius: var(--radius-full); font-weight: 600; font-size: .9375rem; cursor: pointer; transition: all .25s; border: none; }
    .btn-primary { background: linear-gradient(135deg, var(--primary-pastel) 0%, var(--primary-pastel-dark) 100%); color: #fff; box-shadow: 0 4px 20px rgba(44,42,110,.3); }
    .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(27,26,80,.45); }
    .btn-ghost { background: transparent; color: var(--secondary); border: 1.5px solid var(--border); }
    .btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(27,26,80,.04); }
    /* ✡ GOLD BUTTON — boutons d'action premium */
    .btn-gold { background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%); color: var(--navy-dark); box-shadow: var(--shadow-gold); font-weight: 700; letter-spacing: .01em; }
    .btn-gold:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 40px rgba(212,175,55,.55); filter: brightness(1.05); }
    .btn-gold::before { content:'✡'; margin-right:.35rem; font-size:.85em; opacity:.75; }
    .nav-cta { background: var(--primary); color: #fff !important; box-shadow: 0 4px 16px rgba(44,42,110,.3); font-weight: 600; }
    .nav-cta:hover { background: var(--primary-dark); box-shadow: 0 8px 28px rgba(44,42,110,.45); transform: translateY(-1px); }
    .hero-avatar-btn { background: var(--gradient-brand) !important; color: #fff !important; box-shadow: 0 6px 24px rgba(44,42,110,.35) !important; font-weight: 700 !important; font-size: .95rem !important; }
    .hero-avatar-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 10px 36px rgba(44,42,110,.5) !important; }
    .footer-cta { background: var(--primary) !important; color: #fff !important; box-shadow: 0 4px 16px rgba(44,42,110,.3) !important; }
    .footer-cta:hover { background: var(--primary-dark) !important; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(44,42,110,.45) !important; }

    /* HERO */
    #hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 5.5rem 0 2rem; overflow: hidden; }
    @media (max-width: 767px) { #hero { padding: 5rem 0 1.5rem; min-height: auto; } }
    .hero-bg { position: absolute; inset: 0; background: transparent; z-index: -2; overflow: hidden; }
    .hero-cloud-1 { position: absolute; top: -80px; left: -120px; width: 700px; height: 500px; background: radial-gradient(ellipse, rgba(199,210,254,.55) 0%, rgba(224,231,255,.3) 40%, transparent 70%); filter: blur(60px); }
    .hero-cloud-2 { position: absolute; top: 30vh; right: -80px; width: 800px; height: 600px; background: radial-gradient(ellipse, rgba(248,246,252,.55) 0%, rgba(255,252,254,.25) 40%, transparent 70%); filter: blur(80px); will-change: transform; }
    .hero-cloud-3 { display: none; }
    .halo { position: absolute; border-radius: 50%; filter: blur(80px); }
    .halo-1 { top: -15%; right: -10%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(220,225,255,.08) 0%, rgba(240,238,252,.12) 40%, transparent 70%); opacity: .7; animation: floatA 20s ease-in-out infinite; will-change: transform; }
    .halo-2 { bottom: -20%; left: -15%; width: 800px; height: 800px; background: radial-gradient(circle, rgba(186,230,255,.25) 0%, rgba(219,234,254,.18) 40%, transparent 70%); opacity: .6; animation: floatB 25s ease-in-out infinite; will-change: transform; }
    .halo-3 { top: 30%; left: 40%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(237,233,254,.18) 0%, rgba(252,231,243,.22) 40%, transparent 70%); opacity: .5; animation: floatC 22s ease-in-out infinite; will-change: transform; }
    .blob-1 { position: absolute; top: 15%; right: 12%; width: 18rem; height: 18rem; border-radius: 45% 55% 65% 35%/50% 60% 40% 50%; background: linear-gradient(135deg, rgba(230,87,63,.07), rgba(252,231,243,.12)); animation: morphA 15s ease-in-out infinite; will-change: transform; }
    .blob-2 { position: absolute; bottom: 10%; left: 8%; width: 14rem; height: 14rem; border-radius: 55% 45% 35% 65%/40% 50% 60% 50%; background: linear-gradient(135deg, rgba(186,230,255,.12), rgba(219,234,254,.18)); animation: morphB 18s ease-in-out infinite; will-change: transform; }
    @keyframes floatA { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(20px,-30px) scale(1.08);} }
    @keyframes floatB { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-25px,20px) scale(1.05);} }
    @keyframes floatC { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(15px,-15px) scale(1.06);} }
    @keyframes morphA { 0%,100%{transform:translate(0,0) rotate(0deg) scale(1);} 33%{transform:translate(-12px,18px) rotate(6deg) scale(1.05);} 66%{transform:translate(8px,-10px) rotate(-5deg) scale(0.95);} }
    @keyframes morphB { 0%,100%{transform:translate(0,0) rotate(0deg) scale(1);} 50%{transform:translate(10px,-15px) rotate(-5deg) scale(1.04);} }
    @keyframes fadeUp { from{opacity:0;transform:translateY(24px);} to{opacity:1;transform:translateY(0);} }

    .hero-content { position: relative; z-index: 10; text-align: center; max-width: 780px; margin: 0 auto; }
    [dir="rtl"] .hero-content { text-align: center; }

    .hero-badge { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.5rem; border-radius: var(--radius-full); background: rgba(44,42,110,.09); color: var(--primary); font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 1.75rem; min-width: clamp(220px, 28vw, 300px); }

    .hero-h1 { margin-bottom: 1rem; animation: fadeUp .6s .08s ease both; line-height: 1; }
    .hero-h1 .rebsam-logo { display: block; font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-weight: 900; font-size: clamp(2.8rem,7vw,4.5rem); letter-spacing: -.04em; line-height: 1; margin-bottom: .4rem; }
    .hero-h1 .rebsam-logo .reb { color: var(--primary); }
    .hero-h1 .rebsam-logo .sam { color: var(--secondary-dark); }
    .hero-h1 [data-i18n="hero_tagline"] { display: block; font-size: clamp(1rem,2vw,1.3rem); font-weight: 500; color: rgba(75,72,146,.6); letter-spacing: -.01em; line-height: 1.4; }
    [dir="rtl"] .hero-h1 .rebsam-logo { font-size: clamp(3rem,8vw,5.5rem); }
    [dir="rtl"] .hero-h1 [data-i18n="hero_tagline"] { font-family: 'Heebo', sans-serif; font-size: clamp(1.1rem,2.8vw,1.8rem); }
    /* Hébreu — agrandissement proportionnel des titres et sous-titres */
    [dir="rtl"] .section-heading h2 { font-size: clamp(2rem,5vw,3.2rem); letter-spacing: 0; }
    [dir="rtl"] .section-heading p { font-size: clamp(1rem,2vw,1.25rem); line-height: 1.75; }
    [dir="rtl"] .feature-card h3 { font-size: clamp(1.2rem,2.5vw,1.5rem); }
    [dir="rtl"] .feature-card p { font-size: clamp(.9375rem,1.8vw,1.0625rem); line-height: 1.75; }
    [dir="rtl"] .step-title { font-size: clamp(1.15rem,2.5vw,1.45rem); }
    [dir="rtl"] .step-desc { font-size: clamp(.9375rem,1.8vw,1.0625rem); line-height: 1.75; }

    .hero-divider { width: 3rem; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--primary), #2C2A6E); margin: 0 auto 1.25rem; opacity: .5; animation: fadeUp .6s .12s ease both; }

    .hero-p { font-size: clamp(.85rem,1.5vw,1rem); color: rgba(44,42,110,.6); margin-bottom: .85rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6; animation: fadeUp .6s .15s ease both; }
    .hero-points { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; max-width: 560px; margin-left: auto; margin-right: auto; animation: fadeUp .6s .15s ease both; }
    .hero-point { display: flex; align-items: center; gap: .875rem; text-align: left; background: var(--surface-3); border: 1px solid var(--border); border-radius: .875rem; padding: .7rem 1rem; transition: all .25s; }
    .hero-point:hover { box-shadow: 0 6px 20px rgba(44,42,110,.1); transform: translateY(-2px); }
    .hero-point .arr { font-size: 1.4rem; flex-shrink: 0; font-style: normal; line-height: 1; }
    .hero-point span { font-size: clamp(.82rem,1.3vw,.92rem); font-weight: 600; color: var(--secondary-dark); line-height: 1.4; }
    [dir="rtl"] .hero-point { text-align: right; }
    [dir="rtl"] .hero-point span { font-size: clamp(.82rem, 1.3vw, .92rem); font-family: 'Heebo', sans-serif; line-height: 1.4; }

    .hero-trust { font-size: 1rem; font-weight: 500; color: rgba(75,72,146,.6); margin-bottom: 1rem; letter-spacing: -.01em; animation: fadeUp .6s .14s ease both; }
    html.dark .hero-trust { color: rgba(184,182,216,.8); }
    .hero-btns { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-bottom: 1.25rem; animation: fadeUp .6s .2s ease both; }
    [dir="rtl"] .hero-btns { align-items: center; }
    .hero-btns .btn { justify-content: center; width: fit-content; min-width: clamp(240px, 50vw, 380px); padding: .75rem 1.75rem; gap: .6rem; }
    .hero-wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; background: var(--green-wa); color: #fff !important; border: none; padding: .75rem 1.75rem; border-radius: var(--radius-full); font-weight: 700; font-size: .95rem; text-decoration: none; box-shadow: 0 4px 16px rgba(37,211,102,.35); transition: all .25s; min-width: clamp(240px, 50vw, 380px); }
    .hero-wa-btn:hover { background: #1ebe5d; box-shadow: 0 6px 22px rgba(37,211,102,.45); transform: translateY(-2px); }
    @media (max-width: 639px) { .hero-btns .btn { min-width: 0; width: 100%; } .hero-wa-btn { width: 100%; } }
    .store-badges { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: .5rem; flex-wrap: wrap; animation: fadeUp .6s .35s ease both; }
    .store-badge { display: inline-flex; align-items: center; gap: .55rem; background: #000; color: #fff !important; text-decoration: none; padding: .55rem 1.2rem; border-radius: .75rem; transition: all .22s; box-shadow: 0 3px 12px rgba(0,0,0,.25); min-width: 140px; }
    .store-badge:hover { background: #0F0E2A; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
    .store-badge-text { display: flex; flex-direction: column; line-height: 1.15; }
    .store-badge-sub { font-size: .62rem; font-weight: 400; opacity: .85; letter-spacing: .02em; }
    .store-badge-name { font-size: .92rem; font-weight: 700; letter-spacing: -.01em; }
    html.dark .store-badge { background: #0F0E2A; box-shadow: 0 3px 12px rgba(0,0,0,.5); }
    html.dark .store-badge:hover { background: #0F0E2A; }

    .hero-sources { font-size: .68rem; color: rgba(75,72,146,.5); letter-spacing: .03em; animation: fadeUp .6s .25s ease both; line-height: 1.6; max-width: 540px; margin: 0 auto .5rem; }

    .hero-avatar-wrap { position: relative; margin: 1rem auto 0; max-width: 340px; }
    /* ── REVEAL — IntersectionObserver natif (remplace AOS) ── */
    [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.25,.46,.45,.94); }
    [data-reveal][data-reveal-delay="100"] { transition-delay: 100ms; }
    [data-reveal][data-reveal-delay="200"] { transition-delay: 200ms; }
    [data-reveal][data-reveal-delay="300"] { transition-delay: 300ms; }
    [data-reveal][data-reveal-delay="400"] { transition-delay: 400ms; }
    [data-reveal].revealed { opacity: 1; transform: translateY(0); }
    .hero-avatar-img { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1/1; display: block; margin: 0 auto; filter: drop-shadow(0 12px 32px rgba(44,42,110,.28)) drop-shadow(0 4px 12px rgba(0,0,0,.12)); border-radius: 1.5rem; contain: layout; }
    .hero-avatar-btn { background: var(--gradient-brand); box-shadow: 0 6px 24px rgba(44,42,110,.35); font-size: .95rem; padding: .75rem 1.75rem; font-weight: 700; }
    .hero-avatar-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(44,42,110,.5); }
    @media (max-width: 640px) { .hero-avatar-img { max-width: 220px; } }
    .hero-p strong { font-weight: 600; color: var(--hero-text); }

    /* ── BUCKET STATS COUNTER ── */
    #stats { padding: 4rem 0; background: var(--navy); position: relative; overflow: hidden; }
    #stats::before { content:''; position:absolute; inset:0; background: linear-gradient(135deg, rgba(212,175,55,.07) 0%, transparent 60%); }
    html.dark #stats { background: var(--navy-dark); }
    .stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; position:relative; z-index:1; }
    @media (max-width:900px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
    @media (max-width:480px) { .stats-grid { grid-template-columns: 1fr 1fr; gap:1rem; } }
    .stat-card { text-align: center; padding: 1.75rem 1rem; }
    .stat-icon-svg { width:28px; height:28px; stroke:var(--gold); fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; margin:0 auto .75rem; display:block; }
    .stat-number { font-family:'Outfit',sans-serif; font-size: clamp(2rem,5vw,3rem); font-weight: 900; color: var(--gold); line-height:1; letter-spacing:-.02em; margin-bottom: .35rem; }
    .stat-label { font-size: .8125rem; color: rgba(255,255,255,.55); font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
    .stat-sublabel { font-size: .7rem; color: rgba(255,255,255,.32); font-weight: 400; letter-spacing: .02em; line-height: 1.5; margin-top: .3rem; }
    /* Bucket fill visual */
    .bucket-wrap { display:flex; flex-direction:column; align-items:center; gap:.5rem; }
    .bucket-bar { width:100%; max-width:200px; height:8px; background:rgba(255,255,255,.1); border-radius:9999px; overflow:hidden; margin: .5rem auto 0; }
    .bucket-fill { height:100%; border-radius:9999px; background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light)); width:0%; transition: width 1.8s cubic-bezier(.4,0,.2,1); }

    /* ── SOURCES SECTION ── */
    #sources { padding: 5rem 0; background: var(--faq-bg); position:relative; overflow:hidden; content-visibility: auto; contain-intrinsic-size: 0 600px; }
    .sources-grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap:1rem; margin-top:2.5rem; }
    @media (max-width:640px) { .sources-grid { grid-template-columns: repeat(2,1fr); } }
    .source-tag { display:flex; align-items:center; gap:.65rem; background: var(--card-bg); border:1.5px solid var(--border); border-radius:.875rem; padding:.875rem 1.125rem; transition:all .3s; cursor:default; }
    .source-tag:hover { border-color: var(--gold); box-shadow: 0 4px 20px var(--gold-glow); transform:translateY(-3px); }
    .source-tag:hover .source-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
    .source-dot { width:.55rem; height:.55rem; border-radius:50%; background:var(--primary); flex-shrink:0; transition:all .3s; }
    .source-name { font-size:.875rem; font-weight:600; color:var(--secondary-dark); line-height:1.3; }
    .source-name small { display:block; font-weight:400; font-size:.75rem; color:var(--text-muted); margin-top:.1rem; }
    .sources-more { text-align:center; margin-top:2rem; }
    .sources-more p { color:var(--text-muted); font-size:1.2rem; }
    .sources-more span { background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight:700; }

    /* SECTIONS */
    .section-heading { text-align: center; margin-bottom: 3rem; }
    [dir="rtl"] .section-heading { text-align: center; direction: rtl; }
    .section-heading h2 { font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-size: clamp(1.75rem,4vw,2.5rem); font-weight: 900; color: var(--secondary-dark); margin-bottom: .75rem; letter-spacing: -.02em; }
    .section-heading p { font-size: 1.0625rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto; line-height: 1.65; }
    .section-eyebrow { display: inline-block; padding: .28rem .95rem; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 4px 15px rgba(44,42,110,.3); }
    #how-it-works .section-eyebrow { font-size: .85rem; padding: .45rem 1.4rem; letter-spacing: .12em; box-shadow: 0 6px 24px rgba(44,42,110,.4); margin-bottom: 1.5rem; }
    #how-it-works .section-heading { margin-bottom: 4rem; }
    #rag-tech .section-eyebrow { font-size: .85rem; padding: .45rem 1.4rem; letter-spacing: .12em; box-shadow: 0 6px 24px rgba(44,42,110,.4); margin-bottom: 1.5rem; }
    #rag-tech .section-heading { margin-bottom: 3.5rem; }
    #rag-tech .section-heading h2 { margin-top: .75rem; margin-bottom: 1rem; }
    #how-it-works .section-heading h2 { margin-top: .75rem; margin-bottom: 1rem; }
    #pillars .section-eyebrow { font-size: .85rem; padding: .45rem 1.4rem; letter-spacing: .12em; box-shadow: 0 6px 24px rgba(44,42,110,.4); margin-bottom: 1.5rem; }
    #pillars .section-heading { margin-bottom: 4rem; }
    #pillars .section-heading h2 { margin-top: .75rem; margin-bottom: 1rem; }
    #sources .section-eyebrow { font-size: .85rem; padding: .45rem 1.4rem; letter-spacing: .12em; box-shadow: 0 6px 24px rgba(44,42,110,.4); margin-bottom: 1.5rem; }
    #sources .section-heading { margin-bottom: 4rem; }
    #sources .section-heading h2 { margin-top: .75rem; margin-bottom: 1rem; }
    #faq .section-eyebrow { background: none; color: var(--primary); box-shadow: none; font-size: .8rem; letter-spacing: .1em; font-weight: 700; padding: 0; }

    /* HOW IT WORKS */
    #how-it-works { padding: 6rem 0; background: rgba(255,255,255,.45); position: relative; overflow: hidden; content-visibility: auto; contain-intrinsic-size: 0 700px; }
    /* Legacy - keep for safety */
    .steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 3rem; position: relative; }
    @media (max-width: 767px) { .steps-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
    /* New card layout */
    .steps-grid-new { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; position: relative; align-items: start; }
    @media (max-width: 900px) { .steps-grid-new { grid-template-columns: 1fr; gap: 1.5rem; } }
    .step-card { position: relative; background: var(--card-bg); border: 1px solid var(--border); border-radius: 1.75rem; padding: 2.25rem 2rem 2.5rem; box-shadow: var(--shadow-sm); transition: all .35s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; gap: 1.5rem; }
    .step-card:hover { transform: translateY(-8px); box-shadow: 0 24px 56px rgba(44,42,110,.16), 0 8px 20px rgba(0,0,0,.07); border-color: rgba(44,42,110,.22); }
    .step-card-top { display: flex; align-items: center; justify-content: flex-start; }
    .step-badge { display: none; }
    .step-card-icon { width: 4.5rem; height: 4.5rem; border-radius: 1.25rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s; }
    .step-card:hover .step-card-icon { transform: scale(1.12) rotate(-6deg); box-shadow: 0 8px 28px rgba(44,42,110,.25); }
    .step-icon-blue { background: linear-gradient(135deg,#2C2A6E 0%,#1B1A50 100%); color: #fff; box-shadow: 0 4px 18px rgba(44,42,110,.35); }
    .step-icon-indigo { background: linear-gradient(135deg,#2C2A6E 0%,#2C2A6E 100%); color: #fff; box-shadow: 0 4px 18px rgba(44,42,110,.35); }
    .step-icon-cyan { background: linear-gradient(135deg,#0891b2 0%,#06b6d4 100%); color: #fff; box-shadow: 0 4px 18px rgba(8,145,178,.35); }
    .step-card-body { display: flex; flex-direction: column; gap: .6rem; }
    .step-connector { display: none; }
    .step-title { font-size: 1.2rem; font-weight: 800; color: var(--secondary-dark); margin: 0; transition: color .25s; }
    .step-card:hover .step-title { color: var(--primary); }
    .step-desc { font-size: .9375rem; color: var(--text-secondary); line-height: 1.75; margin: 0; }
    [dir="rtl"] .step-card { text-align: right; }
    [dir="rtl"] .step-card-top { justify-content: flex-end; }
    /* Sources grid new */
    .sources-grid-new { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 1.25rem; margin-top: 2.5rem; }
    @media (max-width: 640px) { .sources-grid-new { grid-template-columns: repeat(2,1fr); gap: 1rem; } }
    .source-book { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 1.25rem; padding: 1.5rem 1rem; transition: all .3s cubic-bezier(.4,0,.2,1); cursor: default; }
    .source-book:hover { transform: translateY(-4px) scale(1.03); border-color: var(--gold); box-shadow: 0 8px 28px var(--gold-glow); }
    .source-book:hover .source-book-icon { transform: scale(1.2) rotate(-5deg); }
    /* Library categories */
    .library-category { margin-bottom: 2.75rem; }
    .library-cat-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--border); }
    .library-cat-badge { display: inline-flex; align-items: center; padding: .28rem .9rem; border-radius: var(--radius-full); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .library-cat-badge.blue { background: rgba(44,42,110,.1); color: var(--cat-blue); border: 1px solid rgba(44,42,110,.2); }
    .library-cat-badge.purple { background: rgba(44,42,110,.1); color: #2C2A6E; border: 1px solid rgba(44,42,110,.2); }
    .library-cat-badge.gold { background: rgba(212,163,0,.1); color: #9a6f00; border: 1px solid rgba(212,163,0,.25); }
    html.dark .library-cat-badge.gold { color: #e0b44a; border-color: rgba(212,163,0,.35); }
    .library-cat-title { font-size: 1rem; font-weight: 700; color: var(--secondary-dark); margin: 0; }
    .library-books-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
    @media (max-width: 900px) { .library-books-row { grid-template-columns: repeat(2, 1fr); gap: .875rem; } }
    @media (max-width: 480px) { .library-books-row { grid-template-columns: repeat(2, 1fr); gap: .75rem; } }
    .source-book.cat-blue { border-top: 3px solid var(--cat-blue); }
    .source-book.cat-purple { border-top: 3px solid #2C2A6E; }
    .source-book.cat-gold { border-top: 3px solid var(--gold); }
    .source-book { padding: 1.4rem 1rem 1.25rem; }
    .source-book-desc { font-size: .68rem; color: var(--text-muted); line-height: 1.45; margin-top: .2rem; }
    .source-book-icon { font-size: 2rem; line-height: 1; transition: transform .3s; }
    .source-book-title { font-size: .9375rem; font-weight: 700; color: var(--secondary-dark); line-height: 1.3; direction: rtl; }
    .source-book-sub { font-size: .75rem; font-weight: 400; color: var(--text-muted); }

    /* RAG TECH */
    #rag-tech { padding: 6rem 0; background: var(--bg); content-visibility: auto; contain-intrinsic-size: 0 600px; }
    .rag-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 0; align-items: start; margin: 3rem 0 2.5rem; }
    @media (max-width: 900px) { .rag-flow { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; } .rag-arrow { display: none; } }
    @media (max-width: 480px) { .rag-flow { grid-template-columns: 1fr; } }
    .rag-arrow { display: flex; align-items: flex-start; justify-content: center; padding-top: 1.6rem; color: var(--text-muted); font-size: 1.5rem; font-weight: 300; flex-shrink: 0; width: 2.5rem; }
    .rag-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem; padding: 1.5rem 1rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 1.25rem; box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s; }
    .rag-step:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(44,42,110,.14); }
    .rag-step-icon { width: 3.5rem; height: 3.5rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .rag-icon-blue { background: rgba(44,42,110,.12); color: var(--cat-blue); }
    .rag-icon-indigo { background: rgba(44,42,110,.12); color: var(--cat-indigo); }
    .rag-icon-purple { background: rgba(75,72,146,.12); color: var(--cat-purple); }
    .rag-icon-green { background: rgba(16,185,129,.12); color: #10b981; }
    .rag-step-label { font-size: .875rem; font-weight: 700; color: var(--secondary-dark); line-height: 1.3; }
    .rag-step-desc { font-size: .75rem; color: var(--text-muted); line-height: 1.55; }
    .rag-step-num { font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
    .rag-chips { list-style: none; padding: 0; margin: 2rem auto 2.5rem; max-width: 600px; display: flex; flex-direction: column; gap: .85rem; }
    .rag-chips li { display: flex; align-items: baseline; gap: .65rem; font-size: 1rem; font-weight: 600; color: var(--secondary-dark); line-height: 1.5; }
    .rag-chips li span { color: var(--text-secondary); font-weight: 600; font-style: italic; }
    .rag-explainer { max-width: 680px; margin: 0 auto; }
    .rag-explainer-text { font-family: 'Inter', sans-serif; font-size: 1rem; color: var(--text-secondary); line-height: 1.8; text-align: center; font-weight: 600; }
    .rag-explainer-text strong { font-weight: 600; color: var(--secondary-dark); }
    .rag-section-title { font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-weight: 900; color: var(--secondary-dark); font-size: clamp(1.35rem,3vw,1.75rem); letter-spacing: -.02em; display: block; margin-bottom: 1rem; }
    [dir="rtl"] .rag-explainer-text { text-align: right; }
    @media (max-width: 640px) { .rag-explainer-text { text-align: left; font-size: .9375rem; } }
    .rag-insight { display: flex; align-items: flex-start; gap: 1rem; background: linear-gradient(135deg, rgba(44,42,110,.07) 0%, rgba(75,72,146,.07) 100%); border: 1px solid rgba(44,42,110,.18); border-radius: 1.25rem; padding: 1.5rem 2rem; margin-top: .5rem; }
    .rag-insight-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: .1rem; }
    .rag-insight p { font-size: .9375rem; color: var(--text); line-height: 1.7; margin: 0; }
    html.dark .rag-insight { background: linear-gradient(135deg, rgba(44,42,110,.1) 0%, rgba(75,72,146,.1) 100%); border-color: rgba(44,42,110,.25); }
    [dir="rtl"] .rag-step { text-align: right; align-items: flex-end; }
    [dir="rtl"] .rag-insight { flex-direction: row-reverse; }

    /* PILLARS */
    #pillars { padding: 6rem 0; background: rgba(255,255,255,.3); position: relative; overflow: hidden; content-visibility: auto; contain-intrinsic-size: 0 700px; }
    .pillars-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; position: relative; }
    @media (max-width: 767px) { .pillars-grid { grid-template-columns: 1fr; } }
    .pillars-glow { position: absolute; inset: -8rem; pointer-events: none; z-index: 0; }
    .pillars-glow::before,.pillars-glow::after { content: ''; position: absolute; border-radius: 50%; filter: blur(140px); }
    .pillars-glow::before { top: -30%; left: 5%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(230,87,63,.28) 0%, rgba(252,231,243,.35) 40%, transparent 70%); opacity: .8; }
    .pillars-glow::after { bottom: -25%; right: 0; width: 800px; height: 800px; background: radial-gradient(circle, rgba(186,230,255,.38) 0%, rgba(237,233,254,.35) 40%, transparent 70%); opacity: .75; }
    .feature-card { position: relative; z-index: 1; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow-sm); transition: all .35s cubic-bezier(.4,0,.2,1); }
    .feature-card::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius-xl); background: linear-gradient(135deg, rgba(44,42,110,.04) 0%, rgba(44,42,110,.04) 100%); opacity: 0; transition: opacity .3s; }
    .feature-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 20px 50px rgba(44,42,110,.16), 0 6px 16px rgba(0,0,0,.08); border-color: rgba(44,42,110,.18); }
    .feature-card:hover::before { opacity: 1; }
    .feature-card:hover .feature-card-icon { background: rgba(44,42,110,.14); transform: scale(1.1) rotate(-3deg); }
    .feature-card-icon { transition: background .3s, transform .35s cubic-bezier(.4,0,.2,1); }
    .feature-card-icon-img { width:100%; margin-bottom:1.25rem; overflow:hidden; border-radius:.75rem; }
    .feature-card-icon { width: 3.5rem; height: 3.5rem; border-radius: .875rem; background: rgba(27,26,80,.08); display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; color: var(--primary); font-size: 1.5rem; }
    .feature-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--secondary-dark); margin-bottom: .75rem; }
    .feature-card p { font-size: .9375rem; color: var(--text-secondary); line-height: 1.65; }

    /* FAQ - ENHANCED */
    #faq { padding: 7rem 0 6rem; background: var(--faq-bg); position: relative; overflow: hidden; content-visibility: auto; contain-intrinsic-size: 0 800px; }
    #faq::before { content:''; position:absolute; top:-200px; right:-150px; width:600px; height:600px; border-radius:50%; background: radial-gradient(circle, rgba(186,210,255,.35) 0%, transparent 65%); opacity: .7; }
    #faq::after { content:''; position:absolute; bottom:-150px; left:-100px; width:500px; height:500px; border-radius:50%; background: radial-gradient(circle, rgba(210,225,255,.25) 0%, transparent 65%); opacity: .6; }
    #faq .section-eyebrow { font-size: .85rem; padding: .45rem 1.4rem; letter-spacing: .12em; box-shadow: 0 6px 24px rgba(44,42,110,.4); margin-bottom: 1.5rem; }
    #faq .section-heading h2 { font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-size: clamp(2rem,5vw,3rem); font-weight: 900; color: var(--secondary-dark); margin-bottom: .75rem; letter-spacing: -.02em; }
    #faq .section-heading p { color: var(--text-secondary); font-size: 1.05rem; }
    .faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: .85rem; position: relative; z-index: 1; }
    .faq-item { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 1.1rem; overflow: hidden; transition: box-shadow .25s, border-color .25s, background .25s; }
    .faq-item:hover { box-shadow: 0 6px 28px rgba(44,42,110,.12); border-color: rgba(44,42,110,.25); background: rgba(255,255,255,.96); }
    .faq-item.open { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 4px 20px rgba(44,42,110,.1); }
    .faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 1.35rem 1.75rem; cursor: pointer; background: none; border: none; font-family: 'Outfit', 'Outfit-fallback', sans-serif; font-size: 1rem; font-weight: 700; color: var(--secondary-dark); transition: all .25s; }
    html.dark .faq-question { color: var(--secondary-dark); }
    [dir="rtl"] .faq-question { text-align: right; }
    .faq-question:hover { color: var(--primary); }
    .faq-question.open { color: var(--primary); }
    .faq-chevron { flex-shrink: 0; width: 1.15rem; height: 1.15rem; color: rgba(44,42,110,.5); transition: transform .3s cubic-bezier(.4,0,.2,1), color .3s; }
    .faq-question.open .faq-chevron { transform: rotate(180deg); color: var(--primary); }
    .faq-content { display: none; max-height: 0; overflow: hidden; transition: max-height .3s ease-out, padding .3s ease-out; }
    .faq-answer { padding: 0 1.75rem 1.35rem; font-size: .9375rem; color: var(--text-secondary); line-height: 1.8; border-top: 1px solid rgba(44,42,110,.07); padding-top: 1rem; }
    [dir="rtl"] .faq-answer { text-align: right; }
    .faq-item.open .faq-content { display: block; max-height: 500px; }

    /* FOOTER */
    footer { background: var(--footer-bg); border-top: none; padding: 4.5rem 0 5.5rem; }
    .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
    @media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
    .footer-brand p { font-size: .9375rem; color: rgba(184,182,216,.65); line-height: 1.65; max-width: 24rem; margin-bottom: 1.5rem; margin-top: 1rem; }
    .footer-cta { display: inline-flex; align-items: center; gap: .5rem; background: var(--primary); color: #fff !important; padding: .625rem 1.5rem; border-radius: var(--radius-full); font-size: .875rem; font-weight: 600; transition: all .25s; }
    .footer-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }
    .footer-col h4, .footer-col-title { font-size: .7rem; font-weight: 700; color: rgba(184,182,216,.85); margin-bottom: 1.5rem; letter-spacing: .12em; text-transform: uppercase; }
    .footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
    .footer-col li a { font-size: .9375rem; color: rgba(184,182,216,.7); transition: color .25s; }
    .footer-col li a:hover { color: #fff; }
    .footer-contact-item { display: flex; align-items: flex-start; gap: .6rem; font-size: .9375rem; color: rgba(184,182,216,.7); margin-bottom: .875rem; }
    .footer-contact-item svg { color: #1B1A50; flex-shrink: 0; margin-top: 3px; }
    .footer-contact-support { font-size: .8125rem; color: rgba(184,182,216,.72); margin-top: .35rem; }
    .footer-contact-email { color: #fff; font-weight: 700; font-size: .9375rem; text-decoration: none; transition: color .2s; }
    .footer-contact-email:hover { color: #1B1A50; }
    .footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 1.5rem 0; margin-top: .5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; font-size: .875rem; color: rgba(184,182,216,.72); }
    .footer-bottom-links { display: flex; gap: 1.5rem; }
    .footer-bottom-links a { color: rgba(184,182,216,.72); transition: color .2s; }
    .footer-bottom-links a:hover { color: rgba(184,182,216,.9); }
    .footer-logo .reb { color: #1B1A50; }
    .footer-logo .sam { color: #fff; }
    [dir="rtl"] .footer-col h4, [dir="rtl"] .footer-col-title { text-align: right; }
    [dir="rtl"] .footer-col ul { align-items: flex-end; }
    [dir="rtl"] .footer-contact-item { text-align: right; }
    [dir="rtl"] .footer-brand p { text-align: right; }
    [dir="rtl"] .footer-bottom { direction: rtl; }

    /* FLOATING BUTTONS */
    .float-btn { position: fixed; bottom: 1.5rem; z-index: 300; border: none; cursor: pointer; background: none; padding: 0; transition: opacity .35s, transform .35s; }
    .float-btn.hero-visible { opacity: 0; transform: translateY(.75rem); pointer-events: none; }
    #btn-chat { left: max(1.5rem, calc((100vw - 1200px) / 2 + 1.5rem)); }
    #btn-wa   { right: max(1.5rem, calc((100vw - 1200px) / 2 + 1.5rem)); }
    .float-inner { position: relative; display: inline-flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem; border-radius: var(--radius-full); font-family: 'Inter', sans-serif; font-weight: 600; font-size: .875rem; transition: all .3s cubic-bezier(.4,0,.2,1); }
    .float-inner:hover { transform: scale(1.05); }
    .float-glow { position: absolute; inset: 0; border-radius: var(--radius-full); filter: blur(12px); opacity: .5; animation: pulse 2s ease-in-out infinite; }
    @keyframes pulse { 0%,100%{opacity:.5;transform:scale(1);} 50%{opacity:.7;transform:scale(1.05);} }
    .float-chat-bg { background: linear-gradient(135deg, var(--primary-pastel) 0%, var(--primary-pastel-dark) 100%); }
    .float-chat-glow { background: var(--primary); }
    .float-wa-bg { background: linear-gradient(135deg, var(--green-wa) 0%, #20BA5A 100%); }
    .float-wa-glow { background: var(--green-wa); }
    .float-label { position: relative; z-index: 1; white-space: nowrap; }
    .float-icon { position: relative; z-index: 1; display: flex; }
    @media (max-width: 767px) { .float-label { display: none; } }

    /* CHAT MODAL */
    #chat-overlay { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(15,14,42,.58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
    #chat-overlay.open { display: flex; }
    #chat-modal { position: relative; width: 100%; max-width: 860px; height: min(86vh,780px); background: linear-gradient(180deg,#F5F2EC 0%,#F5F2EC 60%,#EDE8DE 100%); border-radius: 1.75rem; box-shadow: 0 32px 80px rgba(0,0,0,.28), 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; animation: modalIn .35s cubic-bezier(.4,0,.2,1) both; overflow: hidden; }
    @keyframes modalIn { from{opacity:0;transform:scale(.95) translateY(20px);} to{opacity:1;transform:scale(1) translateY(0);} }
    .chat-header { background: #2C2A6E; padding: .85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-radius: 1.75rem 1.75rem 0 0; border-bottom: 1px solid rgba(255,255,255,.1); position: relative; overflow: hidden; }
    .chat-header-left { display: flex; align-items: center; gap: .75rem; position: relative; z-index: 1; }
    .chat-avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,.95); box-shadow: 0 0 0 2.5px rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; }
    .chat-avatar img { width: 88%; height: 88%; object-fit: contain; display: block; }
    .chat-header-name { font-weight: 800; color: #fff; font-size: 1rem; letter-spacing: -.02em; }
    .chat-header-subtitle { font-size: .7rem; color: rgba(255,255,255,.7); letter-spacing: .01em; margin-top: .05rem; }
    .chat-header-status { font-size: .72rem; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: .3rem; margin-top: .15rem; }
    .chat-header-status .dot { width: .42rem; height: .42rem; border-radius: 50%; background: #4ade80; display: inline-block; flex-shrink: 0; }
    .chat-close { width: 2rem; height: 2rem; border-radius: 50%; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; transition: all .25s; position: relative; z-index: 1; }
    .chat-close:hover { background: rgba(255,255,255,.25); }
    #btn-hist { width: auto; height: auto; border-radius: 2rem; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.22); padding: .35rem .9rem; font-size: .78rem; font-weight: 700; letter-spacing: .01em; gap: .35rem; white-space: nowrap; }
    #btn-hist:hover { background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.8); }
    /* Barre de navigation sous le header */
    .chat-nav-bar { display: flex; align-items: center; justify-content: space-between; background: #1B1A50; padding: .35rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }
    .chat-nav-btn { display: flex; align-items: center; gap: .3rem; background: none; border: none; color: rgba(255,255,255,.9); font-size: .75rem; font-weight: 600; cursor: pointer; padding: .25rem .5rem; border-radius: 1rem; transition: background .2s; font-family: 'Inter', sans-serif; }
    .chat-nav-btn:hover { background: rgba(255,255,255,.15); }
    .chat-nav-langs { display: flex; gap: .3rem; }
    .chat-lang-btn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 1rem; color: rgba(255,255,255,.8); font-size: .72rem; font-weight: 700; padding: .2rem .55rem; cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s; }
    .chat-lang-btn:hover, .chat-lang-btn.active { background: rgba(255,255,255,.9); color: #1B1A50; }
    html.dark .chat-nav-bar { background: #1B1A50; }
    /* Mode standalone (app iOS/Android) — plein écran, sans overlay */
    body.is-standalone #chat-overlay { padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
    body.is-standalone #chat-modal { border-radius: 0; height: 100dvh; max-width: 100%; box-shadow: none; animation: none; }
    body.is-standalone .chat-header { border-radius: 0; padding-top: max(.85rem, env(safe-area-inset-top, .85rem)); }
    body.is-standalone .chat-input-area { border-radius: 0; padding-bottom: max(.875rem, calc(env(safe-area-inset-bottom, 0px) + .5rem)); }

    #chat-box {
      flex: 1; overflow-y: auto; padding: 1.5rem 1.75rem;
      display: flex; flex-direction: column; gap: 1.1rem;
      background: transparent;
    }
    #chat-box::-webkit-scrollbar{width:4px;} #chat-box::-webkit-scrollbar-track{background:transparent;} #chat-box::-webkit-scrollbar-thumb{background:#D6D4E8;border-radius:4px;}
    .msg-row { display: flex; align-items: flex-end; gap: .6rem; }
    .msg-row.user { flex-direction: row-reverse; }
    .msg-avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .7rem; color: #fff; flex-shrink: 0; }
    .msg-avatar.sam { background: #fff; border: 1.5px solid rgba(44,42,110,.2); overflow: hidden; padding: 0; }
    .msg-avatar.user { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); font-size: .65rem; }
    .msg-bubble { max-width: 80%; padding: 1rem 1.25rem; border-radius: 1.25rem; font-size: .9375rem; line-height: 1.65; box-shadow: 0 2px 8px rgba(0,0,0,.07); word-break: break-word; animation: bubbleIn .32s ease-out; }
    @keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
    .msg-bubble.sam { background: #fff; border: 1px solid rgba(44,42,110,.15); border-bottom-left-radius: .3rem; color: var(--secondary-dark); box-shadow: 0 1px 4px rgba(44,42,110,.08), 0 2px 10px rgba(0,0,0,.04); font-family: 'Outfit', 'Inter', sans-serif; }
    .msg-bubble.user { background: linear-gradient(135deg, #E8E4F5 0%, #DDD5EB 100%); color: #1B1A50; border-top-right-radius: .3rem; white-space: pre-line; position: relative; cursor: pointer; border: 1px solid rgba(44,42,110,.22); box-shadow: 0 1px 6px rgba(44,42,110,.14); }
    .msg-bubble.user:hover::after { content: '✏️'; position: absolute; top: .3rem; right: .3rem; font-size: .75rem; opacity: .7; }
    .msg-bubble.user[contenteditable="true"] { outline: 2px solid rgba(44,42,110,.4); background: #fff; cursor: text; white-space: pre-wrap; }
    .msg-bubble.sam b,.msg-bubble.sam strong { color: #1B1A50; font-weight: 700; }
    .msg-bubble.sam em { font-style: italic; color: #B43E2B; font-weight: 500; }
    html.dark .msg-bubble.sam em { color: #F2B5A6; }
    .msg-bubble.sam code { background: rgba(27,26,80,.08); padding: 1px 5px; border-radius: 4px; font-size: .85em; }
    .msg-bubble.sam ul,.msg-bubble.sam ol { padding-left: 1.25rem; margin: .3rem 0; }
    .msg-bubble.sam li { margin-bottom: .2rem; }
    .msg-bubble.sam hr { border: none; height: 2px; background: linear-gradient(90deg, #1B1A50 0%, #2C2A6E 55%, #E6573F 100%); border-radius: 2px; margin: 1rem 0; opacity: .55; }
    .msg-bubble.sam p { margin: 0 0 .5rem; }
    .msg-bubble.sam p:last-child { margin-bottom: 0; }
    /* ── Sources grounding (NotebookLM-style) ── */
    .msg-sources { max-width: 78%; margin: .25rem 0 .75rem 2.85rem; }
    .msg-sources-label { font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .45rem; background: linear-gradient(135deg, #1B1A50 0%, #2C2A6E 60%, #E6573F 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .msg-sources-list { display: flex; flex-wrap: wrap; gap: .4rem; }
    /* Book-spine chip */
    .msg-source-chip {
      display: inline-flex; align-items: flex-start; gap: .35rem;
      background: linear-gradient(135deg, rgba(44,42,110,.07) 0%, rgba(44,42,110,.05) 100%);
      border: 1px solid rgba(44,42,110,.2);
      border-left: 2.5px solid #2C2A6E;
      border-radius: .4rem .6rem .6rem .4rem;
      padding: .35rem .65rem .35rem .5rem;
      cursor: default;
      box-shadow: 0 1px 5px rgba(44,42,110,.1);
      transition: all .18s;
      max-width: 100%;
      position: relative;
    }
    .msg-source-chip:hover {
      background: linear-gradient(135deg, rgba(44,42,110,.13) 0%, rgba(44,42,110,.1) 100%);
      box-shadow: 0 3px 10px rgba(44,42,110,.2);
      transform: translateY(-1px);
      border-left-color: #1B1A50;
    }
    .msg-source-icon { display: flex; align-items: center; flex-shrink: 0; margin-top: .1rem; color: #2C2A6E; }
    .msg-source-icon svg { width: .85rem; height: .85rem; }
    .msg-source-body { min-width: 0; }
    .msg-source-title { font-size: .7rem; font-weight: 600; color: #4B4892; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; display: block; }
    .msg-source-snippet { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; display: none; font-size: .82rem; color: #0F0E2A; line-height: 1.55; max-width: 52ch; min-width: 22ch; white-space: normal; background: #ffffff; border: 1px solid rgba(44,42,110,.35); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(15,14,42,.22); pointer-events: none; }
    html[dir="rtl"] .msg-source-snippet { left: auto; right: 0; }
    .msg-source-snippet[data-lang="he"] { font-family: 'Heebo','Frank Ruhl Libre',sans-serif; direction: rtl; text-align: right; font-size: 1rem; line-height: 1.75; letter-spacing: .005em; max-width: 56ch; }
    .msg-source-snippet b, .msg-source-snippet strong { font-weight: 700; color: #1B1A50; background: rgba(44,42,110,.08); border-radius: 3px; padding: 0 2px; }
    .msg-source-snippet[data-lang="he"] b, .msg-source-snippet[data-lang="he"] strong { color: #B43E2B; background: rgba(230,87,63,.10); }
    /* Hover ne montre PLUS l'inline (provoquait des tremblements horizontaux);
       le hover utilise #floating-snippet-tip body-level (cf. JS). Seul le click reste. */
    .msg-source-chip.tooltip-open .msg-source-snippet { display: block; }
    /* Sur mobile (touch), le tap déclenche click → tooltip-open inline qui déborde
       hors viewport (52ch HE > largeur écran). On désactive l'inline, le tooltip
       flottant body-level prend le relais (déjà clampé à 100vw - 24px). */
    @media (hover: none), (pointer: coarse) {
      .msg-source-chip.tooltip-open .msg-source-snippet { display: none !important; }
    }
    #floating-snippet-tip { position: fixed; z-index: 9999; display: none; font-size: .82rem; color: #0F0E2A; line-height: 1.55; width: max-content; max-width: min(52ch, calc(100vw - 24px)); white-space: normal; background: #ffffff; border: 1px solid rgba(44,42,110,.35); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(15,14,42,.22); pointer-events: none; }
    #floating-snippet-tip[data-lang="he"] { font-family: 'Heebo','Frank Ruhl Libre',sans-serif; direction: rtl; text-align: right; font-size: 1rem; line-height: 1.75; letter-spacing: .005em; max-width: min(56ch, calc(100vw - 24px)); }
    #floating-snippet-tip b, #floating-snippet-tip strong { font-weight: 700; color: #1B1A50; background: rgba(44,42,110,.08); border-radius: 3px; padding: 0 2px; }
    #floating-snippet-tip[data-lang="he"] b, #floating-snippet-tip[data-lang="he"] strong { color: #B43E2B; background: rgba(230,87,63,.10); }
    html.dark #floating-snippet-tip { background: #1B1A50; color: #B8B6D8; border-color: rgba(44,42,110,.4); }
    .msg-source-chip.tooltip-open { background: linear-gradient(135deg, rgba(44,42,110,.16) 0%, rgba(44,42,110,.13) 100%); border-left-color: #1B1A50; box-shadow: 0 3px 12px rgba(44,42,110,.25); }
    html.dark .msg-source-chip { background: linear-gradient(135deg, rgba(44,42,110,.1) 0%, rgba(44,42,110,.08) 100%); border-color: rgba(44,42,110,.3); border-left-color: #6E6AB5; }
    html.dark .msg-source-icon { color: #B8B6D8; }
    html.dark .msg-source-title { color: #B8B6D8; }
    html.dark .msg-source-snippet { color: #9491C9; }
    @media (max-width: 640px) { .msg-sources { margin-left: 2.85rem; } .msg-source-title { max-width: 18ch; } .msg-action-row { margin-left: 2.85rem; } }
    .msg-cat-badge { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .7rem; border-radius: 9999px; display: inline-block; margin-bottom: .5rem; }
    .msg-cat-halakha   { background: rgba(44,42,110,.13);  color: #1B1A50; border: 1px solid rgba(44,42,110,.28); }
    .msg-cat-kabbalah  { background: rgba(75,72,146,.13);  color: #1B1A50; border: 1px solid rgba(75,72,146,.28); }
    .msg-cat-chasidout { background: rgba(44,42,110,.13); color: #1B1A50; border: 1px solid rgba(44,42,110,.28); }
    .msg-cat-talmud    { background: rgba(230,87,63,.13);  color: #B43E2B; border: 1px solid rgba(230,87,63,.28); }
    .msg-cat-responsa  { background: rgba(230,87,63,.13);  color: #B43E2B; border: 1px solid rgba(230,87,63,.28); }
    .msg-bubble.sam h1 { font-size: 1.08em; font-weight: 800; color: #1B1A50; margin: .25rem 0 .45rem; line-height: 1.3; }
    .msg-bubble.sam h2 { font-size: 1em;    font-weight: 800; color: #B43E2B; margin: .85rem 0 .35rem; line-height: 1.3; }
    .msg-bubble.sam h3 { font-size: .96em;  font-weight: 700; color: #2C2A6E; margin: .7rem 0 .3rem; line-height: 1.35; }
    .msg-bubble.sam h4 { font-size: .92em;  font-weight: 700; color: #5A1E10; margin: .55rem 0 .25rem; line-height: 1.35; }
    .loading-dots { display: flex; align-items: center; gap: .35rem; padding: .25rem 0; }
    .loading-dots span { width: .46rem; height: .46rem; border-radius: 50%; background: linear-gradient(135deg, #1B1A50, #2C2A6E); animation: dotPulse 1.5s ease-in-out infinite; }
    .loading-dots span:nth-child(2){animation-delay:.18s;} .loading-dots span:nth-child(3){animation-delay:.36s;}
    .chat-input-area { padding: 1.1rem 1.5rem 1.25rem; background: transparent; border-top: 1px solid transparent; flex-shrink: 0; border-radius: 0 0 1.75rem 1.75rem; }
    .chat-input-row { display: flex; align-items: flex-end; gap: .75rem; background: #F5F2EC; border-radius: 1.1rem; padding: .875rem 1.125rem; border: 1.5px solid #D6D4E8; transition: border-color .25s, box-shadow .25s; }
    .chat-input-row:focus-within { border-color: rgba(44,42,110,.45); background: #fff; }
    #chat-input { flex: 1; background: none; border: none; outline: none; font-family: 'Inter', sans-serif; font-size: .9375rem; color: var(--secondary-dark); resize: none; min-height: 1.5rem; max-height: 10rem; overflow-y: auto; line-height: 1.55; }
    #chat-input::placeholder { color: #9491C9; }
    #chat-input:disabled { opacity: .5; }
    #chat-send { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: linear-gradient(135deg, #E6573F 0%, #B43E2B 100%); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .25s; flex-shrink: 0; box-shadow: 0 2px 10px rgba(230,87,63,.45); }
    #chat-mic  { width: 2.75rem; height: 2.75rem; border-radius: 50%; flex-shrink: 0; }
    #chat-send:hover:not(:disabled){ filter: brightness(1.1); transform: scale(1.08); box-shadow: 0 4px 16px rgba(230,87,63,.6); }
    #chat-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
    .chat-hint { text-align: center; font-size: .72rem; color: #9491C9; margin-top: .6rem; letter-spacing: .01em; }
    .chat-mode-row { background: #F5F2EC; padding: .3rem .75rem; display: flex; gap: .35rem; border-bottom: 1px solid rgba(44,42,110,.15); flex-shrink: 0; align-items: center; }
    .mode-label { display: none; }
    .mode-segmented { display: flex; gap: .35rem; }
    html.dark .mode-segmented { background: none; border: none; }
    .mode-btn { font-size: .68rem; font-family: 'Inter', sans-serif; font-weight: 700; padding: .22rem .7rem; border-radius: 9999px; cursor: pointer; transition: all .2s; line-height: 1.4; display: inline-flex; align-items: center; gap: .28rem; letter-spacing: .02em; }
    #mode-court, #mode-detail { background: transparent; color: rgba(180,62,43,.55); border: 1.5px solid rgba(230,87,63,.28); }
    #mode-court.mode-active, #mode-detail.mode-active { background: #E6573F; color: #fff; border-color: #E6573F; box-shadow: 0 2px 10px rgba(230,87,63,.45); }
    .mode-btn:hover:not(.mode-active) { background: rgba(230,87,63,.1); border-color: rgba(230,87,63,.5); color: #B43E2B; }
    html.dark .chat-mode-row { background: #0F0E2A; border-bottom-color: rgba(44,42,110,.15); }
    html.dark #mode-court, html.dark #mode-detail { color: rgba(230,87,63,.45); border-color: rgba(230,87,63,.22); }
    html.dark #mode-court.mode-active, html.dark #mode-detail.mode-active { background: #E6573F; border-color: #E6573F; color: #fff; box-shadow: 0 2px 10px rgba(230,87,63,.4); }
    .msg-mode-tag { display: inline-flex; align-items: center; gap: .2rem; font-size: .6rem; font-weight: 800; padding: .1rem .45rem; border-radius: 9999px; margin-top: .55rem; letter-spacing: .04em; text-transform: uppercase; }
    .msg-mode-tag.tag-court { background: rgba(230,87,63,.13); color: #B43E2B; border: 1px solid rgba(230,87,63,.3); }
    .msg-mode-tag.tag-detail { background: rgba(44,42,110,.1); color: #1B1A50; border: 1px solid rgba(44,42,110,.22); }
    html.dark .msg-mode-tag.tag-court { background: rgba(230,87,63,.18); color: #E6573F; border-color: rgba(230,87,63,.35); }
    html.dark .msg-mode-tag.tag-detail { background: rgba(44,42,110,.14); color: #6E6AB5; border-color: rgba(44,42,110,.3); }
    /* ── Action row: WA | expand (natural width) | share ── aligned to start (left LTR / right RTL) */
    .msg-action-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin: .35rem 0 .5rem 2.85rem; }
    .expand-btn { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; gap: .4rem; height: 44px; padding: 0 1rem; border-radius: .85rem; border: none; background: linear-gradient(135deg, #2C2A6E 0%, #2C2A6E 50%, #1B1A50 100%); color: #fff; font-size: .875rem; font-family: 'Inter',sans-serif; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(44,42,110,.4), inset 0 1px 0 rgba(255,255,255,.25); transition: all .18s cubic-bezier(.4,0,.2,1); white-space: nowrap; }
    .expand-btn svg { flex-shrink: 0; }
    .expand-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 6px 20px rgba(44,42,110,.52), inset 0 1px 0 rgba(255,255,255,.28); }
    .expand-btn:active { transform: translateY(0) scale(.99); box-shadow: 0 2px 8px rgba(44,42,110,.34); }
    /* Share button — send-button gradient (purple→blue) */
    .share-btn-icon { width: 44px; height: 44px; border-radius: 50%; border: none; background: linear-gradient(145deg, #2C2A6E 0%, #4a90e8 100%); box-shadow: 0 4px 14px rgba(44,42,110,.45); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s cubic-bezier(.4,0,.2,1); }
    .share-btn-icon:hover { transform: scale(1.09) translateY(-1px); box-shadow: 0 6px 20px rgba(44,42,110,.6); }
    .share-btn-icon:active { transform: scale(.92); }
    .share-btn-icon.copied { background: linear-gradient(145deg, #22c55e, #16a34a); box-shadow: 0 4px 14px rgba(34,197,94,.45); }
    /* Écouter / pause / stop — tous dans la gamme teal du bouton Écouter */
    .listen-btn-icon { width: 44px; height: 44px; border-radius: 50%; border: none; background: linear-gradient(145deg, #14b8a6 0%, #0d9488 100%); box-shadow: 0 4px 14px rgba(13,148,136,.4); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s cubic-bezier(.4,0,.2,1); }
    .listen-btn-icon:hover { transform: scale(1.09) translateY(-1px); box-shadow: 0 6px 20px rgba(13,148,136,.6); }
    .listen-btn-icon:active { transform: scale(.92); }
    .listen-btn-icon.tts-playing { animation: ttsPulse 1.4s ease-in-out infinite; }
    @keyframes ttsPulse { 0%,100% { box-shadow: 0 4px 14px rgba(13,148,136,.5); } 50% { box-shadow: 0 4px 22px rgba(13,148,136,.95); } }
    .listen-btn-icon.tts-loading { cursor: progress; }
    .listen-btn-icon .tts-spin { animation: ttsSpin .7s linear infinite; transform-origin: 50% 50%; }
    @keyframes ttsSpin { to { transform: rotate(360deg); } }
    .listen-btn-icon.tts-paused { background: linear-gradient(145deg, #2dd4bf 0%, #14b8a6 100%); }
    .listen-btn-icon.tts-stop-btn { width: 38px; height: 38px; background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%); box-shadow: 0 4px 14px rgba(15,118,110,.45); }
    .listen-btn-icon.tts-stop-btn:hover { box-shadow: 0 6px 20px rgba(15,118,110,.65); }
    /* WhatsApp action button — green circle */
    .wa-action-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: #25D366; box-shadow: 0 4px 14px rgba(37,211,102,.4); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s cubic-bezier(.4,0,.2,1); text-decoration: none; }
    .wa-action-btn:hover { transform: scale(1.09) translateY(-1px); box-shadow: 0 6px 20px rgba(37,211,102,.6); }
    .wa-action-btn:active { transform: scale(.92); }
    /* ── Survey willingness-to-pay ── */
    .survey-card { background: linear-gradient(135deg,#F5F2EC,#ECEAF5); border: 1.5px solid rgba(44,42,110,.2); border-radius: 1.1rem; padding: 1.1rem 1.25rem; margin: .75rem 0; max-width: 480px; }
    .survey-title { font-size: .72rem; font-weight: 700; color: #2C2A6E; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
    .survey-q { font-size: .88rem; font-weight: 500; color: #1B1A50; margin-bottom: .75rem; line-height: 1.45; }
    .survey-options { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .55rem; }
    .survey-opt { background: #fff; border: 1.5px solid rgba(44,42,110,.25); border-radius: .75rem; padding: .55rem .9rem; font-size: .84rem; font-family: 'Inter',sans-serif; font-weight: 500; color: #1B1A50; cursor: pointer; text-align: left; transition: all .18s; }
    .survey-opt:hover { background: #2C2A6E; color: #fff; border-color: #2C2A6E; }
    .survey-opt-free { border-color: rgba(75,72,146,.25); color: #4B4892; }
    .survey-opt-free:hover { background: #4B4892; color: #fff; border-color: #4B4892; }
    .survey-dismiss { background: none; border: none; font-size: .77rem; color: #9491C9; cursor: pointer; padding: .15rem 0; font-family: 'Inter',sans-serif; transition: color .15s; }
    .survey-dismiss:hover { color: #4B4892; }
    .survey-thanks { font-size: .85rem; color: #2C2A6E; font-weight: 600; padding: .5rem 0; text-align: center; animation: fadeIn .3s ease; }
    html.dark .survey-card { background: linear-gradient(135deg,#1B1A50,#1B1A50); border-color: rgba(44,42,110,.3); }
    html.dark .survey-q { color: #D6D4E8; }
    html.dark .survey-opt { background: #1B1A50; color: #D6D4E8; border-color: rgba(44,42,110,.3); }
    html.dark .survey-opt:hover { background: #2C2A6E; color: #fff; }
    html[dir="rtl"] .survey-opt { text-align: right; }
    .chat-suggestions { display: flex; flex-direction: row; flex-wrap: nowrap; gap: .45rem; margin-top: .75rem; margin-bottom: -.3rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .5rem; touch-action: pan-x; mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent 100%); -webkit-mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent 100%); }
    .chat-suggestions::-webkit-scrollbar { display: none; }
    [dir="rtl"] .chat-suggestions { mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent 100%); -webkit-mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent 100%); }
    .chat-suggestion { border-radius: 9999px; padding: .22rem .7rem; font-size: .66rem; font-weight: 700; letter-spacing: .02em; text-align: left; cursor: pointer; transition: all .18s; font-family: 'Inter', sans-serif; line-height: 1.4; white-space: nowrap; flex-shrink: 0; border: 1px solid; }
    .chat-suggestion:nth-child(3n+1) { background: rgba(44,42,110,.11); color: #1B1A50; border-color: rgba(44,42,110,.25); }
    .chat-suggestion:nth-child(3n+2) { background: rgba(75,72,146,.11); color: #1B1A50; border-color: rgba(75,72,146,.25); }
    .chat-suggestion:nth-child(3n)   { background: rgba(230,87,63,.12); color: #B43E2B; border-color: rgba(230,87,63,.25); }
    .chat-suggestion:hover { filter: brightness(.92) saturate(1.2); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
    .chat-suggestions { cursor: grab; }
    .chat-suggestions.dragging { cursor: grabbing; user-select: none; }
    html.dark .chat-suggestion { background: rgba(44,42,110,.12); border-color: rgba(44,42,110,.3); color: #9491C9; }
    html.dark .chat-suggestion:hover { background: rgba(44,42,110,.22); border-color: rgba(44,42,110,.5); }
    [dir="rtl"] .chat-suggestion { text-align: right; }
    /* ── Bulle de bienvenue — serrée + hiérarchie typo ── */
    .msg-bubble.sam:has(.chat-welcome) { padding: .7rem .9rem; max-width: 92%; }
    .chat-welcome { display: flex; flex-direction: column; gap: .25rem; }
    .chat-welcome-title { font-family: 'Outfit', 'Inter', sans-serif; font-size: 1.05rem; font-weight: 700; line-height: 1.2; color: #1B1A50; letter-spacing: -.01em; }
    .chat-welcome-sub { font-size: .85rem; font-weight: 500; line-height: 1.3; color: var(--ink-600); }
    [dir="rtl"] .chat-welcome-title, [dir="rtl"] .chat-welcome-sub { font-family: 'Heebo', sans-serif; letter-spacing: 0; }
    html.dark .chat-welcome-title { color: var(--ink-100); }
    html.dark .chat-welcome-sub { color: var(--ink-300); }
    /* ── Chips de bienvenue — soft pastels palette ── */
    .welcome-chips { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; padding: 0; margin: -.15rem 0 .75rem; animation: bubbleIn .32s ease-out .08s both; }
    .welcome-chips .chat-suggestion { border: 1px solid; padding: .5rem .7rem; font-family: 'Lato', 'Inter', sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: -.005em; line-height: 1.25; text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 9999px; transition: all .2s; box-shadow: 0 1px 3px rgba(15,14,42,.08); }
    /* Soft pastels — 4 combos palette, diagonale indigo/coral */
    .welcome-chips .chat-suggestion:nth-child(1) { background: #E8E4F5; color: #2C2A6E; border-color: rgba(44,42,110,.28); }
    .welcome-chips .chat-suggestion:nth-child(2) { background: #FADBD3; color: #B43E2B; border-color: rgba(180,62,43,.30); }
    .welcome-chips .chat-suggestion:nth-child(3) { background: #E8E6F2; color: #1B1A50; border-color: rgba(27,26,80,.28); }
    .welcome-chips .chat-suggestion:nth-child(4) { background: #FCE9E2; color: #5A1E10; border-color: rgba(90,30,16,.28); }
    .welcome-chips .chat-suggestion:hover { filter: brightness(.96); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15,14,42,.10); }
    .welcome-chips .chat-suggestion:active { transform: scale(.97); }
    /* Dark mode : tints translucides */
    html.dark .welcome-chips .chat-suggestion:nth-child(1) { background: rgba(232,228,245,.10); color: #B8B6D8; }
    html.dark .welcome-chips .chat-suggestion:nth-child(2) { background: rgba(252,219,211,.10); color: #FCE9E2; }
    html.dark .welcome-chips .chat-suggestion:nth-child(3) { background: rgba(232,228,245,.08); color: #9491C9; }
    html.dark .welcome-chips .chat-suggestion:nth-child(4) { background: rgba(252,233,226,.08); color: #F2B5A6; }
    /* Bulle de bienvenue plus large sur mobile pour laisser place aux pills */
    @media (max-width: 640px) { .msg-bubble.sam { max-width: 94%; } }
    [dir="rtl"] .chat-suggestion:hover { transform: translateX(-2px); }
    html.dark .chat-suggestion { background: rgba(44,42,110,.1); border-color: rgba(44,42,110,.25); color: #9491C9; }
    html.dark .chat-suggestion:hover { background: rgba(44,42,110,.18); }
    .send-spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .chat-name-row { padding: .6rem 1rem .2rem; }
    #chat-name { width: auto; max-width: 180px; border: 1.5px solid #D6D4E8; border-radius: .6rem; padding: .4rem .75rem; font-size: .8rem; font-family: 'Inter', sans-serif; color: var(--secondary-dark); background: #F5F2EC; outline: none; transition: border-color .25s; }
    #chat-name:focus { border-color: var(--primary); background: #fff; }
    #chat-name::placeholder { color: #B8B6D8; }
    html.dark #chat-name { background: #1B1A50; border-color: rgba(44,42,110,.3); color: #D6D4E8; }
    html.dark #chat-name::placeholder { color: #4B4892; }
    html.dark .chat-input-area { background: #0F0E2A; border-color: rgba(44,42,110,.25); }
    html.dark .chat-input-row { background: #1B1A50; border-color: rgba(44,42,110,.3); }
    html.dark .chat-input-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,42,110,.15); }
    html.dark #chat-input { color: #D6D4E8; }
    html.dark #chat-input::placeholder { color: #4B4892; }
    html.dark .msg-bubble.sam { background: linear-gradient(135deg, #1B1A50, #1B1A50); border-color: rgba(44,42,110,.45); color: #D6D4E8; }
    /* Dark mode — corrections visibilité hero & blobs */
    html.dark .blob-2 { display: none; }
    html.dark .hero-h1 [data-i18n="hero_tagline"] { color: rgba(184,182,216,.8); }
    html.dark a[href="#rag-tech"].btn { background: rgba(255,255,255,.1) !important; border: 1.5px solid rgba(255,255,255,.25) !important; box-shadow: 0 4px 16px rgba(0,0,0,.35) !important; }
    html.dark #how-it-works .section-heading p { color: #B8B6D8; }
    /* ── SESSIONS DRAWER (mobile sidebar) ── */
    .chat-hamburger { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.34); border-radius: .7rem; color: #fff; cursor: pointer; flex-shrink: 0; padding: 0; margin-inline-end: .65rem; transition: background .15s, transform .12s; position: relative; z-index: 1; }
    .chat-hamburger:hover { background: rgba(255,255,255,.3); }
    .chat-hamburger:active { transform: scale(.94); }
    /* RTL : le hamburger est à gauche, l'avatar à sa droite → l'écart doit être à droite du hamburger = margin-inline-start */
    [dir="rtl"] .chat-hamburger { margin-inline-end: 0; margin-inline-start: .65rem; }

    #sessions-drawer-backdrop { display: none; position: absolute; inset: 0; z-index: 25; background: rgba(15,14,42,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
    #sessions-drawer-backdrop.open { display: block; animation: sdFadeIn .18s ease-out; }
    @keyframes sdFadeIn { from { opacity: 0; } to { opacity: 1; } }

    #sessions-drawer { display: none; position: absolute; top: 0; bottom: 0; left: 0; width: 86%; max-width: 340px; z-index: 26; background: #fff; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.22); transform: translateX(-100%); transition: transform .26s cubic-bezier(.4,0,.2,1); border-radius: 1.5rem 0 0 1.5rem; overflow: hidden; }
    #sessions-drawer.open { display: flex; transform: translateX(0); }
    [dir="rtl"] #sessions-drawer { left: auto; right: 0; transform: translateX(100%); border-radius: 0 1.5rem 1.5rem 0; box-shadow: -4px 0 24px rgba(0,0,0,.22); }
    [dir="rtl"] #sessions-drawer.open { transform: translateX(0); }

    .sd-header { display: flex; align-items: center; gap: .5rem; padding: 1rem 1rem .75rem; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
    .sd-new { flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem .9rem; background: linear-gradient(135deg, #2C2A6E, #1B1A50); color: #fff; border: none; border-radius: .85rem; font-size: .82rem; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(44,42,110,.3); font-family: inherit; }
    .sd-new:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(44,42,110,.4); }
    .sd-new:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(44,42,110,.35); }
    .sd-close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid #D6D4E8; border-radius: .7rem; color: #4B4892; cursor: pointer; flex-shrink: 0; padding: 0; }
    .sd-close:hover { background: #f1f5f9; color: #2C2A6E; }
    .sd-close:active { background: #D6D4E8; transform: scale(.94); }

    .sd-search-wrap { position: relative; padding: .55rem 1rem 0; flex-shrink: 0; }
    .sd-search-wrap > svg { position: absolute; left: 1.7rem; top: calc(.55rem + 50% - 7px); color: #9491C9; pointer-events: none; }
    [dir="rtl"] .sd-search-wrap > svg { left: auto; right: 1.7rem; }
    #sd-search { width: 100%; padding: .5rem .8rem .5rem 2.1rem; border: 1px solid #D6D4E8; border-radius: .7rem; font-size: .82rem; outline: none; background: #FAF8F2; font-family: inherit; color: #1B1A50; box-sizing: border-box; }
    [dir="rtl"] #sd-search { padding: .5rem 2.1rem .5rem .8rem; }
    #sd-search:focus { border-color: #2C2A6E; background: #fff; }

    .sd-section-label { padding: .75rem 1rem .25rem; font-size: .66rem; font-weight: 800; letter-spacing: .09em; color: #9491C9; text-transform: uppercase; flex-shrink: 0; }
    /* Zone défilante (en-tête dossier + label + liste) — squelette de la sidebar desktop /page */
    .sd-scroll { flex: 1; overflow-y: auto; padding-bottom: .6rem; }
    .sd-folder { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; padding: .5rem 1rem .1rem; font-size: .84rem; font-weight: 700; font-family: 'Outfit', 'Inter', sans-serif; color: #2C2A6E; user-select: none; }
    .sd-folder-icon { display: flex; flex-shrink: 0; color: #2C2A6E; }
    .sd-list { display: flex; flex-direction: column; gap: 0; padding: 0 .5rem; }
    .sd-item { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: .55rem; background: transparent; border: none; cursor: pointer; text-align: left; width: 100%; color: #1B1A50; font-size: .81rem; font-family: inherit; transition: background .12s; min-height: 36px; }
    [dir="rtl"] .sd-item { text-align: right; }
    .sd-item:hover, .sd-item:focus-visible { background: #f1f5f9; outline: none; }
    .sd-item:active { background: #D6D4E8; }
    .sd-item.active { background: rgba(44,42,110,.09); }
    .sd-item.active .sd-item-title { color: #1B1A50; font-weight: 700; }
    .sd-item-icon { flex-shrink: 0; color: #9491C9; }
    .sd-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; line-height: 1.3; }
    /* Pastille compteur Q — style desktop /page (gradient bleu plein) */
    .sd-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 .35rem; background: linear-gradient(135deg, #2C2A6E, #1B1A50); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 8px; flex-shrink: 0; letter-spacing: .02em; font-family: 'Outfit', 'Inter', sans-serif; }
    /* Pin toggle on/off — corail filled vs gris transparent */
    .sd-pin-btn { flex-shrink: 0; padding: 4px; border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; transition: background .15s, color .15s; }
    .sd-pin-btn.pin-on { color: #E6573F; filter: drop-shadow(0 1px 2px rgba(230,87,63,.4)); }
    .sd-pin-btn.pin-off { color: rgba(124,124,124,.32); }
    .sd-pin-btn.pin-hidden { visibility: hidden; pointer-events: none; }
    .sd-pin-btn.pin-on:hover { background: rgba(230,87,63,.12); }
    .sd-pin-btn.pin-off:hover { color: #E6573F; opacity: .75; }
    .sd-item-pin { flex-shrink: 0; color: #E6573F; }

    /* ─ Tree-view Phase B : chevron + sub-Qs ─ */
    .sd-wrapper { display: flex; flex-direction: column; }
    .sd-chevron { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; cursor: pointer; color: #2C2A6E; border-radius: 5px; user-select: none; transition: background .12s; padding: 0; border: none; background: transparent; }
    .sd-chevron svg { width: 14px; height: 14px; transition: transform .18s ease; }
    .sd-chevron:hover { background: rgba(44,42,110,.13); }
    .sd-chevron.open svg { transform: rotate(90deg); }
    .sd-chevron.closed svg { transform: rotate(0deg); }
    .sd-chevron.hidden { visibility: hidden; pointer-events: none; }
    [dir="rtl"] .sd-chevron.closed svg { transform: rotate(180deg); }
    [dir="rtl"] .sd-chevron.open svg { transform: rotate(90deg); }
    .sd-sub-list { display: flex; flex-direction: column; margin: 2px 0 6px 18px; border-left: 2.5px solid #2C2A6E; padding-left: 4px; }
    [dir="rtl"] .sd-sub-list { margin: 2px 18px 6px 0; border-left: none; border-right: 2.5px solid #2C2A6E; padding-left: 0; padding-right: 4px; }
    .sd-sub-item { background: transparent; border: none; text-align: left; font-family: inherit; font-size: .78rem; font-weight: 600; color: #2C2A6E; padding: .35rem .55rem .35rem .65rem; border-radius: .4rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: .4rem; align-items: center; transition: background .12s, color .12s; opacity: .92; }
    [dir="rtl"] .sd-sub-item { text-align: right; padding: .35rem .65rem .35rem .55rem; }
    .sd-sub-item:hover { background: rgba(44,42,110,.07); opacity: 1; color: #1B1A50; }
    .sd-sub-item:active { background: rgba(44,42,110,.13); }
    .sd-sub-item .sd-sub-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
    .sd-sub-tag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: .85rem; font-weight: 700; flex-shrink: 0; line-height: 1; background: #fff; }
    .sd-sub-tag.q-mode-concis { color: #E6573F; border: 1.5px solid #E6573F; box-shadow: 0 1px 3px rgba(230,87,63,.25); }
    .sd-sub-tag.q-mode-detail { color: #2C2A6E; border: 1.5px solid #2C2A6E; box-shadow: 0 1px 3px rgba(44,42,110,.22); }
    html.dark .sd-sub-item { color: #9491C9; }
    html.dark .sd-sub-item:hover { color: #6E6AB5; background: rgba(44,42,110,.1); }
    html.dark .sd-sub-tag { background: #0F0E2A; }

    /* Flash quand on saute à une Q via tree-view drawer */
    .msg-bubble.q-highlight { animation: qFlashMobile 1.5s ease-out; box-shadow: 0 0 0 3px rgba(44,42,110,.35); }
    @keyframes qFlashMobile {
      0%   { box-shadow: 0 0 0 0   rgba(44,42,110,0);   }
      20%  { box-shadow: 0 0 0 6px rgba(44,42,110,.45); }
      100% { box-shadow: 0 0 0 0   rgba(44,42,110,0);   }
    }

    .sd-empty { display: none; padding: 2.5rem 1.5rem 1.5rem; text-align: center; color: #9491C9; font-size: .82rem; line-height: 1.55; }
    .sd-empty.show { display: block; }

    html.dark #sessions-drawer { background: #0F0E2A; box-shadow: 4px 0 24px rgba(0,0,0,.6); }
    html.dark .sd-header { border-bottom-color: rgba(44,42,110,.18); }
    html.dark .sd-close { border-color: rgba(44,42,110,.25); color: #9491C9; }
    html.dark .sd-close:hover { background: rgba(44,42,110,.12); }
    html.dark #sd-search { background: rgba(44,42,110,.08); border-color: rgba(44,42,110,.22); color: #D6D4E8; }
    html.dark .sd-item { color: #B8B6D8; }
    html.dark .sd-item:hover, html.dark .sd-item:focus-visible { background: rgba(44,42,110,.12); }
    html.dark .sd-section-label { color: #9491C9; }
    html.dark .sd-folder { color: #B8B6D8; }

    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

    /* ══════════════════════════════════════════════════════════════
       MOBILE OPTIMIZATION
    ══════════════════════════════════════════════════════════════ */

    /* ── Conteneur ── */
    @media (max-width: 480px) {
      .container { padding: 0 1rem; }
    }

    /* ── Header ── */
    @media (max-width: 900px) {
      #header { padding: .7rem 0; }
      .logo { font-size: 1.6rem; }
    }

    /* ── Hero ── */
    @media (max-width: 767px) {
      #hero { padding: 4.5rem 0 2rem; }
      .hero-badge { font-size: .72rem; padding: .4rem 1rem; margin-bottom: 1rem; }
      .hero-h1 .rebsam-logo { font-size: clamp(2.4rem,10vw,3.2rem); }
      .hero-h1 [data-i18n="hero_tagline"] { font-size: clamp(.9rem,3.5vw,1.1rem); }
      .hero-divider { margin-bottom: 1rem; }
      .hero-p { font-size: .875rem; margin-bottom: .65rem; }
      .hero-points { gap: .5rem; margin-bottom: 1.1rem; }
      .hero-point { padding: .6rem .85rem; gap: .65rem; border-radius: .75rem; }
      .hero-point span { font-size: .82rem; }
      .hero-btns { gap: .55rem; margin-bottom: 1rem; }
      .hero-sources { font-size: .63rem; }
      .hero-avatar-img { max-width: 200px; }
    }
    @media (max-width: 400px) {
      .hero-points { padding: 0 .25rem; }
      .hero-point { padding: .55rem .75rem; }
    }

    /* ── Stats ── */
    @media (max-width: 767px) {
      #stats { padding: 2.5rem 0; }
      .stat-card { padding: 1.1rem .5rem; }
      .stat-icon { font-size: 1.6rem; margin-bottom: .5rem; }
      .stat-number { font-size: 1.75rem; }
      .stat-label { font-size: .7rem; }
    }

    /* ── Sections générales ── */
    @media (max-width: 767px) {
      .section-heading { margin-bottom: 1.75rem; }
      .section-heading h2 { font-size: clamp(1.5rem,6vw,2rem); margin-bottom: .5rem; }
      .section-heading p { font-size: .9375rem; }
    }

    /* ── Comment ça marche ── */
    @media (max-width: 767px) {
      #how-it-works { padding: 3.5rem 0 4rem; }
      #how-it-works .section-heading { margin-bottom: 2rem; }
      #how-it-works .section-eyebrow { font-size: .75rem; padding: .35rem 1.1rem; margin-bottom: 1rem; }
    }
    /* Tablette : 2 colonnes (600-900px) */
    @media (min-width: 600px) and (max-width: 900px) {
      .steps-grid-new { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
    }
    /* Mobile : plein format, padding réduit */
    @media (max-width: 600px) {
      .steps-grid-new { gap: 1rem; }
      .step-card { padding: 1.5rem 1.25rem 1.75rem; gap: 1rem; border-radius: 1.25rem; }
      .step-card-icon { width: 3.5rem; height: 3.5rem; border-radius: 1rem; }
      .step-card-icon svg { width: 24px; height: 24px; }
      .step-title { font-size: 1.05rem; }
      .step-desc { font-size: .875rem; line-height: 1.65; }
    }

    /* ── Piliers ── */
    @media (max-width: 767px) {
      #pillars { padding: 3.5rem 0; }
      .feature-card { padding: 1.5rem 1.25rem; border-radius: 1.1rem; }
      .feature-card h3 { font-size: 1.1rem; }
      .feature-card p { font-size: .875rem; }
    }

    /* ── Bibliothèque ── */
    @media (max-width: 767px) {
      #sources { padding: 3.5rem 0; }
      .sources-grid-new { gap: .875rem; margin-top: 1.75rem; }
      .library-category { margin-bottom: 2rem; }
      .library-books-row { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    }
    @media (max-width: 480px) {
      .sources-grid-new { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
      .source-book { padding: 1rem .75rem; border-radius: 1rem; }
      .source-book-icon { font-size: 1.6rem; }
      .source-book-title { font-size: .8rem; }
      .source-book-sub { font-size: .68rem; }
      .source-book-desc { display: none; }
      .library-cat-badge { font-size: .6rem; }
    }

    /* ── FAQ ── */
    @media (max-width: 767px) {
      #faq { padding: 3.5rem 0 3rem; }
      #faq .section-heading h2 { font-size: clamp(1.6rem,6vw,2rem); }
      .faq-question { padding: 1rem 1.1rem; font-size: .9375rem; }
      .faq-answer { padding: 0 1.1rem 1rem; padding-top: .875rem; font-size: .875rem; }
      .faq-list { gap: .65rem; }
    }

    /* ── Footer ── */
    @media (max-width: 767px) {
      footer { padding: 3rem 0 5rem; }
      .footer-grid { gap: 1.5rem; margin-bottom: 2rem; }
      .footer-brand p { font-size: .875rem; }
      .footer-col h4 { margin-bottom: 1rem; }
      .footer-col ul { gap: .75rem; }
      .footer-bottom { flex-direction: column; align-items: flex-start; gap: .65rem; }
      .footer-bottom-links { gap: 1rem; }
    }

    /* ── Chat modal — bottom sheet sur mobile ── */
    @media (max-width: 640px) {
      #chat-overlay { padding: 0; align-items: flex-end; background: rgba(0,0,0,.6); }
      #chat-modal {
        max-width: 100%;
        width: 100%;
        height: 92svh;
        border-radius: 1.5rem 1.5rem 0 0;
        margin: 0;
      }
      .chat-header { border-radius: 1.75rem 1.75rem 0 0; }
    }

    /* ── Boutons flottants — iOS safe area + tap targets ── */
    @media (max-width: 767px) {
      .float-btn { bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem)); }
      .float-inner {
        padding: .85rem 1rem;
        min-width: 52px;
        min-height: 52px;
        justify-content: center;
      }
      .float-icon svg { width: 22px; height: 22px; }
    }

    /* ── Mobile menu ── */
    @media (max-width: 640px) {
      .menu-inner { padding: 3.75rem 1.25rem 1.25rem; }
    }

    /* ── Désactiver les animations lourdes sur mobile ── */
    @media (max-width: 767px) {
      .halo-1, .halo-2, .halo-3,
      .blob-1, .blob-2,
      .pillars-glow { display: none; }
      .hero-cloud-1, .hero-cloud-2 { filter: blur(40px); }
    }

    /* ── Supprimer les hover transform sur touch ── */
    @media (hover: none) {
      .step-card:hover { transform: none; box-shadow: var(--shadow-sm); }
      .source-book:hover { transform: none; box-shadow: none; }
      .feature-card:hover { transform: none; box-shadow: var(--shadow-sm); }
      .hero-point:hover { transform: none; box-shadow: none; }
    }

    /* ── ZMANIM SECTION ── */
    #zmanim-section { padding: 2.25rem 0; background: var(--navy); position: relative; overflow: hidden; }
    html.dark #zmanim-section { background: var(--navy-dark); }
    .zmanim-card { background: rgba(255,255,255,.05); border: 1px solid rgba(212,175,55,.22); border-radius: 1.5rem; padding: 1.5rem 1.75rem; }
    .zmanim-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
    .zmanim-title { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--gold); white-space: nowrap; }
    .zmanim-subtitle { font-size: .75rem; color: rgba(255,255,255,.48); letter-spacing: .04em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .zmanim-loc-btn { display: inline-flex; align-items: center; gap: .35rem; background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.28); color: var(--gold); font-size: .72rem; font-weight: 600; padding: .3rem .7rem; border-radius: var(--radius-full); cursor: pointer; transition: all .2s; flex-shrink: 0; white-space: nowrap; }
    .zmanim-loc-btn:hover { background: rgba(212,175,55,.22); }
    .zmanim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .45rem; }
    .zmanim-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: .5rem; padding: .42rem .75rem; gap: .5rem; transition: background .2s, border-color .2s; }
    .zmanim-item:hover { background: rgba(212,175,55,.07); border-color: rgba(212,175,55,.18); }
    .zmanim-label { font-size: .74rem; color: rgba(255,255,255,.6); line-height: 1.3; }
    .zmanim-time { font-size: .86rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
    .zmanim-loading { text-align: center; color: rgba(255,255,255,.4); padding: 1.5rem; font-size: .875rem; }
    [dir="rtl"] .zmanim-item { flex-direction: row-reverse; }
    [dir="rtl"] .zmanim-header { flex-direction: row-reverse; }
    @media (max-width: 767px) { #zmanim-section { padding: 1.5rem 0; } .zmanim-card { padding: 1.1rem 1rem; border-radius: 1.1rem; } .zmanim-grid { grid-template-columns: 1fr 1fr; gap: .35rem; } .zmanim-title { font-size: 1.05rem; } }
    @media (max-width: 380px) { .zmanim-grid { grid-template-columns: 1fr; } }

    /* ── Respect prefers-reduced-motion ── */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
      .halo-1, .halo-2, .halo-3, .blob-1, .blob-2 { animation: none; will-change: auto; }
    }

    /* ══════════════════════════════════════════════════════════════
       DESIGN ENHANCEMENTS
       Chat bubbles · Hebrew/RTL · Dark mode · Mobile UX (iOS Safari)
    ══════════════════════════════════════════════════════════════ */

    /* ── iOS / PWA global ── */
    html { -webkit-text-size-adjust: 100%; }
    a, button, [role="button"] {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    /* ══ CHAT MODAL ══ */

    /* Smoother bottom-sheet on iOS */
    @media (max-width: 640px) {
      #chat-overlay { background: rgba(0,0,0,.65); }
      #chat-modal {
        border-radius: 1.75rem 1.75rem 0 0;
        height: 94svh;
      }
      .chat-header { border-radius: 1.75rem 1.75rem 0 0; position: relative; }
      /* Pull-to-dismiss pill */
      .chat-header::before {
        content: '';
        position: absolute;
        top: .55rem; left: 50%;
        transform: translateX(-50%);
        width: 2.25rem; height: .22rem;
        background: rgba(255,255,255,.45);
        border-radius: 9999px;
        pointer-events: none;
      }
      /* Respect iOS keyboard / safe-area */
      #chat-box {
        padding-bottom: max(.75rem, env(safe-area-inset-bottom, .75rem));
      }
      .chat-input-area {
        padding-bottom: max(.875rem, calc(env(safe-area-inset-bottom, 0px) + .5rem));
      }
    }

    /* ── Chat box scroll ── */
    #chat-box {
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      gap: .6rem;
    }
    #chat-box::-webkit-scrollbar { width: 3px; }
    #chat-box::-webkit-scrollbar-thumb { background: rgba(44,42,110,.18); border-radius: 9999px; }
    html.dark #chat-box::-webkit-scrollbar-thumb { background: rgba(44,42,110,.28); }

    /* ── Chat header — bleu RebSam ── */
    .chat-header {
      background: #2C2A6E;
      border-bottom: 1px solid rgba(255,255,255,.1);
    }
    html.dark .chat-header {
      background: #1B1A50;
      border-bottom-color: rgba(255,255,255,.08);
    }
    .chat-header-name { font-weight: 800; letter-spacing: -.02em; }
    /* Pulsing "online" dot */
    @keyframes onlinePulse { 0%,100%{box-shadow:0 0 0 0 rgba(74,222,128,.5);} 60%{box-shadow:0 0 0 5px rgba(74,222,128,0);} }
    .chat-header-status .dot { animation: onlinePulse 2.8s ease-in-out infinite; }

    /* ══ CHAT BUBBLES ══ */

    /* --- Sam (assistant) bubble --- */
    .msg-bubble.sam {
      border-radius: 1.25rem 1.25rem 1.25rem .25rem;
      background: #fff;
      border: 1px solid rgba(44,42,110,.15);
      color: #1B1A50;
      font-size: .9rem;
      line-height: 1.8;
      padding: 1rem 1.25rem;
      box-shadow: 0 1px 4px rgba(44,42,110,.08), 0 2px 10px rgba(0,0,0,.04);
      max-width: 82%;
    }
    /* Les pills scrollent horizontalement dans la bulle */
    .msg-bubble.sam .chat-suggestions { overflow-x: auto; touch-action: pan-x; }
    html.dark .msg-bubble.sam {
      background: linear-gradient(145deg, #1B1A50 0%, #1B1A50 100%);
      color: #D6D4E8;
      box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 6px 28px rgba(0,0,0,.3);
    }

    /* Sam bubble inline formatting */
    .msg-bubble.sam b, .msg-bubble.sam strong {
      color: #1B1A50; font-weight: 700;
      background: rgba(44,42,110,.10);
      padding: 1px 5px; border-radius: 4px;
    }
    html.dark .msg-bubble.sam b, html.dark .msg-bubble.sam strong {
      color: #6E6AB5; background: rgba(44,42,110,.12);
    }
    .msg-bubble.sam a { color: #1B1A50; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(27,26,80,.3); transition: border-color .2s; }
    .msg-bubble.sam a:hover { border-bottom-color: #c9a84c; color: #9a6a00; }
    .msg-bubble.sam code { background: rgba(44,42,110,.09); padding: 1px 6px; border-radius: 4px; font-size: .85em; }
    /* HR → séparateur dégradé moderne */
    .msg-bubble.sam hr {
      border: none; margin: 1rem 0; height: 2px;
      background: linear-gradient(90deg, #1B1A50 0%, #2C2A6E 55%, #E6573F 100%);
      border-radius: 2px; opacity: .55;
    }
    .msg-bubble.sam blockquote {
      border-left: 3px solid #2C2A6E;
      margin: .5rem 0; padding: .4rem .85rem;
      background: rgba(44,42,110,.06); border-radius: 0 .5rem .5rem 0;
      font-style: italic; color: #4B4892;
    }
    html.dark .msg-bubble.sam blockquote { background: rgba(44,42,110,.1); color: #B8B6D8; }
    /* Hiérarchie titres / sous-titres : warm/cool alternance */
    .msg-bubble.sam h1 { font-family: 'Outfit', sans-serif; font-size: 1.1em;  font-weight: 800; color: #1B1A50; margin: .35rem 0 .45rem; letter-spacing: -.01em; line-height: 1.3; }
    .msg-bubble.sam h2 { font-family: 'Outfit', sans-serif; font-size: 1.02em; font-weight: 800; color: #B43E2B; margin: .85rem 0 .35rem; letter-spacing: -.01em; line-height: 1.3; }
    .msg-bubble.sam h3 { font-family: 'Outfit', sans-serif; font-size: .98em;  font-weight: 700; color: #2C2A6E; margin: .7rem 0 .3rem;   letter-spacing: -.005em; line-height: 1.35; }
    .msg-bubble.sam h4 { font-family: 'Outfit', sans-serif; font-size: .94em;  font-weight: 700; color: #5A1E10; margin: .55rem 0 .25rem; letter-spacing: -.005em; line-height: 1.35; }
    html.dark .msg-bubble.sam h1 { color: #B8B6D8; }
    html.dark .msg-bubble.sam h2 { color: #F2B5A6; }
    html.dark .msg-bubble.sam h3 { color: #9491C9; }
    html.dark .msg-bubble.sam h4 { color: #FCE9E2; }
    .msg-bubble.sam ul, .msg-bubble.sam ol { padding-left: 1.4rem; margin: .4rem 0; direction: ltr; }
    .msg-bubble.sam li { margin-bottom: .3rem; unicode-bidi: isolate; text-align: left; }
    .msg-bubble.sam p { margin: 0 0 .55rem; }
    .msg-bubble.sam p:last-child { margin-bottom: 0; }

    /* --- User bubble — soft lavender, palette pill 1 --- */
    .msg-bubble.user {
      position: relative;
      border-radius: 1.25rem .25rem 1.25rem 1.25rem;
      background: linear-gradient(135deg, #E8E4F5 0%, #DDD5EB 100%);
      color: #1B1A50;
      font-size: .9rem;
      line-height: 1.65;
      padding: .875rem 1.1rem .75rem;
      border: 1px solid rgba(44,42,110,.22);
      box-shadow: 0 1px 6px rgba(44,42,110,.14);
      max-width: 80%;
    }
    html.dark .msg-bubble.user {
      background: linear-gradient(135deg, #2C2A6E 0%, #2C2A6E 100%);
      color: #fff;
      border-color: rgba(44,42,110,.45);
      box-shadow: 0 4px 20px rgba(44,42,110,.28), 0 1px 5px rgba(0,0,0,.3);
    }

    /* Bubble entrance animation */
    @keyframes bubbleIn {
      from { opacity: 0; transform: translateY(10px) scale(.96); }
      to   { opacity: 1; transform: translateY(0)  scale(1); }
    }

    /* ══ RTL / HEBREW BUBBLES ══ */

    /* Flip corner asymmetry for RTL reading direction */
    [dir="rtl"] .msg-bubble.sam {
      border-radius: 1.2rem .3rem 1.2rem 1.2rem;
      /* Frank Ruhl Libre: sefer-like script for Torah content */
      font-family: 'Frank Ruhl Libre', 'Heebo', serif;
      font-size: 1.025rem;
      line-height: 1.95;
      text-align: right;
    }
    [dir="rtl"] .msg-bubble.user {
      border-radius: .3rem 1.2rem 1.2rem 1.2rem;
      font-family: 'Heebo', sans-serif;
      font-size: .9375rem;
      line-height: 1.8;
      text-align: right;
    }

    /* Hebrew bold → gold (source references) */
    [dir="rtl"] .msg-bubble.sam b, [dir="rtl"] .msg-bubble.sam strong {
      color: #9a6a00; font-weight: 700;
    }
    html.dark [dir="rtl"] .msg-bubble.sam b,
    html.dark [dir="rtl"] .msg-bubble.sam strong { color: var(--gold); }

    /* Hebrew headings inside bubble */
    [dir="rtl"] .msg-bubble.sam h1, [dir="rtl"] .msg-bubble.sam h2, [dir="rtl"] .msg-bubble.sam h3 {
      font-family: 'Heebo', sans-serif; font-weight: 800;
      color: var(--primary);
    }
    /* Hebrew lists — full RTL */
    [dir="rtl"] .msg-bubble.sam {
      direction: rtl;
      text-align: right;
    }
    [dir="rtl"] .msg-bubble.sam ul, [dir="rtl"] .msg-bubble.sam ol {
      padding-right: 1.4rem; padding-left: 0;
      direction: rtl;
      list-style-position: outside;
    }
    [dir="rtl"] .msg-bubble.sam li {
      text-align: right;
      unicode-bidi: plaintext;
      direction: rtl;
    }
    [dir="rtl"] .msg-bubble.sam p,
    [dir="rtl"] .msg-bubble.sam h1,
    [dir="rtl"] .msg-bubble.sam h2,
    [dir="rtl"] .msg-bubble.sam h3 {
      text-align: right;
      direction: rtl;
    }
    [dir="rtl"] .msg-bubble.sam blockquote {
      border-left: none;
      border-right: 3px solid #2C2A6E;
      border-radius: .5rem 0 0 .5rem;
      text-align: right;
    }

    /* Sources & actions — RTL margin flips */
    html[dir="rtl"] .msg-sources { margin: .25rem 2.85rem .75rem 0; }
    @media (max-width: 640px) {
      html[dir="rtl"] .msg-sources { margin-left: 0; margin-right: 2.85rem; }
    }
    html[dir="rtl"] .msg-source-chip {
      border-left: 1px solid rgba(44,42,110,.2);
      border-right: 2.5px solid #2C2A6E;
      border-radius: .6rem .4rem .4rem .6rem;
      padding: .35rem .5rem .35rem .65rem;
    }
    html[dir="rtl"] .msg-source-chip:hover { border-right-color: #1B1A50; }
    html[dir="rtl"] .msg-action-row { margin: .35rem 2.85rem .5rem 0; }
    @media (max-width: 640px) { html[dir="rtl"] .msg-action-row { margin-right: 2.85rem; } }

    /* Hebrew header in chat */
    [dir="rtl"] .chat-header { flex-direction: row-reverse; }
    [dir="rtl"] .chat-header-left { flex-direction: row-reverse; }
    [dir="rtl"] .chat-header-status { flex-direction: row-reverse; }
    [dir="rtl"] .chat-header-name { font-family: 'Heebo', sans-serif; }

    /* ══ LOADING DOTS — vert "En ligne" ══ */
    @keyframes dotPulse {
      0%,100% { transform: translateY(0) scale(1); background: rgba(74,222,128,.55); }
      40%      { transform: translateY(-7px) scale(1.3); background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.6); }
    }
    .loading-dots { gap: .42rem; padding: .4rem 0; }
    .loading-dots span {
      width: .46rem; height: .46rem; border-radius: 50%;
      background: rgba(74,222,128,.55);
      animation: dotPulse 1.5s ease-in-out infinite;
    }
    .loading-dots span:nth-child(2) { animation-delay: .18s; }
    .loading-dots span:nth-child(3) { animation-delay: .36s; }

    /* ══ SEND BUTTON ══ */
    #chat-send {
      width: 3rem; height: 3rem;
      border-radius: 50%;
      background: linear-gradient(145deg, #2C2A6E 0%, #4a90e8 100%);
      box-shadow: 0 4px 14px rgba(44,42,110,.45), inset 0 1px 0 rgba(255,255,255,.18);
      transition: all .2s cubic-bezier(.4,0,.2,1);
    }
    #chat-send:hover:not(:disabled) {
      background: linear-gradient(145deg, #4B4892 0%, #6E6AB5 100%);
      box-shadow: 0 6px 20px rgba(44,42,110,.6);
      transform: scale(1.09) translateY(-1px);
    }
    #chat-send:active:not(:disabled) { transform: scale(.92); }

    /* ══ MIC BUTTON ══ */
    #chat-mic {
      width: 3rem; height: 3rem; flex-shrink: 0;
      border-radius: 50%; border: none; cursor: pointer;
      background: linear-gradient(145deg, #E6573F 0%, #B43E2B 100%);
      color: #fff;
      display: flex; align-items: center; justify-content: center;
      transition: all .2s cubic-bezier(.4,0,.2,1);
      box-shadow: 0 4px 14px rgba(230,87,63,.45), inset 0 1px 0 rgba(255,255,255,.18);
    }
    #chat-mic:hover:not(:disabled) {
      background: linear-gradient(145deg, #E6573F 0%, #B43E2B 100%);
      box-shadow: 0 6px 20px rgba(230,87,63,.6);
      transform: scale(1.09) translateY(-1px);
    }
    #chat-mic:active:not(:disabled) { transform: scale(.93); }
    #chat-mic:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
    /* Recording — sound-wave bars (4), red gradient, double-halo pulse */
    #chat-mic.recording {
      background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
      border: none;
      color: #fff;
      animation: rsRecHalo 1.1s ease-out infinite;
      box-shadow: 0 0 0 0 rgba(239,68,68,.55), 0 4px 14px rgba(239,68,68,.55);
    }
    #chat-mic.recording .rs-mic-waves line {
      transform-origin: center;
      animation: rsWaveBar 1s ease-in-out infinite;
    }
    #chat-mic.recording .rs-mic-waves line:nth-child(1) { animation-delay: 0s; }
    #chat-mic.recording .rs-mic-waves line:nth-child(2) { animation-delay: .15s; }
    #chat-mic.recording .rs-mic-waves line:nth-child(3) { animation-delay: .25s; }
    #chat-mic.recording .rs-mic-waves line:nth-child(4) { animation-delay: .4s; }
    @keyframes rsWaveBar { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1.15); } }
    @keyframes rsRecHalo {
      0%   { box-shadow: 0 0 0 0   rgba(239,68,68,.55), 0 4px 14px rgba(239,68,68,.6); }
      70%  { box-shadow: 0 0 0 14px rgba(239,68,68,0),   0 4px 14px rgba(239,68,68,.4); }
      100% { box-shadow: 0 0 0 0   rgba(239,68,68,0),    0 4px 14px rgba(239,68,68,.4); }
    }
    /* Transcribing — large blue spinner + glow */
    #chat-mic.transcribing {
      background: linear-gradient(135deg, #2C2A6E 0%, #1B1A50 100%);
      border: none;
      color: #fff;
      box-shadow: 0 0 22px rgba(44,42,110,.55), 0 4px 14px rgba(44,42,110,.5);
      animation: rsTranscribeGlow 1.6s ease-in-out infinite alternate;
    }
    #chat-mic.transcribing .rs-mic-spinner {
      animation: rsSpin .8s linear infinite;
      filter: drop-shadow(0 0 4px rgba(255,255,255,.7));
    }
    @keyframes rsTranscribeGlow {
      from { box-shadow: 0 0 14px rgba(44,42,110,.4), 0 4px 14px rgba(44,42,110,.45); }
      to   { box-shadow: 0 0 28px rgba(44,42,110,.75), 0 6px 18px rgba(44,42,110,.6); }
    }
    @keyframes rsSpin { to { transform: rotate(360deg); } }
    html.dark #chat-mic { box-shadow: 0 2px 10px rgba(230,87,63,.3); }

    /* ══ STREAMING — underline pulse sur le bouton envoi ══ */
    #chat-send.streaming {
      position: relative;
      overflow: visible;
    }
    #chat-send.streaming::after {
      content: '';
      position: absolute;
      bottom: -5px; left: 20%; right: 20%;
      height: 2px;
      border-radius: 2px;
      background: linear-gradient(90deg, transparent, #2C2A6E, #1B1A50, transparent);
      animation: streamLine 1.2s ease-in-out infinite;
    }
    @keyframes streamLine {
      0%,100% { opacity: .3; transform: scaleX(.5); }
      50%      { opacity: 1;  transform: scaleX(1); }
    }

    /* ══ CHAT INPUT — RTL + iOS ══ */
    [dir="rtl"] #chat-input {
      text-align: right;
      font-family: 'Heebo', sans-serif;
      font-size: 1rem;
      direction: rtl;
      unicode-bidi: embed;
    }
    [dir="rtl"] .chat-input-row { flex-direction: row-reverse; }

    /* Prevent iOS auto-zoom on input focus (16px minimum) */
    @media (max-width: 767px) {
      #chat-input { font-size: 16px; }
      #chat-name  { font-size: 16px; }
      #chat-send  { width: 2.75rem; height: 2.75rem; }
      #chat-mic   { width: 2.75rem; height: 2.75rem; }
      .chat-close { width: 2.5rem; height: 2.5rem; }
      /* Accessible tap targets */
      .lang-btn   { min-height: 40px; min-width: 40px; }
      .float-inner { min-width: 52px; min-height: 52px; }
    }

    /* ══ FLOATING BUTTONS — safe-area ══ */
    @media (max-width: 767px) {
      .float-btn {
        bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + .75rem));
      }
      #btn-chat { left:  max(1.25rem, calc(env(safe-area-inset-left,  0px) + 1rem)); }
      #btn-wa   { right: max(1.25rem, calc(env(safe-area-inset-right, 0px) + 1rem)); }
    }

    /* ══ HISTORY PANEL ══ */

    /* ══ DARK MODE — Chat ══ */
    html.dark #chat-modal { background: #0F0E2A; }
    html.dark #chat-box { background: linear-gradient(180deg, #0F0E2A 0%, #0F0E2A 100%); }
    html.dark .chat-input-area { border-top-color: rgba(44,42,110,.15); }
    html.dark .chat-input-row { background: #1B1A50; border-color: rgba(44,42,110,.22); }
    html.dark .chat-input-row:focus-within {
      border-color: rgba(44,42,110,.45);
    }

    /* ══ THEME TRANSITIONS — chat elements only ══ */
    #chat-modal, #chat-box, .chat-input-area, .chat-input-row, .msg-bubble {
      transition: background .28s ease, border-color .28s ease, color .28s ease,
                  box-shadow .28s ease;
    }

    /* ── Retina antialiasing ── */
    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
      .msg-bubble, .chat-header-name, .logo { -webkit-font-smoothing: antialiased; }
    }

    /* ══════════════════════════════════════════════════════
       CHAT REDESIGN — Fullscreen mobile · Rounded · Contrast
    ══════════════════════════════════════════════════════ */

    /* 1. Masquer l'input prénom */
    .chat-name-row { display: none; }

    /* 2. Bulles plus arrondies */
    .msg-bubble.sam  { border-radius: 1.5rem 1.5rem 1.5rem .3rem; }
    .msg-bubble.user { border-radius: 1.5rem 1.5rem .3rem 1.5rem; }
    [dir="rtl"] .msg-bubble.sam  { border-radius: 1.5rem 1.5rem .3rem 1.5rem; }
    [dir="rtl"] .msg-bubble.user { border-radius: 1.5rem 1.5rem 1.5rem .3rem; }

    /* 3. Bulles plus larges — collées aux bords */
    #chat-box { padding: 1rem .75rem; }
    .msg-bubble { max-width: 86%; }
    .msg-bubble.sam  { max-width: 90%; }

    /* 4. Contraste net input vs chat area */
    .chat-input-area {
      background: #FAF8F2;
      border-top: 1px solid #EDE8DE;
      padding: .875rem .875rem;
    }
    .chat-input-row {
      background: #fff;
      border-radius: 1.5rem;
      border: 1.5px solid rgba(230,87,63,.2);
    }
    html.dark .chat-input-area {
      background: #0F0E2A;
      border-top-color: rgba(44,42,110,.2);
    }
    html.dark .chat-input-row {
      background: #1B1A50;
      border-color: rgba(44,42,110,.28);
    }

    /* 5. Plein écran sur mobile */
    @media (max-width: 640px) {
      #chat-overlay {
        padding: 0;
        background: transparent;
        align-items: stretch;
      }
      #chat-modal {
        height: 100%;
        border-radius: 0;
        max-width: 100%;
      }
      .chat-header { border-radius: 0; }
      .chat-header::before { display: none; }
      .chat-input-area { border-radius: 0; padding-bottom: max(.875rem, calc(env(safe-area-inset-bottom, 0px) + .875rem)); }
    }
