/* ديباج القصيد — الهوية البصرية الملكية الفاخرة */
:root {
  --bg-main: #07110E;
  --bg-elevated: #0D1B16;
  --bg-card: rgba(16, 32, 26, 0.78);
  --bg-input: rgba(8, 17, 14, 0.85);
  --border-subtle: rgba(212, 175, 55, 0.16);
  --border-strong: rgba(212, 175, 55, 0.42);
  --gold: #D4AF37;
  --gold-light: #F3D98B;
  --gold-soft: rgba(212, 175, 55, 0.12);
  --text-primary: #F6F1E7;
  --text-secondary: #B8C4BC;
  --text-muted: #7F9187;
  --shadow-luxury: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 12px 35px rgba(212, 175, 55, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-ui: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
  --font-poetry: 'Amiri', serif;
}

[data-theme="parchment"] {
  --bg-main: #F8F3E8;
  --bg-elevated: #FFFDF8;
  --bg-card: rgba(255, 252, 245, 0.92);
  --bg-input: #F3EBDC;
  --border-subtle: rgba(156, 115, 38, 0.2);
  --border-strong: rgba(156, 115, 38, 0.52);
  --gold: #9C7326;
  --gold-light: #6E4B10;
  --gold-soft: rgba(156, 115, 38, 0.1);
  --text-primary: #1F1810;
  --text-secondary: #574838;
  --text-muted: #82715E;
  --shadow-luxury: 0 20px 50px rgba(72, 50, 20, 0.12);
  --shadow-gold: 0 10px 28px rgba(156, 115, 38, 0.18);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.08), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(16, 78, 56, 0.18), transparent 45%);
}

[data-theme="parchment"] body {
  background-image:
    radial-gradient(circle at 15% 10%, rgba(186, 142, 60, 0.12), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(224, 198, 152, 0.25), transparent 50%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }

.container {
  width: min(1240px, 92%);
  margin: 0 auto;
}

/* الهيدر العلوي */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 17, 14, 0.82);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="parchment"] .navbar {
  background: rgba(248, 243, 232, 0.88);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

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

.brand-logo-img {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-gold);
}

.brand-text strong {
  display: block;
  font-family: var(--font-poetry);
  font-size: 1.58rem;
  line-height: 1.15;
  color: var(--gold-light);
  letter-spacing: 0.2px;
}

.brand-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 999px;
}

.nav-links a {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--gold-soft);
  color: var(--gold-light);
}

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

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, #E2C068, #B88E32);
  color: #0B120E;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-ghost {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 0.84rem;
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

/* شريط الإهداء الزجاجي الشفاف والأنيق */
.royal-dedication-wrap {
  padding: 16px 0 0;
}

.royal-dedication-plaque {
  max-width: 860px;
  margin: 0 auto;
  background: linear-gradient(120deg, rgba(212, 175, 55, 0.08), rgba(14, 42, 34, 0.35), rgba(212, 175, 55, 0.08));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 999px;
  padding: 10px 26px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  animation: fadeSlideDown 0.8s ease both;
}

[data-theme="parchment"] .royal-dedication-plaque {
  background: linear-gradient(120deg, rgba(156, 115, 38, 0.08), rgba(255, 252, 245, 0.65), rgba(156, 115, 38, 0.08));
  border-color: rgba(156, 115, 38, 0.38);
}

