/* ============================================================
   PM TECH Water Solutions × معرض صحاري مصر الدولي
   Modern Minimalist High-Tech Exhibition Kiosk Design System
   ============================================================ */

:root {
  /* ============================================================
     النظام اللوني المينيمال الموحد (Clean Minimal Luxury Theme)
     ============================================================ */
  --bg-dark: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F8FAFC;
  --bg-card-hover: #F1F5F9;
  --bg-card-active: #EFF6FF;
  --bg-glass: rgba(255, 255, 255, 0.92);

  /* لون الهوية الأساسي الموحد (Unified PM TECH Blue) */
  --cyan: #2563EB;
  --cyan-glow: rgba(37, 99, 235, 0.16);
  --cyan-subtle: rgba(37, 99, 235, 0.08);
  --blue-brand: #2563EB;
  --blue-brand-hover: #1D4ED8;

  /* ألوان التمييز الثانوية (هادئة وغير متضاربة) */
  --emerald: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.18);
  --emerald-subtle: rgba(16, 185, 129, 0.08);
  --green-dark: #047857;

  /* مكافأة الـ VIP (ذهبي دافئ هادئ بدون فقع) */
  --gold: #B45309;
  --gold-bg: #FFFBEB;
  --gold-border: #FDE68A;
  --gold-glow: rgba(217, 119, 6, 0.12);

  /* ألوان النصوص والطباعة (Crisp Minimalist Typography) */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* توافق مع المتغيرات القديمة */
  --navy: #0F172A;
  --navy-soft: #475569;
  --muted: #94A3B8;

  /* الحدود الدقيقة والظلال الطبيعية (Hairline Borders & Soft Ambient Shadows) */
  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-active: #2563EB;
  --border-hover: #CBD5E1;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px -3px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 14px 34px -4px rgba(15, 23, 42, 0.07), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 24px var(--cyan-glow);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --font-main: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-en: "Plus Jakarta Sans", "Cairo", sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* السماح بالتمرير الطبيعي في الصفحات طويلة المحتوى (لوحات التحكم والتسجيل)
   بينما تبقى شاشات الكشك الثابتة (كالمحادثة) بدون تمرير */
html:has(body.page-scroll),
body.page-scroll {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-scroll {
  overscroll-behavior-y: none;
}

/* ============================================================
   1. الخلفية المحيطية الهادئة والمريحة (Ambient Background)
   ============================================================ */
.ambient-mesh-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
}

.orb-1 {
  width: 500px;
  height: 500px;
  top: -160px;
  right: -80px;
  background: rgba(37, 99, 235, 0.08);
}

.orb-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  left: -120px;
  background: rgba(16, 185, 129, 0.06);
}

.orb-3 {
  width: 450px;
  height: 450px;
  top: 30%;
  left: 40%;
  background: rgba(37, 99, 235, 0.04);
}

/* ============================================================
   2. استوديو الصفحة الرئيسية — تصميم شاشة المعرض التفاعلية المباشرة (Kiosk Home Studio)
   ============================================================ */
.kiosk-home-studio {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 15%, #e0f2fe 0%, #f8fafc 50%, #f1f5f9 100%);
  overflow: hidden;
  box-sizing: border-box;
}

.studio-ambient-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.orb-top-right {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  filter: blur(120px);
}

.orb-bottom-left {
  position: absolute;
  bottom: -120px;
  left: -80px;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.14);
  filter: blur(130px);
}

/* الحاوية الرئيسية للشاشة بدون إطار خارجي (Full Screen Edge-to-Edge) */
.studio-main-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  max-width: 1540px;
  display: flex;
  flex-direction: column;
  padding: 16px 28px 20px;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 auto;
}

/* الترويسة العلوية للكشك */
.studio-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  flex-shrink: 0;
}

.nav-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-drop-svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.35));
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 19px;
  font-weight: 900;
  color: #1e40af;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 1.2px;
}

.nav-title-center {
  text-align: center;
  flex: 1;
  padding: 0 16px;
}

.main-studio-title {
  font-size: 23px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.sub-studio-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

.nav-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lang-dropdown-wrapper {
  position: relative;
}

.lang-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lang-pill-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.lang-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 50;
  min-width: 155px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lang-opt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  border-radius: 8px;
  cursor: pointer;
  text-align: start;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}

.lang-opt-item:hover, .lang-opt-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

/* تخطيط البطاقتين المتجاورتين */
.studio-cards-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

/* البطاقة 1: بطاقة الفورم والبناء */
.card-form-builder {
  background: #ffffff;
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.form-builder-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 14px;
}

.form-section-block {
  display: flex;
  flex-direction: column;
}

.section-step-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-num {
  color: #2563eb;
  font-weight: 900;
}

/* شبكة بطاقات الأشكال الأربعة */
.avatar-styles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-style-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-style-card:hover {
  border-color: #93c5fd;
  background: #f0fdf4;
  transform: translateY(-2px);
}

.avatar-style-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  transform: translateY(-2px);
}

.style-avatar-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.style-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.style-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.avatar-style-card.active .style-card-name {
  color: #2563eb;
  font-weight: 800;
}

/* حقل اسم الشخصية */
.character-name-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px 14px;
  transition: all 0.2s;
}

.character-name-field:focus-within {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-prefix-icon {
  font-size: 18px;
  margin-inline-end: 8px;
  color: #94a3b8;
}

.studio-char-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 4px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  font-family: inherit;
}

.studio-char-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

/* خيارات الشخصية الأربعة */
.persona-options-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.persona-select-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.persona-select-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.persona-select-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.persona-emoji {
  font-size: 15px;
}

/* زر بدء الدردشة العريض */
.form-action-footer {
  margin-top: 4px;
}

.btn-start-chat-hero {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 13px 24px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px -3px rgba(37, 99, 235, 0.45);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-start-chat-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(37, 99, 235, 0.55);
}

.btn-start-chat-hero:active {
  transform: translateY(0);
}

.chat-bubble-ico {
  font-size: 18px;
}

.btn-arrow-ico {
  font-size: 19px;
  font-weight: 900;
}

/* البطاقة 2: بطاقة المسرح والمعاينة الحية */
.card-preview-stage {
  background: #ffffff;
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.preview-stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

/* فقاعة الحديث العلوية */
.stage-speech-bubble {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  max-width: 90%;
}

.bubble-title-line {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}

.bubble-subtitle-line {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.bubble-arrow-pointer {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 7px;
  background: #f8fafc;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 1.5px solid #e2e8f0;
}

/* عرض المجسم */
.stage-mascot-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
  position: relative;
}

.mascot-circular-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0) 70%);
  pointer-events: none;
}

.mascot-hero-stage-img {
  max-height: 220px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(15, 23, 42, 0.14));
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* اسم الشخصية والوصف */
.stage-meta-center {
  text-align: center;
  margin-bottom: 8px;
  width: 100%;
}

.mascot-name-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 3px;
}

.pencil-ico {
  font-size: 14px;
  opacity: 0.7;
}

.mascot-tagline-text {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  max-width: 90%;
  margin: 0 auto;
}

/* شريط هدية VIP */
.stage-vip-reward-banner {
  width: 100%;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 9999px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

/* ============================================================
   Robot creator v2 — PM TECH exhibition experience
   ============================================================ */
.robot-studio {
  --robot-navy: #062967;
  --robot-blue: #087cff;
  --robot-accent: #13b8ff;
  --robot-green: #57bd47;
  --robot-ink: #07275e;
  --robot-soft: #eaf6ff;
  background:
    radial-gradient(circle at 50% -20%, rgba(106, 206, 255, .42), transparent 42%),
    radial-gradient(circle at 0% 82%, rgba(28, 160, 255, .14), transparent 32%),
    #f8fcff;
  color: var(--robot-ink);
  isolation: isolate;
}

.robot-studio[data-theme="dark"] {
  --robot-ink: #edf7ff;
  --robot-soft: #102e61;
  background:
    radial-gradient(circle at 50% -20%, rgba(21, 145, 255, .28), transparent 45%),
    radial-gradient(circle at 0% 82%, rgba(3, 105, 219, .2), transparent 35%),
    #061634;
}

.robot-studio-glow {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(14px);
  z-index: -1;
}

.robot-studio-glow--one {
  width: min(46vw, 780px);
  height: min(46vw, 780px);
  top: -44%;
  right: -10%;
  background: rgba(95, 197, 255, .16);
}

.robot-studio-glow--two {
  width: min(40vw, 650px);
  height: min(40vw, 650px);
  bottom: -38%;
  left: -8%;
  background: rgba(49, 139, 255, .11);
}

.robot-studio-shell {
  width: min(1720px, 100%);
  height: 100%;
  padding: clamp(14px, 1.7vw, 30px) clamp(18px, 3.1vw, 54px) clamp(16px, 2vw, 34px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 26px);
}

.robot-studio-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(330px, 1.5fr) minmax(310px, 1fr);
  align-items: center;
  gap: 18px;
  direction: ltr;
}

.robot-brand-logo {
  width: min(100%, 226px);
  height: auto;
  display: block;
}

.robot-studio-heading {
  text-align: center;
  direction: rtl;
}

.robot-heading-kicker {
  display: block;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
  color: var(--robot-blue);
  margin-bottom: 1px;
}

.robot-studio-heading h1 {
  font-size: clamp(25px, 2.25vw, 42px);
  line-height: 1.13;
  letter-spacing: -.055em;
  font-weight: 900;
  color: var(--robot-navy);
}

.robot-studio-heading p {
  margin-top: 3px;
  color: #5875a4;
  font-size: clamp(11px, .88vw, 16px);
  font-weight: 600;
}

.robot-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.robot-expo-badge,
.robot-theme-toggle,
.robot-studio .lang-pill-btn {
  min-height: 40px;
  border: 1px solid #dceaff;
  background: rgba(255, 255, 255, .76);
  color: #19488f;
  box-shadow: 0 6px 20px rgba(22, 104, 207, .05);
}

.robot-expo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.robot-badge-pin {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--robot-blue);
  font-size: 15px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
}

.robot-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  cursor: pointer;
  padding: 7px 10px;
  font: 800 11px var(--font-main);
  transition: .2s ease;
}

.robot-theme-toggle:hover { transform: translateY(-1px); border-color: #9fcaff; }
.theme-toggle-icon { font: 700 18px/1 var(--font-en); color: var(--robot-blue); }

.robot-studio .robot-lang-dropdown .lang-pill-btn {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
}

.robot-studio .lang-menu-dropdown {
  border-color: #d9eaff;
  box-shadow: 0 16px 40px rgba(5, 43, 104, .17);
}

.robot-creator-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(610px, 1.3fr) minmax(400px, .78fr);
  gap: clamp(16px, 1.8vw, 28px);
  direction: ltr;
}

.robot-builder-card,
.robot-preview-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(222, 237, 255, .98);
  box-shadow: 0 18px 45px rgba(14, 81, 161, .09), 0 2px 6px rgba(5, 45, 109, .03);
  border-radius: clamp(24px, 2vw, 34px);
  direction: rtl;
}

.robot-builder-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 2vw, 31px);
  scrollbar-width: thin;
  scrollbar-color: #c6ddff transparent;
}

.robot-card-intro,
.robot-control-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.robot-card-intro { margin-bottom: clamp(13px, 1.4vw, 20px); }

.robot-card-intro h2,
.robot-control-title > :last-child {
  color: var(--robot-navy);
  font-size: clamp(15px, 1.1vw, 20px);
  line-height: 1.2;
  font-weight: 900;
}

.robot-card-intro p {
  margin-top: 3px;
  color: #7991b7;
  font-size: 11px;
  font-weight: 600;
}

.robot-step-chip {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #3ebfff, #1673ec);
  box-shadow: 0 5px 13px rgba(19, 135, 245, .28), inset 0 1px 1px rgba(255,255,255,.45);
  font: 900 12px var(--font-en);
  direction: ltr;
}

.robot-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(7px, .8vw, 12px);
  direction: rtl;
}

.robot-studio .robot-style-card {
  min-width: 0;
  border: 1.5px solid #dceaff;
  border-radius: 15px;
  padding: 7px 5px 8px;
  background: #f6fbff;
  color: #2d5797;
  font-family: inherit;
  box-shadow: none;
  transform: none;
}

.robot-studio .robot-style-card:hover {
  border-color: #82bdff;
  background: #f0f8ff;
  transform: translateY(-2px);
}

.robot-studio .robot-style-card.active {
  border-color: var(--robot-blue);
  background: #eff8ff;
  box-shadow: 0 0 0 3px rgba(8, 124, 255, .12);
  transform: none;
}

.robot-style-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(54px, 5.4vw, 78px);
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 16%, #d8f5ff 0, #edf7ff 54%, #d9edff 100%);
}

.robot-style-thumb img {
  position: absolute;
  width: 152%;
  max-width: none;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 8px rgba(7, 63, 146, .18));
}

