/* ————— مِداد: استوديو الخط العربي ————— */
* { box-sizing: border-box; }

/* لوحة الألوان (إعادة التصميم): فاتح أزرق + داكن ذهبي دافئ */
:root, :root[data-theme="light"], body[data-theme="light"] {
  --bg: #ffffff;
  --bg2: #f7f7f5;
  --panel: #ffffff;
  --panel2: #f7f7f5;
  --ink: #131316;
  --muted: #9a9aa2;
  --navy: #101014;
  --navy2: #22379e;
  --primary: #2746d6;
  --primary2: #1b2f9e;
  --gold: #2746d6;
  --gold2: #5a78ff;
  --on-acc: #ffffff;
  --line: #e7e7e3;
  --danger: #c0392b;
  --ok: #1f9d6b;
  --stage-checker-a: #ececea;
  --stage-checker-b: #f6f6f4;
}
:root[data-theme="dark"], body[data-theme="dark"] {
  --bg: #14110b;
  --bg2: #1d1810;
  --panel: #1d1810;
  --panel2: #221c12;
  --ink: #ece2cd;
  --muted: #8d846e;
  --navy: #1d1810;
  --navy2: #221c12;
  --primary: #d8b04e;
  --primary2: #f0d690;
  --gold: #d8b04e;
  --gold2: #f0d690;
  --on-acc: #221a08;
  --line: rgba(216,176,78,.16);
  --danger: #e0746a;
  --ok: #7fc98a;
  --stage-checker-a: #221c12;
  --stage-checker-b: #1d1810;
}

html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--gold) 7%, transparent), transparent), var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Naskh Arabic", "Geeza Pro", system-ui, sans-serif;
  font-size: 14.5px;
  transition: background .35s ease, color .35s ease;
}

/* ———— شاشة البداية ———— */
#splash {
  position: fixed; inset: 0; z-index: 99;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo {
  font-size: 64px; font-weight: 800; color: var(--gold2);
  text-shadow: 0 4px 30px color-mix(in srgb, var(--gold) 45%, transparent);
}
.splash-sub { color: var(--muted); margin-top: 6px; font-size: 18px; }
.splash-msg { margin-top: 28px; color: var(--muted); line-height: 2; }
.splash-msg code { background: var(--panel2); padding: 2px 8px; border-radius: 6px; color: var(--gold2); }

/* ———— الرأس ———— */
header {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; cursor: pointer; position: relative; }
.logo { font-size: 26px; font-weight: 800; color: var(--primary); }
.tagline { color: var(--muted); font-size: 13px; }
/* الشعار التفاعلي (نفس شعار الصفحة الرئيسية) */
.logoInk { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); display: inline-block; }
.logopen { color: var(--gold); font-size: 17px; display: inline-block; will-change: transform; }
.adm-title { color: var(--muted); font-size: 15px; font-weight: 600; }
#tabs { display: flex; gap: 6px; margin-inline-start: auto; }
#tabs button {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 16px; font-size: 14.5px; cursor: pointer; font-family: inherit;
}
#tabs button:hover { color: var(--ink); }
#tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#themeToggle { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; cursor: pointer; font-size: 15px; color: var(--ink); }
.acct-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; cursor: pointer; color: var(--ink); font-size: 13px; }
.acct-chip img { width: 28px; height: 28px; border-radius: 50%; }
.acct-chip .badge-mini { background: var(--gold); color: var(--on-acc); font-weight: 700; border-radius: 999px; padding: 1px 8px; font-size: 11px; }

/* زرّ تبديل المظهر (موحّد) */
.tg { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); transition: transform .2s, background .2s; flex: 0 0 auto; }
.tg:hover { transform: rotate(-12deg); }
.tg svg { width: 19px; height: 19px; }
:root[data-theme="light"] .tg .moon, body[data-theme="light"] .tg .moon { display: block; }
:root[data-theme="light"] .tg .sun, body[data-theme="light"] .tg .sun { display: none; }
:root[data-theme="dark"] .tg .sun, body[data-theme="dark"] .tg .sun { display: block; }
:root[data-theme="dark"] .tg .moon, body[data-theme="dark"] .tg .moon { display: none; }