.royal-dedication-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.royal-dedication-kicker {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.32);
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.royal-dedication-text {
  margin: 0;
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: clamp(1.05rem, 1.6vw, 1.24rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
}

.royal-dedication-text strong {
  color: var(--gold-light);
}

/* حركات فخمة للعناوين والبطاقات */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes goldShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.showcase-card {
  animation: floatGentle 6.5s ease-in-out infinite;
}

.section-header h2 {
  background: linear-gradient(100deg, var(--text-primary) 20%, var(--gold-light) 50%, var(--text-primary) 80%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 9s linear infinite;
}

/* تنوع ألوان الأحجار الكريمة لبطاقات المزايا مع حركة وبريق ناعم */
.feature-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.32s ease;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
  transform: translateX(120%);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.feature-card:hover::after {
  transform: translateX(-120%);
}

.feature-card:nth-child(1) { border-top: 2px solid #D4AF37; }
.feature-card:nth-child(1) .feature-icon { background: rgba(212, 175, 55, 0.14); border-color: rgba(212, 175, 55, 0.45); color: #F5DC9B; }

.feature-card:nth-child(2) { border-top: 2px solid #C85A7C; }
.feature-card:nth-child(2) .feature-icon { background: rgba(200, 90, 124, 0.14); border-color: rgba(200, 90, 124, 0.45); color: #F2A6BE; }

.feature-card:nth-child(3) { border-top: 2px solid #4DA6C9; }
.feature-card:nth-child(3) .feature-icon { background: rgba(77, 166, 201, 0.14); border-color: rgba(77, 166, 201, 0.45); color: #9ED9F0; }

.feature-card:nth-child(4) { border-top: 2px solid #48B58A; }
.feature-card:nth-child(4) .feature-icon { background: rgba(72, 181, 138, 0.14); border-color: rgba(72, 181, 138, 0.45); color: #9AE6C7; }

.feature-card:nth-child(5) { border-top: 2px solid #9F7AEA; }
.feature-card:nth-child(5) .feature-icon { background: rgba(159, 122, 234, 0.14); border-color: rgba(159, 122, 234, 0.45); color: #D4C2FA; }

.feature-card:nth-child(6) { border-top: 2px solid #E59854; }
.feature-card:nth-child(6) .feature-icon { background: rgba(229, 152, 84, 0.14); border-color: rgba(229, 152, 84, 0.45); color: #FAD0A7; }

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.meter-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.meter-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.meter-card:nth-child(4n+1) { border-right: 3px solid #D4AF37; }
.meter-card:nth-child(4n+2) { border-right: 3px solid #48B58A; }
.meter-card:nth-child(4n+3) { border-right: 3px solid #5B9BD5; }
.meter-card:nth-child(4n+4) { border-right: 3px solid #C86D8E; }

/* ظهور سلس عند التمرير */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .royal-dedication-plaque { border-radius: 16px; padding: 10px 14px; }
}

/* القسم الافتتاحي Hero */
.hero {
  padding: 64px 0 54px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: clamp(2.1rem, 3.55vw, 3.15rem);
  line-height: 1.42;
  padding: 4px 0 8px;
  margin: 0 0 10px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--gold-light);
  text-shadow: 0 4px 22px rgba(212, 175, 55, 0.28);
  display: inline-block;
}

.choice-scroll {
  max-height: 195px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.palette-scroll {
  max-height: 210px;
  overflow-y: auto;
  padding-left: 4px;
}

[data-theme="parchment"] .hero h1 span {
  color: #8E6319;
  text-shadow: 0 4px 18px rgba(142, 99, 25, 0.18);
}

.hero-flourish {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--gold);
  font-size: 0.95rem;
}

.hero-flourish::before,
.hero-flourish::after {
  content: "";
  height: 1.5px;
  width: 64px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* لوحة ألوان سريعة */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.palette-chip {
  border-radius: 10px;
  padding: 8px 6px;
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.palette-chip:hover, .palette-chip.active {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* مشغّل الريلز السينمائي */
.reel-panel {
  display: none;
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
}

.reel-panel.open {
  display: block;
  animation: fadeIn 0.25s ease;
}

.reel-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.reel-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  margin-bottom: 8px;
}

.reel-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.08s linear;
}

/* لوحة التحكم الإدارية */
.admin-modal-box {
  width: min(860px, 100%);
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.kpi-card strong {
  display: block;
  font-family: var(--font-poetry);
  font-size: 1.8rem;
  color: var(--gold-light);
  line-height: 1.2;
}

.kpi-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.admin-table th, .admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
}

.admin-table th {
  color: var(--gold-light);
  font-weight: 700;
}

@media (max-width: 680px) {
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 0 28px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* عرض البطاقة الفاخرة في الهيرو */
.hero-showcase {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.24), transparent 70%);
  filter: blur(28px);
  z-index: 0;
}

.showcase-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 470px;
  background: linear-gradient(160deg, #071A14 0%, #103126 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: var(--shadow-luxury), 0 0 0 8px rgba(212, 175, 55, 0.06);
  text-align: center;
  color: #F6F1E7;
}

.showcase-card-inner {
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 14px;
  padding: 26px 18px;
  position: relative;
}

.showcase-ornament {
  color: #D4AF37;
  font-size: 1.2rem;
  letter-spacing: 6px;
  margin-bottom: 10px;
}

.showcase-title {
  font-family: var(--font-poetry);
  font-size: 1.6rem;
  color: #F3D98B;
  margin: 0 0 6px;
}

.showcase-poet {
  font-size: 0.84rem;
  color: #B7C9C0;
  margin-bottom: 20px;
}

.showcase-verses {
  font-family: var(--font-poetry);
  font-size: 0.98rem;
  line-height: 2.2;
  color: #F6F1E7;
}

.showcase-verse-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.showcase-verse-row span.sep {
  color: #D4AF37;
  font-size: 0.78rem;
}

.showcase-badge {
  position: absolute;
  bottom: -16px;
  left: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-luxury);
}

/* عناوين الأقسام */
.section {
  padding: 68px 0;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 42px;
}

.section-header h2 {
  font-family: var(--font-poetry);
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  margin: 0 0 10px;
  color: var(--text-primary);
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* قسم قبل وبعد */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.ba-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
}

.ba-card.after {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-gold);
}

.ba-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.ba-tag.raw {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.ba-tag.luxury {
  background: var(--gold-soft);
  color: var(--gold-light);
  border: 1px solid var(--border-strong);
}

.ba-cinematic-img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  display: block;
}

.ba-card.after .ba-cinematic-img {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.raw-text-box {
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  font-family: monospace;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.9;
}

.luxury-mini-preview {
  background: radial-gradient(circle at 50% 35%, #11362A 0%, #071A14 70%, #04100C 100%);
  color: #F6F1E7;
  border-radius: 18px;
  padding: 16px;
  border: 2px solid #D4AF37;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 0 0 6px rgba(212, 175, 55, 0.08);
  text-align: center;
  font-family: var(--font-poetry);
  position: relative;
}

.luxury-mini-inner {
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 22px 20px;
  position: relative;
}

.luxury-mini-inner::before,
.luxury-mini-inner::after {
  content: "✦";
  position: absolute;
  color: #D4AF37;
  font-size: 0.85rem;
}
.luxury-mini-inner::before { top: 6px; right: 10px; }
.luxury-mini-inner::after { bottom: 6px; left: 10px; }

.luxury-mini-preview h4 {
  margin: 0 0 4px;
  color: #F5DC9B;
  font-size: 1.42rem;
  text-shadow: 0 3px 14px rgba(212, 175, 55, 0.25);
}

.luxury-mini-verses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 470px;
  margin: 14px auto 12px;
}

.luxury-mini-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  font-size: 1.06rem;
}

.luxury-mini-row .hem {
  text-align: justify;
  text-align-last: justify;
  color: #F6F1E7;
}

.luxury-mini-row .sep {
  color: #D4AF37;
  font-size: 0.78rem;
}

/* مساحة عمل الاستوديو */
.studio-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-luxury);
}

.studio-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.studio-topbar h3 {
  margin: 0;
  font-family: var(--font-poetry);
  font-size: 1.7rem;
  color: var(--gold-light);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 26px;
  align-items: start;
}

.editor-column,
.preview-column,
.preview-card,
.studio-shell {
  min-width: 0;
  max-width: 100%;
}

/* تبويبات المحرر */
.editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-input);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  background: linear-gradient(135deg, #E2C068, #B88E32);
  color: #0B120E;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

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

/* حقول الإدخال */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.field textarea {
  min-height: 155px;
  resize: vertical;
  font-family: var(--font-poetry);
  font-size: 1.12rem;
  line-height: 1.9;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

/* لوحة الحركات والتشكيل الواضحة */
.harakat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.haraka-btn {
  min-width: 40px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--gold-light);
  font-family: var(--font-poetry);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.haraka-btn:hover {
  background: var(--gold);
  color: #07110E;
  transform: translateY(-1px);
}

/* محلل الوزن والقافية */
.analyzer-box {
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
}

.analyzer-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 10px;
}

.stat-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 6px;
}

.stat-pill strong {
  display: block;
  font-size: 1.1rem;
  color: var(--gold-light);
}

.stat-pill span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* شبكة القوالب */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.template-card {
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  border: 1.5px solid var(--border-subtle);
  transition: all 0.2s ease;
  text-align: right;
  position: relative;
  overflow: hidden;
}

.template-card:hover, .template-card.active {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.template-swatch {
  height: 68px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-poetry);
  font-size: 1rem;
}

.template-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.template-card span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* خيارات الاختيار السريع (Pills) */
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-pill {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
}

.choice-pill.active, .choice-pill:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-light);
}

/* المعاينة الحية المثبتة */
.preview-column {
  position: sticky;
  top: 86px;
}

.preview-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ratio-group {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.ratio-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.ratio-btn.active {
  background: var(--gold);
  color: #07110E;
}

.canvas-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0.25));
  border-radius: 14px;
  padding: 16px;
  min-height: 430px;
  position: relative;
}

#poetryCanvas {
  max-width: 100%;
  max-height: 540px;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.export-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.export-actions .btn-gold {
  grid-column: span 2;
}

/* المختارات والقصائد المحفوظة */
.poem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-left: 4px;
}

.poem-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.poem-item h4 {
  margin: 0 0 3px;
  font-family: var(--font-poetry);
  font-size: 1.1rem;
  color: var(--gold-light);
}

.poem-item p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* بطاقات الخدمات والمزايا */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.22s ease;
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.feature-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* علم العروض */
.arud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.meter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
}

.meter-card h4 {
  margin: 0 0 6px;
  font-family: var(--font-poetry);
  font-size: 1.25rem;
  color: var(--gold-light);
}

.meter-key {
  font-family: var(--font-poetry);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.meter-pattern {
  font-size: 0.78rem;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 6px;
}

.meter-mood {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.exercise-answer {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--gold-light);
  font-size: 0.9rem;
}

.exercise-answer.open {
  display: block;
}

/* الباقات والأسعار */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 999px;
  margin-top: 16px;
}

.billing-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.billing-btn.active {
  background: var(--gold);
  color: #07110E;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.featured {
  border: 1.5px solid var(--gold);
  box-shadow: var(--shadow-gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), var(--bg-card));
}

.popular-badge {
  position: absolute;
  top: -13px;
  left: 24px;
  background: linear-gradient(135deg, #E2C068, #B88E32);
  color: #07110E;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.price-amount {
  font-family: var(--font-poetry);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 10px 0 4px;
}

.price-amount small {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  flex: 1;
}

.price-list li {
  padding: 7px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-list li::before {
  content: "✦";
  color: var(--gold);
  font-size: 0.8rem;
}

/* الأسئلة الشائعة والفوتر */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 30px;
  background: rgba(0, 0, 0, 0.22);
}

[data-theme="parchment"] .footer {
  background: rgba(156, 115, 38, 0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.footer h4 {
  margin: 0 0 12px;
  color: var(--gold-light);
  font-size: 0.95rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* النوافذ المنبثقة والتنبيهات */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: min(620px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-luxury);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-poetry);
  font-size: 1.5rem;
  color: var(--gold-light);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-luxury);
  z-index: 1200;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.25s ease;
  font-size: 0.88rem;
  font-weight: 600;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* الاستجابة الفاخرة للشاشات المتوسطة والهواتف الذكية */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-grid, .studio-grid, .before-after-grid, .features-grid, .pricing-grid, .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .arud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-column { position: static; }
  .hero { padding: 38px 0 34px; }
  .hero-grid { gap: 32px; }
  .section { padding: 46px 0; }
}

@media (max-width: 640px) {
  .container { width: 94%; }
  .navbar-inner { padding: 10px 0; gap: 8px; }
  .brand-logo-img { width: 40px; height: 40px; border-radius: 10px; }
  .brand-text strong { font-size: 1.28rem; }
  .brand-text span { display: none; }
  #themeLabel { display: none; }
  .nav-actions .btn { padding: 8px 13px; font-size: 0.82rem; }

  .hero h1 { font-size: 2rem; line-height: 1.45; }
  .hero-lead { font-size: 0.96rem; margin-bottom: 22px; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; padding: 12px 18px; }
  .trust-strip { gap: 10px; font-size: 0.78rem; }

  .showcase-card { padding: 18px 14px; max-width: 100%; }
  .showcase-card-inner { padding: 18px 12px; }
  .showcase-verses { font-size: 0.92rem; line-height: 2; }
  .showcase-verse-row { white-space: normal; flex-wrap: wrap; justify-content: center; gap: 4px; }

  .studio-shell { padding: 14px; border-radius: 18px; }
  .studio-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .studio-topbar > div:last-child { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .studio-topbar .btn { width: 100%; justify-content: center; }

  /* تبويبات منزلقة بسلاسة باللمس مثل تطبيقات الهاتف */
  .editor-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  .editor-tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; padding: 9px 14px; font-size: 0.83rem; }

  /* منع التكبير التلقائي في iOS عند الكتابة */
  .field input[type="text"],
  .field input[type="search"],
  .field select,
  .field textarea { font-size: 16px; }

  .haraka-btn { min-width: 36px; height: 36px; font-size: 1.25rem; }
  .arud-grid, .templates-grid, .form-row { grid-template-columns: 1fr; }
  .analyzer-stats { grid-template-columns: repeat(2, 1fr); }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }

  .preview-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ratio-group { justify-content: space-between; width: 100%; }
  .ratio-btn { flex: 1; text-align: center; padding: 7px 6px; font-size: 0.76rem; }
  .canvas-stage { min-height: 320px; padding: 10px; }
  #poetryCanvas { max-height: 410px; }

  .export-actions { grid-template-columns: 1fr; }
  .export-actions .btn-gold,
  .export-actions #btnShareWhatsapp { grid-column: span 1; }

  .toast { left: 14px; right: 14px; bottom: 16px; text-align: center; }
  .modal-box { padding: 18px; }
}
