/* ========================================
   عاداتي - Shared Styles
   Liquid Glass on Antique Paper Theme
   ======================================== */

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/cairo-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/cairo-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/cairo-bold.woff2') format('woff2');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* CSS Variables - Light Mode */
:root {
  --bg-primary: #F4EAD3;
  --bg-primary-rgb: 244, 234, 211;
  --primary: #2A5A4A;
  --primary-rgb: 42, 90, 74;
  --secondary: #704D36;
  --secondary-rgb: 112, 77, 54;
  --tertiary: #C08A3E;
  --tertiary-rgb: 192, 138, 62;
  --surface: #FFFFFF;
  --surface-rgb: 255, 255, 255;
  --surface-variant: #FAF8F5;
  --surface-variant-rgb: 250, 248, 245;
  --on-background: #3D3328;
  --on-surface: #3D3328;
  --on-surface-variant: #5C4E3D;
  --outline: rgba(0, 0, 0, 0.25);
  --outline-variant: rgba(255, 255, 255, 0.5);
}

/* CSS Variables - Dark Mode */
[data-theme="dark"] {
  --bg-primary: #161512;
  --bg-primary-rgb: 22, 21, 18;
  --primary: #7FC6A4;
  --primary-rgb: 127, 198, 164;
  --secondary: #D4B196;
  --secondary-rgb: 212, 177, 150;
  --tertiary: #E5C158;
  --tertiary-rgb: 229, 193, 88;
  --surface: #22201C;
  --surface-rgb: 34, 32, 28;
  --surface-variant: #2E2B26;
  --surface-variant-rgb: 46, 43, 38;
  --on-background: #EDE9E0;
  --on-surface: #EDE9E0;
  --on-surface-variant: #CCC5B5;
  --outline: #4A463F;
  --outline-variant: #5C574F;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* الترويسة ثابتة فوق المحتوى؛ بدون هذه الحاشية يستقر عنوان القسم
     تحتها عند القفز إلى مرساة مثل #faq أو #download */
  scroll-padding-top: 96px;
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-primary);
  color: var(--on-background);
  line-height: 1.6;
  /* الزخارف (blob) مطلقة الموضع؛ بجعل body مرجعاً لها يقصّها overflow-x
     أدناه، وإلا تجاوزت حافة الشاشة وانزلقت الصفحة أفقياً على الجوال. */
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glass Morphism */
.glass-card {
  background: rgba(var(--surface-rgb), 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .glass-card {
  background: rgba(var(--surface-rgb), 0.8);
  border: 1px solid var(--outline);
}

.glass-header {
  background: rgba(var(--bg-primary-rgb), 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline-variant);
}

.glass-header a {
  text-decoration: none;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  padding: 12px 32px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.95rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  padding: 12px 32px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* Navigation */
.desktop-nav {
  display: flex;
}

.nav-link {
  color: var(--on-surface);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.15);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--on-surface);
  font-weight: 800;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

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

.text-secondary {
  color: var(--secondary);
}

.text-tertiary {
  color: var(--tertiary);
}

/* Section Styles */
section {
  padding: 80px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Phone Mockup */
.phone-mockup {
  /* w-72 ثابت عند ٢٨٨ بكسل فيتجاوز الشاشات الضيقة (٣٢٠) لولا هذا الحد */
  max-width: 100%;
  border: 12px solid #222;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  background: var(--surface);
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 25px;
  background-color: #222;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 10;
}

.phone-mockup img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Dark Mode Toggle */
.theme-toggle {
  background: rgba(var(--primary-rgb), 0.1);
  border: 2px solid var(--primary);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--primary);
}

.theme-toggle:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--on-surface);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 1000;
  padding: 80px 20px 20px;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav .nav-link {
  font-size: 1.25rem;
  padding: 16px;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  section {
    padding: 60px 20px;
  }

  .phone-mockup {
    border-width: 8px;
    border-radius: 32px;
  }

  .phone-mockup::before {
    width: 120px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 24px;
    font-size: 1rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mt-12 {
  margin-top: 3rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.p-12 {
  padding: 3rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

.rounded-3xl {
  border-radius: 1.5rem;
}

.shadow-lg {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md\:w-1\/2 {
    width: 50%;
  }

  .md\:flex-row {
    flex-direction: row;
  }

  .md\:text-right {
    text-align: right;
  }

  .md\:text-center {
    text-align: center;
  }

  .md\:p-12 {
    padding: 3rem;
  }

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:w-80 {
    width: 20rem;
  }

  .md\:pt-40 {
    padding-top: 10rem;
  }

  .md\:pb-32 {
    padding-bottom: 8rem;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.max-w-md {
  max-width: 28rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.text-5xl {
  font-size: 3rem;
}

.font-bold {
  font-weight: 700;
}

.w-8 {
  width: 2rem;
}

.w-10 {
  width: 2.5rem;
}

.w-12 {
  width: 3rem;
}

.w-20 {
  width: 5rem;
}

.w-24 {
  width: 6rem;
}

.w-72 {
  width: 18rem;
}

.w-80 {
  width: 20rem;
}

.w-full {
  width: 100%;
}

.h-8 {
  height: 2rem;
}

.h-10 {
  height: 2.5rem;
}

.h-12 {
  height: 3rem;
}

.h-20 {
  height: 5rem;
}

.h-24 {
  height: 6rem;
}

.h-72 {
  height: 18rem;
}

.h-80 {
  height: 20rem;
}

.h-full {
  height: 100%;
}

.flex-1 {
  flex: 1 1 0%;
}

.fixed {
  position: fixed;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.top-0 {
  top: 0;
}

.left-0 {
  left: 0;
}

.right-0 {
  right: 0;
}

.z-50 {
  z-index: 50;
}

.pt-32 {
  padding-top: 8rem;
}

.pb-20 {
  padding-bottom: 5rem;
}

.pt-40 {
  padding-top: 10rem;
}

.pb-32 {
  padding-bottom: 8rem;
}

.border-t {
  border-top: 1px solid var(--outline-variant);
}

/* Feature Cards */
.feature-card {
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.75rem;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}

/* Download Section */
.download-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  background: var(--surface);
  border: 2px solid var(--outline);
  color: var(--on-surface);
}

.store-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

.store-badge img {
  height: 40px;
}

/* Footer */
footer {
  background: var(--surface-variant);
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--outline-variant);
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Blob Backgrounds */
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.3;
  border-radius: 50%;
}

.blob-primary {
  background: var(--primary);
}

.blob-secondary {
  background: var(--secondary);
}

.blob-tertiary {
  background: var(--tertiary);
}

/* ========================================
   Icon System (replaces Font Awesome CDN)
   ======================================== */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-lg {
  width: 1.4em;
  height: 1.4em;
}

.rating-stars .icon {
  width: 1.1em;
  height: 1.1em;
}

.rating-stars .icon:last-child {
  opacity: 0.5;
}

/* ========================================
   Additional Utility Classes
   ======================================== */
.cursor-pointer { cursor: pointer; }
.transition-colors { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
.italic { font-style: italic; }
.inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.border-2 { border-width: 2px; border-style: solid; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t { border-radius: 0.5rem 0.5rem 0 0; }
.shadow-md { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }

.gap-6 { gap: 1.5rem; }
.gap-12 { gap: 3rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

.p-3 { padding: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pb-16 { padding-bottom: 4rem; }
.pt-8 { padding-top: 2rem; }

.top-4 { top: 1rem; }
.left-4 { left: 1rem; }

.w-2 { width: 0.5rem; }
.w-16 { width: 4rem; }
.w-96 { width: 24rem; }
.h-2 { height: 0.5rem; }
.h-16 { height: 4rem; }
.h-96 { height: 24rem; }
.h-auto { height: auto; }

.max-w-4xl { max-width: 56rem; }
.text-3xl { font-size: 1.75rem; }
.text-xs { font-size: 0.75rem; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:flex-row-reverse { flex-direction: row-reverse; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:text-xl { font-size: 1.25rem; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .glass-card,
  .btn-primary,
  .btn-secondary,
  .store-badge {
    transition: none !important;
    animation: none !important;
  }
  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }
}

/* Hero phone mockup */
.phone-mockup .phone-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Screenshot placeholder (shown until real device screenshots are added) */
.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  min-height: 420px;
  padding: 24px;
  text-align: center;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
}

.screenshot-placeholder .icon {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.5;
}

/* ========================================
   مستكشف الشخصيات - personas.js
   ======================================== */

/* ألوان خانات الخريطة الحرارية - تتبع الثيم كي تبقى مقروءة في الوضعين */
:root {
  --heat-empty: rgba(120, 105, 85, 0.09);
  --heat-missed: rgba(120, 105, 85, 0.3);
}

[data-theme="dark"] {
  --heat-empty: rgba(237, 233, 224, 0.07);
  --heat-missed: rgba(237, 233, 224, 0.22);
}

.persona-explorer .persona-stage { display: none; }
.persona-explorer.is-ready .persona-stage { display: grid; }

.persona-loading {
  text-align: center;
  color: var(--on-surface-variant);
}

/* شرائح الاختيار */
.persona-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  background: var(--surface);
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.persona-chip span { font-size: 1.15rem; line-height: 1; }

.persona-chip:hover { border-color: var(--primary); transform: translateY(-2px); }

.persona-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* المسرح: الهاتف واللوحة */
.persona-stage {
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 48px;
  align-items: start;
}

.persona-phone { position: sticky; top: 100px; }

.persona-phone .phone-mockup {
  width: 100%;
  container-type: inline-size;
}

.persona-panel { min-width: 0; }

/* رأس الشخصية */
.persona-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.persona-face {
  width: 60px;
  height: 60px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  border-radius: 18px;
  background: rgba(var(--primary-rgb), 0.1);
}

.persona-head strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--on-surface);
}

.persona-meta {
  display: block;
  margin-top: 2px;
  color: var(--on-surface-variant);
  font-size: 0.9375rem;
}

/* بطاقات الأرقام */
.persona-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.persona-stats div {
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--surface-variant);
  border: 1px solid var(--outline-variant);
  text-align: center;
}

.persona-stats b {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.persona-stats span {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}

/* الخريطة الحرارية */
.heat-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}

.heat-head b { font-weight: 700; }
.heat-head .on-narrow { display: none; }

.heat-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.heat-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  background: var(--heat-empty);
}

.heat-legend .s1 { background: var(--heat-missed); }
.heat-legend .s2 { background: var(--primary); }

.heat-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr 42px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}

.heat-row.is-archived { opacity: 0.55; }

.heat-label { min-width: 0; }

.heat-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heat-sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heat-cells {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 1.5px;
  direction: ltr;
}

.heat-cells i {
  aspect-ratio: 1;
  border-radius: 1.5px;
  background: var(--heat-empty);
}

.heat-cells .s1 { background: var(--heat-missed); }
.heat-cells .s2 { background: var(--c); }

.heat-cells .has-note {
  box-shadow: 0 0 0 1.5px var(--tertiary);
  border-radius: 50%;
}

.heat-rate {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-align: left;
}

/* ماذا حدث في الطريق */
.persona-events {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(var(--tertiary-rgb), 0.08);
  border: 1px solid rgba(var(--tertiary-rgb), 0.2);
}

.persona-events strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  color: var(--on-surface);
}

.persona-events ul { list-style: none; padding: 0; margin: 0; }

.persona-events li {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}

.persona-events li span {
  flex: none;
  min-width: 92px;
  font-weight: 600;
  color: var(--tertiary);
}

.persona-note {
  margin-top: 20px;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--on-surface-variant);
}

.persona-note b { color: var(--on-surface); }

@media (max-width: 900px) {
  .persona-stage { grid-template-columns: 1fr; justify-items: center; gap: 32px; }
  .persona-phone { position: static; width: 100%; max-width: 300px; }
  .persona-panel { width: 100%; }
  .heat-row { grid-template-columns: 1fr 42px; row-gap: 4px; }
  .heat-label { grid-column: 1 / -1; }
  /* على الجوال تُعرض آخر ٣٠ يوماً فقط كي تبقى الخانات مقروءة */
  .heat-cells { grid-template-columns: repeat(30, 1fr); gap: 2px; }
  .heat-cells i:nth-child(-n + 60) { display: none; }
  .heat-head .on-wide { display: none; }
  .heat-head .on-narrow { display: inline; }
}

/* ========================================
   محاكاة شاشة التطبيق داخل الهاتف
   ألوانها ثابتة على ثيم التطبيق الفاتح - ui/theme/Color.kt
   ======================================== */

.phone-screen {
  --app-bg: #F4EAD3;
  --app-surface: #FFFFFF;
  --app-on: #3D3328;
  --app-on-var: #5C4E3D;
  --app-primary: #2A5A4A;
  --app-done: #EAF0ED;

  position: relative;
  width: 100%;
  aspect-ratio: 360 / 780;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--app-on);
  /* ١em = ١٠ بكسل في تصميم عرضه ٣٦٠ */
  font-size: 2.7778cqw;
  line-height: 1.4;
  text-align: right;
}

@supports not (font-size: 1cqw) {
  .phone-screen { font-size: 8.6px; }
}

/* حلقة التقدّم */
.ph-ring {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 4.8em;
  height: 4.8em;
}

.ph-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(0, 0, 0, 0.16) 0);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - var(--w)), #000 calc(100% - var(--w)));
  mask: radial-gradient(farthest-side, #0000 calc(100% - var(--w)), #000 calc(100% - var(--w)));
  transition: background 0.35s ease;
}

.ph-ring > span { position: relative; font-weight: 700; font-size: 1.3em; }

.ph-ring-lg { --w: 0.35em; }
.ph-ring-lg > span { color: var(--app-primary); }
.ph-ring-sm { --w: 0.4em; }

/* شريط الحالة والترويسة */
.ph-status {
  display: flex;
  justify-content: space-between;
  padding: 0.8em 1.6em 0;
  font-size: 1.1em;
  font-weight: 600;
}

.ph-signal { opacity: 0.55; }

.ph-header {
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 1.2em 1.6em 0;
}

.ph-avatar {
  width: 4.4em;
  height: 4.4em;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2em;
  width: 2.2em;
  height: 2.2em;
  background: rgba(42, 90, 74, 0.14);
  box-shadow: inset 0 0 0 0.05em rgba(42, 90, 74, 0.35);
}

.ph-title {
  font-size: 1.9em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-gear {
  margin-inline-start: auto;
  width: 1.8em;
  height: 1.8em;
  flex: none;
  border-radius: 50%;
  border: 0.2em solid rgba(92, 78, 61, 0.65);
}

/* بطاقة التقدّم */
.ph-progress {
  display: flex;
  align-items: center;
  gap: 1em;
  margin: 1.2em 1.6em 0;
  padding: 0.9em 1em;
  border-radius: 2em;
  background: rgba(42, 90, 74, 0.18);
  box-shadow: inset 0 0 0 0.1em rgba(42, 90, 74, 0.12);
}

.ph-progress-text { min-width: 0; }
.ph-progress-text strong { display: block; font-size: 1.25em; font-weight: 700; }
.ph-progress-text > span { display: block; font-size: 1.05em; color: var(--app-on-var); }
.ph-progress-text em {
  display: block;
  font-size: 1.05em;
  font-weight: 700;
  font-style: normal;
  color: var(--app-primary);
}

/* مرشّح التصنيفات */
.ph-cats {
  display: flex;
  gap: 0.8em;
  margin: 1.4em 1.6em 0;
  overflow: hidden;
}

.ph-cat {
  flex: none;
  padding: 0.45em 1em;
  border-radius: 1.4em;
  font-size: 1.15em;
  font-weight: 600;
  color: var(--app-primary);
  background: rgba(42, 90, 74, 0.08);
  box-shadow: inset 0 0 0 0.09em rgba(42, 90, 74, 0.2);
}

.ph-cat.is-active { background: var(--app-primary); color: var(--app-surface); }

/* بطاقات العادات */
.ph-list {
  margin: 1.4em 1.6em 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-height: 47.2em;
  overflow: hidden;
  -webkit-mask: linear-gradient(#000 88%, #0000);
  mask: linear-gradient(#000 88%, #0000);
}

.ph-card {
  display: flex;
  align-items: center;
  gap: 0.9em;
  flex: none;
  height: 8.4em;
  padding: 0 1.2em;
  border-radius: 1.6em;
  background: var(--app-surface);
  box-shadow: inset 0 0 0 0.1em rgba(0, 0, 0, 0.1);
}

.ph-card.is-done {
  background: var(--app-done);
  box-shadow: inset 0 0 0 0.1em rgba(42, 90, 74, 0.3);
}

.ph-body { flex: 1; min-width: 0; }

.ph-name {
  display: block;
  font-size: 1.45em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.4em;
}

.ph-chip {
  flex: none;
  padding: 0.15em 0.7em;
  border-radius: 1em;
  font-size: 1.05em;
  font-weight: 600;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
}

.ph-target { font-size: 1.1em; color: var(--app-on-var); white-space: nowrap; }

.ph-act {
  flex: none;
  width: 3.4em;
  height: 3.4em;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.ph-act svg { width: 2.2em; height: 2.2em; }

.ph-act path {
  fill: none;
  stroke: rgba(92, 78, 61, 0.75);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ph-act .ph-play { fill: rgba(92, 78, 61, 0.75); stroke: none; }
.ph-act.is-done { background: rgba(42, 90, 74, 0.12); }
.ph-act.is-done path { stroke: var(--app-primary); }

/* الزر العائم والشريط السفلي */
.ph-fab {
  position: absolute;
  inset-inline-start: 2.4em;
  bottom: 8em;
  width: 5.6em;
  height: 5.6em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--app-primary);
}

.ph-fab svg { width: 2.6em; height: 2.6em; }
.ph-fab path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }

.ph-nav {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 6.8em;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0.1em 0 rgba(0, 0, 0, 0.08);
}

.ph-nav span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-size: 1.05em;
  color: var(--app-on-var);
  opacity: 0.6;
}

.ph-nav i {
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  border: 0.19em solid currentColor;
}

.ph-nav .is-active { color: var(--app-primary); opacity: 1; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .persona-chip { transition: none; }
  .ph-ring::before { transition: none; }
}

/* ========================================
   تحسينات العرض على الجوال
   موضعها بعد أدوات التنسيق العامة كي تسبقها في الترتيب
   ======================================== */
@media (max-width: 768px) {
  /* بدون قيمة صريحة هنا يُرحَّل overflow-x من body إلى نافذة العرض فيصير
     body نفسه visible ولا يقصّ الزخارف، فتنزلق الصفحة أفقياً تحت الإصبع.
     ونقصره على الجوال لأن clip يغيّر مرجع التمرير الذي يعتمد عليه
     position: sticky في .persona-phone على الشاشات الأوسع. */
  html {
    overflow-x: clip;
  }

  /* الترويسة: زر التحميل يتكرر في القائمة وفي البطل، فإخفاؤه هنا
     يمنع انضغاط زر الثيم ويترك مساحة للشعار وزر القائمة */
  .glass-header .btn-primary.btn-sm {
    display: none;
  }

  /* padding المختصر كان يبطل حاشية py-4 الرأسية أيضاً فيلتصق الشعار
     بحافتي الشريط؛ الاقتصار على المحور الأفقي يبقيها */
  .glass-header .container {
    padding-inline: 16px;
  }

  .theme-toggle {
    flex: none;
  }

  /* هدف لمس ٤٤ بكسل لزر القائمة بدل أيقونة ٢٤ بكسل عارية */
  .mobile-menu-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  /* حاشية واحدة بدل حاشيتين متراكبتين (القسم ٢٠ + الحاوية ٢٠) */
  section,
  footer {
    padding-inline: 0;
  }

  /* إيقاع رأسي أقصر يناسب الشاشة الطويلة الضيقة */
  .py-20 {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .py-16 {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .pt-32 {
    padding-top: 112px;
  }

  .pb-20 {
    padding-bottom: 48px;
  }

  .mb-16 {
    margin-bottom: 40px;
  }

  .mb-12 {
    margin-bottom: 32px;
  }

  .gap-12 {
    gap: 2rem;
  }

  .p-8 {
    padding: 1.5rem;
  }

  /* أزرار التحميل: عمود بعرض كامل بدل صفّ مكسور */
  .download-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .download-buttons > * {
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
    justify-content: center;
    text-align: center;
  }

  /* شرائح الشخصيات: صف يُمرَّر أفقياً بدل جدار من عشر شرائح */
  .persona-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -20px;
    padding: 2px 20px 6px;
    margin-bottom: 28px;
  }

  .persona-chips::-webkit-scrollbar {
    display: none;
  }

  .persona-chip {
    flex: none;
    scroll-snap-align: center;
  }

  .persona-chip:hover {
    transform: none;
  }

  .persona-head {
    gap: 12px;
    margin-bottom: 20px;
  }

  .persona-head strong {
    font-size: 1.25rem;
  }

  .persona-face {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .persona-stats {
    gap: 8px;
  }

  .persona-stats div {
    padding: 12px 6px;
  }

  .persona-stats b {
    font-size: 1.25rem;
  }

  .persona-stats span {
    font-size: 0.75rem;
  }

  /* التواريخ في «ماذا حدث» تأخذ سطراً مستقلاً بدل عمود يخنق النص */
  .persona-events li {
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
  }

  .persona-events li span {
    min-width: 0;
  }

  /* روابط التذييل ٢٦ بكسل فقط، والحشوة ترفعها إلى هدف لمس معقول */
  .footer-links {
    gap: 8px 20px;
  }

  .footer-links a {
    display: inline-block;
    padding: 8px 4px;
  }

  /* ظهور رأسي فقط: الإزاحة الجانبية ٥٠ بكسل تخرج عن شاشة ٣٧٥ */
  .reveal-left,
  .reveal-right {
    transform: translateY(30px);
  }

  .reveal-left.active,
  .reveal-right.active {
    transform: translateY(0);
  }
}

/* ========================================
   الأسئلة الشائعة (FAQ)
   accordion بلا جافاسكربت — المحتوى موجود في الـ DOM
   ليقرأه الزاحف حتى وهو مطوي
   ======================================== */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}

.faq-item:hover {
  transform: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--on-surface);
  list-style: none;
  transition: color 0.2s ease;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary:hover {
  color: var(--primary);
}

.faq-item > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 18px;
}

/* السهم يدور عند الفتح — يشير لليسار في الواجهة العربية */
.faq-item .faq-chevron {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
  transition: transform 0.25s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(-90deg);
}

.faq-answer {
  padding: 0 24px 22px;
  color: var(--on-surface-variant);
  line-height: 1.9;
}

.faq-answer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .faq-item .faq-chevron {
    transition: none;
  }
}

@media (max-width: 480px) {
  .faq-item > summary {
    padding: 16px 18px;
    font-size: 0.98rem;
  }

  .faq-answer {
    padding: 0 18px 18px;
  }
}

/* ===================================================================
   Curriculum series — breadcrumb, prose, table of contents, pager
   =================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--on-surface-variant);
}

.breadcrumb a {
  color: var(--on-surface-variant);
  text-decoration: none;
  border-radius: 8px;
  padding: 2px 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.5;
}

.curriculum-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.curriculum-prose {
  line-height: 2.05;
  font-size: 1.05rem;
}

.curriculum-prose > *:last-child {
  margin-bottom: 0;
}

.curriculum-h3 {
  margin: 32px 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.6;
}

.curriculum-prose > .curriculum-h3:first-child {
  margin-top: 0;
}

.curriculum-list {
  margin: 0 0 20px;
  padding-inline-start: 1.5rem;
  list-style: none;
  color: var(--on-surface-variant);
}

.curriculum-list > li {
  position: relative;
  margin-bottom: 8px;
}

.curriculum-list > li::before {
  content: "";
  position: absolute;
  inset-inline-start: -1.15rem;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.65;
}

/* حلقة العادة: إشارة ← توقع ← رغبة ← فعل ← نتيجة ← تعلم */
.habit-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(var(--primary-rgb), 0.07);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.loop-step {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.loop-step + .loop-step::before {
  content: "←";
  display: inline-block;
  margin-inline-end: 10px;
  margin-inline-start: -6px;
  color: var(--on-surface-variant);
  opacity: 0.7;
  font-weight: 400;
}

/* القواعد الذهبية العشرون */
.rules-list {
  margin: 0 0 20px;
  padding-inline-start: 2.4rem;
  color: var(--on-surface-variant);
}

.rules-list > li {
  margin-bottom: 20px;
  padding-inline-start: 6px;
}

.rules-list > li::marker {
  color: var(--primary);
  font-weight: 700;
}

.rules-list strong {
  color: var(--on-surface);
}

/* فهرس المراجع */
.refs-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.ref-item {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 0.95rem;
  line-height: 1.85;
  scroll-margin-top: 120px;
}

.ref-item:target {
  background: rgba(var(--primary-rgb), 0.14);
  outline: 2px solid var(--primary);
}

.ref-num {
  font-weight: 700;
  color: var(--primary);
}

a.cite {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9em;
  vertical-align: super;
  line-height: 0;
  padding: 0 2px;
}

a.cite:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* فهرس الأقسام */
.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.toc-item > a,
.toc-item.is-current {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-variant);
  text-decoration: none;
  color: var(--on-surface);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.toc-item > a:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  transform: translateX(-4px);
}

.toc-item.is-current {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
}

.toc-num {
  flex-shrink: 0;
  min-width: 5.5rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

.toc-title {
  font-weight: 600;
  line-height: 1.6;
}

/* التنقل بين الأقسام */
.curriculum-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.curriculum-pager .btn-primary,
.curriculum-pager .btn-secondary {
  font-size: 1rem;
  padding: 12px 24px;
  text-align: center;
}

.pager-next {
  margin-inline-start: auto;
}

@media (prefers-reduced-motion: reduce) {
  .toc-item > a {
    transition: none;
  }

  .toc-item > a:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .curriculum-prose {
    font-size: 1rem;
    line-height: 1.95;
  }

  .curriculum-h3 {
    font-size: 1.12rem;
    margin-top: 26px;
  }

  .toc-num {
    min-width: auto;
  }

  .curriculum-pager {
    flex-direction: column;
  }

  .curriculum-pager .btn-primary,
  .curriculum-pager .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .pager-next {
    margin-inline-start: 0;
  }
}