/* ———— تخطيط عام ———— */
.tab-page { padding: 14px; }
.tab-page[hidden] { display: none !important; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
aside.panel { max-height: calc(100vh - 90px); overflow-y: auto; }

details { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
details:last-child { border-bottom: none; margin-bottom: 0; }
summary {
  cursor: pointer; font-weight: 700; color: var(--primary);
  padding: 4px 0; user-select: none; font-size: 15px;
}

/* ———— عناصر الإدخال ———— */
textarea, input[type=text], input[type=number], select {
  width: 100%;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-family: inherit; font-size: 15px;
}
textarea { resize: vertical; font-size: 19px; line-height: 1.9; }
textarea:focus, input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); }

.field { display: block; margin: 10px 0; color: var(--muted); }
.field > span { display: flex; justify-content: space-between; margin-bottom: 4px; }
.field select, .field input[type=text] { margin-top: 4px; }
output { color: var(--gold2); font-weight: 600; }

input[type=range] { width: 100%; accent-color: var(--gold); margin: 4px 0; }
input[type=color] {
  width: 38px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: none; cursor: pointer; vertical-align: middle;
}
input[type=number] { width: 90px; }

.hint { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 6px 0; }
.hint-inline { color: var(--muted); font-weight: 400; font-size: 12px; }
.row-label { color: var(--muted); font-size: 13px; margin: 10px 0 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: var(--panel2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-family: inherit; font-size: 13.5px;
}
.chip:hover { border-color: var(--gold); color: var(--gold2); }

.marks { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.mark {
  background: var(--panel2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; min-width: 38px; padding: 6px 6px; cursor: pointer;
  font-size: 18px; font-family: inherit;
}
.mark:hover { border-color: var(--gold); color: var(--gold2); }

.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0; color: var(--muted); }
.checks label, .switch, .radio-row label { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.switch { display: flex; margin: 10px 0 4px; color: var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 16px; height: 16px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; color: var(--muted); align-items: center; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0; color: var(--muted); }
.color-row label { display: inline-flex; align-items: center; gap: 7px; }
#geGradBlock, #geBgGradBlock, #geBgC1Block { display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.inline-range { display: inline-flex; align-items: center; gap: 8px; }
.inline-range input[type=range] { width: 110px; }
.sub-block { margin: 6px 0 10px; padding: 8px 10px; background: var(--panel2); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); }

.btn {
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.btn:hover { border-color: var(--gold); color: var(--gold2); }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--on-acc); font-weight: 700; border: none; }
.btn.primary:hover { filter: brightness(1.06); color: var(--on-acc); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; }


/* ———— منطقة المعاينة ———— */


/* ———— صانع الخطوط ———— */
.fm-modes { display: flex; gap: 8px; margin-bottom: 14px; }
.fm-modes button {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 22px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.fm-modes button.active { color: var(--gold2); border-color: var(--gold); background: var(--panel2); }

.fm-grid { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .fm-grid { grid-template-columns: 1fr; } }

.preview-box {
  background: var(--panel2); border: 1px dashed var(--line); border-radius: 12px;
  min-height: 110px; margin: 6px 0 14px; padding: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.badge { border-radius: 10px; padding: 9px 14px; margin: 8px 0; font-size: 14px; }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.status-line { color: var(--muted); min-height: 20px; margin: 6px 0; }

.dr-topbar {
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 14px; color: var(--muted);
}
.dr-topbar label { display: inline-flex; align-items: center; gap: 8px; }
.dr-topbar input[type=text] { width: 180px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.progress { width: 140px; height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); width: 0; transition: width .3s; }

.dr-grid { display: grid; grid-template-columns: 240px minmax(420px, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dr-grid { grid-template-columns: 1fr; } }

.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.letter-grid button {
  font-size: 22px; padding: 8px 0; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-family: inherit;
  position: relative;
}
.letter-grid button.done::after {
  content: ''; position: absolute; top: 5px; inset-inline-start: 6px;
  width: 7px; height: 7px; border-radius: 99px; background: var(--ok);
}
.letter-grid button.active { border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 0 1px var(--gold); }
.grid-sep { grid-column: 1/-1; color: var(--muted); font-size: 12px; margin-top: 8px; }

.draw-panel { display: flex; flex-direction: column; gap: 10px; }
.dr-canvas-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.form-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.form-tab {
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; cursor: pointer; font-family: inherit; font-size: 13px;
}
.form-tab.active { color: var(--gold2); border-color: var(--gold); }
.form-tab.done { color: var(--ok); }
#drawCanvas {
  width: 100%; max-width: 560px; aspect-ratio: 1; align-self: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.dr-tools { display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.dr-tools .inline-range input[type=range] { width: 150px; }
.dr-tools input[type=number] { width: 90px; }

.test-panel input[type=text] { font-size: 17px; }

/* ———— محرر الحروف ———— */
.ge-layout {
  display: grid;
  grid-template-columns: 52px 1fr 300px;
  gap: 10px;
  height: calc(100vh - 88px);
  min-height: 480px;
}
@media (max-width: 1000px) { .ge-layout { grid-template-columns: 48px 1fr; } .ge-panels { grid-column: 1 / -1; max-height: 40vh; } }

.ge-toolbar {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 4px;
}
.ge-toolbar button {
  width: 38px; height: 38px; font-size: 17px;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.ge-toolbar button:hover { border-color: var(--gold); color: var(--gold2); }
.ge-toolbar button.active { border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 0 1px var(--gold); }
.ge-toolbar button.danger { color: var(--danger); }
.ge-toolbar hr { width: 70%; border: none; border-top: 1px solid var(--line); margin: 2px 0; }

.ge-stage-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ge-stage {
  flex: 1; min-height: 0;
  background: repeating-conic-gradient(var(--stage-checker-a) 0 25%, var(--stage-checker-b) 0 50%) 0 0 / 22px 22px;
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
#geSvg { width: 100%; height: 100%; display: block; touch-action: none; }
.ge-artboard { stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ge-piece { cursor: move; }
.ge-piece:hover { opacity: .85; }
.ge-selbox { fill: none; stroke: #2f9df4; stroke-dasharray: 5 4; pointer-events: none; }
.ge-selbox.light { stroke: color-mix(in srgb, #2f9df4 55%, transparent); stroke-dasharray: 3 3; }
.ge-marquee { fill: rgba(47, 157, 244, .08); stroke: #2f9df4; stroke-dasharray: 4 3; pointer-events: none; }
.ge-char { display: block; color: var(--ink); margin: 8px 0 4px; }
.ge-handle { fill: #fff; stroke: #2f9df4; cursor: pointer; }
.ge-handle.ge-rot { cursor: grab; fill: #2f9df4; }
.ge-node.on { fill: #2f9df4; stroke: #fff; cursor: move; }
.ge-node.ctl { fill: #fff; stroke: #e0742f; cursor: move; }

.ge-statusbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 14px; color: var(--muted); font-size: 13px;
}
#geStatus { color: var(--ok); margin-inline-end: auto; }
.ge-statusbar label { display: inline-flex; align-items: center; gap: 6px; }
.ge-statusbar select { width: auto; padding: 5px 9px; }
.ge-export { display: flex; gap: 6px; flex-wrap: wrap; }

.ge-panels {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; overflow-y: auto;
}
.ge-variants {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px;
  max-height: 240px; overflow-y: auto;
}
.variant-card {
  aspect-ratio: 1; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer; padding: 4px;
}
.variant-card svg { width: 100%; height: 100%; }
.variant-card:hover { border-color: var(--gold); color: var(--gold2); }

.ge-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; color: var(--muted); margin: 8px 0; }
.ge-prop-grid label { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.ge-prop-grid input[type=number] { width: 76px; padding: 5px 7px; }
.ge-prop-grid .ge-char { grid-column: 1 / -1; color: var(--ink); }
.ge-char b { color: var(--gold2); font-size: 19px; }

/* ———— المساعدة ———— */
.help { max-width: 860px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; line-height: 2; }
.help h2 { color: var(--gold2); margin-top: 0; }
.help h3 { color: var(--gold2); margin-bottom: 4px; }
.help code { background: var(--panel2); padding: 2px 8px; border-radius: 6px; color: var(--gold2); }
.help li { margin: 4px 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════ الحساب والنوافذ المنبثقة ═══════════════ */
.header-end { display: flex; align-items: center; gap: 10px; }
.acct-ava { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.auth-modal-back {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 22, 38, .55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-modal {
  position: relative; width: min(560px, 96vw); max-height: 92vh; overflow-y: auto;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 26px; box-shadow: 0 30px 80px rgba(15,22,38,.35);
}
.auth-modal.sm { width: min(420px, 96vw); }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-logo { font-size: 30px; font-weight: 800; color: var(--primary); }
.auth-head p { color: var(--muted); margin: 6px 0 0; }
.auth-gbtn { display: flex; justify-content: center; min-height: 44px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-demo { display: flex; flex-direction: column; gap: 10px; }
.auth-demo input { width: 100%; }
.auth-err { color: var(--danger); font-size: 13px; min-height: 16px; text-align: center; }
.auth-note { color: var(--muted); font-size: 12.5px; line-height: 1.8; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.auth-note.center { text-align: center; margin-top: 14px; }
.auth-x { position: absolute; top: 14px; left: 16px; background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.acct-status { text-align: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--ink); margin-bottom: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { text-align: right; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; cursor: pointer; font-family: inherit; font-size: 14px; color: var(--ink); }
.menu-item:hover { border-color: var(--primary); }
.menu-item.danger { color: var(--danger); }

.btn-cta {
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color: var(--on-acc); font-weight: 800; border: none; border-radius: 12px;
  padding: 12px 22px; cursor: pointer; font-family: inherit; font-size: 15px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--gold) 40%, transparent);
  transition: transform .12s, filter .12s; text-decoration: none; display: inline-block; text-align: center;
}
.btn-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-cta.full { width: 100%; }
.btn-navy { background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 12px 22px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px; text-decoration: none; display: inline-block; }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 12px; padding: 11px 22px; cursor: pointer; font-family: inherit; font-weight: 700; text-decoration: none; display: inline-block; }

/* باقات الاشتراك */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-card {
  position: relative; background: var(--panel2); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 22px 16px 18px; text-align: center;
}
.plan-card.best { border-color: var(--gold); box-shadow: 0 12px 30px color-mix(in srgb, var(--gold) 22%, transparent); }
.plan-card.popular { border-color: var(--primary2); }
.plan-card.current { outline: 2px dashed var(--ok); }
.plan-flag { position: absolute; top: -11px; inset-inline-start: 50%; transform: translateX(50%); background: var(--gold); color: var(--on-acc); font-weight: 800; font-size: 11px; padding: 3px 12px; border-radius: 999px; }
.plan-flag.pop { background: var(--primary2); color: #fff; }
.plan-name { color: var(--muted); font-weight: 700; }
.plan-price { font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1.1; margin-top: 4px; }
.plan-price .cur { font-size: 20px; vertical-align: super; color: var(--gold); }
.plan-per { color: var(--muted); font-size: 12.5px; }
.plan-note { color: var(--ok); font-size: 12.5px; margin: 8px 0 14px; min-height: 16px; font-weight: 600; }

/* ═══════════════ صفحة الهبوط ═══════════════ */
@font-face { font-family: 'AmiriLP'; src: url('fonts/Amiri-Regular.ttf'); font-display: swap; }
@font-face { font-family: 'ReemLP'; src: url('fonts/ReemKufi.ttf'); font-display: swap; }
body.landing { height: auto; }
.lp-nav {
  display: flex; align-items: center; gap: 20px; padding: 14px 5vw;
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lp-brand { font-size: 26px; font-weight: 800; color: var(--primary); }
.lp-brand span { color: var(--gold); }
.lp-links { display: flex; gap: 22px; margin-inline-start: auto; }
.lp-links a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.lp-links a:hover { color: var(--gold); }
.lp-nav-cta { display: flex; align-items: center; gap: 10px; }
@media (max-width: 820px) { .lp-links { display: none; } }

.lp-hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  padding: 70px 5vw 60px; max-width: 1280px; margin: 0 auto;
}
@media (max-width: 920px) { .lp-hero { grid-template-columns: 1fr; text-align: center; } }
.lp-eyebrow { display: inline-block; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.lp-hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.25; color: var(--primary); margin: 16px 0; }
.lp-hero h1 .hl { color: var(--gold); }
.lp-hero p.sub { font-size: 18px; color: var(--muted); line-height: 1.9; max-width: 560px; }
@media (max-width: 920px) { .lp-hero p.sub { margin-inline: auto; } }
.lp-hero-cta { display: flex; gap: 12px; margin: 26px 0 18px; flex-wrap: wrap; }
@media (max-width: 920px) { .lp-hero-cta { justify-content: center; } }
.lp-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 920px) { .lp-trust { justify-content: center; } }
.lp-trust b { color: var(--ok); }

.lp-art {
  background: linear-gradient(150deg, var(--navy), #16223e);
  border-radius: 26px; padding: 38px 26px; position: relative; overflow: hidden;
  box-shadow: 0 30px 70px rgba(20,30,55,.35); min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.lp-art::before { content: ''; position: absolute; inset: -40%; background: radial-gradient(circle at 30% 20%, rgba(244,181,63,.18), transparent 55%); }
.lp-art-main {
  font-family: 'AmiriLP', serif; font-size: clamp(40px, 7vw, 78px); line-height: 1.4; text-align: center;
  background: linear-gradient(120deg, #f4b53f, #e0972a 60%, #fff4d6);
  -webkit-background-clip: text; background-clip: text; color: transparent; position: relative;
}
.lp-art-sub { font-family: 'ReemLP', sans-serif; color: #cdd8f0; font-size: 22px; position: relative; }
.lp-chips { display: flex; gap: 8px; position: relative; flex-wrap: wrap; justify-content: center; }
.lp-chip { font-family: 'AmiriLP', serif; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: #f4b53f; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; }

.lp-section { max-width: 1180px; margin: 0 auto; padding: 60px 5vw; }
.lp-section h2 { font-size: clamp(26px, 3.4vw, 38px); color: var(--primary); text-align: center; margin: 0 0 8px; }
.lp-section .lead { text-align: center; color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 auto 38px; line-height: 1.9; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .lp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .lp-grid { grid-template-columns: 1fr; } }
.lp-feat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; transition: transform .15s, box-shadow .15s; }
.lp-feat:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(20,30,55,.1); }
.lp-feat .ic { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 22%, transparent), color-mix(in srgb, var(--primary) 14%, transparent)); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 14px; }
.lp-feat h3 { color: var(--primary); margin: 0 0 8px; font-size: 19px; }
.lp-feat p { color: var(--muted); line-height: 1.9; margin: 0; font-size: 14.5px; }

.lp-alt { background: var(--bg2); }
.lp-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .lp-tools { grid-template-columns: 1fr; } }
.lp-tool { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.lp-tool .tn { font-size: 28px; flex-shrink: 0; }
.lp-tool h4 { margin: 0 0 5px; color: var(--primary); font-size: 16.5px; }
.lp-tool p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.8; }

.lp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: st; }
@media (max-width: 820px) { .lp-steps { grid-template-columns: 1fr 1fr; } }
.lp-step { text-align: center; padding: 10px; }
.lp-step .num { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 19px; }
.lp-step h4 { color: var(--primary); margin: 0 0 6px; }
.lp-step p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.8; }

.lp-faq { max-width: 800px; margin: 0 auto; }
.lp-faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; }
.lp-faq summary { color: var(--primary); font-size: 16px; padding: 14px 0; }
.lp-faq p { color: var(--muted); line-height: 1.9; margin: 0 0 14px; }

.lp-footer { background: var(--navy); color: #cdd8f0; padding: 50px 5vw 28px; margin-top: 40px; }
.lp-footer-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .lp-footer-in { grid-template-columns: 1fr; } }
.lp-footer h4 { color: #fff; margin: 0 0 14px; }
.lp-footer .fbrand { font-size: 26px; font-weight: 800; color: #fff; }
.lp-footer .fbrand span { color: var(--gold2); }
.lp-footer a { color: #cdd8f0; text-decoration: none; display: block; margin: 8px 0; }
.lp-footer a:hover { color: var(--gold2); }
.lp-footer p { color: #9fb0d4; line-height: 1.9; font-size: 14px; }
.lp-copy { text-align: center; color: #8294bd; border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 20px; font-size: 13px; }
.lp-pricing-note { text-align: center; color: var(--muted); margin-top: 18px; font-size: 13.5px; }

.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%) translateY(20px); background: var(--primary); color: #fff; padding: 14px 24px; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.3); opacity: 0; transition: all .3s; z-index: 2000; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ═══════════════ لوحة الإدارة ═══════════════ */
.adm-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 5vw; }
.adm-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.adm-top .logo { font-size: 24px; font-weight: 800; color: var(--primary); }
.adm-top .sp { margin-inline-start: auto; }
.adm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px) { .adm-stats { grid-template-columns: 1fr 1fr; } }
.adm-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.adm-stat .v { font-size: 30px; font-weight: 800; color: var(--primary); }
.adm-stat .l { color: var(--muted); font-size: 13px; }
.adm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 18px; }
.adm-card h3 { color: var(--primary); margin: 0 0 14px; }
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th, .adm-table td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-table th { color: var(--muted); font-weight: 600; }
.adm-table td .pill { background: var(--panel2); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.adm-table td .pill.on { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.adm-table td .pill.off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.adm-row-act { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-form { display: grid; grid-template-columns: 220px 1fr; gap: 10px 16px; align-items: center; }
@media (max-width: 640px) { .adm-form { grid-template-columns: 1fr; } }
.adm-form label { color: var(--muted); font-size: 14px; }
.adm-gate { max-width: 420px; margin: 12vh auto; text-align: center; }
.adm-mini { width: auto !important; padding: 5px 8px; font-size: 12px; }
.adm-row-act .btn { padding: 5px 9px; font-size: 12px; }

/* كوبونات + سعر مشطوب */
.coupon-row { display: flex; gap: 8px; margin-bottom: 8px; }
.coupon-row input { flex: 1; }
.coupon-msg { min-height: 18px; font-size: 13px; margin-bottom: 10px; text-align: center; }
.coupon-msg.ok { color: var(--ok); }
.coupon-msg.bad { color: var(--danger); }
.plan-price .was { font-size: 18px; color: var(--muted); text-decoration: line-through; font-weight: 600; }

/* نماذج جاهزة */
.lp-tpls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .lp-tpls { grid-template-columns: 1fr 1fr; } }
.tpl-card { border: none; border-radius: 16px; overflow: hidden; cursor: pointer; padding: 0; background: var(--panel); box-shadow: 0 8px 24px rgba(20,30,55,.08); transition: transform .15s, box-shadow .15s; font-family: inherit; }
.tpl-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20,30,55,.18); }
.tpl-prev { height: 150px; display: flex; align-items: center; justify-content: center; padding: 14px; text-align: center; }
.tpl-prev span { font-family: 'AmiriLP', serif; font-size: 34px; line-height: 1.5; }
.tpl-foot { background: var(--panel); padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; }
.tpl-foot b { color: var(--ink); font-size: 14.5px; }
.tpl-foot .go { color: var(--gold); font-weight: 700; font-size: 13px; }

/* المقارنة */
.cmp-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: right; }
.cmp-table thead th { background: var(--primary); color: #fff; font-size: 15px; }
.cmp-table thead th.us { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--on-acc); }
.cmp-table td.feat { color: var(--ink); font-weight: 600; }
.cmp-table td .yes { color: var(--ok); font-weight: 800; font-size: 18px; }
.cmp-table td .no { color: var(--danger); font-weight: 800; font-size: 18px; }
.cmp-table td .partial { color: var(--muted); }
.cmp-table tbody tr:hover { background: var(--panel2); }
.cmp-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; }

/* آراء */
.lp-quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .lp-quotes { grid-template-columns: 1fr; } }
.quote { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.quote p { color: var(--ink); line-height: 1.9; margin: 0 0 14px; }
.quote .who { display: flex; align-items: center; gap: 10px; }
.quote .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.quote .who b { color: var(--primary); display: block; }
.quote .who span { color: var(--muted); font-size: 12.5px; }

/* محرر الباقات/الكوبونات في الإدارة */
.tier-edit, .cpn-edit { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; margin-bottom: 8px; padding: 10px; background: var(--panel2); border-radius: 10px; }
.tier-edit input, .cpn-edit input, .cpn-edit select { width: 100%; padding: 7px 9px; font-size: 13px; }
.tier-edit label, .cpn-edit label { font-size: 11px; color: var(--muted); display: block; }
@media (max-width: 800px) { .tier-edit, .cpn-edit { grid-template-columns: 1fr 1fr; } }
.acct-quota { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.acct-quota b { color: var(--primary); }

/* تخطيط الإدارة بأقسام */
.adm-layout { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .adm-layout { grid-template-columns: 1fr; } }
.adm-nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 16px; }
@media (max-width: 820px) { .adm-nav { flex-direction: row; flex-wrap: wrap; position: static; } }
.adm-nav button { text-align: right; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 600; }
.adm-nav button:hover { border-color: var(--primary); }
.adm-nav button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.adm-steps { color: var(--muted); line-height: 2; padding-inline-start: 20px; margin: 10px 0; }
.adm-steps b { color: var(--ink); }
.ge-tip { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }
.ge-tip .field { margin: 7px 0; }
.ge-tip-apex { fill: var(--gold); stroke: #fff; }
.ge-tip-cut { stroke: var(--gold); stroke-dasharray: 5 4; fill: none; pointer-events: none; }

/* ═══ بانر المطوّر/الإعلانات + شارة المجانية ═══ */
.promo-slot { margin: 0 auto; }
.promo-banner { max-width: 1100px; padding: 10px 5vw 0; }
.promo-unit { display: block; position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; background: var(--panel); box-shadow: 0 4px 14px rgba(20,30,55,.06); }
.promo-unit img { width: 100%; display: block; }
.promo-text { padding: 20px; text-align: center; color: var(--ink); font-weight: 700; font-size: 17px; }
.promo-tag { position: absolute; top: 6px; inset-inline-start: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 6px; }
.ge-panels .promo-slot { margin-top: 10px; }
.free-badge { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 700; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
@media (max-width: 820px) { .free-badge { display: none; } }
.lp-free { text-align: center; background: linear-gradient(150deg, var(--navy), #16223e); color: #fff; border-radius: 22px; padding: 46px 24px; box-shadow: 0 24px 60px rgba(20,30,55,.28); }
.lp-free h2 { color: #fff; }
.lp-free .lead { color: #cdd8f0; }
.adm-ad-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.adm-ad-row .thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--bg2); }
.adm-ad-row .meta b { color: var(--ink); }
.adm-ad-row .meta span { color: var(--muted); font-size: 12px; display: block; }

/* صفحات قانونية */
.legal { max-width: 820px; margin: 0 auto; padding: 36px 5vw 10px; line-height: 2; color: var(--ink); }
.legal h1 { color: var(--primary); margin-bottom: 4px; }
.legal h3 { color: var(--primary); margin-top: 24px; margin-bottom: 4px; }
.legal .upd { color: var(--muted); font-size: 13px; margin-top: 0; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin: 5px 0; }
.legal a { color: var(--gold); }
.legal-credit { margin: 30px 0 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center; color: var(--muted); }
.legal-credit a { color: var(--primary); text-decoration: none; }

/* شريط موافقة الكوكيز (سياسة جوجل للإعلانات) */
.mx-consent {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 3000;
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  background: var(--navy); color: #e6ecf8;
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: 14px 18px; box-shadow: 0 16px 50px rgba(10,16,30,.45); font-size: 14px; line-height: 1.7;
}
.mx-consent a { color: var(--gold2); }
.mx-consent-btns { display: flex; gap: 8px; }
.mx-consent .btn { background: transparent; color: #e6ecf8; border-color: rgba(255,255,255,.3); }
.mx-consent .btn:hover { color: #fff; border-color: #fff; }
