:root {
  --ink: #15302a;
  --ink-2: #44574f;
  --muted: #6b7c76;
  --line: #dce3de;
  --bg: #ffffff;
  --surface: #f2f5f2;
  --majlis: #0f4c3a;
  --majlis-2: #156049;
  --saffron: #c8902e;
  --saffron-soft: #f7ecd6;
  --yes: #1e7a52;
  --yes-bg: #e1f2e9;
  --no: #a93c3c;
  --no-bg: #f8e3e1;
  --wait: #8a5f0f;
  --wait-bg: #fbefd6;
  --in: #2b5c9e;
  --in-bg: #e3ecf8;
  --wa: #1a9f4c;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif;
  --display: "Aref Ruqaa", "Amiri", "Traditional Arabic", "Noto Naskh Arabic", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { line-height: 1.3; margin: 0; }
p { margin: 0; }
a { color: var(--majlis); }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }

/* ---------- عناصر الإدخال والأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  font: 600 .95rem/1.2 var(--font);
  border: 1px solid transparent; border-radius: 10px;
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--majlis); color: #fff; }
.btn.primary:hover { background: var(--majlis-2); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--no-bg); color: var(--no); }
.btn.sm { min-height: 36px; padding: .35rem .8rem; font-size: .85rem; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }

.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.icon-btn.wa.done { background: #fff; color: var(--wa); border-color: #9fd6b4; }
.icon-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
label.field > small { display: block; color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type="text"], input[type="tel"], input[type="password"], input[type="search"],
input[type="date"], input[type="time"], input[type="url"], textarea, select {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: 400 1rem/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1px solid #c9d3cc; border-radius: 10px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--majlis); box-shadow: 0 0 0 3px rgba(15, 76, 58, .15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; cursor: pointer; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 30px; background: #c9d3cc; position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--yes); }
.switch input:checked::after { transform: translateX(-20px); }

/* ---------- الحالات ---------- */
.pill { display: inline-block; padding: .15rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.pending { background: var(--wait-bg); color: var(--wait); }
.pill.yes { background: var(--yes-bg); color: var(--yes); }
.pill.no { background: var(--no-bg); color: var(--no); }
.pill.in { background: var(--in-bg); color: var(--in); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.yes { background: var(--yes); } .dot.no { background: var(--no); } .dot.pending { background: #d9b263; } .dot.in { background: var(--in); }

/* ---------- لوحة المسؤول ---------- */
.admin { background: #e6ece8; }
.shell { max-width: 760px; margin: 0 auto; min-height: 100vh; overflow-x: clip; background: var(--bg); padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
body.admin::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--majlis); z-index: 30; }
.appbar { background: var(--majlis) var(--pattern); color: #fff; padding: .6rem 1rem 1rem; }
.appbar-row { display: flex; align-items: center; gap: .5rem; }
.ev-switch { position: relative; flex: 1; min-width: 0; }
.ev-switch select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 46px; padding: .2rem .2rem .2rem 1.8rem;
  background: transparent; border: 0; border-radius: 8px; color: #fff; font: 700 1.2rem/1.3 var(--font);
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden; cursor: pointer;
}
.ev-switch select:focus { box-shadow: none; }
.ev-switch select option { color: var(--ink); font-size: 1rem; font-weight: 500; }
.ev-switch svg { position: absolute; left: .2rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none; opacity: .75; }
.icon-btn { position: relative; }
.badge { position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e0533f; color: #fff; font: 700 .72rem/20px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--majlis); }
.logo-row { display: flex; align-items: center; gap: 1rem; margin: .2rem 0 .5rem; }
.logo-prev { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 6px; flex: none; }
.logo-prev.empty { display: grid; place-items: center; font-size: .72rem; color: var(--muted); text-align: center; }
.pay-card { margin: 1rem 1rem 0; padding: 1.1rem; border-radius: 16px; background: #13382d; color: #fff; display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.pay-amount { font-size: 1.02rem; }
.pay-amount b { font-size: 1.6rem; color: #e3bd72; font-variant-numeric: tabular-nums; margin: 0 .2rem; }
.pay-card .btn.gold { background: var(--saffron); color: #1d1406; }
.pay-card .btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); justify-self: start; }
.pay-bank { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; font-size: .92rem; color: rgba(255,255,255,.85); }
.iban { display: flex; justify-content: space-between; align-items: center; gap: .8rem; width: 100%; padding: .7rem .9rem; border-radius: 12px; border: 1px dashed rgba(227,189,114,.6); background: rgba(255,255,255,.06); color: #fff; font: 600 1rem var(--font); cursor: pointer; letter-spacing: .03em; }
.iban small { color: #e3bd72; font-weight: 600; flex: none; }
.iban .ltr { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.pay-note { font-size: .86rem; color: rgba(255,255,255,.7); }
.hub { list-style: none; margin: 0; padding: 0; }
.hub button, .hub a { width: 100%; display: flex; align-items: center; gap: .9rem; padding: .9rem .2rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: right; text-decoration: none; cursor: pointer; }
.hub svg { width: 24px; height: 24px; flex: none; color: var(--majlis); }
.hub span { flex: 1; display: grid; }
.hub b { font-size: 1rem; }
.hub small { color: var(--muted); font-size: .84rem; }
.badge-inline { font-style: normal; background: #fde6e2; color: #b33b2b; font-weight: 700; font-size: .78rem; padding: .15rem .6rem; border-radius: 99px; }
.acc-sum { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 1rem; background: var(--surface); border-radius: 14px; padding: .7rem .3rem; }
.acc-sum div { text-align: center; border-inline-start: 1px solid var(--line); }
.acc-sum div:first-child { border-inline-start: 0; }
.acc-sum dt { font-size: .76rem; color: var(--muted); }
.acc-sum dd { margin: 0; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-sum dd.ok { color: var(--yes); }
.acc-sum dd.due { color: var(--wait); }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; text-align: right; padding: .8rem .2rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; cursor: pointer; }
.req-list .r-name { font-weight: 700; }
.req-list .r-meta { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); }
.req-list time { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.pill.r-new { background: #fde6e2; color: #b33b2b; }
.pill.r-contacted { background: var(--wait-bg); color: var(--wait); }
.pill.r-confirmed { background: var(--yes-bg); color: var(--yes); }
.pill.r-cancelled { background: var(--surface); color: var(--muted); }
.kv { margin: 0 0 1rem; display: grid; gap: .1rem; }
.kv div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.pkg-edit { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin-bottom: .8rem; }
.pkg-edit legend { font-weight: 700; padding: 0 .3rem; }
.ev-title { flex: 1; min-width: 0; font-size: 1.2rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .4rem .2rem; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.type-opt { position: relative; display: block; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; }
.type-opt span { display: block; height: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .8rem; }
.type-opt b { display: block; font-size: .9rem; line-height: 1.45; }
.type-opt small { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.type-opt input:checked + span { border-color: var(--majlis); background: #eef6f1; box-shadow: inset 0 0 0 1px var(--majlis); }
.type-opt input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.dz-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: .7rem; margin-top: .8rem; }
.dz-opt { display: grid; gap: .35rem; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); text-align: center; }
.dz-opt .dz-wrap, .dz-opt .dz-plain { border-radius: 10px; overflow: hidden; outline: 2px solid var(--line); outline-offset: 0; }
.dz-opt .dz-plain { aspect-ratio: 2 / 3; display: grid; place-items: center; background: #fff; color: var(--muted); font-size: .8rem; font-weight: 600; box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px var(--saffron); }
.dz-opt small { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.dz-opt.on .dz-wrap, .dz-opt.on .dz-plain { outline: 3px solid var(--majlis); outline-offset: 2px; }
.dz-opt.on small { color: var(--majlis); }
.inv-card .dz-wrap { border-radius: 0; }
.card-prev { display: block; max-width: 220px; width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: .6rem 0; }
.link-row { display: grid; gap: .2rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.link-row:first-of-type { border-top: 0; padding-top: 0; }
.link-row small { color: var(--muted); font-size: .84rem; }
.link-row .actions-row { margin-top: .5rem; gap: .45rem; }
.rlist .wish-row { display: block; }
.rlist .wish-row p { color: var(--ink-2); margin-top: .2rem; white-space: pre-line; line-height: 1.8; }
.icon-btn.on-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.ev-when { color: rgba(255,255,255,.74); font-size: .86rem; margin: 0 .2rem .9rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; background: rgba(0,0,0,.2); border-radius: 14px; padding: .65rem .2rem; }
.kpis div { text-align: center; border-inline-start: 1px solid rgba(255,255,255,.12); }
.kpis div:first-child { border-inline-start: 0; }
.kpis dt { font-size: .74rem; color: rgba(255,255,255,.72); }
.kpis dd { margin: 0; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpis .k-yes dd { color: #9be6bd; }
.kpis .k-no dd { color: #f6b1a9; }
.kpis .k-in dd { color: #b3d0f7; }

.bnav { position: fixed; inset: auto 0 0; z-index: 25; display: flex; justify-content: center; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bnav-in { display: flex; width: 100%; max-width: 760px; }
.bnav button { position: relative; flex: 1; display: grid; justify-items: center; gap: 1px; padding: .55rem 0 .5rem; border: 0; background: none; font: 600 .74rem var(--font); color: #7d8c86; cursor: pointer; }
.bnav svg { width: 24px; height: 24px; }
.bnav button[aria-selected="true"] { color: var(--majlis); }
.bnav button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--saffron); }
.admin .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }

.view { padding: 1rem 1rem 6rem; }
.toolbar { display: flex; gap: .6rem; margin-bottom: .8rem; }
.toolbar input { flex: 1; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .4rem; margin: 0 -1rem .6rem; padding-inline: 1rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: .3rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: 500 .85rem var(--font); color: var(--ink-2); cursor: pointer; }
.chip b { font-weight: 700; margin-inline-start: .25rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.glist { list-style: none; margin: 0; padding: 0; }
.grow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; background: var(--surface); color: var(--ink-2); flex: none; }
.avatar.s-yes { background: var(--yes-bg); color: var(--yes); }
.avatar.s-no { background: var(--no-bg); color: var(--no); }
.avatar.s-in { background: var(--in-bg); color: var(--in); }
.avatar.s-pending { background: var(--wait-bg); color: var(--wait); }
.g-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; }
.g-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin-top: .2rem; }
.g-meta .pill { font-size: .72rem; padding: .05rem .55rem; }
.g-actions { display: flex; gap: .4rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 1.15rem; margin-bottom: .4rem; }
.empty .btn { margin-top: 1rem; }

/* الإرسال المتتابع */
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 1rem; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; font: 600 .88rem var(--font); color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--majlis); box-shadow: 0 1px 3px rgba(21,48,42,.12); }
.queue { border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.queue .q-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; }
.queue .q-name { font-size: 1.3rem; font-weight: 700; }
.progress { height: 6px; background: var(--surface); border-radius: 6px; overflow: hidden; margin-bottom: 1rem; }
.progress > span { display: block; height: 100%; background: var(--wa); transition: width .3s; }
.msg-preview { white-space: pre-wrap; background: #e9f6ee; border-radius: 12px 12px 4px 12px; padding: .8rem 1rem; font-size: .9rem; margin: .8rem 0 1rem; max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
.q-actions { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .9rem; }

/* التقارير */
.rep-block { margin-bottom: 1.6rem; }
.rep-block .chips { margin-inline: 0; padding-inline: 0; }
.rlist li > * { min-width: 0; overflow-wrap: anywhere; }
.g-name, .r-name, .kv dd { overflow-wrap: anywhere; }
.rep-block h2 { font-size: 1rem; margin-bottom: .7rem; }
.stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--surface); }
.stack span { display: block; height: 100%; }
.stack .yes { background: var(--yes); } .stack .no { background: var(--no); } .stack .pending { background: #e2c27e; }
.legend { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .35rem; }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.legend small { color: var(--muted); width: 3.2rem; text-align: left; }
.donut-wrap { display: grid; grid-template-columns: 132px 1fr; gap: 1.2rem; align-items: center; }
.donut { width: 132px; height: 132px; display: block; }
.donut .d-total { font: 700 26px var(--font); fill: var(--ink); }
.donut .d-label { font: 500 11px var(--font); fill: var(--muted); }
.donut-wrap .legend { margin: 0; }
.attend-line { font-size: 1.05rem; margin-bottom: .5rem; }
.attend-line b { font-size: 1.7rem; color: var(--in); font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--surface); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--in); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; margin: 0; }
.facts div { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-2); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rlist { list-style: none; padding: 0; margin: 0; }
.rlist li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.rlist time, .rlist small { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.actions-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* الإعدادات */
.card-sec { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.card-sec h2 { font-size: 1rem; margin-bottom: .8rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .6rem; }
.ph-chips button { border: 1px dashed var(--saffron); background: var(--saffron-soft); color: #6d4a0e; border-radius: 8px; padding: .2rem .55rem; font: 500 .8rem var(--font); cursor: pointer; }
.sticky-save { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 82px); }

/* النوافذ المنبثقة */
dialog.sheet {
  border: 0; padding: 0; width: min(560px, 100%); max-height: 92dvh;
  border-radius: 20px; color: var(--ink); background: #fff;
  box-shadow: 0 20px 60px rgba(10, 30, 25, .35);
}
dialog.sheet::backdrop { background: rgba(10, 30, 25, .5); }
.sheet-in { padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0px)); overflow: auto; max-height: 92dvh; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.sheet-head h2 { font-size: 1.1rem; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: .7rem; min-height: 50px; padding: 0 .3rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: 500 1rem var(--font); color: var(--ink); text-align: right; cursor: pointer; text-decoration: none; }
.menu svg { width: 22px; height: 22px; flex: none; color: var(--wa); }
.menu .danger-text { color: var(--no); }
.status-set { display: flex; gap: .5rem; margin: .6rem 0 .2rem; }
.status-set button { flex: 1; }
.status-set button[aria-pressed="true"] { outline: 2px solid var(--ink); }
.xl-steps p { font-size: .9rem; color: var(--ink-2); line-height: 1.8; }
.xl-drop { display: grid; place-items: center; min-height: 90px; margin-top: .4rem; border: 2px dashed #c9d3cc; border-radius: 14px; background: var(--surface); cursor: pointer; text-align: center; padding: 1rem; }
.xl-drop:hover, .xl-drop:focus-within { border-color: var(--majlis); }
.xl-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.xl-drop span { font-weight: 600; color: var(--majlis); }
.pill.sec-men { background: #e4edf8; color: #2b5c9e; }
.pill.sec-women { background: #f8e6ef; color: #9b3a6a; }
.plus-tag { font-size: .74rem; font-weight: 700; color: var(--saffron); background: var(--saffron-soft); padding: .05rem .45rem; border-radius: 99px; }
.stepper { display: flex; align-items: center; gap: .8rem; margin-top: .4rem; }
.stepper b { min-width: 2ch; text-align: center; font-size: 1.15rem; }
.gm-extra { margin-top: .8rem; }
.people-line { font-size: .92rem; color: var(--ink-2); margin: .2rem 0 .6rem; }
.people-line b { color: var(--in); font-variant-numeric: tabular-nums; }
.sec-split { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.sec-card { border-radius: 12px; padding: .7rem .8rem; display: grid; gap: .1rem; font-size: .86rem; }
.sec-card b { font-size: 1rem; }
.sec-card.sec-men { background: #eef3fa; color: #2b5c9e; }
.sec-card.sec-women { background: #fbeff4; color: #9b3a6a; }
.parsed li .pill, .parsed li .plus-tag { flex: none; }
.parsed { list-style: none; margin: .6rem 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.parsed li { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.parsed li:last-child { border-bottom: 0; }
.parsed li.bad { background: var(--no-bg); }
.parsed .x { margin-inline-start: auto; border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--muted); padding: .2rem .4rem; }

@media (max-width: 600px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 1.2rem); z-index: 100;
  transform: translate(-50%, 150%); opacity: 0;
  background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 12px;
  font-weight: 500; max-width: calc(100% - 2rem); text-align: center;
  transition: transform .25s, opacity .25s, visibility .25s;
  pointer-events: none; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.err { background: var(--no); }

/* شاشة الدخول */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--majlis) var(--pattern); }
.login form, .login .login-box { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 1.6rem; }
.login h1 { font-size: 1.3rem; margin-bottom: .3rem; }
.login p { color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }

:root {
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c8902e' stroke-opacity='.28' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- صفحة الدعوة ---------- */
:root { --gold: #b8862f; --gold-line: #e7d6b2; --gold-text: #8a6017; }
.invite { background: var(--majlis) var(--pattern); min-height: 100vh; }
.inv-wrap { max-width: 470px; margin: 0 auto; padding: 1.4rem 1rem 2.4rem; }
.inv-card { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .42); animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: none; } }
.inv-main { position: relative; padding: 2.5rem 1.7rem 2rem; text-align: center; }
.inv-main::before { content: ""; position: absolute; inset: 12px 12px 0; border: 1px solid var(--gold-line); border-bottom: 0; border-radius: 12px 12px 0 0; pointer-events: none; }
.inv-main .corner { position: absolute; top: 4px; width: 18px; height: 18px; color: var(--gold); }
.inv-main .corner.r { right: 4px; }
.inv-main .corner.l { left: 4px; }
.orn { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 1.1rem; color: var(--gold); }
.inv-hosts { font-size: .98rem; color: var(--ink-2); line-height: 1.85; }
.inv-hosts strong { display: block; font-size: 1.18rem; color: var(--ink); }
.inv-title { font-family: var(--display); font-weight: 700; color: var(--majlis); font-size: clamp(2.5rem, 11.5vw, 3.5rem); line-height: 1.5; margin: .35rem 0 .2rem; overflow-wrap: anywhere; }
.orn.small { width: 120px; margin-bottom: 1.4rem; }
.inv-guest { margin: 0 0 1.7rem; }
.inv-guest span { display: block; font-size: .8rem; font-weight: 600; color: var(--gold-text); }
.inv-guest strong { font-size: 1.3rem; color: var(--ink); }
.inv-date { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; max-width: 330px; margin: 0 auto; }
.inv-date .d-side { font-size: .98rem; font-weight: 600; color: var(--ink-2); padding: .55rem 0; border-block: 1px solid var(--gold-line); line-height: 1.45; }
.inv-date .d-num { font-size: 3.4rem; font-weight: 700; color: var(--majlis); line-height: 1; font-variant-numeric: tabular-nums; }
.d-hijri { font-size: .86rem; color: var(--muted); margin-top: .7rem; }
.inv-place { margin-top: 1.2rem; display: grid; gap: .15rem; }
.inv-place p { font-size: 1.06rem; font-weight: 600; }
.map-btn { display: inline-flex; align-items: center; gap: .35rem; justify-self: center; margin-top: .7rem; padding: .45rem 1rem; border: 1px solid var(--gold-line); border-radius: 99px; color: var(--majlis); font-size: .88rem; font-weight: 600; text-decoration: none; }
.map-btn svg { width: 16px; height: 16px; }
.inv-notes { white-space: pre-line; color: var(--muted); font-size: .9rem; margin-top: 1.4rem; line-height: 1.85; }
.perf { position: relative; height: 26px; background: linear-gradient(#fff 50%, #fafbfa 50%); }
.perf::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; border-top: 2px dashed #dce3de; }
.perf i { position: absolute; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--majlis); }
.perf i:first-child { right: -13px; }
.perf i:last-child { left: -13px; }
.inv-stub { padding: 1.2rem 1.7rem 1.9rem; text-align: center; background: #fafbfa; }
.stub-label { font-size: .8rem; font-weight: 700; color: var(--gold-text); }
.inv-stub h2 { font-size: 1.15rem; margin: .15rem 0 1.1rem; }
.inv-stub .btns { display: grid; gap: .6rem; }
.inv-stub .linkish { margin-top: .9rem; background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font: 500 .88rem var(--font); cursor: pointer; padding: .4rem; }
.confirmed { display: inline-flex; align-items: center; gap: .35rem; background: var(--yes-bg); color: var(--yes); padding: .3rem .85rem; border-radius: 99px; font-weight: 700; font-size: .88rem; }
.confirmed svg { width: 16px; height: 16px; }
.coming { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: .4rem 0 1rem; }
.coming button { min-width: 48px; min-height: 46px; padding: .3rem .9rem; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font: 700 1rem var(--font); color: var(--ink); cursor: pointer; }
.coming button[aria-checked="true"] { background: var(--majlis); border-color: var(--majlis); color: #fff; }
.w-ask { font-weight: 600; margin-top: .4rem; }
.w-ask small { color: var(--muted); font-weight: 400; }
.pass-extra { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: .2rem 0 .6rem; }
.sec-badge, .with-badge { font-size: .86rem; font-weight: 700; padding: .25rem .8rem; border-radius: 99px; }
.sec-badge.sec-men { background: #e4edf8; color: #2b5c9e; }
.sec-badge.sec-women { background: #f8e6ef; color: #9b3a6a; }
.with-badge { background: var(--saffron-soft); color: #8a5a10; }
.promo-card { display: grid; gap: .25rem; text-align: center; margin: 1rem auto 0; max-width: 460px; padding: 1rem 1.2rem; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px dashed rgba(227, 189, 114, .6); color: #f3ead6; text-decoration: none; font-size: .92rem; }
.promo-card .pc-off { color: #e3bd72; font-size: 1rem; }
.pass-name { font-size: 1.2rem; font-weight: 700; margin-top: .7rem; }
.qr-box { width: min(236px, 72%); margin: .9rem auto .7rem; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--gold-line), 0 10px 28px rgba(21, 48, 42, .1); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-code { font-size: 1.2rem; font-weight: 700; letter-spacing: .3em; color: var(--ink); }
.qr-note { font-size: .86rem; color: var(--muted); margin: .25rem 0 1.1rem; }
.stub-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: .3rem auto .7rem; }
.stub-icon svg { width: 26px; height: 26px; }
.stub-icon.ok { background: var(--yes); color: #fff; }
.stub-icon.soft { background: var(--surface); color: var(--muted); }
.reveal { animation: reveal .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reveal { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
.inv-image img { display: block; width: 100%; height: auto; }
.inv-main.compact { padding: 1.4rem 1.7rem 1.6rem; }
.inv-main.compact::before, .inv-main.compact .corner { display: none; }
.inv-main.compact .inv-guest { margin-bottom: .6rem; }
.inv-wish:empty { display: none; }
.inv-wish { padding: 1.3rem 1.7rem 1.8rem; text-align: center; border-top: 1px solid var(--line); background: #fafbfa; }
.inv-wish h2 { font-size: 1.1rem; margin: .1rem 0 .8rem; }
.inv-wish textarea { min-height: 90px; margin-bottom: .7rem; text-align: right; }
.wish-sent { margin: .5rem 0 0; padding: .9rem 1rem; background: #fff; border: 1px solid var(--gold-line); border-radius: 12px; white-space: pre-line; color: var(--ink-2); line-height: 1.85; }
.inv-wish .linkish { margin-top: .6rem; background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font: 500 .88rem var(--font); cursor: pointer; }
.demo-banner { background: var(--saffron); color: #1d1406; text-align: center; font-weight: 600; font-size: .92rem; padding: .6rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.demo-banner a { color: #1d1406; }
.inv-foot { text-align: center; color: rgba(255, 255, 255, .6); font-size: .78rem; margin-top: 1.2rem; }
.inv-state { min-height: 70vh; display: grid; place-items: center; color: #fff; text-align: center; padding: 2rem; }

/* ---------- ماسح البوابة ---------- */
.scan { background: #0c1f1a; color: #fff; min-height: 100vh; }
.scan-wrap { max-width: 560px; margin: 0 auto; padding: .8rem 1rem 2rem; }
.scan-top { display: flex; gap: .6rem; align-items: center; margin-bottom: .9rem; }
.scan-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #16332b; color: var(--saffron); flex: none; }
.scan-mark svg { width: 22px; height: 22px; }
.scan-top .ev-switch select { font-size: 1.1rem; }
.counter { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 .9rem; background: #122b24; border: 1px solid #22423a; border-radius: 14px; padding: .6rem .2rem; }
.counter div { text-align: center; border-inline-start: 1px solid #22423a; }
.counter div:first-child { border-inline-start: 0; }
.counter dt { font-size: .76rem; color: #87a39a; }
.counter dd { margin: 0; font-size: 1.55rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.25; }
.counter div:first-child dd { color: #9be6bd; }
.cam-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(200,144,46,.14); color: var(--saffron); }
.cam-icon svg { width: 30px; height: 30px; }
.cam { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #071410; display: grid; place-items: center; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .aim { position: absolute; inset: 14%; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); outline: 3px solid rgba(200, 144, 46, .9); pointer-events: none; }
.cam .cam-msg { position: relative; z-index: 2; padding: 1.5rem; text-align: center; display: grid; gap: .8rem; justify-items: center; color: #cfdcd7; }
.manual { margin-top: 1rem; }
.manual form { display: flex; gap: .5rem; }
.manual input { background: #16332b; color: #fff; border-color: #2c5246; }
.manual input::placeholder { color: #87a39a; }
.matches { list-style: none; margin: .6rem 0 0; padding: 0; }
.matches li { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid #22423a; }
.matches li > div { flex: 1; min-width: 0; }
.scan .btn.ghost { color: #fff; border-color: #2c5246; }
.scan-foot { display: flex; justify-content: space-between; margin-top: 1.4rem; font-size: .85rem; color: #87a39a; }
.scan-foot button { background: none; border: 0; color: #b9cbc4; text-decoration: underline; font: inherit; cursor: pointer; }

.gate-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .2rem 0 .6rem; }
.gate-pick button { min-height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #dfe8e3; font: 600 .86rem var(--font); cursor: pointer; }
.gate-pick button[aria-checked="true"] { background: #e3bd72; color: #1b1305; border-color: transparent; }
.r-extra { font-size: 1.15rem; font-weight: 700; margin-top: .3rem; opacity: .92; }
.result {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  color: #fff; animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.result.ok { background: #13784b; }
.result.bad { background: #a12f2f; }
.result.warn { background: #9a6a0c; }
.result .r-icon { width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; margin: 0 auto 1rem; }
.result .r-icon svg { width: 52px; height: 52px; }
.result h2 { font-size: 1.9rem; margin-bottom: .4rem; }
.result .r-name { font-size: 1.5rem; font-weight: 700; overflow-wrap: anywhere; }
.result .r-sub { opacity: .9; margin-top: .4rem; }
.result .r-actions { display: grid; gap: .6rem; margin-top: 1.6rem; width: min(320px, 80vw); margin-inline: auto; }
.result .btn.light { background: #fff; color: var(--ink); }
.result .btn.outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.result .r-tap { margin-top: 1.4rem; opacity: .75; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .bnav, .appbar-row, .actions-row, .toolbar, .chips, .g-actions { display: none !important; }
}

/* =========================================================
   لوحة التحكم: القائمة الجانبية + الصفحة الرئيسية + اختيار التصميم
   ========================================================= */
.layout { min-height: 100vh; }
.side { display: none; }
.mob-only { display: inline-flex; }

/* ---- الصفحة الرئيسية ---- */
.home { max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 3rem; }
body.admin { background: var(--surface); }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .4rem 0 1.1rem; }
.home-top h1 { font-size: 1.45rem; }
.home-top p { font-size: .9rem; margin-top: .15rem; }
.home-top-act { display: flex; gap: .5rem; align-items: center; }
.home-top .icon-btn { background: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center;
  padding: .95rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-align: start; font: inherit; color: var(--ink); }
button.stat { cursor: pointer; transition: border-color .15s, transform .1s; }
button.stat:hover { border-color: var(--saffron); }
.stat-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--yes-bg); color: var(--majlis); }
.stat-ic svg { width: 22px; height: 22px; }
.stat-ic.warm { background: var(--saffron-soft); color: var(--wait); }
.stat-ic.blue { background: var(--in-bg); color: var(--in); }
.stat-ic.red { background: var(--no-bg); color: var(--no); }
.stat b { font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .8rem; }

.home-cols { display: grid; gap: 1rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1rem; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.panel-h h2 { font-size: 1.05rem; }
.panel-empty { padding: 1.4rem .2rem; font-size: .92rem; }

.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .75rem; }
.ev-card { display: flex; gap: .85rem; align-items: stretch; width: 100%; padding: .7rem; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; font: inherit; color: var(--ink); text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.ev-card:hover { border-color: var(--saffron); box-shadow: 0 6px 18px -10px rgba(15, 76, 58, .35); }
.ev-card:active { transform: scale(.99); }
.ev-thumb { flex: none; width: 70px; aspect-ratio: 2 / 3; border-radius: 9px; overflow: hidden; background: var(--surface); display: grid; place-items: center; outline: 1px solid var(--line); }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ev-thumb .dz-wrap { width: 100%; height: 100%; display: block; }
.ev-thumb .dz-wrap > * { transform-origin: top right; }
.ev-thumb.plain { background: var(--majlis) var(--pattern); color: var(--saffron); }
.ev-thumb.plain svg { width: 26px; height: 26px; }
.ev-body { flex: 1; min-width: 0; display: grid; align-content: center; gap: .3rem; }
.ev-top { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.ev-top b { font-size: .98rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-body small { font-size: .8rem; }
.when { flex: none; font-style: normal; font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: var(--in-bg); color: var(--in); white-space: nowrap; }
.when.soon { background: var(--saffron-soft); color: var(--wait); }
.when.past { background: var(--surface); color: var(--muted); }
.ev-prog { display: block; height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.ev-prog { display: flex; }
.ev-prog i { display: block; height: 100%; }
.ev-prog i.y { background: var(--yes); }
.ev-prog i.n { background: var(--no); opacity: .75; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; font-size: .78rem; color: var(--ink-2); }
.ev-meta .pill { font-size: .7rem; padding: .05rem .5rem; }
details.past { margin-top: 1rem; }
details.past summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: .7rem; }

.mini-reqs { list-style: none; margin: 0; padding: 0; }
.mini-reqs button { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .65rem .1rem; border: 0; border-bottom: 1px solid var(--line);
  background: none; font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.mini-reqs li:last-child button { border-bottom: 0; }
.mini-reqs .avatar { width: 38px; height: 38px; font-size: .95rem; }
.mr-body { flex: 1; min-width: 0; display: grid; }
.mr-body b { font-size: .93rem; }
.mr-body small { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-hero { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2.4rem 1.2rem; text-align: center; margin-bottom: 1rem; }
.empty-art { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 20px; display: grid; place-items: center; background: var(--majlis) var(--pattern); color: var(--saffron); }
.empty-art svg { width: 34px; height: 34px; }
.empty-hero h2 { font-size: 1.25rem; margin-bottom: .4rem; }
.empty-hero p { color: var(--muted); max-width: 42ch; margin: 0 auto 1.2rem; }

/* ---- تصميم الدعوة ---- */
.ds-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .8rem; }
.ds-head h2 { margin: 0; }
.ds-now { font-size: .84rem; color: var(--muted); }
.ds-now b { color: var(--majlis); }
.dmodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.dmode { display: flex; align-items: center; gap: .6rem; padding: .75rem .7rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; color: var(--ink); text-align: start; cursor: pointer; transition: border-color .15s, background .15s; }
.dmode svg { width: 24px; height: 24px; flex: none; color: var(--muted); }
.dmode span { display: grid; min-width: 0; }
.dmode b { font-size: .92rem; }
.dmode small { font-size: .74rem; color: var(--muted); }
.dmode[aria-selected="true"] { border-color: var(--majlis); background: var(--yes-bg); }
.dmode[aria-selected="true"] svg { color: var(--majlis); }
.dm-none { display: flex; gap: 1rem; align-items: center; }
.dm-none .dz-opt { width: 96px; flex: none; cursor: default; }
.dm-none p { margin-bottom: .4rem; }
.dm-on { display: inline-flex; align-items: center; gap: .35rem; color: var(--yes); font-weight: 600; }
.dm-on svg { width: 18px; height: 18px; }
.dm-warn { background: var(--wait-bg); color: var(--wait); border-radius: 10px; padding: .6rem .8rem; font-size: .86rem; margin-bottom: .8rem; }
.dm-own { display: grid; gap: 1rem; }
.drop { display: grid; justify-items: center; gap: .4rem; padding: 2rem 1rem; border: 2px dashed #bfd0c7; border-radius: 14px; background: #f7faf8;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--majlis); background: var(--yes-bg); }
.drop svg { width: 34px; height: 34px; color: var(--majlis); }
.drop small { color: var(--muted); font-size: .82rem; }
.dm-own .card-prev { max-width: 220px; border-radius: 12px; outline: 1px solid var(--line); }
.dm-own-side p { margin-bottom: .45rem; }
@media (max-width: 520px) {
  .dmode { flex-direction: column; justify-content: center; gap: .3rem; padding: .7rem .3rem; text-align: center; }
  .dmode small { display: none; }
  .dmode b { font-size: .84rem; }
}
@media (min-width: 700px) {
  .dm-own { grid-template-columns: auto 1fr; align-items: start; }
  .dm-own .drop { width: 240px; aspect-ratio: 2 / 3; align-content: center; }
}

/* ---- الكمبيوتر: قائمة جانبية ثابتة ---- */
@media (min-width: 1000px) {
  .mob-only { display: none !important; }
  .layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: .6rem; position: sticky; top: 0; height: 100vh; overflow: auto;
    padding: 1.2rem 1rem; background: var(--majlis) var(--pattern); color: #fff; }
  .side-brand { display: grid; padding: .2rem .4rem .8rem; border-bottom: 1px solid rgba(255,255,255,.14); margin-bottom: .3rem; }
  .side-brand b { font-family: var(--display); font-size: 2rem; line-height: 1.2; color: var(--saffron); }
  .side-brand img { max-height: 46px; max-width: 170px; object-fit: contain; object-position: right; }
  .side-brand small { color: rgba(255,255,255,.65); font-size: .78rem; }
  .side-new { background: var(--saffron) !important; color: #1d1405 !important; }
  .side-nav, .side-events { display: grid; gap: 2px; }
  .side-nav button, .side-events button, .side-foot a, .side-foot button {
    display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 10px;
    background: none; color: rgba(255,255,255,.86); font: 500 .92rem var(--font); text-align: start; text-decoration: none; cursor: pointer; }
  .side-nav button:hover, .side-events button:hover, .side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }
  .side-nav button[aria-current="page"], .side-events button[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset -3px 0 0 var(--saffron); }
  .side-nav svg, .side-foot svg { width: 20px; height: 20px; flex: none; opacity: .9; }
  .side-nav span { flex: 1; }
  .side-badge { font-style: normal; font-size: .72rem; font-weight: 700; min-width: 22px; padding: .05rem .4rem; border-radius: 99px; background: #e5533d; color: #fff; text-align: center; }
  .side-h { margin: .7rem .7rem 0; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: rgba(255,255,255,.55); }
  .side-events { flex: 1; align-content: start; }
  .side-events button { padding: .5rem .7rem; }
  .se-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); flex: none; }
  .se-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .side-events small { color: rgba(255,255,255,.55); font-size: .74rem; white-space: nowrap; }
  .side-none { color: rgba(255,255,255,.6) !important; font-size: .85rem; padding: .3rem .7rem; }
  .side-foot { display: grid; gap: 2px; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.14); }

  .main { min-width: 0; }
  .home { padding: 1.6rem 2rem 3rem; }
  .home-top h1 { font-size: 1.7rem; }
  .stat-row { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .home-cols { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }

  /* صفحة المناسبة: أعرض، والأقسام كتبويبات فوق بدل الشريط السفلي */
  .layout .shell { max-width: 1040px; display: flex; flex-direction: column; padding: 1.4rem 2rem 2rem; background: transparent; }
  .layout .appbar { order: 0; border-radius: 20px; padding: 1rem 1.3rem 1.2rem; }
  .layout .bnav { order: 1; position: sticky; top: 0; inset: auto; z-index: 20; margin: .9rem 0 0; padding: .35rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .layout .bnav-in { max-width: none; gap: .3rem; }
  .layout .bnav button { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem .8rem; border-radius: 10px; font-size: .92rem; }
  .layout .bnav svg { width: 20px; height: 20px; }
  .layout .bnav button[aria-selected="true"] { background: var(--majlis); color: #fff; }
  .layout .bnav button[aria-selected="true"]::before { display: none; }
  .layout #payCard { order: 2; }
  .layout .view { order: 3; margin-top: 1rem; padding: 1.2rem 1.3rem 2rem; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
  .layout .sticky-save { position: static; }
  .admin .layout ~ .toast, .admin .toast { bottom: 1.5rem; }
}

/* ---- قفل الدفع + الإرسال الجماعي ---- */
.btn.gold { background: var(--saffron); color: #1d1406; }
.lock-banner { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; margin-bottom: 1rem; border-radius: 14px; background: var(--wait-bg); color: var(--wait); }
.lock-banner > svg { width: 26px; height: 26px; flex: none; }
.lock-banner span { flex: 1; display: grid; }
.lock-banner b { font-size: .95rem; }
.lock-banner small { font-size: .82rem; color: #6d4b0c; }
.lock-card { text-align: center; padding: 2rem 1rem; }
.lock-ic { width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 22px; display: grid; place-items: center; background: var(--wait-bg); color: var(--wait); }
.lock-ic svg { width: 36px; height: 36px; }
.lock-card h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.lock-card p { max-width: 46ch; margin: 0 auto .7rem; }
.lock-amt { font-size: 1.05rem; }
.lock-amt b { font-size: 1.5rem; color: var(--majlis); }
.bulk { border: 1.5px solid #9fd6b4; background: linear-gradient(180deg, #effaf3, #fff); border-radius: 16px; padding: 1.1rem; margin-bottom: 1.2rem; }
.bulk h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin-bottom: .4rem; }
.bulk h2 svg { width: 22px; height: 22px; color: var(--wa); }
.bulk > p { font-size: .9rem; margin-bottom: .8rem; }
.bulk .progress { margin: .6rem 0 .3rem; }
.bulk-res { display: flex; align-items: center; gap: .4rem; font-weight: 600; margin-bottom: .6rem; }
.bulk-res svg { width: 18px; height: 18px; }
.bulk-res.ok { color: var(--yes); }
.bulk-res.warn { color: var(--wait); }
.bulk-fail { margin: 0 0 .8rem; padding-inline-start: 1.2rem; font-size: .86rem; color: var(--no); }
.bulk-off { border: 1px dashed var(--line); border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1.2rem; background: #fafcfb; }
.bulk-off summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bulk-off summary svg { width: 20px; height: 20px; color: var(--majlis); }
.bulk-off summary small { color: var(--muted); }
.bulk-off p { font-size: .88rem; margin-top: .6rem; }
.manual-h { font-size: .95rem; color: var(--ink-2); margin: .2rem 0 .7rem; }
.wa-st { font-size: .74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wa-st.read { color: #2b7bd6; }
.wa-st.delivered { color: var(--yes); }
.wa-st.failed { color: var(--no); }

/* ---- الدعوة على شاشة الكمبيوتر: التصميم بكامل الارتفاع وبطاقة الرد بجانبه ---- */
@media (min-width: 900px) and (min-height: 560px) {
  body.invite .inv-wrap { max-width: 1060px; min-height: 100vh; display: grid; align-content: center; justify-items: center; padding: 2rem; }
  .inv-card { display: grid; grid-template-columns: auto minmax(330px, 400px); max-width: 100%; }
  .inv-card.no-stub { grid-template-columns: auto; }
  .inv-face { width: min(480px, calc((100vh - 4rem) * 2 / 3)); align-self: start; }
  .inv-face > .dz-wrap, .inv-face > .inv-image { display: block; }
  .inv-face .inv-image img { max-height: calc(100vh - 4rem); object-fit: cover; }
  .inv-side { display: flex; flex-direction: column; background: #fafbfa; border-inline-start: 2px dashed #dce3de; position: relative; }
  .inv-side .perf { display: none; }
  .inv-side .inv-stub { flex: 1; display: grid; align-content: center; padding: 2rem 2rem; }
  .inv-side .inv-wish { border-top: 1px solid var(--line); padding: 1.4rem 2rem 1.8rem; }
  .inv-side::before, .inv-side::after { content: ""; position: absolute; inset-inline-start: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--majlis); }
  .inv-side::before { top: -13px; }
  .inv-side::after { bottom: -13px; }
  .inv-card.no-stub .inv-side:empty, .inv-card.no-stub .inv-side:has(.inv-wish:empty) { display: none; }
  .inv-foot { margin-top: 1rem; }
}
.inv-main.compact:not(:has(*)) { display: none; }
.dz-cats { margin: 0 0 .4rem; padding: 0 0 .4rem; flex-wrap: nowrap; overflow-x: auto; }
@media (min-width: 700px) { .dz-cats { flex-wrap: wrap; overflow: visible; } }

/* رمز الريال السعودي */
.sar { display: inline-block; height: .82em; width: auto; vertical-align: -.06em; }
.sar-amt { white-space: nowrap; }

.type-prices { border: 1px dashed var(--line); border-radius: 10px; padding: .55rem .8rem; margin: .2rem 0 .8rem; }
.type-prices summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.type-prices .row2 { margin-top: .6rem; }

/* ---- الجوال: القائمة الجانبية تنزلق من الجنب ---- */
.side-scrim { display: none; }
@media (max-width: 999px) {
  .side { display: flex; flex-direction: column; gap: .6rem; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
    width: min(300px, 86vw); overflow: auto; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--majlis) var(--pattern); color: #fff; transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); visibility: hidden; }
  body.drawer-open .side { transform: none; visibility: visible; box-shadow: -12px 0 40px rgba(0,0,0,.35); }
  body.drawer-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(8, 24, 19, .5); }
  body.drawer-open { overflow: hidden; }
  .side-close { position: absolute; top: calc(.8rem + env(safe-area-inset-top, 0px)); inset-inline-end: .8rem; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; display: grid !important; place-items: center; cursor: pointer; }
  .side-close svg { width: 16px; height: 16px; }
  .side-brand { display: grid; padding: .2rem .4rem .8rem; border-bottom: 1px solid rgba(255,255,255,.14); margin-bottom: .3rem; }
  .side-brand b { font-family: var(--display); font-size: 2rem; line-height: 1.2; color: var(--saffron); }
  .side-brand img { max-height: 46px; max-width: 170px; object-fit: contain; object-position: right; }
  .side-brand small { color: rgba(255,255,255,.65); font-size: .78rem; }
  .side-new { background: var(--saffron) !important; color: #1d1405 !important; }
  .side-nav, .side-events { display: grid; gap: 2px; }
  .side-nav button, .side-events button, .side-foot a, .side-foot button {
    display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 10px;
    background: none; color: rgba(255,255,255,.86); font: 500 .92rem var(--font); text-align: start; text-decoration: none; cursor: pointer; }
  .side-nav button:hover, .side-events button:hover, .side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }
  .side-nav button[aria-current="page"], .side-events button[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset -3px 0 0 var(--saffron); }
  .side-nav svg, .side-foot svg { width: 20px; height: 20px; flex: none; opacity: .9; }
  .side-nav span { flex: 1; }
  .side-badge { font-style: normal; font-size: .72rem; font-weight: 700; min-width: 22px; padding: .05rem .4rem; border-radius: 99px; background: #e5533d; color: #fff; text-align: center; }
  .side-h { margin: .7rem .7rem 0; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: rgba(255,255,255,.55); }
  .side-events { flex: 1; align-content: start; }
  .side-events button { padding: .5rem .7rem; }
  .se-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); flex: none; }
  .side-events small { color: rgba(255,255,255,.55); font-size: .74rem; white-space: nowrap; }
  .side-none { color: rgba(255,255,255,.6) !important; font-size: .85rem; padding: .3rem .7rem; }
  .side-foot { display: grid; gap: 2px; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.14); }
}
@media (min-width: 1000px) { .side-close { display: none !important; } }

/* ---- حذف المناسبة من بطاقتها ---- */
.ev-cell { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.ev-cell:hover { border-color: var(--saffron); box-shadow: 0 6px 18px -10px rgba(15, 76, 58, .35); }
.ev-cell .ev-card { border: 0; box-shadow: none; background: transparent; }
.ev-rep { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; padding: 0 .7rem .6rem; }
.ev-rep .r { display: grid; justify-items: center; gap: .05rem; padding: .4rem .2rem; border-radius: 10px; font-size: .72rem; color: var(--ink-2); background: var(--surface); }
.ev-rep .r b { font-size: 1.05rem; line-height: 1.2; }
.ev-rep .r.yes { background: var(--yes-bg); } .ev-rep .r.yes b { color: var(--yes); }
.ev-rep .r.no { background: var(--no-bg); } .ev-rep .r.no b { color: var(--no); }
.ev-rep .r.wait { background: var(--saffron-soft); } .ev-rep .r.wait b { color: var(--wait); }
.ev-rep .r.in { background: var(--in-bg); } .ev-rep .r.in b { color: var(--in); }
.ev-rep .r.out b { color: var(--muted); }
.ev-acts { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border-top: 1px dashed var(--line); }
.ev-acts .btn svg { width: 16px; height: 16px; }
.ev-del { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.ev-del svg { width: 17px; height: 17px; }
.ev-del:hover, .ev-del:focus-visible { color: var(--no); border-color: #e6b3ae; background: var(--no-bg); }
.del-confirm p { margin-bottom: 1rem; line-height: 1.8; } .del-confirm .btn svg { width: 18px; height: 18px; }
dialog.ask { border: 0; border-radius: 18px; padding: 1.3rem 1.2rem 1.1rem; width: min(380px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog.ask::backdrop { background: rgba(10, 30, 25, .5); }
dialog.ask p { line-height: 1.8; margin-bottom: 1.1rem; }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
/* لون المتجر */
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.pal { display: grid; justify-items: center; gap: .3rem; padding: .55rem .2rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.pal small { font-size: .78rem; font-weight: 600; }
.pal[aria-checked="true"] { border-color: var(--majlis); background: var(--yes-bg); }
.pal-sw { position: relative; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); overflow: hidden; }
.pal-sw i { position: absolute; inset: 50% 0 0 50%; }
.pal-custom { background: conic-gradient(#e74c3c, #f1c40f, #2ecc71, #3498db, #9b59b6, #e74c3c); }
.pal-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .8rem; }
.pal-pick input[type="color"] { width: 100%; height: 46px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.pal-prev { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-top: .9rem; padding: .9rem 1rem; border-radius: 14px; font-weight: 700; }
.pal-prev b { font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.pal-prev span { font-size: 1.1rem; }
.pal-prev em { font-style: normal; font-size: .85rem; padding: .45rem .8rem; border-radius: 99px; }
/* النسخة الاحتياطية */
.bk p { margin-bottom: .6rem; line-height: 1.8; }
.bk-last { font-weight: 700; padding: .6rem .8rem; border-radius: 10px; }
.bk-last.ok { background: var(--yes-bg); color: var(--yes); }
.bk-last.warn { background: var(--no-bg); color: var(--no); }
.bk-note { display: flex; align-items: center; gap: .7rem; width: 100%; margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #f0c9a0; border-radius: 14px; background: #fff6ea; color: #8a4b12; font: inherit; text-align: start; cursor: pointer; }
.bk-note svg { width: 22px; height: 22px; flex-shrink: 0; }
.bk-note b { display: block; }
/* مساعد واتساب + أزرار التجربة والشكر */
.wa-assist { margin: 0 0 1rem; padding: .85rem 1rem; border-radius: 14px; background: #e8f7ee; border: 1px solid #bfe6cc; color: #14532d; }
.wa-assist b { display: inline-flex; align-items: center; gap: .4rem; }
.wa-assist svg { width: 18px; height: 18px; }
.wa-assist p { margin: .35rem 0 .6rem; font-size: .88rem; line-height: 1.8; }
.bulk-extra { margin-top: .6rem; }
/* صفحة إعدادات المتجر / الباقات (صفحة كاملة بدل نافذة) */
.setpage { max-width: 820px; margin: 0 auto; padding: 1.4rem 1rem 0; }
.setpage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.setpage-head h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
.setpage-head p { margin: 0; font-size: .9rem; }
.set-jump { position: sticky; top: 0; z-index: 5; display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding: .6rem 0; margin-bottom: .6rem; background: var(--surface); }
.set-jump::-webkit-scrollbar { display: none; }
.set-jump button { flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 99px; padding: .4rem .9rem; font: 600 .85rem var(--font); cursor: pointer; }
.set-jump button:hover { border-color: var(--majlis); }
.setpage .card-sec { scroll-margin-top: 80px; }
.sub-h { font-size: 1rem; margin: 1.3rem 0 .6rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.why-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.why-edit fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem .7rem; margin: 0; display: grid; gap: .45rem; min-width: 0; }
.why-edit legend { font-size: .8rem; font-weight: 700; color: var(--muted, #6b7a73); padding: 0 .3rem; }
.why-edit input, .why-edit textarea, .faq-row input, .faq-row textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: #fff; color: var(--ink); }
.why-edit textarea { min-height: 64px; resize: vertical; }
.faq-row { display: grid; gap: .45rem; padding: .7rem; margin-bottom: .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; }
.faq-row input { font-weight: 700; }
.faq-row textarea { min-height: 70px; resize: vertical; }
.faq-row .btn { justify-self: start; }
.save-bar { position: sticky; bottom: 0; z-index: 5; padding: .8rem 0 calc(.8rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--surface) 70%, transparent); }
.setpage-acts { display: flex; align-items: center; gap: .5rem; flex: none; }
/* اختيار شكل صفحة الهبوط + مجموعات المحتوى */
.ls-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ls-pick button { display: grid; gap: .25rem; text-align: start; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.ls-pick button small { font-size: .78rem; color: var(--muted, #6b7a73); line-height: 1.6; }
.ls-pick button[aria-pressed="true"] { border-color: var(--majlis); background: var(--yes-bg); }
.lgroup .switch { margin: .2rem 0 .5rem; }
@media (max-width: 480px) { .ls-pick { grid-template-columns: 1fr; } }
.pkg-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px dashed var(--line); }
.pkg-head .switch { margin: 0; flex: 1; }
.pkg-head .btn svg { width: 16px; height: 16px; }

/* خانات حسابات السوشيال */
.soc-fields { display: grid; gap: 0 .8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .soc-fields { grid-template-columns: 1fr 1fr; } }
.soc-f > span { display: inline-flex; align-items: center; gap: .4rem; }
.soc-ic { display: inline-grid; width: 18px; height: 18px; color: var(--gold, #c8902e); }
.soc-ic svg { width: 18px; height: 18px; }

/* ---------- البحث العام ---------- */
.gsearch { position: relative; margin: 0 0 1rem; }
.gsearch input { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; color: var(--ink); }
.gsearch input:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }
.gs-res { position: absolute; inset-inline: 0; top: calc(100% + .35rem); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(15, 76, 58, .45); max-height: 60vh; overflow: auto; padding: .35rem; }
.gs-res button { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: center; width: 100%; text-align: start; padding: .55rem .6rem; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.gs-res button:hover, .gs-res button:focus-visible { background: var(--surface); }
.gs-res .gs-k { grid-row: span 2; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; background: var(--yes-bg); color: var(--yes); }
.gs-res .gs-k.req { background: var(--saffron-soft); color: var(--wait); }
.gs-res .gs-k.guest { background: var(--in-bg); color: var(--in); }
.gs-res small { color: var(--muted); font-size: .78rem; }
.gs-res p { padding: .8rem; font-size: .9rem; }

/* ---------- يحتاج انتباهك ---------- */
.attn { margin-bottom: 1rem; }
.attn-n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; margin-inline-start: .3rem; border-radius: 99px; background: var(--no); color: #fff; font-size: .78rem; vertical-align: middle; }
.attn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.attn-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem .6rem; align-items: center; padding: .55rem .6rem; border-radius: 12px; border: 1px solid var(--line); border-inline-start-width: 4px; background: #fff; }
.attn-list li p { font-size: .9rem; line-height: 1.6; min-width: 0; }
.attn-list .attn-act { display: flex; gap: .35rem; align-items: center; }
.attn-list .attn-act .btn { white-space: nowrap; padding-inline: .7rem; }
@media (max-width: 400px) { .attn-list li p { font-size: .84rem; } .attn-ic { width: 30px; height: 30px; } }
.attn-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); }
.attn-ic svg { width: 18px; height: 18px; }
.attn-list li.t-red { border-inline-start-color: var(--no); } .attn-list li.t-red .attn-ic { background: var(--no-bg); color: var(--no); }
.attn-list li.t-warm { border-inline-start-color: var(--saffron); } .attn-list li.t-warm .attn-ic { background: var(--saffron-soft); color: var(--wait); }
.attn-list li.t-blue { border-inline-start-color: var(--in); } .attn-list li.t-blue .attn-ic { background: var(--in-bg); color: var(--in); }
.attn-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--yes); display: grid; place-items: center; cursor: pointer; }
.attn-x svg { width: 16px; height: 16px; }
.attn-ok { display: flex; align-items: center; gap: .5rem; color: var(--yes); font-weight: 600; font-size: .92rem; }
.attn-ok svg { width: 18px; height: 18px; }

/* طلب متأخر في القائمة */
.req-list li.late > button { border-inline-start: 4px solid var(--no); padding-inline-start: .6rem; }
.req-list li.late time { color: var(--no); font-weight: 700; }

/* ---------- الإرسال اليدوي: خطوات واضحة ---------- */
.send-how { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; }
.send-how h2 { display: flex; align-items: center; gap: .45rem; font-size: 1rem; margin-bottom: .6rem; }
.send-how h2 svg { width: 18px; height: 18px; color: var(--yes); }
.send-how ol { margin: 0 0 .6rem; padding-inline-start: 1.3rem; display: grid; gap: .35rem; font-size: .92rem; line-height: 1.7; }
.send-how .bulk-off { border: 0; padding: 0; background: none; }
.send-how .bulk-off summary { cursor: pointer; color: var(--in); }
.send-how .bulk-off p { font-size: .88rem; line-height: 1.8; margin-top: .4rem; color: var(--ink-2); }

/* ---------- الدخل حسب الشهر ---------- */
.acc-months { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.acc-months summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.acc-months ul { list-style: none; padding: 0; margin: .7rem 0 .4rem; display: grid; gap: .45rem; }
.acc-months li { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .6rem; align-items: center; font-size: .85rem; }
.acc-months li i { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; display: block; }
.acc-months li i b { display: block; height: 100%; background: var(--yes); }
.acc-months li em { font-style: normal; font-weight: 700; }

/* ---------- لوحة العميل: اسم المتجر، الخطوات، الباقة، الدفع ---------- */
.cl-brand { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem 1rem; background: #fff; border-bottom: 1px solid var(--line); }
.cl-brand:empty { display: none; }
.clb-name { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.clb-name img { height: 30px; width: auto; max-width: 120px; object-fit: contain; }
.clb-name b { font-size: 1rem; color: var(--majlis, #0f4c3a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-brand .btn svg { width: 16px; height: 16px; }
.scan-lbl { display: inline-flex; align-items: center; gap: .35rem; color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .4); white-space: nowrap; }
.scan-lbl svg { width: 16px; height: 16px; }

.cl-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: 1rem 1rem 0; padding: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.cl-steps button { display: grid; justify-items: center; gap: .3rem; padding: .35rem .15rem; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--muted); cursor: pointer; font-size: .76rem; text-align: center; }
.cl-steps i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: var(--surface); color: var(--muted); }
.cl-steps i svg { width: 16px; height: 16px; }
.cl-steps .done { color: var(--yes); } .cl-steps .done i { background: var(--yes-bg); color: var(--yes); }
.cl-steps .now { color: var(--ink); font-weight: 700; background: var(--saffron-soft); } .cl-steps .now i { background: var(--saffron); color: #1d1406; }

.pay-done { display: flex; align-items: center; gap: .7rem; margin: 1rem 1rem 0; padding: .8rem 1rem; border-radius: 14px; background: var(--yes-bg); color: var(--yes); }
.pay-done > svg { flex: none; width: 26px; height: 26px; }
.pay-done span { display: grid; gap: .1rem; } .pay-done small { color: var(--ink-2); }
.pay-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: 0; }
.pay-split div { background: rgba(255, 255, 255, .08); border-radius: 10px; padding: .5rem; text-align: center; }
.pay-split dt { font-size: .75rem; opacity: .8; } .pay-split dd { margin: 0; font-weight: 700; } .pay-split dd.ok { color: #8fe0b4; }
.pay-wait { display: flex; gap: .5rem; align-items: start; font-size: .88rem; line-height: 1.7; background: rgba(255, 255, 255, .1); border-radius: 10px; padding: .55rem .7rem; }
.pay-wait svg { flex: none; width: 18px; height: 18px; margin-top: .2rem; }
.pay-wait.admin { background: var(--saffron-soft); color: var(--wait); margin: 0 0 1rem; }

.pkg-strip { margin: .8rem 1rem 0; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pkg-strip summary { display: flex; justify-content: space-between; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; }
.pkg-strip summary em { font-style: normal; font-size: .82rem; font-weight: 700; color: var(--in); background: var(--in-bg); padding: .1rem .55rem; border-radius: 99px; }
.pkg-strip.full summary em { color: var(--no); background: var(--no-bg); }
.pkg-bar { display: block; height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; margin: .6rem 0 .2rem; }
.pkg-bar i { display: block; height: 100%; background: var(--in); }
.pkg-strip.full .pkg-bar i { background: var(--no); }
.pkg-full { font-size: .85rem; color: var(--no); margin-top: .4rem; }
.pkg-strip ul { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .3rem; font-size: .86rem; }
.pkg-strip li { display: flex; gap: .4rem; align-items: center; } .pkg-strip li svg { width: 15px; height: 15px; color: var(--yes); flex: none; }
.om-opt { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.om-opt input { grid-row: span 2; margin-top: .3rem; accent-color: var(--majlis, #0f4c3a); }
.om-opt small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.om-opt:has(input:checked) { border-color: var(--majlis, #0f4c3a); background: var(--yes-bg); }

/* ---------- صفحة التصاميم ---------- */
.dz-up h2 { display: flex; align-items: center; gap: .45rem; } .dz-up h2 svg { width: 18px; height: 18px; }
.dz-headrow { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-bottom: .6rem; }
.dzm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.dzm { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: grid; }
.dzm.off .dzm-img { opacity: .4; filter: grayscale(.6); }
.dzm-img { position: relative; }
.dzm-img .dz-wrap { display: block; }
.dzm-img em { position: absolute; top: .4rem; inset-inline-start: .4rem; font-style: normal; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; }
.dzm-top { background: var(--saffron); color: #1d1406; }
.dzm-hid { background: #333; color: #fff; top: auto !important; bottom: .4rem; }
.dzm-own { background: var(--in); color: #fff; inset-inline-start: auto !important; inset-inline-end: .4rem; }
.dzm-body { padding: .5rem; display: grid; gap: .35rem; }
.dzm-body input, .dzm-body select { width: 100%; font: inherit; font-size: .84rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.dzm-acts { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.dzm-acts .icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; background: #fff; color: var(--ink); }
.dzm-acts .btn.sm { padding: .25rem .6rem; min-height: 32px; }
.dzm-sw { margin-inline-start: auto; padding: 0; border: 0; }
.dzm-del { color: var(--no) !important; } .dzm-del svg { width: 16px; height: 16px; }
/* محرر «روابط تهمك» */
.fl-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.fl-row input, .fl-row select { width: 100%; font: inherit; font-size: .88rem; padding: .5rem .55rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.fl-row .fl-x { grid-column: 1 / 3; }
.fl-acts { display: flex; gap: .25rem; }
.fl-acts .icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.fl-acts .fl-del { color: var(--no); } .fl-acts svg { width: 15px; height: 15px; }
@media (max-width: 520px) { .fl-row { grid-template-columns: 1fr auto; } .fl-row .fl-u { grid-column: 1; } .fl-row .fl-x { grid-column: 1 / -1; } .fl-row .fl-acts { grid-row: 1 / 3; grid-column: 2; flex-direction: column; } }
/* خلفية الصفحة ولون الأزرار */
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg3 button { font-size: .82rem; padding-inline: .3rem; }
.look-one, .look-secs { margin-top: .7rem; }
.ls-row { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; }
.ls-row .switch { flex: 1; margin: 0; }
.ls-row input[type="color"] { width: 54px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: #fff; flex: none; }
.look-one input[type="color"] { width: 100%; height: 44px; }
.dz-drop { display: grid; justify-items: center; gap: .3rem; padding: 1.4rem 1rem; border: 2px dashed var(--line); border-radius: 14px; background: var(--surface); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dz-drop svg { width: 28px; height: 28px; color: var(--majlis, #0f4c3a); }
.dz-drop small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.dz-drop:hover, .dz-drop.over { border-color: var(--majlis, #0f4c3a); background: var(--yes-bg); }
.font-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fp-opt { display: flex; gap: .5rem; align-items: start; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.fp-opt input { margin-top: .35rem; accent-color: var(--majlis, #0f4c3a); }
.fp-opt span { display: grid; gap: .15rem; min-width: 0; }
.fp-opt b { font-size: .95rem; } .fp-opt small { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.fp-opt .fp-brand { font-size: 1.5rem; line-height: 1.3; font-weight: 700; color: var(--majlis, #0f4c3a); }
.fp-opt:has(input:checked) { border-color: var(--majlis, #0f4c3a); background: var(--yes-bg); }
/* اختيار أيقونة الميزة */
.ic-pick { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .5rem; }
.ic-pick label { cursor: pointer; position: relative; }
.why-edit .ic-pick input { position: absolute; inset: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.ic-pick span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line, #ddd); color: var(--text-2, #555); transition: .15s; }
.ic-pick span svg { width: 20px; height: 20px; }
.ic-pick input:checked + span { border-color: var(--gold, #a67b01); background: rgba(166, 123, 1, .12); color: var(--gold-2, #8a6500); box-shadow: 0 0 0 2px rgba(166, 123, 1, .25); }
.ic-pick input:focus-visible + span { outline: 2px solid var(--gold, #a67b01); outline-offset: 2px; }
/* طريقة عرض التصاميم */
.gal-mode { margin: .3rem 0 .3rem; }
.gal-mode label { flex: 1; position: relative; cursor: pointer; }
.gal-mode input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gal-mode span { display: grid; place-items: center; min-height: 40px; border-radius: 9px; font: 600 .88rem var(--font); color: var(--ink-2); }
.gal-mode input:checked + span { background: #fff; color: var(--majlis); box-shadow: 0 1px 3px rgba(21, 48, 42, .12); }
.gal-mode input:focus-visible + span { outline: 2px solid var(--majlis); outline-offset: 2px; }
/* ترتيب أقسام الصفحة */
.ord-fixed { font-size: .82rem; color: var(--muted, #6b7a73); background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: .45rem .7rem; text-align: center; }
.ord-list { list-style: none; margin: .45rem 0; padding: 0; display: grid; gap: .4rem; counter-reset: ord; }
.ord-row { counter-increment: ord; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: background .3s, opacity .2s, box-shadow .2s; }
.ord-row::before { content: counter(ord); min-width: 1.5em; height: 1.5em; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.ord-grip { cursor: grab; color: var(--muted, #9aa59f); letter-spacing: -2px; font-size: .9rem; user-select: none; }
.ord-name { flex: 1; min-width: 0; font-size: .92rem; }
.ord-row.off .ord-name { opacity: .5; text-decoration: line-through; }
.ord-vis { border: 1px solid #b9dcc4; background: #eef8f1; color: #1f7a45; border-radius: 99px; padding: .2rem .65rem; font: 600 .78rem var(--font); cursor: pointer; }
.ord-vis.off { border-color: var(--line); background: var(--surface); color: var(--muted, #6b7a73); }
.ord-btns { display: flex; gap: .25rem; }
.ord-btns .icon-btn { width: 34px; height: 34px; font-size: .7rem; }
.ord-row.dragging { opacity: .45; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.ord-row.moved { animation: ordFlash .7s ease; }
@keyframes ordFlash { from { background: #fff6dc; } to { background: #fff; } }
@media (max-width: 420px) { .ord-grip { display: none; } .ord-row { gap: .4rem; padding: .45rem .5rem; } }
.ord-note { display: block; font-weight: 400; font-size: .74rem; }
/* العرض الحي في الإعدادات */
.sc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.sc-nums .field { margin: 0; }
.sc-icd { border: 1px solid var(--line); border-radius: 12px; padding: .45rem .6rem; margin-bottom: .4rem; background: #fff; }
.sc-icd summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; list-style: none; }
.sc-icd summary::-webkit-details-marker { display: none; }
.sc-icd summary::after { content: "تغيير"; margin-inline-start: auto; font-size: .78rem; font-weight: 600; color: var(--majlis); }
.sc-icd[open] summary::after { content: "إغلاق"; }
.sc-icnow { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface); color: var(--ink-2); }
.sc-icnow svg { width: 18px; height: 18px; }
.sc-icd .ic-pick { margin-top: .5rem; }
.sc-edit .ic-pick input { position: absolute; inset: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
/* الزر العائم في الإعدادات */
.fab-edit { display: grid; gap: .55rem; }
.fab-edit .ic-pick input { position: absolute; inset: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.fab-prev-wrap { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: 12px; background: var(--surface); }
.fab-prev { min-width: 52px; height: 52px; padding: 0 12px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: var(--wf-bg, #1fa855); color: var(--wf-fg, #fff); font-weight: 700; font-size: .92rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.fab-prev.pill { padding: 0 1rem 0 .9rem; }
.fab-prev.off { opacity: .35; }
.fab-prev .wf-ic { display: grid; place-items: center; }
.fab-prev svg { width: 26px; height: 26px; }
/* بطاقة الدخول المصممة في صفحة الدعوة */
.pd-card { width: min(330px, 100%); margin: .8rem auto .9rem; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 34px rgba(0, 0, 0, .16); line-height: 0; }
.pd-card svg { display: block; width: 100%; height: auto; }
/* ===== مصمم بطاقة الدخول ===== */
.setpage.wide { max-width: 1180px; }
.pe { --pe-acc: var(--majlis); }
.pe-bar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .6rem; margin-bottom: .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.pe-bar-g { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pe-ib { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); cursor: pointer; padding: 0; }
.pe-ib:hover { border-color: var(--pe-acc); }
.pe-ib:disabled { opacity: .35; cursor: default; }
.pe-ib.danger { color: var(--no); }
.pe-tog { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; padding: 0 .4rem; cursor: pointer; }
.pe-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.pe-stage-wrap { position: sticky; top: 64px; }
.pe-stage { position: relative; width: min(100%, calc((100vh - 170px) * 1080 / 1620)); margin: 0 auto; aspect-ratio: 1080 / 1620; border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0, 0, 0, .14); touch-action: none; user-select: none; -webkit-user-select: none; outline: none; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.pe-svg, .pe-svg svg { display: block; width: 100%; height: 100%; }
.pe-svg { border-radius: 12px; overflow: hidden; }
.pe-svg g[data-id] { cursor: move; }
.pe-ov { position: absolute; inset: 0; pointer-events: none; }
.pe-box { position: absolute; outline: 2px solid #2f80ed; outline-offset: 2px; transform-origin: center; }
.pe-box.locked { outline-style: dashed; outline-color: #999; }
.pe-box.locked .pe-h, .pe-box.locked .pe-rot { display: none; }
.pe-box.qr { outline-color: #1e7a52; }
.pe-box.qr .pe-rot, .pe-box.qr .pe-h.e, .pe-box.qr .pe-h.w { display: none; }
.pe-h { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #2f80ed; pointer-events: auto; touch-action: none; }
.pe-box.qr .pe-h { border-color: #1e7a52; }
.pe-h.nw { top: -9px; left: -9px; cursor: nwse-resize; }
.pe-h.se { bottom: -9px; right: -9px; cursor: nwse-resize; }
.pe-h.ne { top: -9px; right: -9px; cursor: nesw-resize; }
.pe-h.sw { bottom: -9px; left: -9px; cursor: nesw-resize; }
.pe-h.e { top: calc(50% - 7px); right: -9px; cursor: ew-resize; border-radius: 4px; width: 10px; }
.pe-h.w { top: calc(50% - 7px); left: -9px; cursor: ew-resize; border-radius: 4px; width: 10px; }
.pe-rot { position: absolute; top: -38px; left: calc(50% - 9px); width: 18px; height: 18px; border-radius: 50%; background: #2f80ed; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); pointer-events: auto; cursor: grab; touch-action: none; }
.pe-rot::after { content: ""; position: absolute; top: 15px; left: 6px; width: 2px; height: 16px; background: #2f80ed; }
.pe-guide { position: absolute; background: #e8467c; }
.pe-guide.v { top: 0; bottom: 0; left: calc(50% - .5px); width: 1px; }
.pe-guide.h { left: 0; right: 0; top: calc(50% - .5px); height: 1px; }
.pe-hint { font-size: .78rem; color: var(--muted); text-align: center; margin: .6rem auto 0; max-width: 460px; line-height: 1.7; }
.pe-side { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.pe-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.pe-tabs button { display: grid; justify-items: center; gap: .15rem; padding: .55rem .2rem; border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; border-bottom: 2px solid transparent; }
.pe-tabs button[aria-selected="true"] { color: var(--pe-acc); border-bottom-color: var(--pe-acc); font-weight: 700; }
.pe-panel { padding: .8rem .9rem 1rem; display: grid; gap: .55rem; max-height: calc(100vh - 210px); overflow: auto; }
.pe-panel h3 { font-size: .86rem; margin: .5rem 0 0; color: var(--ink); }
.pe-panel h3:first-child { margin-top: 0; }
.pe-note { font-size: .78rem; color: var(--muted); margin: 0; line-height: 1.7; }
.pe-note.good { background: var(--yes-bg); color: var(--yes); padding: .5rem .65rem; border-radius: 10px; }
.pe-note.warn { background: var(--wait-bg); color: var(--wait); padding: .5rem .65rem; border-radius: 10px; }
.pe-empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 1.5rem .5rem; line-height: 1.8; }
.pe-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.pe-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.pe-add { display: grid; justify-items: center; gap: .2rem; padding: .6rem .3rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.pe-add:hover { border-color: var(--pe-acc); }
.pe-add.wide { grid-auto-flow: row; }
.pe-add small { color: var(--muted); font-size: .72rem; }
.pe-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.pe-chip { border: 1px dashed var(--saffron); background: var(--saffron-soft); color: #7a5a1c; border-radius: 99px; padding: .25rem .65rem; font: inherit; font-size: .78rem; cursor: pointer; }
.pe-chips.sm .pe-chip { font-size: .72rem; padding: .18rem .5rem; }
.pe-tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.pe-tpl { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; overflow: hidden; font: inherit; font-size: .75rem; color: var(--ink); }
.pe-tpl span { display: block; line-height: 0; }
.pe-tpl svg { width: 100%; height: auto; }
.pe-tpl b { display: block; padding: .3rem; }
.pe-tpl:hover { border-color: var(--pe-acc); }
.pe-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .84rem; min-height: 34px; }
.pe-row > span:first-child { flex: 1; }
.pe-rng input { flex: 0 0 46%; accent-color: var(--pe-acc); }
.pe-rng output { min-width: 3.2em; text-align: center; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pe-col { display: inline-flex; align-items: center; gap: .3rem; }
.pe-col input[type="color"] { width: 42px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.pe-none { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0; }
.pe-none.on { border-color: var(--pe-acc); color: var(--pe-acc); font-weight: 700; }
.pe-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pe-seg button { border: 0; background: var(--bg); color: var(--ink); padding: .35rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; display: inline-grid; place-items: center; }
.pe-seg button + button { border-inline-start: 1px solid var(--line); }
.pe-seg button[aria-pressed="true"] { background: var(--pe-acc); color: #fff; }
.pe-field { display: grid; gap: .25rem; font-size: .84rem; }
.pe-field textarea, .pe-field select { width: 100%; font: inherit; font-size: .95rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.pe-elhead { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.pe-elhead b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-elic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--ink-2); flex: none; }
.pe-acts { display: flex; flex-wrap: wrap; gap: .35rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.pe-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.pe-layers li { display: flex; align-items: center; gap: .4rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .82rem; }
.pe-layers li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pe-layers li[aria-current="true"] { border-color: var(--pe-acc); background: var(--surface); }
.pe-layers .pe-ib { width: 28px; height: 28px; }
.pe-scope { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .8rem; padding: .7rem .8rem; border-radius: 12px; background: var(--surface); font-size: .86rem; }
.pe-scope b { color: var(--ink); }
.pe-scope .on { color: var(--yes); font-weight: 700; }
.pe-scope .off { color: var(--muted); }
@media (max-width: 860px) {
  .pe-body { grid-template-columns: 1fr; }
  /* الجوال: البطاقة تبقى ظاهرة فوق، واللوحة تمشي تحتها */
  .pe-stage-wrap { position: sticky; top: 60px; z-index: 5; padding: .5rem 0 .6rem; background: var(--surface); }
  .pe-stage { width: min(100%, calc(46vh * 1080 / 1620)); }
  .pe-hint { display: none; }
  .pe-panel { max-height: none; }
  .pe-h { width: 18px; height: 18px; }
  .pe-h.nw { top: -11px; left: -11px; } .pe-h.se { bottom: -11px; right: -11px; } .pe-h.ne { top: -11px; right: -11px; } .pe-h.sw { bottom: -11px; left: -11px; }
  .pe-rot { width: 22px; height: 22px; left: calc(50% - 11px); top: -42px; }
}
