// ─── Live ARIA Orchestration console — agentic hero centerpiece ─────
// Cycles through real customer scenarios. Each one plays a sequence of
// events: incoming customer message → ZARA triage (language + intent) →
// specialist agent works → outcome metric. The component is purely visual
// — the data shape is what a real orchestrator would emit on the wire.

const SCENARIOS = [
  {
    id: 'gulf-serum',
    channel: 'WA',
    customer: { name: 'Layla', city: 'Dubai', flag: '🇦🇪', tz: '14:23 GST' },
    msg: { lang: 'ar', text: 'بشرتي حساسة، شو أحسن سيروم لتفتيح البقع؟', dir: 'rtl' },
    msgEn: 'My skin is sensitive — what serum brightens dark spots best?',
    steps: [
      { agent: 'ZARA', code: 'Z', label: { en: 'Triage', fr: 'Triage', ar: 'فرز' }, line: { en: 'Detected AR-Gulf · intent = routine-advice', fr: 'Détecté AR-Golfe · intention = conseil-routine', ar: 'لهجة خليجية · القصد = نصيحة روتين' }, meta: '97% conf.' },
      { agent: 'AMINE', code: 'A', label: { en: 'Routine Architect', fr: 'Architecte routine', ar: 'مهندس الروتين' }, line: { en: 'Drafting 4-step routine · retinol-alt for sensitive', fr: 'Brouillon routine 4 étapes · alternative rétinol', ar: 'يصيغ روتين 4 خطوات · بديل ريتنول' }, meta: 'pH-balanced' },
      { agent: 'NOOR', code: 'N', label: { en: 'Reply Concierge', fr: 'Concierge réponse', ar: 'كونسيرج الردّ' }, line: { en: 'Sending voice + text in AR-Gulf', fr: 'Envoi voix + texte en AR-Golfe', ar: 'إرسال صوت + نصّ بالخليجي' }, meta: 'in 2.4s' },
    ],
    outcome: { en: 'Reply sent · NOOR +1 reply rate', fr: 'Réponse envoyée · NOOR +1 taux de réponse', ar: 'تمّ الردّ · NOOR +1 معدّل الرد' },
    accent: '+18%',
  },
  {
    id: 'qc-refund',
    channel: 'SMS',
    customer: { name: 'Sophie', city: 'Montréal', flag: '🇨🇦', tz: '11:08 HE' },
    msg: { lang: 'fr', text: 'Le sérum ne fonctionne pas, je veux être remboursée.', dir: 'ltr' },
    msgEn: 'The serum isn\u2019t working — I want a refund.',
    steps: [
      { agent: 'ZARA', code: 'Z', label: { en: 'Triage', fr: 'Triage', ar: 'فرز' }, line: { en: 'Detected FR-CA · intent = refund · sentiment = frustrated', fr: 'Détecté FR-CA · intention = remboursement · sentiment = frustré', ar: 'فرنسية كندية · القصد = استرداد · مشاعر = إحباط' }, meta: '94% conf.' },
      { agent: 'SAJA', code: 'S', label: { en: 'Refund De-escalator', fr: 'Désescalade', ar: 'تهدئة الاسترداد' }, line: { en: 'Offering reformulated routine + 30-day credit', fr: 'Routine reformulée + crédit 30 jours', ar: 'روتين معدّل + رصيد 30 يوماً' }, meta: 'Tier-2 persona' },
      { agent: 'KENZA', code: 'K', label: { en: 'Compliance', fr: 'Conformité', ar: 'امتثال' }, line: { en: 'Logged consent · refund right preserved', fr: 'Consentement journalisé · droit préservé', ar: 'مُسجّل · الحقّ محفوظ' }, meta: 'PDPL+GDPR' },
    ],
    outcome: { en: 'Saved · SAJA −1 refund cost', fr: 'Sauvé · SAJA −1 coût remboursement', ar: 'تمّ إنقاذها · SAJA −1 تكلفة' },
    accent: '−23%',
  },
  {
    id: 'cart-revive',
    channel: 'IG',
    customer: { name: 'Aaliyah', city: 'London', flag: '🇬🇧', tz: '16:42 GMT' },
    msg: { lang: 'en', text: 'Cart sitting for 3 days — still deciding 🤔', dir: 'ltr' },
    msgEn: 'Cart sitting for 3 days — still deciding',
    steps: [
      { agent: 'ZARA', code: 'Z', label: { en: 'Triage', fr: 'Triage', ar: 'فرز' }, line: { en: 'Detected EN-UK · cart age 72h · intent = consider', fr: 'Détecté EN-UK · âge panier 72h · intention = hésitation', ar: 'إنجليزية بريطانية · عمر السلّة 72س' }, meta: 'High-AOV' },
      { agent: 'LAYLA', code: 'L', label: { en: 'Cart Reviver', fr: 'Réanimatrice', ar: 'منعِشة السلّة' }, line: { en: 'Drafting voice note · advice first, link second', fr: 'Note vocale · conseil d\u2019abord, lien ensuite', ar: 'ملاحظة صوتية · نصيحة ثم رابط' }, meta: 'no coupon' },
      { agent: 'AMINE', code: 'A', label: { en: 'Routine Architect', fr: 'Architecte routine', ar: 'مهندس الروتين' }, line: { en: 'Pairing with morning SPF · +€18 AOV uplift', fr: 'Associé à SPF matin · +18€ panier', ar: 'إقتران SPF صباحي · +18€' }, meta: 'cross-brand' },
    ],
    outcome: { en: 'Voice note sent · LAYLA +1 cart-recovery', fr: 'Note envoyée · LAYLA +1 récup. panier', ar: 'تمّ الإرسال · LAYLA +1 سلّة' },
    accent: '+12%',
  },
  {
    id: 'maghreb-vip',
    channel: 'TG',
    customer: { name: 'Yasmine', city: 'Casablanca', flag: '🇲🇦', tz: '12:30 WET' },
    msg: { lang: 'ar', text: 'بغيت نعرف أش هو السيروم لي كتنصحوني بيه؟', dir: 'rtl' },
    msgEn: 'I want to know which serum you\u2019d recommend.',
    steps: [
      { agent: 'ZARA', code: 'Z', label: { en: 'Triage', fr: 'Triage', ar: 'فرز' }, line: { en: 'Detected AR-Maghreb (Darija) · intent = discovery', fr: 'Détecté AR-Maghreb (Darija) · intention = découverte', ar: 'دارجة مغربية · القصد = اكتشاف' }, meta: '91% conf.' },
      { agent: 'RANIA', code: 'R', label: { en: 'VIP Curator', fr: 'Curatrice VIP', ar: 'منسّقة VIP' }, line: { en: 'Tier-1 candidate · sending welcome sample + private line', fr: 'Candidate Tier-1 · échantillon + ligne privée', ar: 'مرشّحة فئة أولى · عيّنة + خطّ خاصّ' }, meta: 'cohort #7' },
    ],
    outcome: { en: 'VIP onboarding · RANIA +1 repeat-purchase', fr: 'VIP activé · RANIA +1 rachat', ar: 'تفعيل VIP · RANIA +1 إعادة شراء' },
    accent: '+27%',
  },
  {
    id: 'paris-erasure',
    channel: 'EM',
    customer: { name: 'Inès', city: 'Paris', flag: '🇫🇷', tz: '09:15 CET' },
    msg: { lang: 'fr', text: 'Bonjour, j\u2019aimerais effacer mon compte et toutes mes données.', dir: 'ltr' },
    msgEn: 'Hello, I\u2019d like to erase my account and all my data.',
    steps: [
      { agent: 'ZARA', code: 'Z', label: { en: 'Triage', fr: 'Triage', ar: 'فرز' }, line: { en: 'Detected FR · intent = GDPR Art. 17 erasure', fr: 'Détecté FR · intention = effacement RGPD Art. 17', ar: 'فرنسية · القصد = محو RGPD م.17' }, meta: '99% conf.' },
      { agent: 'KENZA', code: 'K', label: { en: 'Compliance Scribe', fr: 'Greffière conformité', ar: 'كاتبة الامتثال' }, line: { en: 'Erasure logged · 72h window opened · confirm sent', fr: 'Effacement journalisé · fenêtre 72h · confirm. envoyée', ar: 'تسجيل المحو · نافذة 72س · تأكيد مُرسل' }, meta: 'Audit-ready' },
    ],
    outcome: { en: 'Scheduled · KENZA 100% audit pass', fr: 'Planifié · KENZA 100% audit', ar: 'مُجدول · KENZA 100% تدقيق' },
    accent: '100%',
  },
];

window.SCENARIOS = SCENARIOS;