.robot-style-thumb--modern { background: radial-gradient(circle at 50% 12%, #e5eaff 0, #eaf3ff 54%, #d9e5ff 100%); }
.robot-style-thumb--modern img { filter: hue-rotate(17deg) saturate(1.15) drop-shadow(0 5px 8px rgba(49, 53, 189, .18)); }
.robot-style-thumb--explorer { background: radial-gradient(circle at 50% 12%, #e0fff4 0, #eafaff 52%, #d9f4e5 100%); }
.robot-style-thumb--explorer img { filter: hue-rotate(74deg) saturate(.96) drop-shadow(0 5px 8px rgba(18, 116, 92, .17)); }
.robot-style-thumb--simple { background: radial-gradient(circle at 50% 12%, #f0f5fb 0, #fff 56%, #e4ebf4 100%); }
.robot-style-thumb--simple img { filter: saturate(.35) contrast(.93) drop-shadow(0 5px 8px rgba(28, 52, 89, .16)); }

.robot-studio .style-card-name {
  display: block;
  margin-top: 5px;
  color: inherit;
  font-size: clamp(10px, .7vw, 12px);
  font-weight: 800;
}

.robot-controls-grid {
  display: grid;
  grid-template-columns: 1.17fr .83fr;
  gap: 13px 16px;
  margin-top: clamp(14px, 1.5vw, 21px);
}

.robot-control-block { min-width: 0; }
.robot-control-wide { grid-column: 1 / -1; }
.robot-control-title { margin-bottom: 8px; }
.robot-control-title .robot-step-chip { width: 25px; height: 25px; font-size: 10px; }

.robot-studio .character-name-field {
  padding: 2px 12px;
  border: 1.5px solid #dbe9fd;
  border-radius: 13px;
  background: #f8fbff;
}

.robot-studio .character-name-field:focus-within {
  border-color: var(--robot-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(8, 124, 255, .1);
}

.robot-studio .input-prefix-icon { color: var(--robot-blue); font-size: 17px; }
.robot-studio .studio-char-input { padding: 8px 3px; color: var(--robot-navy); font-size: 13px; }

.robot-choice-row,
.robot-compact-options {
  display: grid;
  gap: 7px;
}

.robot-choice-row { grid-template-columns: repeat(2, 1fr); }
.robot-compact-options { grid-template-columns: repeat(3, 1fr); }

.robot-choice-btn,
.robot-visual-option {
  border: 1.5px solid #dbe9fd;
  background: #f8fbff;
  color: #315b9c;
  min-width: 0;
  cursor: pointer;
  font-family: inherit;
  transition: .18s ease;
}

.robot-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 12px;
}

.robot-choice-btn > span { color: var(--robot-blue); font: 900 22px/1 var(--font-en); }
.robot-choice-btn b, .robot-visual-option b { font-size: 11px; font-weight: 800; white-space: nowrap; }

.robot-visual-option {
  display: flex;
  min-height: 51px;
  padding: 5px 3px;
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.robot-choice-btn:hover,
.robot-visual-option:hover { border-color: #9ccaff; background: #f1f8ff; }
.robot-choice-btn.active,
.robot-visual-option.active { border-color: var(--robot-blue); background: #edf7ff; color: #1066cb; box-shadow: 0 0 0 2px rgba(8,124,255,.1); }

.headwear-symbol {
  position: relative;
  display: block;
  width: 30px;
  height: 15px;
  border: 3px solid #2865ba;
  border-bottom: 0;
  border-radius: 19px 19px 4px 4px;
}

.headwear-symbol--cap::after { content: ""; position: absolute; width: 19px; height: 4px; border-radius: 50%; background: #2865ba; right: -9px; bottom: -3px; }
.headwear-symbol--visor { border-color: var(--robot-accent); border-radius: 7px; height: 11px; border-width: 2px; box-shadow: 0 0 8px rgba(19,184,255,.55); }
.headwear-symbol--keffiyeh { border-radius: 50% 50% 6px 6px; border-color: #0c397f; height: 18px; }

.outfit-symbol { font: 900 24px/18px var(--font-en); color: #176de2; }

.robot-colors { display: flex; gap: 10px; align-items: center; padding: 3px 1px; }
.robot-color-swatch { position: relative; width: 27px; height: 27px; border: 0; border-radius: 50%; background: var(--swatch); cursor: pointer; box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 3px 7px rgba(8,51,112,.13); transition: .18s ease; }
.robot-color-swatch:hover { transform: scale(1.12); }
.robot-color-swatch.active::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--robot-blue); border-radius: inherit; }

.robot-persona-block { margin-top: 14px; }
.robot-persona-block .robot-control-title { margin-bottom: 8px; }
.robot-studio .persona-options-row { gap: 7px; }
.robot-studio .persona-select-btn { min-height: 42px; border-radius: 12px; padding: 7px 4px; background: #f8fbff; border-color: #dbe9fd; color: #315b9c; font-size: 11px; }
.robot-studio .persona-select-btn:hover { border-color: #9ccaff; background: #f1f8ff; }
.robot-studio .persona-select-btn.active { border-color: var(--robot-blue); background: #edf7ff; color: #1066cb; box-shadow: 0 0 0 2px rgba(8,124,255,.1); }
.robot-studio .persona-emoji { color: var(--robot-blue); font-size: 16px; }

.robot-studio .btn-start-chat-hero {
  flex: 0 0 auto;
  margin-top: clamp(14px, 1.6vw, 22px);
  min-height: 52px;
  border-radius: 16px;
  background: linear-gradient(105deg, #0577fa 0%, #16bcff 50%, #0a77ed 100%);
  box-shadow: 0 13px 21px rgba(4, 119, 250, .27), inset 0 1px 1px rgba(255,255,255,.4);
  font-size: 16px;
}

.robot-studio .btn-start-chat-hero:hover { box-shadow: 0 17px 27px rgba(4,119,250,.34); }

.robot-preview-card {
  position: relative;
  min-height: 0;
  padding: clamp(15px, 1.6vw, 25px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(148deg, rgba(248, 253, 255, .98), rgba(229, 245, 255, .94)),
    #eff8ff;
}

.robot-preview-card::before,
.robot-preview-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(44, 160, 255, .12);
}
.robot-preview-card::before { width: 580px; height: 580px; bottom: -355px; left: -190px; }
.robot-preview-card::after { width: 420px; height: 420px; top: -235px; right: -235px; }

.robot-preview-topline {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  color: #5680b5;
  font-size: 10px;
  font-weight: 800;
}
.robot-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--robot-green); box-shadow: 0 0 0 4px rgba(87,189,71,.12); }

.robot-studio .robot-speech-bubble {
  z-index: 4;
  align-self: flex-end;
  min-width: min(78%, 325px);
  margin-top: 8px;
  border: 0;
  border-radius: 22px;
  padding: 14px 18px;
  text-align: right;
  background: rgba(255,255,255,.96);
  box-shadow: 0 13px 30px rgba(31, 111, 204, .13);
}
.robot-studio .robot-speech-bubble .bubble-title-line { color: #0574e6; font-size: clamp(16px, 1.2vw, 22px); }
.robot-studio .robot-speech-bubble .bubble-subtitle-line { color: #173f83; font-size: clamp(11px, .85vw, 14px); }
.robot-studio .robot-speech-bubble .bubble-arrow-pointer { right: 31px; left: auto; transform: none; bottom: -10px; width: 22px; height: 12px; background: white; border: 0; }

.robot-preview-stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  margin: -13px -5px -2px;
  overflow: hidden;
  isolation: isolate;
}

.robot-preview-aura {
  position: absolute;
  z-index: -1;
  width: min(33vw, 500px);
  aspect-ratio: 1;
  bottom: -11%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--robot-accent) 26%, transparent), rgba(109,204,255,.08) 48%, transparent 70%);
  transition: background .3s ease;
}

.robot-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--robot-accent) 25%, transparent); border-radius: 50%; z-index: -1; }
.robot-orbit--one { width: 73%; aspect-ratio: 1; bottom: -16%; left: 14%; transform: rotate(-25deg) scaleY(.44); }
.robot-orbit--two { width: 59%; aspect-ratio: 1; bottom: -11%; left: 21%; transform: rotate(42deg) scaleY(.56); border-style: dashed; }

.robot-stage-avatar {
  position: absolute;
  z-index: 1;
  bottom: -7%;
  left: 50%;
  width: min(91%, 565px);
  max-height: 124%;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 20px 20px rgba(3, 40, 107, .2));
  transition: filter .28s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}

.robot-studio[data-robot-style="modern"] .robot-stage-avatar { filter: hue-rotate(16deg) saturate(1.13) drop-shadow(0 20px 20px rgba(25, 30, 160, .18)); transform: translateX(-50%) scale(1.02); }
.robot-studio[data-robot-style="explorer"] .robot-stage-avatar { filter: hue-rotate(70deg) saturate(.95) drop-shadow(0 20px 20px rgba(7, 101, 75, .18)); transform: translateX(-50%) scale(.99); }
.robot-studio[data-robot-style="simple"] .robot-stage-avatar { filter: saturate(.35) contrast(.94) drop-shadow(0 20px 20px rgba(15, 46, 89, .16)); transform: translateX(-50%) scale(.97); }

.robot-headwear-layer,
.robot-outfit-layer { position: absolute; pointer-events: none; z-index: 2; opacity: 0; transition: .25s ease; }
.robot-headwear-layer { top: 15%; left: 50%; width: 29%; height: 10%; transform: translateX(-50%); }
.robot-outfit-layer { bottom: 6%; left: 50%; width: 30%; height: 9%; transform: translateX(-50%); }

.robot-studio[data-robot-headwear="visor"] .robot-headwear-layer { top: 26%; width: 52%; height: 11%; opacity: 1; border-radius: 999px; border: 2px solid var(--robot-accent); background: color-mix(in srgb, var(--robot-accent) 18%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--robot-accent) 60%, transparent); }
.robot-studio[data-robot-headwear="keffiyeh"] .robot-headwear-layer { opacity: .88; height: 13%; top: 12%; border-radius: 52% 52% 18% 18%; border: 5px solid rgba(255,255,255,.88); box-shadow: 0 0 0 3px rgba(5, 41, 104, .68); }
.robot-studio[data-robot-headwear="cap"] .robot-headwear-layer { opacity: 0; }

.robot-studio[data-robot-outfit="formal"] .robot-outfit-layer { opacity: .85; width: 12%; height: 15%; bottom: 3%; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); background: linear-gradient(135deg, #fff 0 46%, #0d3f90 47% 53%, #fff 54%); }
.robot-studio[data-robot-outfit="field"] .robot-outfit-layer { opacity: .78; width: 33%; height: 12%; bottom: 4%; border-radius: 40% 40% 8px 8px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--robot-accent) 80%, #fff) 0 7px, #fff 7px 14px); mix-blend-mode: multiply; }
.robot-studio[data-robot-outfit="water"] .robot-outfit-layer { opacity: 0; }

.robot-stage-meta { position: relative; z-index: 4; flex: 0 0 auto; margin: 0 0 11px; }
.robot-studio .mascot-name-pill { color: var(--robot-navy); font-size: clamp(18px, 1.5vw, 26px); }
.robot-studio .pencil-ico { color: #2796f2; }
.robot-studio .mascot-tagline-text { max-width: 85%; font-size: clamp(10px, .8vw, 13px); color: #6e8cb6; }

.robot-studio .robot-vip-banner {
  position: relative;
  z-index: 4;
  min-height: 63px;
  border: 0;
  border-radius: 17px;
  padding: 10px 14px;
  background: linear-gradient(105deg, #e8f5ff, #f5fbff);
  color: #1769d3;
  box-shadow: none;
}
.robot-studio .gift-box-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #0780fa, #11c4ff); font-size: 25px; }
.robot-studio .gift-reward-copy { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; }
.robot-studio .gift-reward-copy b { color: #0a67d2; font-size: 15px; }
.robot-studio .gift-reward-copy span { color: #6385b6; font-size: 10px; font-weight: 700; }

.robot-studio[data-theme="dark"] .robot-builder-card,
.robot-studio[data-theme="dark"] .robot-preview-card { background: rgba(10, 37, 80, .94); border-color: rgba(106, 183, 255, .22); box-shadow: 0 18px 45px rgba(0,0,0,.27); }
.robot-studio[data-theme="dark"] .robot-studio-heading h1,
.robot-studio[data-theme="dark"] .robot-card-intro h2,
.robot-studio[data-theme="dark"] .robot-control-title > :last-child,
.robot-studio[data-theme="dark"] .mascot-name-pill { color: #f1f8ff; }
.robot-studio[data-theme="dark"] .robot-studio-heading p,
.robot-studio[data-theme="dark"] .robot-card-intro p,
.robot-studio[data-theme="dark"] .mascot-tagline-text { color: #a8c5ea; }
.robot-studio[data-theme="dark"] .robot-expo-badge,
.robot-studio[data-theme="dark"] .robot-theme-toggle,
.robot-studio[data-theme="dark"] .lang-pill-btn,
.robot-studio[data-theme="dark"] .robot-style-card,
.robot-studio[data-theme="dark"] .character-name-field,
.robot-studio[data-theme="dark"] .robot-choice-btn,
.robot-studio[data-theme="dark"] .robot-visual-option,
.robot-studio[data-theme="dark"] .persona-select-btn { background: #0d326d; border-color: #275690; color: #d7eaff; }
.robot-studio[data-theme="dark"] .robot-preview-card { background: linear-gradient(148deg, #0d397b, #071d47); }
.robot-studio[data-theme="dark"] .robot-speech-bubble { background: #f5fbff; }
.robot-studio[data-theme="dark"] .studio-char-input { color: #fff; }
.robot-studio[data-theme="dark"] .robot-vip-banner { background: linear-gradient(105deg, #103f7f, #0d2f67); }

@media (max-width: 1170px) {
  .robot-studio { overflow-y: auto; align-items: flex-start; }
  .robot-studio-shell { height: auto; min-height: 100%; }
  .robot-studio-header { grid-template-columns: 190px 1fr; }
  .robot-studio-heading { grid-column: 1 / -1; grid-row: 1; }
  .robot-brand-logo { grid-row: 2; }
  .robot-header-actions { grid-row: 2; }
  .robot-creator-layout { grid-template-columns: 1fr; }
  .robot-builder-card { overflow: visible; }
  .robot-preview-card { min-height: 580px; }
}

@media (max-width: 680px) {
  html:has(.robot-studio), body:has(.robot-studio) { overflow: auto; }
  .robot-studio-shell { padding: 15px; gap: 15px; }
  .robot-studio-header { grid-template-columns: 1fr; gap: 11px; }
  .robot-studio-heading { grid-row: auto; grid-column: auto; order: -1; }
  .robot-brand-logo { width: 180px; grid-row: auto; }
  .robot-header-actions { grid-row: auto; justify-content: space-between; flex-wrap: wrap; }
  .robot-expo-badge { display: none; }
  .robot-creator-layout { gap: 15px; }
  .robot-builder-card, .robot-preview-card { border-radius: 22px; padding: 17px; }
  .robot-style-grid { grid-template-columns: repeat(2, 1fr); }
  .robot-style-thumb { height: 72px; }
  .robot-controls-grid { grid-template-columns: 1fr; gap: 14px; }
  .robot-control-wide { grid-column: auto; }
  .robot-compact-options { gap: 5px; }
  .robot-preview-card { min-height: 520px; }
  .robot-preview-stage { min-height: 300px; }
  .robot-stage-avatar { width: 100%; }
}

/* نسخة المعالج المتدرّج — مطابقة لواجهة إنشاء المساعد المرجعية. */
.ai-character-studio {
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 4%, #e6f8ff 0, #f9fdff 42%, #eefaff 100%);
}
.ai-character-studio .robot-studio-shell { width: min(1400px, calc(100% - 40px)); padding: 27px 0 18px; gap: 22px; }
.ai-character-studio .robot-studio-header { grid-template-columns: 250px 1fr 320px; min-height: 66px; }
.ai-character-studio .robot-brand-logo { width: 205px; }
.ai-character-studio .robot-studio-heading h1 { font-size: 37px; }
.ai-character-studio .robot-studio-heading p { font-size: 15px; }
.ai-character-studio .robot-theme-toggle { display: none; }
.ai-character-studio .robot-creator-layout { flex: none; grid-template-columns: minmax(0, 1.74fr) minmax(410px, 1fr); gap: 15px; align-items: stretch; }
.ai-character-studio .robot-builder-card,
.ai-character-studio .robot-preview-card { border-radius: 19px; box-shadow: 0 12px 35px rgba(26, 100, 182, .08); }
.ai-character-studio .robot-builder-card { padding: 24px 26px 22px; overflow: hidden; }
.ai-character-studio .character-wizard-steps { display: flex; direction: rtl; align-items: flex-start; justify-content: center; gap: 12px; margin: 4px 0 24px; }
.ai-character-studio .wizard-step { width: 128px; text-align: center; color: #728bb2; }
.ai-character-studio .wizard-step span { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 7px; border: 1px solid #cfe2fb; border-radius: 50%; font: 800 15px/1 var(--font-en); background: #f7fbff; }
.ai-character-studio .wizard-step strong { display: block; font-size: 13px; }
.ai-character-studio .wizard-step small { display: block; margin-top: 3px; font-size: 10px; white-space: nowrap; }
.ai-character-studio .wizard-step.is-active { color: #0877f8; }
.ai-character-studio .wizard-step.is-active span { color: #fff; border-color: transparent; background: linear-gradient(145deg, #28aeff, #0874ef); box-shadow: 0 6px 13px rgba(0,128,255,.22); }
.ai-character-studio .character-wizard-steps > i { width: min(14vw, 145px); height: 1px; margin-top: 17px; background: #d9e7f8; }
.ai-character-studio .character-wizard-steps > i:nth-of-type(3) { background: linear-gradient(90deg,#d9e7f8,#2197fb); }
.ai-character-studio .robot-card-intro { margin: 0 0 18px; padding: 15px 17px; border: 1px solid #e1edfc; border-radius: 13px 13px 0 0; background: #f9fcff; }
.ai-character-studio .robot-card-intro h2 { font-size: 16px; }
.ai-character-studio .robot-card-intro p { font-size: 10px; }
.ai-character-studio .robot-controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px 16px; border: 1px solid #e7f0fc; border-top: 0; border-radius: 0 0 13px 13px; background: rgba(255,255,255,.66); }
.ai-character-studio .robot-control-title { margin-bottom: 8px; }
.ai-character-studio .robot-control-title > :last-child { font-size: 14px; }
.ai-character-studio .robot-control-title .robot-step-chip { width: 0; height: 0; overflow: hidden; opacity: 0; }
.ai-character-studio .robot-control-title > :last-child::first-letter { color: inherit; }
.ai-character-studio .robot-choice-btn { min-height: 52px; border-radius: 11px; font-size: 13px; }
.ai-character-studio .robot-choice-btn b { font-size: 13px; }
.ai-character-studio .robot-choice-btn > span { font-size: 23px; }
.ai-character-studio .robot-studio .character-name-field { height: 52px; border-radius: 11px; background: #fff; }
.ai-character-studio .studio-char-input { font-size: 13px; }
.ai-character-studio .robot-colors { justify-content: center; min-height: 52px; gap: 20px; }
.ai-character-studio .robot-color-swatch { width: 31px; height: 31px; }
.ai-character-studio .robot-compact-options { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px; }
.ai-character-studio .robot-visual-option { min-height: 72px; border-radius: 11px; gap: 5px; }
.ai-character-studio .robot-visual-option b { font-size: 10px; }
.ai-character-studio .outfit-symbol { font-size: 23px; }
/* خطوات المظهر والشخصية لا تظهر قبل الضغط على «التالي» في النسخة الأولى. */
.ai-character-studio #robotHeadwearRow,
.ai-character-studio #robotOutfitRow,
.ai-character-studio .robot-accessory-block,
.ai-character-studio .robot-persona-block { display: none; }
.ai-character-studio .robot-controls-grid > .robot-control-block:nth-of-type(7),
.ai-character-studio .robot-controls-grid > .robot-control-block:nth-of-type(8) { display: none; }
.ai-character-studio .btn-generate-ai-character { order: 2; min-height: 57px; margin: 20px 0 0; border-radius: 11px; font-size: 15px; background: linear-gradient(110deg,#0973ec,#16b1ff); }
.ai-character-studio .ai-generation-status { display: none; }
.ai-character-studio .robot-builder-card { position: relative; padding-bottom: 96px; }
.ai-character-studio .btn-start-chat-hero,
.ai-character-studio .btn-generate-ai-character { position: absolute; bottom: 22px; width: calc(50% - 35px); margin: 0; }
.ai-character-studio .btn-start-chat-hero { left: 26px; color: #376496; background: #f5faff; border: 1px solid #cfe2fb; box-shadow: none; }
.ai-character-studio .btn-generate-ai-character { right: 26px; }
.ai-character-studio .robot-preview-card { padding: 26px; min-height: 720px; }
.ai-character-studio .preview-card-heading { display: flex; flex-direction: row-reverse; align-items: flex-start; justify-content: space-between; gap: 10px; text-align: right; }
.ai-character-studio .preview-card-heading h2 { margin: 0; color: var(--robot-navy); font-size: 19px; }
.ai-character-studio .preview-card-heading p { margin: 5px 0 0; color: #7490b7; font-size: 11px; }
.ai-character-studio .preview-card-heading button { width: 41px; height: 41px; border: 1px solid #d8e8fc; border-radius: 11px; color: #1978e9; background: #fff; font-size: 21px; }
.ai-character-studio .robot-preview-topline { display: none; }
.ai-character-studio .robot-preview-stage { margin-top: 20px; min-height: 485px; }
.ai-character-studio .robot-speech-bubble { position: absolute; z-index: 7; right: 28px; left: 28px; bottom: 140px; max-width: none; text-align: center; }
.ai-character-studio .robot-preview-footer { margin-top: auto; }
.ai-character-studio .character-builder-footer { display: flex; justify-content: space-between; align-items: center; direction: rtl; color: #6482ad; font-size: 11px; padding: 0 5px; }

@media (max-width: 900px) {
  .ai-character-studio .robot-studio-shell { width: min(100% - 24px, 680px); padding-top: 16px; }
  .ai-character-studio .robot-studio-header { grid-template-columns: 1fr; gap: 12px; }
  .ai-character-studio .robot-brand-logo { justify-self: center; }
  .ai-character-studio .robot-header-actions { justify-content: center; }
  .ai-character-studio .robot-creator-layout { grid-template-columns: 1fr; }
  .ai-character-studio .robot-preview-card { min-height: 560px; order: -1; }
  .ai-character-studio .character-builder-footer { display: none; }
}

@media (max-width: 620px) {
  .ai-character-studio .robot-studio-heading h1 { font-size: 28px; }
  .ai-character-studio .robot-studio-heading p { font-size: 12px; }
  .ai-character-studio .robot-expo-badge { display: none; }
  .ai-character-studio .robot-builder-card, .ai-character-studio .robot-preview-card { padding: 15px; }
  .ai-character-studio .character-wizard-steps { gap: 3px; margin-bottom: 17px; }
  .ai-character-studio .wizard-step { width: 65px; }
  .ai-character-studio .wizard-step strong { font-size: 10px; }
  .ai-character-studio .wizard-step small { display: none; }
  .ai-character-studio .character-wizard-steps > i { width: 16px; }
  .ai-character-studio .robot-controls-grid { grid-template-columns: 1fr; padding: 12px; }
  .ai-character-studio .robot-compact-options { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .ai-character-studio .robot-builder-card { padding-bottom: 138px; }
  .ai-character-studio .btn-generate-ai-character, .ai-character-studio .btn-start-chat-hero { position: absolute; left: 15px; right: 15px; width: auto; }
  .ai-character-studio .btn-generate-ai-character { bottom: 72px; }
  .ai-character-studio .btn-start-chat-hero { bottom: 15px; }
  .ai-character-studio .robot-preview-card { min-height: 460px; }
  .ai-character-studio .robot-preview-stage { min-height: 340px; }
  .ai-character-studio .robot-speech-bubble { right: 15px; left: 15px; bottom: 105px; }
}

/* هيكل صفحة مستقل: لا تثبيت ولا تراكب بين الترويسة والمحتوى. */
.kiosk-home-studio.ai-character-studio {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}
.ai-character-studio .robot-studio-shell {
  width: min(1220px, calc(100% - 32px));
  min-height: 100dvh;
  height: auto;
  margin: 0 auto;
  padding: 28px 0 24px;
  gap: 24px;
}
.ai-character-studio .robot-studio-header { min-height: 64px; }
.ai-character-studio .robot-creator-layout { min-height: 690px; }
.ai-character-studio .robot-builder-card { min-height: 690px; }
.ai-character-studio .character-chat-creator { min-height: 690px; }
.ai-character-studio .robot-preview-card { min-height: 690px; }
.ai-character-studio .robot-preview-stage { min-height: 410px; margin: 14px 0 0; }
.ai-character-studio .robot-speech-bubble {
  position: relative;
  inset: auto;
  align-self: stretch;
  min-width: 0;
  margin: 16px 0 10px;
  padding: 14px 16px;
  text-align: center;
}
.ai-character-studio .robot-speech-bubble .bubble-arrow-pointer { display: none; }
.ai-character-studio .robot-preview-card .robot-preview-footer { position: relative; z-index: 3; margin-top: auto; }
.ai-character-studio .creator-female-only[hidden] { display: none; }
.ai-character-studio .creator-question .creator-female-only { margin-top: 6px; }

@media (max-width: 900px) {
  .ai-character-studio .robot-studio-shell { width: min(100% - 24px, 680px); padding: 16px 0 20px; }
  .ai-character-studio .robot-creator-layout { min-height: auto; }
  .ai-character-studio .robot-builder-card,
  .ai-character-studio .character-chat-creator,
  .ai-character-studio .robot-preview-card { min-height: 0; }
  .ai-character-studio .robot-preview-stage { min-height: 340px; }
}

/* منشئ محادثي: يحل محل النموذج الكثيف القديم. */
.ai-character-studio .robot-builder-card { overflow: hidden; padding: 0; min-height: 690px; }
.ai-character-studio .character-chat-creator { display: flex; flex-direction: column; height: 100%; min-height: 690px; padding: 28px; direction: rtl; background: linear-gradient(180deg,#fff 0%,#f8fcff 100%); }
.ai-character-studio .character-wizard-steps,
.ai-character-studio .robot-card-intro,
.ai-character-studio .robot-controls-grid,
.ai-character-studio .robot-persona-block,
.ai-character-studio .robot-builder-card > #btnGenerateAiCharacter,
.ai-character-studio .robot-builder-card > .ai-generation-status,
.ai-character-studio .robot-builder-card > #btnLaunchChat { display: none !important; }
.creator-chat-header { display: flex; align-items: center; gap: 12px; padding-bottom: 19px; border-bottom: 1px solid #e3eefb; }
.creator-chat-orb { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; color: #fff; background: linear-gradient(145deg,#1ac1ff,#0a74ed); box-shadow: 0 7px 18px rgba(5,121,244,.25); font-size: 19px; }
.creator-chat-header span { color: #1582f5; font: 800 9px var(--font-en); letter-spacing: .14em; }
.creator-chat-header h2 { margin: 2px 0; color: #092b67; font-size: 20px; }
.creator-chat-header p { margin: 0; color: #7890b6; font-size: 11px; }
.creator-chat-header > b { margin-inline-start: auto; align-self: flex-start; padding: 7px 10px; color: #167ff2; border-radius: 999px; background: #edf7ff; font: 800 12px var(--font-en); }
.creator-chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 150px; overflow: auto; padding: 20px 0 12px; scrollbar-width: thin; }
.creator-message { max-width: 83%; padding: 13px 15px; border-radius: 17px; font-size: 13px; line-height: 1.65; }
.creator-message--assistant { display: flex; gap: 9px; align-items: flex-start; color: #1b4e8d; background: #edf8ff; border: 1px solid #d4eafe; border-top-right-radius: 4px; }
.creator-message--assistant > span { color: #0786fb; font-size: 16px; }
.creator-message--assistant p { margin: 0; }
.creator-message--visitor { align-self: flex-start; color: #fff; background: linear-gradient(120deg,#1079ef,#1cb8ff); border-top-left-radius: 4px; }
.creator-question { margin-top: 4px; padding: 19px; border: 1px solid #dceafa; border-radius: 17px; background: #fff; box-shadow: 0 9px 24px rgba(12,90,175,.05); animation: creatorSlide .25s ease both; }
.creator-question[hidden] { display: none; }
@keyframes creatorSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.creator-question label, .creator-question .choice-caption { display: block; margin: 0 0 10px; color: #082b66; font-size: 14px; font-weight: 900; }
.creator-question label strong { color: #1180f5; }
.creator-question input[type="text"] { width: 100%; height: 49px; padding: 0 14px; outline: 0; border: 1.5px solid #d7e7fa; border-radius: 11px; color: #0d3470; font: 700 13px var(--font-main); background: #fbfdff; }
.creator-question input[type="text"]:focus { border-color: #1387ff; box-shadow: 0 0 0 3px rgba(19,135,255,.1); }
.creator-choice-grid { display: grid; gap: 8px; margin-bottom: 17px; }
.creator-choice-grid.two { grid-template-columns: repeat(2,1fr); }
.creator-choice-grid.four { grid-template-columns: repeat(4,1fr); }
.creator-choice-grid button { min-height: 62px; border: 1.5px solid #dceafa; border-radius: 12px; color: #4970a8; background: #fbfdff; font: 700 21px/1 var(--font-en); cursor: pointer; transition: .18s ease; }
.creator-choice-grid button b { display: block; margin-top: 6px; font: 800 10px var(--font-main); }
.creator-choice-grid button:hover { transform: translateY(-1px); border-color: #9ccaff; }
.creator-choice-grid button.is-selected { color: #087cf6; border-color: #1387ff; background: #edf8ff; box-shadow: 0 0 0 2px rgba(15,133,255,.1); }
.creator-choice-grid#chatStyleChoices button { min-height: 112px; padding: 5px; overflow: hidden; }
.creator-choice-grid#chatStyleChoices button b { position: relative; margin-top: 5px; }
.style-sample { display: block; height: 72px; border-radius: 8px; background-image: url('/images/character-styles/style-examples-v1.png'); background-repeat: no-repeat; background-size: 400% auto; background-position-y: 42%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.56); }
.style-sample--3d { background-position: 0 50%; }
.style-sample--editorial { background-position: 33.333% 50%; }
.style-sample--realistic { background-position: 66.666% 50%; }
.style-sample--cinematic { background-position: 100% 50%; }
.creator-question input[type="range"] { width: 100%; accent-color: #1184f8; }
.range-labels { display: flex; justify-content: space-between; margin: -2px 0 19px; color: #728ab1; font: 700 11px var(--font-en); }
.creator-skin-choices { display: flex; align-items: center; gap: 15px; padding: 4px 3px; }
.creator-skin-choices button { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--skin); cursor: pointer; box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 3px 7px rgba(7,54,113,.15); }
.creator-skin-choices button.is-selected::after { content: ""; position: absolute; inset: -5px; border: 2px solid #0b80fa; border-radius: 50%; }
.creator-chat-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 22px; direction: rtl; }
.creator-chat-actions button { height: 51px; border-radius: 12px; font: 900 14px var(--font-main); cursor: pointer; }
.creator-next { flex: 1; color: #fff; border: 0; background: linear-gradient(105deg,#0875ed,#16baff); box-shadow: 0 10px 19px rgba(8,118,239,.23); }
.creator-next:disabled { opacity: .64; cursor: wait; }
.creator-next span { margin-inline-start: 8px; }
.creator-back { width: 116px; color: #4d70a3; border: 1px solid #d8e7f9; background: #f7fbff; }

@media (max-width: 620px) {
  .ai-character-studio .robot-builder-card,
  .ai-character-studio .character-chat-creator { min-height: 650px; }
  .ai-character-studio .character-chat-creator { padding: 18px; }
  .creator-chat-header h2 { font-size: 18px; }
  .creator-question { padding: 14px; }
  .creator-choice-grid.four { grid-template-columns: repeat(2,1fr); }
  .creator-choice-grid button { min-height: 58px; }
  .creator-choice-grid#chatStyleChoices button { min-height: 112px; }
}

.gift-box-ico {
  font-size: 16px;
}

.gift-reward-copy {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gift-reward-copy b {
  color: #1e3a8a;
  font-weight: 900;
}

.divider-pipe {
  opacity: 0.4;
}

.gift-arrow-ico {
  font-size: 18px;
  font-weight: 900;
}

/* ============================================================
   5. شاشة المحادثة والتسجيل التفاعلية المينيمال (Chat App)
   ============================================================ */
.chat-app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.chat-header {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 20px;
  box-shadow: var(--shadow-xs);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  height: 26px;
  width: auto;
}

.header-exhibit-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #ECFDF5;
  color: var(--green-dark);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.badge-live .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--emerald);
}

.header-assistant {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 3px 12px 3px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.assistant-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistant-mini-avatar svg {
  width: 100%;
  height: 100%;
}

.assistant-mini-meta {
  display: flex;
  flex-direction: column;
}

.assistant-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.assistant-status {
  font-size: 10px;
  color: var(--blue-brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-builder-toggle, .btn-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-builder-toggle:hover, .btn-mode-toggle:hover {
  background: #F1F5F9;
  color: var(--text-primary);
}

.btn-mode-toggle.active {
  background: #EFF6FF;
  color: var(--blue-brand);
  border-color: #BFDBFE;
}

.progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
}

.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--blue-brand);
  transition: width 0.3s ease;
}

/* تخطيط الشات للشاشات العريضة والتابلت */
.chat-main-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  flex: 1;
  padding: 14px 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

@media (max-width: 900px) {
  .chat-main-layout {
    grid-template-columns: 1fr;
  }
  .mascot-live-panel {
    display: none;
  }
}

/* لوحة المساعد الجانبية للشات */
.mascot-live-panel {
  height: 100%;
}

.mascot-live-card {
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.mascot-live-header {
  text-align: center;
}

.mascot-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue-brand);
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.mascot-live-header h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 2px 0;
}

.mascot-persona-tag {
  font-size: 11px;
  color: var(--text-secondary);
}

.mascot-live-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mascot-stage-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.04);
  filter: blur(20px);
}

.mascot-sprite-host {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.mascot-sprite-host svg {
  width: 100%;
  height: 100%;
}

.mascot-live-quote {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  margin-top: 8px;
  z-index: 2;
}

.mascot-live-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mascot-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-quick-ask {
  padding: 6px 8px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-family: var(--font-main);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: right;
  transition: all 0.2s ease;
}

.btn-quick-ask:hover {
  background: #EFF6FF;
  color: var(--blue-brand);
  border-color: #DBEAFE;
}

.mascot-hint {
  font-size: 10.5px;
  color: var(--gold);
  text-align: center;
}

/* عمود المحادثة المينيمال */
.chat-conversation-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.chat-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-light);
}

.mode-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

.banner-btn {
  padding: 3px 10px;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-brand);
  cursor: pointer;
}

.chat-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-body::-webkit-scrollbar {
  width: 4px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}

/* فقاعات الرسائل (Chat Bubbles) */
.msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgPop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.bot {
  align-self: flex-start;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #F1F5F9;
  border: 1px solid var(--border-light);
}

.msg-avatar svg {
  width: 100%;
  height: 100%;
}

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.5;
}

.msg.bot .msg-bubble {
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  color: #0F172A;
  border-top-right-radius: 2px;
}

.msg.user .msg-bubble {
  background: var(--blue-brand);
  color: #FFFFFF;
  border-top-left-radius: 2px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* خيارات الإجابة السريعة (Quick Reply Chips) */
.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-btn {
  padding: 6px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chip-btn:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--blue-brand);
  transform: translateY(-1px);
}

/* منطقة الإدخال والكتابة */
.chat-composer {
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
}

.composer-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-input {
  flex: 1;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.composer-input:focus {
  border-color: var(--blue-brand);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-send-msg {
  padding: 10px 18px;
  background: var(--blue-brand);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-send-msg:hover {
  background: var(--blue-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* ============================================================
   6. لوحة التحكم والإدارة (Admin Dashboard Styles)
   ============================================================ */
.admin-wrap {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-y: auto;
  background: var(--bg-dark);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.ah-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ah-logo {
  height: 36px;
}

.ah-right h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.ah-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.ah-actions {
  display: flex;
  gap: 10px;
}

.btn-line {
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.045);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.btn-gold {
  padding: 8px 16px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
}

.stat .lbl {
  font-size: 12px;
  color: var(--text-muted);
}

.stat b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--cyan);
  margin: 4px 0;
}

.stat b.small {
  font-size: 18px;
}

.stat small {
  font-size: 11px;
  color: var(--text-secondary);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .search {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
}

.live-pill {
  font-size: 12px;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   7. رسائل المحادثة (Chat Messages Engine) — الوضع المضيء
   ============================================================ */
.row {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: msgPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.row.bot {
  align-self: flex-start;
}

.row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.row .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.row .avatar svg {
  width: 100%;
  height: 100%;
}

.bubble {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  border-top-right-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.row.user .bubble {
  background: #1E3A8A;
  border-color: rgba(59, 130, 246, 0.4);
  color: #FFFFFF;
  border-top-right-radius: 16px;
  border-top-left-radius: 4px;
}

.bubble.err {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #B91C1C;
}

.bubble.big {
  max-width: 100%;
  font-size: 14.5px;
}

/* نقاط «يكتب الآن…» */
.bubble .d {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  margin-inline-end: 4px;
  animation: typingBounce 1.2s infinite;
}

.bubble .d:nth-child(2) { animation-delay: 0.15s; }
.bubble .d:nth-child(3) { animation-delay: 0.3s; }

.reply-loading {
  min-width: 214px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
}

.reply-loading-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
}

.reply-loading-top b {
  font-size: 12px;
  margin: 0;
}

.reply-loading-pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(14, 165, 233, .45);
  animation: replyPulse 1.25s ease-out infinite;
}

.reply-loading-copy {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.reply-loading-steps {
  display: flex;
  align-items: center;
  margin-top: 8px;
  direction: ltr;
}

.reply-loading-steps i {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid #BFDBFE;
  border-radius: 50%;
  background: #FFFFFF;
  color: #94A3B8;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  transition: .2s ease;
}

.reply-loading-steps i.is-active {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}

.reply-loading-steps i.is-done {
  border-color: #22C55E;
  background: #22C55E;
  color: #FFFFFF;
}

.reply-loading-steps em {
  width: 26px;
  height: 1px;
  background: #BFDBFE;
}

.reply-loading-bar {
  display: block;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #E0F2FE;
}

.reply-loading-bar i {
  display: block;
  width: 22%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0EA5E9, #2563EB, #38BDF8);
  transition: width .35s ease;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes replyPulse {
  70%, 100% { box-shadow: 0 0 0 7px rgba(14, 165, 233, 0); }
}

/* رقائق الاختيار السريع */
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
}

.chip {
  padding: 9px 16px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--cyan-glow);
}

.chip.sel {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #FFFFFF;
}

.chip.pick {
  background: var(--emerald-subtle);
  border-color: var(--emerald);
  color: var(--green-dark);
}

.chip.done {
  background: var(--emerald);
  border-color: transparent;
  color: #FFFFFF;
}

.chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chips-wrap .chip {
  touch-action: manipulation;
}

.chat-smart-suggestions {
  width: 100%;
  max-width: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #EEF4FA;
}

.chat-smart-suggestions .chip {
  padding: 7px 11px;
  font-size: 11.5px;
  box-shadow: none;
  background: #F8FBFF;
}

.chat-smart-suggestions .chip:hover {
  transform: none;
}

/* حقل الإدخال وإرسال الرسائل */
.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.input {
  flex: 1;
  padding: 13px 18px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

textarea.input {
  min-height: 48px;
  max-height: 132px;
  resize: none;
  line-height: 1.55;
  overflow-y: auto;
}

.input.ltr {
  direction: ltr;
  text-align: left;
}

.input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-subtle);
}

.input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.send {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan);
  border: none;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--cyan-glow);
}

.send:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.send.ghost {
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  color: var(--text-secondary);
  width: auto;
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 12.5px;
  font-weight: 700;
}

.send.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  width: 100%;
}

/* شارة الإجابة المولدة بالذكاء الاصطناعي */
.ai-badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--cyan-subtle);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: var(--cyan);
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.ai-rich-answer p {
  margin: 0 0 8px;
}

.ai-rich-answer p:last-child,
.ai-rich-answer ul:last-child,
.ai-rich-answer ol:last-child,
.ai-rich-answer .ai-table-wrap:last-child {
  margin-bottom: 0;
}

.ai-rich-answer h1,
.ai-rich-answer h2,
.ai-rich-answer h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
}

.ai-rich-answer ul,
.ai-rich-answer ol {
  margin: 5px 0 10px;
  padding-inline-start: 22px;
}

.ai-rich-answer li {
  margin: 3px 0;
}

.ai-rich-answer code {
  padding: 1px 5px;
  direction: ltr;
  border-radius: 5px;
  background: #EAF5FF;
  color: var(--navy);
  font-family: var(--font-en);
  font-size: .9em;
}

.ai-table-wrap {
  max-width: 100%;
  margin: 8px 0 10px;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 9px;
}

.ai-table {
  width: 100%;
  min-width: 260px;
  border-collapse: collapse;
  font-size: 12px;
}

.ai-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-light);
  text-align: start;
  vertical-align: top;
}

.ai-table tr:first-child td {
  background: #EFF8FF;
  color: var(--navy);
  font-weight: 800;
}

.ai-table tr:last-child td {
  border-bottom: 0;
}

/* ملخص المراجعة قبل التأكيد */
.summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #F8FAFC;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 6px;
}

.summary div {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary b {
  color: var(--text-primary);
}

.summary span {
  font-weight: 700;
  color: var(--cyan);
}

/* رقم التذكرة */
.tkt {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 22px;
  background: var(--navy);
  color: #FFFFFF;
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
}

/* بطاقة النجاح واستلام الهدية */
.success-card {
  background: #ECFDF5;
  border: 1.5px solid rgba(5, 150, 105, 0.35);
  text-align: center;
}

.success-card .emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 4px;
}

/* دليل موقع الجناح */
.booth-guide-box {
  margin-top: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: right;
}

.booth-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-primary);
}

.booth-hall-pill {
  background: var(--gold);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.booth-details-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* دليل فريق الجناح */
.team-guide-box {
  margin-top: 10px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: right;
}

.team-guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.team-members-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
}

.member-info b {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.member-info small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.member-badge {
  display: inline-block;
  margin-top: 3px;
  background: var(--cyan-subtle);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.member-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-contact-call, .btn-contact-wa {
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.btn-contact-call {
  background: var(--cyan-subtle);
  color: var(--cyan);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.btn-contact-wa {
  background: #ECFDF5;
  color: var(--green-dark);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

/* ============================================================
   8. الشخصية المجهولة (Mystery Avatar) قبل اكتمال البناء
   ============================================================ */
.mystery-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #F1F5F9;
  border: 3px dashed #94A3B8;
  color: var(--text-muted);
  animation: mysteryPulse 2.4s ease-in-out infinite;
  position: relative;
}

.mystery-avatar span {
  font-size: 42%;
  font-weight: 900;
  line-height: 1;
}

.mystery-avatar small {
  font-size: 20%;
  margin-top: 6%;
}

@keyframes mysteryPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--cyan-subtle); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 14px transparent; }
}

/* نبض على الخطوة الناقصة */
.step-nav-btn.missing {
  animation: missingPulse 1.4s ease-in-out 2;
  border-color: var(--gold);
}

@keyframes missingPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(217, 119, 6, 0.12); }
}

/* اهتزاز زر التأكيد عند نقص البيانات */
.shake {
  animation: shakeX 0.45s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* ============================================================
   9. إشعار تنبيه إكمال الخطوات (Toast)
   ============================================================ */
.sahara-toast {
  position: fixed;
  bottom: 26px;
  right: 50%;
  transform: translateX(50%) translateY(30px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid rgba(217, 119, 6, 0.45);
  border-right: 5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: min(92vw, 560px);
}

.sahara-toast.show {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.sahara-toast .toast-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.sahara-toast .toast-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
}

.sahara-toast .toast-text b {
  color: var(--gold);
}

.sahara-toast.success {
  border-color: rgba(5, 150, 105, 0.45);
  border-right-color: var(--emerald);
}

.sahara-toast.success .toast-text b {
  color: var(--green-dark);
}

/* ============================================================
   10. فقاعات وكونفيتي (Ambient & Celebration)
   ============================================================ */
.floating-bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble-particle {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.2);
  animation: bubbleRise linear infinite;
  opacity: 0.55;
}

@keyframes bubbleRise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.55; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

.confetti-bit {
  position: fixed;
  top: -30px;
  z-index: 999;
  border-radius: 2px;
  pointer-events: none;
}

/* ============================================================
   11. إكمال ستايلات لوحة التحكم (Admin Tables & Bars)
   ============================================================ */
.alert-ok {
  background: #ECFDF5;
  border: 1px solid rgba(5, 150, 105, 0.35);
  color: var(--green-dark);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 13.5px;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 260px) 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.bar-row .nm {
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row .track {
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-row .track i {
  display: block;
  height: 100%;
  background: var(--cyan);
  border-radius: var(--radius-full);
}

.bar-row .ct {
  font-weight: 800;
  color: var(--cyan);
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
}

.admin-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1080px;
}

.admin-wrap th {
  background: #F1F5F9;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 800;
  text-align: right;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  vertical-align: top;
}

.admin-wrap tbody tr:hover {
  background: #F8FAFC;
}

.admin-wrap td.tk {
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--cyan);
  white-space: nowrap;
}

.admin-wrap .muted {
  color: var(--text-muted);
  font-size: 11.5px;
}

.admin-wrap .tag {
  display: inline-block;
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  margin: 2px 2px 2px 0;
}

.admin-wrap .tag.type {
  background: var(--cyan-subtle);
  border-color: rgba(2, 132, 199, 0.25);
  color: var(--cyan);
}

.admin-wrap td.tags-cell {
  max-width: 220px;
}

.admin-wrap a.phone {
  color: var(--text-primary);
  font-weight: 800;
  text-decoration: none;
  font-family: var(--font-en);
  white-space: nowrap;
}

.admin-wrap a.phone:hover {
  color: var(--cyan);
}

.admin-wrap .acts {
  white-space: nowrap;
}

.admin-wrap a.wa {
  display: inline-block;
  background: #ECFDF5;
  color: var(--green-dark);
  border: 1px solid rgba(5, 150, 105, 0.3);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  margin-inline-end: 6px;
}

.admin-wrap button.del {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
  font-family: var(--font-main);
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.admin-wrap button.del:hover {
  background: #B91C1C;
  color: #FFFFFF;
}

.admin-wrap td.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px;
  font-weight: 700;
}

.admin-wrap nav[role="navigation"] {
  margin-top: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-wrap nav[role="navigation"] a,
.admin-wrap nav[role="navigation"] span {
  padding: 6px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-wrap nav[role="navigation"] span.current {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #FFFFFF;
}

/* ============================================================
   المحرك ثلاثي الأبعاد — Avatar 3D Engine (Three.js)
   ============================================================ */
.avatar3d-host {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
  filter: drop-shadow(0 14px 26px rgba(15, 23, 42, 0.18));
  transition: cursor 0.2s ease;
}

.avatar3d-canvas.grabbing {
  cursor: grabbing;
}

.avatar3d-stage-meta {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.avatar3d-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #FFFFFF;
  background: var(--cyan);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
  animation: badge3dPulse 2.6s ease-in-out infinite;
}

@keyframes badge3dPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.avatar3d-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #64748B);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-light, rgba(15, 23, 42, 0.08));
  padding: 3px 10px;
  border-radius: 999px;
}

/* الأفاتار المصغر — لقطات الـ 3D في الرسائل والترويسة والمرشد */
.row .avatar img,
.assistant-mini-avatar img,
.mascot-sprite-host img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* ============================================================
   12. الأيقونات الخطية والأعلام الرقمية (SVG Icon System)
   ============================================================ */
.i-ic {
  flex-shrink: 0;
  vertical-align: -3px;
}

.flag-badge {
  display: inline-block;
  vertical-align: -3px;
  border-radius: 50%;
}

.lang-flag .flag-badge {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.chip-ic {
  color: var(--cyan);
  margin-inline-end: 6px;
  vertical-align: -3px;
}

.chip.done .chip-ic,
.chip.sel .chip-ic {
  color: currentColor;
}

.g-icon .i-ic {
  color: var(--cyan);
}

.persona-icon-box .i-ic {
  color: var(--cyan);
}

.btn-quick-ask .i-ic {
  color: var(--cyan);
}

.gift-badge-live .i-ic {
  vertical-align: -2px;
  margin-inline-end: 4px;
}

.identity-badge .flag-badge {
  margin-inline-end: 4px;
  vertical-align: -2px;
}

.success-gift {
  color: var(--emerald);
}

.booth-guide-header .i-ic,
.booth-details-row .i-ic {
  color: var(--gold);
  vertical-align: -2px;
  margin-inline-end: 4px;
}

.team-member-item .i-ic {
  vertical-align: -2px;
}

.mystery-drop {
  color: var(--cyan);
}

.toast-icon .i-ic {
  color: var(--gold);
}

.sahara-toast.success .toast-icon .i-ic {
  color: var(--emerald);
}

.ai-badge-tag .i-ic {
  vertical-align: -2px;
  margin-inline-end: 3px;
}

.opt-icon:empty {
  display: none;
}

/* ============================================================
   Modular robot model — every choice maps to a real SVG layer
   ============================================================ */
.robot-studio .robot-style-thumb {
  display: grid;
  place-items: end center;
  background: radial-gradient(circle at 50% 18%, #e6f9ff 0, #f6fbff 52%, #d8edff 100%);
}

.robot-studio .robot-style-thumb img { display: none; }

.robot-mini-bot {
  --mini-accent: #13b8ff;
  position: relative;
  display: block;
  width: 47px;
  height: 59px;
  margin-bottom: -5px;
  border: 3px solid #0a3175;
  border-radius: 22px 22px 14px 14px;
  background: linear-gradient(150deg, #fff 35%, #dcefff);
  box-shadow: inset 0 5px 0 #0a3175, 0 5px 9px rgba(8,52,121,.15);
}

.robot-mini-bot::before,
.robot-mini-bot::after {
  content: "";
  position: absolute;
  top: 25px;
  width: 8px;
  height: 13px;
  border-radius: 50%;
  background: #082764;
  box-shadow: 0 0 0 2px var(--mini-accent);
}
.robot-mini-bot::before { left: 9px; }
.robot-mini-bot::after { right: 9px; }
.robot-mini-bot i { position: absolute; top: -7px; left: 9px; width: 30px; height: 13px; border-radius: 16px 16px 4px 4px; background: #0a3175; }
.robot-mini-bot b { position: absolute; bottom: -15px; left: 50%; width: 25px; height: 17px; transform: translateX(-50%); border-radius: 9px 9px 2px 2px; background: #0a3175; }
.robot-style-thumb--modern .robot-mini-bot { --mini-accent: #8161ff; transform: rotate(3deg); }
.robot-style-thumb--explorer .robot-mini-bot { --mini-accent: #50bd71; }
.robot-style-thumb--simple .robot-mini-bot { --mini-accent: #7b8aa3; filter: grayscale(.65); }

.robot-accessory-block { padding-top: 1px; }
.robot-accessories-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.robot-accessory-btn {
  min-width: 0;
  min-height: 48px;
  padding: 5px 3px;
  border: 1.5px solid #dbe9fd;
  border-radius: 12px;
  background: #f8fbff;
  color: #315b9c;
  cursor: pointer;
  font-family: inherit;
  transition: .18s ease;
}
.robot-accessory-btn:hover { background: #f1f8ff; border-color: #9ccaff; transform: translateY(-1px); }
.robot-accessory-btn.active { color: #1066cb; background: #edf7ff; border-color: var(--robot-blue); box-shadow: 0 0 0 2px rgba(8,124,255,.1); }
.robot-accessory-btn b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.accessory-icon { display: block; min-height: 18px; color: var(--robot-blue); font: 800 16px/18px var(--font-en); direction: ltr; }

.robot-modular-model {
  --model-navy: #082b73;
  --model-accent: var(--robot-accent);
  position: absolute;
  z-index: 2;
  inset: 2% 0 -6%;
  display: flex;
  justify-content: center;
  align-items: end;
  pointer-events: none;
  transition: filter .28s ease, transform .28s ease;
}

.robot-model-svg {
  width: min(93%, 510px);
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 18px 18px rgba(3,40,107,.14));
}

.robot-model-svg .robot-ground-shadow { fill: rgba(22,87,155,.18); }
.robot-model-svg .robot-antenna { display: none; fill: var(--model-accent); stroke: var(--model-navy); stroke-width: 7; stroke-linecap: round; }
.robot-model-svg .robot-arm > path:not(.robot-arm-cuff) { fill: url(#robotNavy); stroke: #071e5c; stroke-width: 7; stroke-linejoin: round; }
.robot-model-svg .robot-arm-cuff { fill: var(--model-accent); stroke: #e7fbff; stroke-width: 4; }
.robot-model-svg .robot-body-shell { fill: url(#robotWhite); stroke: #91b9e2; stroke-width: 6; }
.robot-model-svg .robot-outfit { display: none; }
.robot-model-svg .robot-outfit-water { display: block; fill: var(--model-navy); }
.robot-model-svg .robot-water-wave { fill: none; stroke: var(--model-accent); stroke-width: 8; stroke-linecap: round; }
.robot-model-svg .robot-chest-core { fill: #0d397e; stroke: #b6dcff; stroke-width: 7; }
.robot-model-svg .robot-chest-core-inner { fill: var(--model-accent); stroke: #eafcff; stroke-width: 5; filter: drop-shadow(0 0 6px var(--model-accent)); }
.robot-model-svg .robot-badge { display: none; fill: #2483ed; stroke: #fff; stroke-width: 2; }
.robot-model-svg .robot-badge path:nth-child(2) { fill: #56bb3f; }

.robot-model-svg .robot-ear rect { fill: url(#robotNavy); stroke: #061c54; stroke-width: 6; }
.robot-model-svg .robot-ear circle { fill: var(--model-accent); stroke: #dffbff; stroke-width: 4; filter: drop-shadow(0 0 5px var(--model-accent)); }
.robot-model-svg .robot-head-shell { fill: url(#robotFace); stroke: #9bc4ec; stroke-width: 6; }
.robot-model-svg .robot-helmet { fill: var(--model-navy); }
.robot-model-svg .robot-helmet-stripe { fill: var(--model-accent); opacity: .92; }
.robot-model-svg .robot-eye > ellipse:first-child { fill: #061b52; stroke: #183c77; stroke-width: 5; }
.robot-model-svg .robot-iris { fill: var(--model-accent); }
.robot-model-svg .robot-eye-glint { fill: #fff; }
.robot-model-svg .robot-smile { fill: none; stroke: #09225c; stroke-width: 8; stroke-linecap: round; }

.robot-model-svg .robot-female-layer { display: none; }
.robot-model-svg .robot-female-hair { fill: #263681; stroke: #122461; stroke-width: 5; }
.robot-model-svg .robot-eyelash { fill: none; stroke: #122461; stroke-width: 4; stroke-linecap: round; }
.robot-model-svg .robot-headwear { display: none; }
.robot-model-svg .robot-headwear-cap { display: block; fill: var(--model-navy); }
.robot-model-svg .robot-cap-line { fill: none; stroke: var(--model-accent); stroke-width: 6; stroke-linecap: round; }
.robot-model-svg .robot-headwear-visor { fill: color-mix(in srgb, var(--model-accent) 22%, rgba(255,255,255,.2)); stroke: var(--model-accent); stroke-width: 6; }
.robot-model-svg .robot-headwear-visor path { stroke: #fff; stroke-width: 3; opacity: .85; }
.robot-model-svg .robot-headwear-keffiyeh { fill: #f9fcff; stroke: #8fb4d9; stroke-width: 6; }
.robot-model-svg .robot-headwear-keffiyeh path:nth-child(2) { fill: none; stroke: var(--model-navy); stroke-width: 8; }
.robot-model-svg .robot-glasses,
.robot-model-svg .robot-bow { display: none; }
.robot-model-svg .robot-glasses { fill: color-mix(in srgb, var(--model-accent) 14%, transparent); stroke: var(--model-navy); stroke-width: 7; }
.robot-model-svg .robot-glasses path { fill: none; }
.robot-model-svg .robot-bow { fill: #ef69ac; stroke: #9e275b; stroke-width: 5; }

.robot-studio[data-robot-gender="female"] .robot-model-svg .robot-female-layer { display: block; }
.robot-studio[data-robot-gender="female"] .robot-model-svg .robot-helmet-stripe { fill: #e95da4; }
.robot-studio[data-robot-headwear="cap"] .robot-model-svg .robot-headwear-cap,
.robot-studio[data-robot-headwear="visor"] .robot-model-svg .robot-headwear-visor,
.robot-studio[data-robot-headwear="keffiyeh"] .robot-model-svg .robot-headwear-keffiyeh { display: block; }
.robot-studio[data-robot-headwear="visor"] .robot-model-svg .robot-headwear-cap,
.robot-studio[data-robot-headwear="keffiyeh"] .robot-model-svg .robot-headwear-cap { display: none; }
.robot-studio[data-robot-outfit="water"] .robot-model-svg .robot-outfit-water,
.robot-studio[data-robot-outfit="formal"] .robot-model-svg .robot-outfit-formal,
.robot-studio[data-robot-outfit="field"] .robot-model-svg .robot-outfit-field { display: block; }
.robot-studio[data-robot-outfit="formal"] .robot-model-svg .robot-outfit-water,
.robot-studio[data-robot-outfit="field"] .robot-model-svg .robot-outfit-water { display: none; }
.robot-model-svg .robot-outfit-formal { fill: #18335f; }
.robot-model-svg .robot-shirt { fill: #f7fcff; stroke: #a7c7ea; stroke-width: 3; }
.robot-model-svg .robot-tie { fill: var(--model-accent); }
.robot-model-svg .robot-outfit-field { fill: #276caf; }
.robot-model-svg .robot-vest { fill: #e9f6ff; stroke: #0c4d90; stroke-width: 5; }
.robot-model-svg .robot-vest-stripe { fill: none; stroke: #56bb3f; stroke-width: 11; }
.robot-studio[data-robot-accessory-glasses="true"] .robot-model-svg .robot-glasses,
.robot-studio[data-robot-accessory-bow="true"] .robot-model-svg .robot-bow,
.robot-studio[data-robot-accessory-badge="true"] .robot-model-svg .robot-badge,
.robot-studio[data-robot-accessory-antenna="true"] .robot-model-svg .robot-antenna { display: block; }

.robot-studio[data-robot-style="modern"] .robot-modular-model { --model-navy: #273d9a; transform: scale(1.025) translateY(-2px); }
.robot-studio[data-robot-style="explorer"] .robot-modular-model { --model-navy: #075c6b; transform: scale(.99); }
.robot-studio[data-robot-style="simple"] .robot-modular-model { --model-navy: #354458; filter: saturate(.55); transform: scale(.96); }

.robot-studio[data-theme="dark"] .robot-accessory-btn { background: #0d326d; border-color: #275690; color: #d7eaff; }
.robot-studio[data-theme="dark"] .robot-accessory-btn.active { background: #164e9e; border-color: #49a5ff; color: #fff; }

@media (max-width: 680px) {
  .robot-accessories-row { grid-template-columns: repeat(2, 1fr); }
  .robot-modular-model { inset: 1% -4% -5%; }
}

/* Rive character asset supplied for the experience. The SVG builder remains a safe fallback. */
.rive-character-stage {
  position: absolute;
  z-index: 4;
  inset: 2% 1% -4%;
  display: none;
  align-items: center;
  justify-content: center;
}

.rive-character-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

.rive-load-status {
  position: absolute;
  inset: auto 50% 18%;
  transform: translateX(50%);
  width: max-content;
  padding: 7px 12px;
  border-radius: 999px;
  color: #3971ad;
  background: rgba(255,255,255,.88);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(20,75,142,.12);
}

.robot-preview-stage.rive-ready .rive-character-stage { display: flex; }
.robot-preview-stage.rive-ready .rive-load-status { display: none; }
.robot-preview-stage.rive-ready .robot-modular-model { opacity: 0; visibility: hidden; }
.robot-preview-stage.rive-error .rive-character-stage { display: flex; }
.robot-preview-stage.rive-error .rive-load-status { color: #a24a58; }

.robot-studio[data-theme="dark"] .rive-load-status { background: rgba(7,31,72,.9); color: #c8e5ff; }

/* Four Rive characters: gallery first, then a cropped individual preview with applied layers. */
.rive-canvas-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #292929;
}

.rive-character-stage canvas {
  transform-origin: center;
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}

.robot-studio[data-rive-mode="preview"] .rive-character-picker { display: none; }
.robot-studio[data-rive-mode="gallery"] .rive-customization-layer,
.robot-studio[data-rive-mode="gallery"] .rive-back-to-gallery { display: none; }

.robot-studio[data-rive-mode="preview"][data-rive-character="0"] #riveCharacterCanvas { transform: scale(2.02); transform-origin: 25% 25%; }
.robot-studio[data-rive-mode="preview"][data-rive-character="1"] #riveCharacterCanvas { transform: scale(2.02); transform-origin: 75% 25%; }
.robot-studio[data-rive-mode="preview"][data-rive-character="2"] #riveCharacterCanvas { transform: scale(2.02); transform-origin: 25% 75%; }
.robot-studio[data-rive-mode="preview"][data-rive-character="3"] #riveCharacterCanvas { transform: scale(2.02); transform-origin: 75% 75%; }

.rive-character-picker {
  position: absolute;
  z-index: 6;
  inset: 7% 9%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 7%;
}

.rive-character-picker button {
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: .18s ease;
}
.rive-character-picker button:hover,
.rive-character-picker button.active { border-color: var(--robot-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--robot-accent) 22%, transparent); }

.rive-back-to-gallery {
  position: absolute;
  z-index: 9;
  top: 9px;
  left: 9px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  color: #0b4d99;
  background: rgba(255,255,255,.9);
  box-shadow: 0 5px 14px rgba(3,39,96,.16);
  cursor: pointer;
  font: 800 10px var(--font-main);
}

.rive-customization-layer { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.rive-addon { position: absolute; display: none; color: var(--robot-accent); filter: drop-shadow(0 2px 2px rgba(3,36,92,.24)); }
.rive-addon--cap { top: 16%; left: 50%; width: 31%; height: 8%; transform: translateX(-50%); border-radius: 80% 80% 12px 12px; border: 3px solid #072b72; background: linear-gradient(140deg, #0a3380, var(--robot-accent)); }
.rive-addon--visor { top: 36%; left: 50%; width: 43%; height: 8%; transform: translateX(-50%); border: 3px solid var(--robot-accent); border-radius: 999px; background: color-mix(in srgb, var(--robot-accent) 20%, transparent); box-shadow: 0 0 10px var(--robot-accent); }
.rive-addon--keffiyeh { top: 13%; left: 50%; width: 39%; height: 18%; transform: translateX(-50%); border: 3px solid #102d66; border-radius: 46% 46% 12px 12px; clip-path: polygon(10% 0, 90% 0, 100% 38%, 88% 100%, 12% 100%, 0 38%); background: repeating-linear-gradient(45deg, rgba(255,255,255,.92) 0 8px, rgba(221,232,246,.86) 8px 11px); }
.rive-addon--glasses { top: 38%; left: 50%; transform: translateX(-50%); padding: 0 4px; border: 3px solid #11316c; border-radius: 999px; color: var(--robot-accent); background: color-mix(in srgb, var(--robot-accent) 18%, transparent); font: 900 clamp(25px, 2.7vw, 40px)/1 var(--font-en); letter-spacing: -.15em; white-space: nowrap; }
.rive-addon--bow { top: 65%; left: 50%; width: 12%; height: 7%; transform: translateX(-50%); border-radius: 42% 42% 50% 50%; background: #ec5a9f; clip-path: polygon(0 20%, 44% 38%, 50% 0, 56% 38%, 100% 20%, 78% 50%, 100% 80%, 56% 62%, 50% 100%, 44% 62%, 0 80%, 22% 50%); }
.rive-addon--antenna { top: 10%; left: 50%; width: 3px; height: 9%; transform: translateX(-50%); border-radius: 99px; background: var(--robot-accent); }
.rive-addon--antenna::before { content: ''; position: absolute; width: 12px; height: 12px; top: -7px; left: 50%; transform: translateX(-50%); border: 3px solid #fff; border-radius: 50%; background: var(--robot-accent); box-shadow: 0 0 8px var(--robot-accent); }
.rive-addon--badge { top: 72%; right: 34%; color: #57bd47; font: 900 clamp(19px, 2vw, 29px)/1 var(--font-en); }
.rive-addon--energy { top: 77%; left: 50%; display: block; width: 11%; aspect-ratio: 1; transform: translateX(-50%); border: 3px solid var(--robot-accent); border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.74), 0 0 12px var(--robot-accent); background: color-mix(in srgb, var(--robot-accent) 35%, transparent); }
.rive-addon--outfit-water,
.rive-addon--outfit-formal,
.rive-addon--outfit-field { top: 74%; left: 50%; width: 29%; height: 19%; transform: translateX(-50%); display: none; text-align: center; }
.rive-addon--outfit-water { border-radius: 32% 32% 8px 8px; border: 3px solid #0d3a7e; color: var(--robot-accent); background: linear-gradient(145deg, #0d3a7e, #1964b6); font: 900 31px/1 var(--font-en); }
.rive-addon--outfit-formal { clip-path: polygon(50% 0, 92% 20%, 85% 100%, 15% 100%, 8% 20%); color: var(--robot-accent); background: linear-gradient(135deg, rgba(248,251,255,.94) 0 42%, #16315e 43% 57%, rgba(248,251,255,.94) 58%); font: 900 22px/1 var(--font-en); padding-top: 11%; }
.rive-addon--outfit-field { border-radius: 14px 14px 5px 5px; color: #fff; background: repeating-linear-gradient(0deg, #2b6fae 0 21%, #57bd47 22% 31%, #2b6fae 32% 50%); font: 900 27px/1 var(--font-en); padding-top: 7%; }

.robot-studio[data-robot-headwear="cap"] .rive-addon--cap,
.robot-studio[data-robot-headwear="visor"] .rive-addon--visor,
.robot-studio[data-robot-headwear="keffiyeh"] .rive-addon--keffiyeh,
.robot-studio[data-robot-accessory-glasses="true"] .rive-addon--glasses,
.robot-studio[data-robot-accessory-bow="true"] .rive-addon--bow,
.robot-studio[data-robot-accessory-antenna="true"] .rive-addon--antenna,
.robot-studio[data-robot-accessory-badge="true"] .rive-addon--badge,
.robot-studio[data-robot-outfit="water"] .rive-addon--outfit-water,
.robot-studio[data-robot-outfit="formal"] .rive-addon--outfit-formal,
.robot-studio[data-robot-outfit="field"] .rive-addon--outfit-field { display: block; }

.robot-studio[data-theme="dark"] .rive-back-to-gallery { background: rgba(7,31,72,.9); color: #d9eeff; }

/* ============================================================
   AI character creator — the image is generated server-side.
   ============================================================ */
.ai-character-studio .rive-character-stage,
.ai-character-studio .robot-modular-model { display: none !important; }

/* ترتيب مبسط لقسم إنشاء الشخصية */
.ai-character-studio .robot-controls-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ai-character-studio .robot-control-wide,
.ai-character-studio .robot-control-name,
.ai-character-studio .robot-control-gender { grid-column: auto; }
.ai-character-studio .robot-control-name,
.ai-character-studio .robot-control-gender { min-width: 0; }
.ai-character-studio .robot-controls-grid > .robot-control-name,
.ai-character-studio .robot-controls-grid > .robot-control-gender { width: auto; }
.ai-character-studio .robot-compact-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 680px) {
  .ai-character-studio .robot-controls-grid { grid-template-columns: 1fr; }
  .ai-character-studio .robot-compact-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* واجهة منشئ الشخصية الجديدة: كثافة هادئة على الكمبيوتر وتجربة عمود واحد على الهاتف. */
.ai-character-studio .robot-studio-shell { width: min(1280px, 100%); }
.ai-character-studio .robot-creator-layout { grid-template-columns: minmax(0, 1.55fr) minmax(360px, .9fr); gap: 22px; }
.ai-character-studio .robot-builder-card { padding: 22px 24px; }
.ai-character-studio .robot-preview-card { padding: 19px; }
.ai-character-studio .robot-card-intro { margin-bottom: 11px; }
.ai-character-studio .robot-card-intro h2 { font-size: 17px; }
.ai-character-studio .robot-card-intro p { font-size: 10px; }
.ai-character-studio .robot-controls-grid { gap: 9px 13px; margin-top: 0; }
.ai-character-studio .robot-control-title { margin-bottom: 5px; gap: 6px; }
.ai-character-studio .robot-control-title > :last-child { font-size: 14px; }
.ai-character-studio .robot-control-title .robot-step-chip { width: 21px; height: 21px; font-size: 9px; }
.ai-character-studio .robot-choice-row,
.ai-character-studio .robot-compact-options,
.ai-character-studio .robot-accessories-row { gap: 5px; }
.ai-character-studio .robot-choice-btn { min-height: 31px; border-radius: 9px; font-size: 10px; }
.ai-character-studio .robot-choice-btn > span { font-size: 16px; }
.ai-character-studio .robot-visual-option,
.ai-character-studio .robot-accessory-btn { min-height: 41px; padding: 3px 2px; border-radius: 9px; }
.ai-character-studio .robot-visual-option b,
.ai-character-studio .robot-accessory-btn b,
.ai-character-studio .robot-choice-btn b { font-size: 9px; white-space: normal; line-height: 1.1; }
.ai-character-studio .outfit-symbol { font-size: 17px; line-height: 14px; }
.ai-character-studio .robot-color-swatch { width: 22px; height: 22px; }
.ai-character-studio .robot-colors { gap: 8px; padding: 1px; }
.ai-character-studio .robot-persona-block { margin-top: 9px; }
.ai-character-studio .persona-options-row { gap: 5px; }
.ai-character-studio .persona-select-btn { min-height: 34px; padding: 4px 2px; border-radius: 9px; }
.ai-character-studio .btn-generate-ai-character { min-height: 42px; margin-top: 9px; font-size: 13px; }
.ai-character-studio .ai-generation-status { margin: 4px 0 0; font-size: 9px; }
.ai-character-studio .btn-start-chat-hero { margin-top: 12px; min-height: 44px; border-radius: 12px; font-size: 13px; }

@media (min-width: 901px) {
  .ai-character-studio .robot-studio-shell { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
  .ai-character-studio .robot-studio-header { min-height: 50px; }
  .ai-character-studio .robot-brand-logo { width: 185px; }
  .ai-character-studio .robot-studio-heading h1 { font-size: 34px; }
  .ai-character-studio .robot-studio-heading p { font-size: 12px; }
  .ai-character-studio .robot-expo-badge,
  .ai-character-studio .robot-theme-toggle,
  .ai-character-studio .robot-studio .lang-pill-btn { min-height: 32px; padding-block: 5px; }
}

@media (max-width: 900px) {
  .ai-character-studio .robot-studio-shell { width: 100%; }
  .ai-character-studio .robot-creator-layout { grid-template-columns: 1fr; }
  .ai-character-studio .robot-preview-card { order: -1; min-height: 440px; }
}

@media (max-width: 680px) {
  .ai-character-studio .robot-studio-shell { padding: 12px; }
  .ai-character-studio .robot-studio-header { grid-template-columns: 1fr; text-align: center; }
  .ai-character-studio .robot-brand-logo { width: 155px; justify-self: center; }
  .ai-character-studio .robot-header-actions { justify-content: center; flex-wrap: wrap; }
  .ai-character-studio .robot-expo-badge { font-size: 9px; }
  .ai-character-studio .robot-builder-card,
  .ai-character-studio .robot-preview-card { padding: 16px; border-radius: 20px; }
  .ai-character-studio .robot-preview-card { min-height: 380px; order: 0; }
  .ai-character-studio .robot-controls-grid { gap: 12px; }
  .ai-character-studio .robot-control-title > :last-child { font-size: 15px; }
  .ai-character-studio .robot-compact-options { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ai-character-studio .robot-accessories-row,
  .ai-character-studio .persona-options-row { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  .ai-character-studio .robot-visual-option,
  .ai-character-studio .robot-accessory-btn { min-height: 48px; }
}

.ai-character-archetypes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ai-archetype-card {
  min-height: 86px;
  padding: 9px 7px;
  border: 1.5px solid #d7e7fb;
  border-radius: 14px;
  color: #27518b;
  background: linear-gradient(145deg, #fafdff, #ecf6ff);
  font-family: inherit;
  cursor: pointer;
  transition: .2s ease;
}
.ai-archetype-card:hover { border-color: #81bdff; transform: translateY(-1px); }
.ai-archetype-card.active { border-color: var(--robot-accent); background: linear-gradient(145deg, #fff, #e5f6ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--robot-accent) 15%, transparent); }
.ai-archetype-card b,
.ai-archetype-card small { display: block; }
.ai-archetype-card b { margin-top: 2px; font-size: 11px; font-weight: 900; color: #0c397a; }
.ai-archetype-card small { margin-top: 2px; font-size: 8px; line-height: 1.35; color: #7292bd; }
.ai-archetype-icon { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #0b3b89, var(--robot-accent)); font: 900 17px/1 var(--font-en); }

.ai-prompt-block { margin-top: 10px; }
.ai-character-prompt {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 65px;
  resize: vertical;
  padding: 10px 12px;
  border: 1.5px solid #d7e7fb;
  border-radius: 12px;
  color: #113876;
  background: #fbfdff;
  font: 600 11px/1.65 var(--font-main);
  outline: 0;
}
.ai-character-prompt:focus { border-color: var(--robot-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--robot-accent) 13%, transparent); }
.ai-prompt-help { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; color: #7591b6; font-size: 9px; line-height: 1.45; }
.ai-prompt-help span:last-child { direction: ltr; white-space: nowrap; }

.btn-generate-ai-character {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 47px;
  margin-top: 11px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(110deg, #082d78, #086de2 55%, #13b8ff);
  box-shadow: 0 10px 20px rgba(8, 97, 205, .2);
  font: 800 13px var(--font-main);
  cursor: pointer;
  transition: .2s ease;
}
.btn-generate-ai-character:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 25px rgba(8, 97, 205, .26); }
.btn-generate-ai-character:disabled { cursor: progress; opacity: .7; }
.ai-generate-icon { font: 900 20px/1 var(--font-en); color: #d5f6ff; }
.ai-model-pill { padding: 3px 7px; border: 1px solid rgba(255,255,255,.26); border-radius: 999px; background: rgba(255,255,255,.13); direction: ltr; font: 800 8px/1.25 var(--font-en); }
.ai-generation-status { min-height: 18px; margin: 6px 4px 3px; color: #6f8eae; font-size: 10px; font-weight: 700; text-align: center; }
.ai-generation-status[data-state="success"] { color: #168251; }
.ai-generation-status[data-state="error"] { color: #b04757; }
.ai-generation-status[data-state="loading"] { color: #0b69cc; }

.ai-character-preview {
  position: absolute;
  z-index: 8;
  inset: 2% 1% -4%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 32%, rgba(255,255,255,.98), rgba(220,241,255,.88) 54%, rgba(202,230,251,.74));
  box-shadow: inset 0 0 0 1px rgba(71,143,209,.12);
}
.ai-character-preview::before { content: ''; position: absolute; inset: 9%; border: 1px solid color-mix(in srgb, var(--robot-accent) 28%, transparent); border-radius: 50%; opacity: .65; }
.ai-character-preview.has-image { background: #e9f7ff; }
.ai-character-placeholder,
.ai-character-loading { position: relative; z-index: 2; display: grid; justify-items: center; max-width: 245px; padding: 25px; color: #25558f; text-align: center; }
.ai-character-loading[hidden] { display: none; }
.ai-character-placeholder strong,
.ai-character-loading strong { margin-top: 11px; font-size: 14px; font-weight: 900; }
.ai-character-placeholder p,
.ai-character-loading small { margin: 6px 0 0; color: #6d91ba; font-size: 10px; line-height: 1.7; }
.ai-placeholder-spark { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid #a8d9ff; border-radius: 17px; color: var(--robot-accent); background: rgba(255,255,255,.83); box-shadow: 0 10px 22px rgba(7,79,164,.13); font: 900 30px/1 var(--font-en); }
.ai-character-image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.18)) saturate(1.04) contrast(1.02);
}
.ai-preview-model-tag { position: absolute; z-index: 3; right: 11px; bottom: 11px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.75); border-radius: 999px; color: #174e91; background: rgba(255,255,255,.86); box-shadow: 0 6px 15px rgba(5,52,122,.12); direction: ltr; font: 800 9px var(--font-en); }
.ai-character-loading { min-width: 190px; }
.ai-loader-ring { width: 39px; height: 39px; border: 4px solid #c9ecff; border-top-color: var(--robot-accent); border-radius: 50%; animation: ai-character-spin .8s linear infinite; }
@keyframes ai-character-spin { to { transform: rotate(360deg); } }

.generated-chat-avatar { display: block; object-fit: cover; border: 2px solid #d8edff; border-radius: 50%; background: #eaf6ff; }
.generated-chat-avatar.talking { animation: generated-avatar-talk .75s ease-in-out infinite alternate; }
@keyframes generated-avatar-talk { to { transform: scale(1.06); } }

.ai-character-studio .btn-start-chat-hero:disabled { cursor: not-allowed; opacity: .52; filter: grayscale(.15); }
.robot-studio[data-theme="dark"] .ai-archetype-card,
.robot-studio[data-theme="dark"] .ai-character-prompt { border-color: #285990; color: #d8eeff; background: #0e326a; }
.robot-studio[data-theme="dark"] .ai-archetype-card b { color: #eef8ff; }
.robot-studio[data-theme="dark"] .ai-character-preview { border-color: #24558c; background: radial-gradient(circle at 50% 30%, #17477c, #092954 68%); }
.robot-studio[data-theme="dark"] .ai-character-placeholder,
.robot-studio[data-theme="dark"] .ai-character-loading { color: #e3f2ff; }

@media (max-width: 680px) {
  .ai-character-archetypes { gap: 6px; }
  .ai-archetype-card { min-height: 77px; padding-inline: 4px; }
  .ai-archetype-card small { font-size: 7px; }
}

/* ============================================================
   PMTECH Minimal AI Avatar Creator (Stitch Design System)
   Pure Minimalist Mobile & Kiosk Experience - RTL
   ============================================================ */

.stitch-creator-app {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F1F5F9;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  color: #0F172A;
  direction: rtl;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.stitch-container {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  max-height: 890px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(11, 37, 69, 0.12), 0 0 1px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
  .stitch-container {
    border-radius: 36px;
    border: 1px solid #E2E8F0;
    margin: 16px auto;
  }
}

/* Global SVG Icons Sizing Utilities */
.stitch-container svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.w-3, .h-3 { width: 12px !important; height: 12px !important; max-width: 12px; max-height: 12px; }
.w-3\.5, .h-3\.5 { width: 14px !important; height: 14px !important; max-width: 14px; max-height: 14px; }
.w-4, .h-4 { width: 16px !important; height: 16px !important; max-width: 16px; max-height: 16px; }
.w-5, .h-5 { width: 20px !important; height: 20px !important; max-width: 20px; max-height: 20px; }
.w-6, .h-6 { width: 24px !important; height: 24px !important; max-width: 24px; max-height: 24px; }
.w-8, .h-8 { width: 32px !important; height: 32px !important; max-width: 32px; max-height: 32px; }

.stitch-btn-primary svg,
.stitch-btn-secondary svg,
.stitch-nav-back svg,
.stitch-card-arrow svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

/* Screens Visibility Controller */
.stitch-screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.stitch-screen.is-active {
  display: flex;
  animation: stitchFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stitchFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header & Top Bar */
.stitch-topbar {
  padding: 16px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.stitch-brand .stitch-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.stitch-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stitch-theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-theme-toggle:hover {
  border-color: #CBD5E1;
  color: #0066FF;
}

.stitch-lang-wrapper {
  position: relative;
}

.stitch-lang-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #0B2545;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-lang-btn:hover {
  border-color: #0066FF;
  color: #0066FF;
}

.stitch-lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.stitch-lang-menu button {
  padding: 8px 14px;
  text-align: right;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s;
}

.stitch-lang-menu button:hover,
.stitch-lang-menu button.active {
  background: #EFF6FF;
  color: #0066FF;
}

/* Secondary Navigation Bar (Back, Logo, Step) */
.stitch-nav-bar {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F1F5F9;
  flex-shrink: 0;
}

.stitch-nav-back {
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}

.stitch-nav-back:hover {
  color: #0066FF;
}

.stitch-mini-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.stitch-mini-logo b {
  color: #0B2545;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.stitch-mini-logo small {
  color: #0066FF;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 1px;
}

.stitch-step-indicator {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748B;
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 20px;
}

.stitch-badge-verified {
  font-size: 11px;
  font-weight: 700;
  color: #10B981;
  background: #ECFDF5;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Body Scroll & Layout */
.stitch-body-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
}

.stitch-heading h2 {
  font-size: 20px;
  font-weight: 900;
  color: #0B2545;
  line-height: 1.3;
  margin-bottom: 4px;
}

.stitch-heading p {
  font-size: 12.5px;
  color: #64748B;
  font-weight: 500;
  line-height: 1.5;
}

/* Page 1 Intro Styles */
.stitch-intro-content {
  flex: 1;
  padding: 10px 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stitch-intro-heading .stitch-title {
  font-size: 24px;
  font-weight: 900;
  color: #0B2545;
  line-height: 1.3;
  margin-bottom: 6px;
}

.stitch-intro-heading .stitch-subtitle {
  font-size: 13px;
  color: #64748B;
  font-weight: 500;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

.stitch-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px auto 22px;
  padding: 5px 14px;
  background: #EFF6FF;
  color: #0066FF;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

/* Cards List */
.stitch-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stitch-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.stitch-card-item:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
}

.stitch-card-item.is-selected {
  border-color: #0066FF;
  border-width: 2px;
  background: #F0F6FF;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.08);
}

.stitch-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #F1F5F9;
  color: #0066FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.stitch-card-item.is-selected .stitch-card-icon {
  background: #0066FF;
  color: #FFFFFF;
}

.stitch-card-body {
  flex: 1;
  padding: 0 14px;
  text-align: right;
}

.stitch-card-body h3 {
  font-size: 15px;
  font-weight: 800;
  color: #0B2545;
  margin-bottom: 2px;
}

.stitch-card-body p {
  font-size: 11.5px;
  color: #64748B;
  font-weight: 500;
  line-height: 1.4;
}

.stitch-card-arrow {
  color: #CBD5E1;
  transition: all 0.15s;
}

.stitch-card-item.is-selected .stitch-card-arrow {
  color: #0066FF;
  transform: translateX(-2px);
}

/* Footer & Buttons */
.stitch-footer-action {
  padding: 12px 20px 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
}

.stitch-btn-primary {
  width: 100%;
  height: 50px;
  background: #0066FF;
  color: #FFFFFF;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.28);
  transition: all 0.15s;
}

.stitch-btn-primary:hover {
  background: #0052CC;
  box-shadow: 0 6px 18px rgba(0, 102, 255, 0.38);
  transform: translateY(-1px);
}

.stitch-btn-primary:active {
  transform: translateY(0);
}

.stitch-btn-secondary {
  width: 100%;
  height: 44px;
  background: #F8FAFC;
  color: #475569;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-btn-secondary:hover {
  border-color: #CBD5E1;
  color: #0B2545;
}

.stitch-bottom-slogan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #94A3B8;
  font-weight: 600;
  padding: 0 4px;
}

.stitch-bottom-slogan .brand-code {
  letter-spacing: 0.5px;
  color: #64748B;
}

/* Form Components */
.stitch-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stitch-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stitch-field-label {
  font-size: 12px;
  font-weight: 800;
  color: #0B2545;
  text-align: right;
}

.stitch-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.stitch-text-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #0B2545;
  font-family: inherit;
  background: #FFFFFF;
  transition: all 0.15s;
}

.stitch-text-input:focus {
  outline: none;
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.stitch-input-action-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #F1F5F9;
  color: #0066FF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-input-action-btn:hover {
  background: #E2E8F0;
}

/* Radio Choice Cards */
.stitch-radio-grid {
  display: grid;
  gap: 8px;
}

.stitch-radio-grid.two { grid-template-columns: repeat(2, 1fr); }
.stitch-radio-grid.three { grid-template-columns: repeat(3, 1fr); }
.stitch-radio-grid.four { grid-template-columns: repeat(4, 1fr); }

.stitch-choice-card {
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  min-height: 48px;
  transition: all 0.15s;
}

.stitch-choice-card:hover {
  border-color: #CBD5E1;
}

.stitch-choice-card.is-selected {
  border-color: #0066FF;
  border-width: 2px;
  background: #F0F6FF;
}

.stitch-choice-title {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  transition: color 0.15s;
}

.stitch-choice-card.is-selected .stitch-choice-title {
  color: #0066FF;
}

.stitch-choice-sub {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 600;
}

.stitch-check-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.stitch-choice-card.is-selected .stitch-check-circle {
  border-color: #0066FF;
}

.stitch-check-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0066FF;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s;
}

.stitch-choice-card.is-selected .stitch-check-dot {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   مؤشر نسبي للعمر (Relative Age Range Slider)
   ============================================================ */
.stitch-age-slider-group {
  margin-bottom: 6px;
}

.stitch-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stitch-age-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: #0066FF;
  box-shadow: 0 2px 6px rgba(0, 102, 255, 0.08);
  transition: all 0.2s ease;
}

.stitch-age-badge .age-num {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 900;
  color: #0066FF;
  line-height: 1;
}

.stitch-age-badge .age-unit {
  font-size: 11px;
  font-weight: 700;
  color: #1D4ED8;
}

.stitch-age-badge .age-dot {
  color: #93C5FD;
  font-size: 10px;
}

.stitch-age-badge .age-label {
  font-size: 12px;
  font-weight: 800;
  color: #0B2545;
}

.stitch-slider-wrapper {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.15s ease;
}

.stitch-slider-wrapper:focus-within {
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.stitch-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to left, #0066FF 0%, #0066FF var(--slider-fill, 21.28%), #E2E8F0 var(--slider-fill, 21.28%), #E2E8F0 100%);
  cursor: pointer;
  margin: 6px 0;
  transition: background 0.08s ease;
}

/* Chrome / Safari / Edge thumb */
.stitch-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3.5px solid #0066FF;
  box-shadow: 0 3px 8px rgba(0, 102, 255, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stitch-range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.18);
  box-shadow: 0 5px 14px rgba(0, 102, 255, 0.5);
}

/* Firefox thumb */
.stitch-range-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3.5px solid #0066FF;
  box-shadow: 0 3px 8px rgba(0, 102, 255, 0.35);
  cursor: grab;
  transition: transform 0.15s ease;
}

.stitch-range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.18);
}

.stitch-slider-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #94A3B8;
  padding: 0 2px;
}

/* Skin Tone Swatches */
.stitch-swatches-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
}

.stitch-swatch-item {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--swatch);
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.stitch-swatch-item:hover {
  transform: scale(1.06);
}

.stitch-swatch-item.is-selected {
  outline: 2.5px solid #0066FF;
  outline-offset: 2px;
  box-shadow: 0 4px 10px rgba(0, 102, 255, 0.25);
}

/* Tabs Bar */
.stitch-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: #F1F5F9;
  border-radius: 14px;
  margin: 10px 20px 0;
}

.stitch-tab-btn {
  padding: 8px 4px;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-tab-btn.is-active {
  background: #FFFFFF;
  color: #0066FF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.stitch-tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.stitch-tab-pane.is-active {
  display: flex;
}

/* Smart Mode Textarea & Chips */
.stitch-smart-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stitch-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0B2545;
  font-family: inherit;
  resize: none;
  line-height: 1.6;
  transition: all 0.15s;
}

.stitch-textarea:focus {
  outline: none;
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.stitch-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips-title {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
}

.stitch-chip {
  padding: 6px 12px;
  background: #EFF6FF;
  color: #0066FF;
  border: 1px solid #BFDBFE;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.stitch-chip:hover {
  background: #DBEAFE;
}

.stitch-grid-help {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* Page 4: Final Screen Showcase */
.stitch-showcase-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 24px;
}

.stitch-avatar-frame {
  width: 150px;
  height: 150px;
  border-radius: 24px;
  overflow: hidden;
  background: #FFFFFF;
  border: 3px solid #FFFFFF;
  box-shadow: 0 10px 25px rgba(0, 102, 255, 0.16);
  position: relative;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.stitch-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.stitch-live-status-dot {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
}

.stitch-showcase-info .stitch-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #0066FF;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stitch-char-title {
  font-size: 22px;
  font-weight: 900;
  color: #0B2545;
  margin: 2px 0;
}

.stitch-char-role {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 6px;
}

.stitch-char-desc {
  font-size: 11.5px;
  color: #475569;
  font-weight: 500;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* Capabilities List (Clean minimal without subtext) */
.stitch-capabilities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stitch-capability-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.stitch-capability-card:hover {
  border-color: #0066FF;
  background: #F0F6FF;
  transform: translateY(-1px);
}

.stitch-capability-card .cap-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #EFF6FF;
  color: #0066FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stitch-capability-card .cap-text {
  flex: 1;
  text-align: right;
}

.stitch-capability-card .cap-text b {
  font-size: 13.5px;
  font-weight: 800;
  color: #0B2545;
}

.stitch-capability-card .cap-arrow {
  color: #94A3B8;
  display: flex;
  align-items: center;
}

/* VIP Gift Announcement Banner (Screen 1 & 4) */
.stitch-gift-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
  border: 1.5px solid #FCD34D;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 6px 0 10px;
  color: #92400E;
}

.stitch-gift-callout .gift-callout-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #F59E0B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stitch-gift-callout-text {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.35;
}

.stitch-gift-callout-text b {
  font-size: 13px;
  font-weight: 900;
  color: #78350F;
}

.stitch-gift-callout-text span {
  font-size: 11px;
  font-weight: 600;
  color: #B45309;
}

/* Dedicated Screen 5: VIP Gift Voucher Card */
.stitch-gift-voucher-box {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 24px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(11, 37, 69, 0.08);
}

.stitch-gift-voucher-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #F59E0B, #0066FF, #10B981);
}

.voucher-ticket-badge {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 38px;
  font-weight: 900;
  color: #0066FF;
  letter-spacing: 2px;
  margin: 6px 0;
  line-height: 1;
}

.voucher-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  margin: 8px auto 14px;
}

.voucher-status-pill.pending {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.voucher-status-pill.delivered {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.voucher-details-grid {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  font-size: 12.5px;
  text-align: right;
}

.voucher-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voucher-detail-row span {
  color: #64748B;
  font-weight: 600;
}

.voucher-detail-row b {
  color: #0B2545;
  font-weight: 800;
}

/* Loading Overlay */
.stitch-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stitch-loading-overlay.is-active {
  display: flex !important;
  animation: stitchFadeIn 0.2s ease-out;
}

.stitch-loading-overlay[hidden],
.stitch-loading-overlay.is-hidden {
  display: none !important;
}

.stitch-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 280px;
  gap: 12px;
}

.stitch-spinner-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #DBEAFE;
  border-top-color: #0066FF;
  animation: stitchSpin 0.8s linear infinite;
}

@keyframes stitchSpin {
  to { transform: rotate(360deg); }
}

.stitch-loading-card b {
  font-size: 15px;
  font-weight: 900;
  color: #0B2545;
}

.stitch-loading-card p {
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.5;
}

.stitch-skip-loading {
  margin-top: 6px;
  background: transparent;
  border: 1px solid #CBD5E1;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stitch-skip-loading:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* Choice Card Illustrative Icon */
.stitch-choice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.stitch-choice-icon svg {
  width: 20px;
  height: 20px;
}

.stitch-choice-card.is-selected .stitch-choice-icon {
  color: #0066FF;
  transform: scale(1.06);
}

/* Field Error */
.stitch-field-error {
  color: #EF4444;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 5px;
  line-height: 1.4;
  text-align: right;
}

.stitch-text-input.has-error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ============================================================
   Dark Theme Support (متناسق ومريح للعين 100%)
   ============================================================ */
.stitch-creator-app[data-theme="dark"] {
  background-color: #081225;
  color: #F8FAFC;
}

.stitch-creator-app[data-theme="dark"] .stitch-container {
  background: #0D1B36;
  border-color: #1E2E4E;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.stitch-creator-app[data-theme="dark"] .stitch-theme-toggle,
.stitch-creator-app[data-theme="dark"] .stitch-lang-btn {
  background: #152648;
  border-color: #243B66;
  color: #E2E8F0;
}

.stitch-creator-app[data-theme="dark"] .stitch-theme-toggle:hover,
.stitch-creator-app[data-theme="dark"] .stitch-lang-btn:hover {
  background: #1E3563;
  border-color: #38BDF8;
  color: #FFFFFF;
}

.stitch-creator-app[data-theme="dark"] .stitch-lang-menu {
  background: #111F3C;
  border-color: #243B66;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stitch-creator-app[data-theme="dark"] .stitch-lang-menu button {
  color: #CBD5E1;
}

.stitch-creator-app[data-theme="dark"] .stitch-lang-menu button:hover,
.stitch-creator-app[data-theme="dark"] .stitch-lang-menu button.active {
  background: #0066FF;
  color: #FFFFFF;
}

.stitch-creator-app[data-theme="dark"] .stitch-badge-pill,
.stitch-creator-app[data-theme="dark"] .stitch-badge-verified,
.stitch-creator-app[data-theme="dark"] .stitch-step-indicator {
  background: #152648;
  border-color: #243B66;
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-nav-back {
  background: #152648;
  border-color: #243B66;
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-nav-back:hover {
  background: #1E3563;
  color: #FFFFFF;
}

.stitch-creator-app[data-theme="dark"] .stitch-title,
.stitch-creator-app[data-theme="dark"] .stitch-heading h2,
.stitch-creator-app[data-theme="dark"] .stitch-mini-logo b,
.stitch-creator-app[data-theme="dark"] .stitch-card-body h3,
.stitch-creator-app[data-theme="dark"] .stitch-field-label,
.stitch-creator-app[data-theme="dark"] .stitch-choice-title,
.stitch-creator-app[data-theme="dark"] .stitch-char-title,
.stitch-creator-app[data-theme="dark"] .stitch-capability-card .cap-text b,
.stitch-creator-app[data-theme="dark"] .stitch-loading-card b {
  color: #F8FAFC;
}

.stitch-creator-app[data-theme="dark"] .stitch-subtitle,
.stitch-creator-app[data-theme="dark"] .stitch-heading p,
.stitch-creator-app[data-theme="dark"] .stitch-card-body p,
.stitch-creator-app[data-theme="dark"] .stitch-char-desc,
.stitch-creator-app[data-theme="dark"] .stitch-choice-sub,
.stitch-creator-app[data-theme="dark"] .stitch-bottom-slogan {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-card-item,
.stitch-creator-app[data-theme="dark"] .stitch-choice-card,
.stitch-creator-app[data-theme="dark"] .stitch-capability-card {
  background: #132342;
  border-color: #243B66;
}

.stitch-creator-app[data-theme="dark"] .stitch-card-item:hover,
.stitch-creator-app[data-theme="dark"] .stitch-choice-card:hover,
.stitch-creator-app[data-theme="dark"] .stitch-capability-card:hover {
  background: #182C52;
  border-color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-card-item.is-selected,
.stitch-creator-app[data-theme="dark"] .stitch-choice-card.is-selected {
  border-color: #38BDF8;
  background: #1A3464;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.stitch-creator-app[data-theme="dark"] .stitch-choice-card.is-selected .stitch-choice-title {
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-choice-icon {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-choice-card.is-selected .stitch-choice-icon {
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-card-icon {
  background: #1E3563;
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-text-input,
.stitch-creator-app[data-theme="dark"] .stitch-textarea {
  background: #111F3C;
  border-color: #243B66;
  color: #F8FAFC;
}

.stitch-creator-app[data-theme="dark"] .stitch-text-input:focus,
.stitch-creator-app[data-theme="dark"] .stitch-textarea:focus {
  border-color: #38BDF8;
  background: #152648;
}

.stitch-creator-app[data-theme="dark"] .stitch-text-input::placeholder,
.stitch-creator-app[data-theme="dark"] .stitch-textarea::placeholder {
  color: #64748B;
}

.stitch-creator-app[data-theme="dark"] .stitch-field-error {
  color: #F87171;
}

.stitch-creator-app[data-theme="dark"] .stitch-tabs-bar {
  background: #111F3C;
  border: 1px solid #243B66;
}

.stitch-creator-app[data-theme="dark"] .stitch-tab-btn {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-tab-btn.is-active {
  background: #0D1B36;
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-showcase-card {
  background: #111F3C;
  border-color: #243B66;
}

.stitch-creator-app[data-theme="dark"] .stitch-avatar-frame {
  background: #0D1B36;
  border-color: #243B66;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.stitch-creator-app[data-theme="dark"] .stitch-kicker {
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-char-role {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-capability-card .cap-icon {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-capability-card .cap-arrow {
  color: #64748B;
}

/* VIP Gift Callout in Dark Mode */
.stitch-creator-app[data-theme="dark"] .stitch-gift-callout {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(180, 83, 9, 0.1) 100%);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FDE68A;
}

.stitch-creator-app[data-theme="dark"] .stitch-gift-callout b {
  color: #FBBF24;
}

.stitch-creator-app[data-theme="dark"] .stitch-gift-callout small,
.stitch-creator-app[data-theme="dark"] .stitch-gift-callout-text span {
  color: #FDE68A;
}

.stitch-creator-app[data-theme="dark"] .stitch-gift-callout .gift-callout-arrow {
  color: #FBBF24;
}

/* VIP Gift Voucher Screen 5 in Dark Mode */
.stitch-creator-app[data-theme="dark"] .stitch-gift-voucher-box {
  background: #111F3C;
  border-color: #243B66;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.stitch-creator-app[data-theme="dark"] .voucher-ticket-badge {
  color: #60A5FA;
}

.stitch-creator-app[data-theme="dark"] .voucher-status-pill.pending {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #FBBF24;
}

.stitch-creator-app[data-theme="dark"] .voucher-status-pill.delivered {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34D399;
}

.stitch-creator-app[data-theme="dark"] .voucher-details-grid {
  background: #0D1B36;
  border-color: #1E2E4E;
}

.stitch-creator-app[data-theme="dark"] .voucher-detail-row span {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .voucher-detail-row b {
  color: #F8FAFC;
}

.stitch-creator-app[data-theme="dark"] .voucher-barcode svg {
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-btn-secondary {
  background: #152648;
  border-color: #243B66;
  color: #E2E8F0;
}

.stitch-creator-app[data-theme="dark"] .stitch-btn-secondary:hover {
  background: #1E3563;
  border-color: #38BDF8;
  color: #FFFFFF;
}

.stitch-creator-app[data-theme="dark"] .stitch-footer-action,
.stitch-creator-app[data-theme="dark"] .stitch-nav-bar {
  background: #0D1B36;
  border-color: #1E2E4E;
}

.stitch-creator-app[data-theme="dark"] .stitch-loading-overlay {
  background: rgba(13, 27, 54, 0.96);
}

.stitch-creator-app[data-theme="dark"] .stitch-spinner-ring {
  border-color: #1E3563;
  border-top-color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-skip-loading {
  border-color: #243B66;
  color: #94A3B8;
}

.stitch-creator-app[data-theme="dark"] .stitch-skip-loading:hover {
  background: #152648;
  color: #F8FAFC;
}

/* Dark Mode Age Range Slider */
.stitch-creator-app[data-theme="dark"] .stitch-slider-wrapper {
  background: #111F3C;
  border-color: #243B66;
}

.stitch-creator-app[data-theme="dark"] .stitch-slider-wrapper:focus-within {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.stitch-creator-app[data-theme="dark"] .stitch-age-badge {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-age-badge .age-num {
  color: #38BDF8;
}

.stitch-creator-app[data-theme="dark"] .stitch-age-badge .age-unit {
  color: #7DD3FC;
}

.stitch-creator-app[data-theme="dark"] .stitch-age-badge .age-dot {
  color: #0284C7;
}

.stitch-creator-app[data-theme="dark"] .stitch-age-badge .age-label {
  color: #F8FAFC;
}

.stitch-creator-app[data-theme="dark"] .stitch-range-slider {
  background: linear-gradient(to left, #38BDF8 0%, #38BDF8 var(--slider-fill, 21.28%), #243B66 var(--slider-fill, 21.28%), #243B66 100%);
}

.stitch-creator-app[data-theme="dark"] .stitch-range-slider::-webkit-slider-thumb {
  background: #0D1B36;
  border-color: #38BDF8;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4);
}

.stitch-creator-app[data-theme="dark"] .stitch-range-slider::-moz-range-thumb {
  background: #0D1B36;
  border-color: #38BDF8;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4);
}

.stitch-creator-app[data-theme="dark"] .stitch-slider-scale {
  color: #64748B;
}

/* ============================================================
   أزرار الهدية والدعم الفني في الشات وبطاقات الاستشارة الميدانية
   ============================================================ */
.btn-chat-gift-highlight {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid #F59E0B;
  color: #92400E;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-chat-gift-highlight:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  background: #FDE68A;
}

.btn-chat-support-highlight {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1.5px solid #3B82F6;
  color: #1D4ED8;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-chat-support-highlight:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
  background: #BFDBFE;
}

/* بطاقة استئناف الجلسة المحفوظة بالكوكيز (30 يوماً) */
.stitch-resume-session-box {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1.5px solid #86EFAC;
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 16px 0;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.12);
  animation: slideInDown 0.3s ease;
}
.stitch-resume-session-box .resume-avatar-preview {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #22C55E;
  background: #FFFFFF;
  flex-shrink: 0;
}
.stitch-resume-session-box .resume-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stitch-resume-session-box .resume-info {
  flex: 1;
  text-align: right;
}
.stitch-resume-session-box .resume-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #15803D;
  background: rgba(34, 197, 94, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 3px;
}
.stitch-resume-session-box h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
}
.stitch-resume-session-box p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.35;
}
.stitch-resume-session-box .btn-resume-chat {
  background: #16A34A;
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
  transition: all 0.2s;
}
.stitch-resume-session-box .btn-resume-chat:hover {
  background: #15803D;
  transform: translateY(-1px);
}

/* بطاقة الهدية التفاعلية داخل رسائل الشات */
.inchat-gift-card {
  background: #FFFFFF;
  border: 2px solid #F59E0B;
  border-radius: 18px;
  padding: 16px;
  margin-top: 6px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.12);
  text-align: right;
  direction: rtl;
}
.inchat-gift-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #FEF3C7;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.inchat-gift-icon {
  font-size: 26px;
  line-height: 1;
}
.inchat-gift-title {
  flex: 1;
}
.inchat-gift-title b {
  display: block;
  font-size: 14.5px;
  color: #92400E;
}
.inchat-gift-title small {
  font-size: 11.5px;
  color: #78350F;
}
.inchat-gift-ticket {
  background: #FEF3C7;
  color: #B45309;
  border: 1.5px dashed #F59E0B;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.inchat-gift-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ECFDF5;
  color: #047857;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 10px;
}
.live-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 1.8s infinite;
}
.inchat-gift-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  margin-bottom: 12px;
}
.inchat-gift-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #F1F5F9;
  padding-bottom: 4px;
}
.inchat-gift-row span {
  color: #64748B;
}
.inchat-gift-row b {
  color: #0F172A;
}
.inchat-gift-phone-prompt {
  background: #FFFBEB;
  border: 1px dashed #FDE68A;
  border-radius: 12px;
  padding: 10px;
  margin: 6px 0;
}
.inchat-gift-phone-prompt span {
  font-size: 11.5px;
  font-weight: 700;
  color: #92400E;
  display: block;
  margin-bottom: 6px;
}
.inchat-gift-input-wrap {
  display: flex;
  gap: 8px;
}
.inchat-input {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #FCD34D;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
}
.btn-inchat-save-phone {
  background: #F59E0B;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.inchat-gift-footer {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn-gift-view-full {
  flex: 1;
  background: #0066FF;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
}
.btn-gift-share-wa {
  flex: 1;
  background: #10B981;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* بطاقة الدعم الفني داخل الشات */
.inchat-support-card {
  background: #FFFFFF;
  border: 2px solid #3B82F6;
  border-radius: 18px;
  padding: 16px;
  margin-top: 6px;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
  text-align: right;
  direction: rtl;
}
.inchat-support-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #EFF6FF;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.support-tool-icon {
  font-size: 24px;
  line-height: 1;
}
.inchat-support-header b {
  display: block;
  font-size: 14.5px;
  color: #1E3A8A;
}
.inchat-support-header small {
  font-size: 11.5px;
  color: #2563EB;
}
.inchat-support-desc {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.5;
  margin: 6px 0 12px 0;
}
.inchat-support-actions {
  display: flex;
  gap: 8px;
}
.btn-support-wa-chat {
  flex: 1;
  background: #10B981;
  color: #FFFFFF;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}
.btn-support-details {
  flex: 1;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

/* نافذة الدعم الفني المنبثقة (Modal) */
.chat-support-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  direction: rtl;
}
.chat-support-card {
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: scaleUp 0.25s ease;
}
.support-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.support-badge {
  display: inline-block;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.support-title-wrap h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0F172A;
}
.support-title-wrap p {
  margin: 4px 0 0 0;
  font-size: 12.5px;
  color: #64748B;
}
.btn-close-support {
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.support-location-banner {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.loc-pin {
  font-size: 22px;
}
.loc-text b {
  display: block;
  font-size: 13px;
  color: #1E3A8A;
}
.loc-text small {
  font-size: 11.5px;
  color: #2563EB;
}
.support-team-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.support-member-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.member-avatar {
  font-size: 26px;
}
.member-meta {
  flex: 1;
}
.member-meta b {
  display: block;
  font-size: 13.5px;
  color: #0F172A;
}
.member-role {
  display: block;
  font-size: 11.5px;
  color: #64748B;
}
.member-status-live {
  font-size: 10.5px;
  color: #16A34A;
  font-weight: 700;
}
.member-actions {
  display: flex;
  gap: 6px;
}
.btn-support-wa {
  background: #10B981;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 800;
}
.btn-support-call {
  background: #0066FF;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 800;
}
.support-features-callout {
  background: #F0FDF4;
  border: 1px dashed #86EFAC;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.feature-item {
  font-size: 12px;
  color: #166534;
  line-height: 1.45;
}
.support-modal-actions {
  text-align: center;
}
.btn-modal-dismiss {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* التوافق مع الوضع المظلم */
.stitch-creator-app[data-theme="dark"] .btn-chat-gift-highlight {
  background: #78350F;
  border-color: #F59E0B;
  color: #FEF3C7;
}
.stitch-creator-app[data-theme="dark"] .btn-chat-support-highlight {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #DBEAFE;
}
.stitch-creator-app[data-theme="dark"] .stitch-resume-session-box {
  background: #064E3B;
  border-color: #059669;
}
.stitch-creator-app[data-theme="dark"] .stitch-resume-session-box h4 {
  color: #ECFDF5;
}
.stitch-creator-app[data-theme="dark"] .stitch-resume-session-box p {
  color: #A7F3D0;
}
.stitch-creator-app[data-theme="dark"] .inchat-gift-card,
.stitch-creator-app[data-theme="dark"] .inchat-support-card,
.stitch-creator-app[data-theme="dark"] .chat-support-card {
  background: #0F172A;
  border-color: #334155;
  color: #F8FAFC;
}
.stitch-creator-app[data-theme="dark"] .support-title-wrap h3,
.stitch-creator-app[data-theme="dark"] .member-meta b {
  color: #F8FAFC;
}
.stitch-creator-app[data-theme="dark"] .support-location-banner {
  background: #1E293B;
  border-color: #334155;
}
.stitch-creator-app[data-theme="dark"] .support-member-card {
  background: #1E293B;
  border-color: #334155;
}



/* صف رقم وكود الهدية في تذكرة استلام الهدايا */
.voucher-gift-code-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 10px 0 4px; padding: 9px 14px; border-radius: 12px; background: rgba(20, 184, 166, 0.1); border: 1px dashed rgba(13, 148, 136, 0.45); }
.voucher-gift-code-row span { font-size: 12px; font-weight: 700; color: #475569; display: inline-flex; align-items: center; gap: 5px; }
.voucher-gift-code-row b { font-size: 14px; font-weight: 900; color: #0F766E; font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.5px; }
