/* لوحة الالوان المسماة: ليل، سطح عاجي، حبر، ذهب، ذهب غامق للنصوص */
:root {
  --night: #0e1626;
  --night-2: #16223a;
  --ivory: #f7f1e3;
  --ivory-2: #efe6d2;
  --ink: #292214;
  --ink-2: #675b41;
  --gold: #c9a227;
  --gold-deep: #8a6317;
  --on-night: #f2ead6;
  --ok: #1c7c3f;
  --err: #b02a2a;
  --line: rgba(201, 162, 39, 0.4);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-backdrop: 10;
  --z-sheet: 20;
  --z-toast: 30;
}

@font-face {
  font-family: 'El Messiri';
  src: url('fonts/elmessiri-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Almarai';
  src: url('fonts/almarai-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Almarai';
  src: url('fonts/almarai-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  font-family: 'Almarai', 'SF Arabic', 'Segoe UI', Tahoma, sans-serif;
  background:
    radial-gradient(ellipse at 50% -20%, var(--night-2), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 6l7 22h23l-18 14 7 24-19-15-19 15 7-24L6 28h23z' fill='%23c9a227' fill-opacity='0.04'/%3E%3C/svg%3E"),
    var(--night);
  color: var(--on-night);
  font-size: 17px;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

html:not(.js) .js-only { display: none; }

/* ============ الحركة الاساسية ============ */
.reveal {
  animation: rise 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.hero > .reveal:nth-child(1) { --i: 0; }
.hero > .reveal:nth-child(2) { --i: 1; }
.hero > .reveal:nth-child(3) { --i: 2; }
.hero > .reveal:nth-child(4) { --i: 3; }
.hero > .reveal:nth-child(5) { --i: 4; }
.hero > .reveal:nth-child(6) { --i: 5; }
.hero > .reveal:nth-child(7) { --i: 6; }
.hero > .reveal:nth-child(8) { --i: 7; }
.hero > .reveal:nth-child(9) { --i: 8; }
.hero > .reveal:nth-child(10) { --i: 9; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ الشاشة الرئيسية ============ */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.hero {
  width: 100%;
  max-width: 460px;
  text-align: center;
}
@media (min-width: 1200px) {
  .hero { max-width: 560px; }
}

.kicker {
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  word-spacing: 3px;
}

.groom {
  font-family: 'El Messiri', 'Almarai', serif;
  font-weight: 700;
  font-size: clamp(44px, 15vw, 72px);
  line-height: 1.25;
  overflow-wrap: anywhere;
  color: var(--on-night);
  text-shadow: 0 2px 30px rgba(201, 162, 39, 0.25);
  margin: 6px 0 2px;
}

/* التوقيع البصري: خط ذهبي يرسم نفسه تحت الاسم */
.flourish {
  width: min(280px, 70vw);
  height: 24px;
  display: block;
  margin: 0 auto 10px;
}
.flourish path {
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 1.1s var(--ease) 0.35s forwards;
}
.flourish circle {
  fill: var(--gold);
  opacity: 0;
  animation: appear 0.3s ease-out 1.2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

.blessing {
  font-size: 18px;
  color: var(--on-night);
  margin-bottom: 22px;
}

.btn {
  display: inline-block;
  border: 0; cursor: pointer;
  border-radius: 14px;
  padding: 14px 26px;
  font-size: 17px;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none; text-align: center;
  min-height: 48px;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); }
  .bank-btn:hover { transform: translateY(-1px); }
  .menu-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

.btn-gold {
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  box-shadow: 0 6px 22px rgba(201, 162, 39, 0.35);
}
.btn-hero { min-width: 220px; font-size: 19px; }

.btn-line {
  background: transparent;
  color: var(--gold-deep);
  border: 1.5px solid var(--line);
}
.sheet .btn-line { color: var(--gold-deep); }
.btn-big { width: 100%; margin-top: 14px; }

.btn-text {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-2); font-family: inherit; font-size: 14px;
  text-decoration: underline;
  padding: 10px;
  min-height: 44px;
}

.mine-line { margin-top: 12px; color: var(--gold); font-size: 15px; }
.closed-note { color: var(--gold); font-size: 17px; }

.goal { margin: 0 auto 20px; max-width: 320px; }
.goal-bar {
  height: 6px; border-radius: 3px;
  background: rgba(247, 241, 227, 0.12);
  overflow: hidden;
}
.goal-fill {
  height: 100%; width: 0;
  background: linear-gradient(to left, var(--gold-deep), var(--gold));
  border-radius: 3px;
  transition: width 1s var(--ease);
}
.goal-text { font-size: 13px; color: var(--gold); margin-top: 6px; }

.about { margin-top: 26px; }
.about p { font-size: 14px; color: rgba(242, 234, 214, 0.75); max-width: 380px; margin: 4px auto 0; line-height: 2; }

.foot {
  text-align: center;
  color: rgba(242, 234, 214, 0.55);
  font-size: 13px;
  padding: 18px 20px 26px;
}

/* ============ نافذة الاهداء: sheet على الجوال، modal على الكبير ============ */
.sheet {
  z-index: var(--z-sheet);
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: fixed;
  inset: auto 0 0 0;
  max-height: 92dvh;
}
.sheet::backdrop {
  background: rgba(8, 12, 22, 0.65);
  backdrop-filter: blur(2px);
}
.sheet-inner {
  background: var(--ivory);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(26px + env(safe-area-inset-bottom));
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet[open] .sheet-inner { animation: sheet-up 0.35s var(--ease); }
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0.4; }
  to   { transform: translateY(0); opacity: 1; }
}

@media (min-width: 640px) {
  .sheet {
    inset: 0;
    margin: auto;
    width: min(92vw, 430px);
    max-height: 88vh;
  }
  .sheet-inner { border-radius: 24px; padding-top: 20px; max-height: 88vh; }
  .sheet-handle { display: none; }
  .sheet[open] .sheet-inner { animation: modal-in 0.3s var(--ease); }
  @keyframes modal-in {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
}

.sheet-handle {
  width: 44px; height: 5px;
  border-radius: 3px;
  background: rgba(41, 34, 20, 0.2);
  margin: 0 auto 10px;
}
.sheet-close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: var(--ivory-2);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease);
}
.sheet-close svg { width: 18px; height: 18px; }
.sheet-close:active { transform: scale(0.92); }

/* زر الحسابات البنكية: نفس مقاس زر الاغلاق ومحاذيه افقيا وعاموديا في الجهة المقابلة */
.bank-btn {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(201, 162, 39, 0.35);
  transition: transform 0.2s var(--ease);
}
.bank-btn:active { transform: scale(0.92); }
.bank-btn svg { width: 20px; height: 20px; }

.sheet h2 {
  font-family: 'El Messiri', 'Almarai', serif;
  color: var(--gold-deep);
  font-size: 24px;
  text-align: center;
  margin: 6px 0 14px;
}

/* النموذج داخل النافذة */
label { display: block; margin: 12px 0 6px; font-weight: 700; color: var(--ink); font-size: 15px; }
.amount-label { text-align: center; }

.amount-hero { position: relative; max-width: 260px; margin: 0 auto; }
.amount-hero input {
  width: 100%;
  background: #fffdf6;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  padding: 10px 54px 10px 16px;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.amount-hero .suffix {
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

input[type="text"], input[type="password"] {
  width: 100%;
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 16px; font-family: inherit;
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.btn:focus-visible, .qbtn:focus-visible, .btn-text:focus-visible,
summary:focus-visible, a:focus-visible, .copy-btn:focus-visible,
.qr-mini:focus-visible, .sheet-close:focus-visible, th button:focus-visible,
.bank-btn:focus-visible, .accounts:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.btn-gold:focus-visible { outline-color: var(--ink); }

.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 4px;
}
.qbtn {
  min-height: 46px;
  min-width: 0;
  flex: 1 1 64px;
  max-width: 96px;
  padding: 0 10px;
  border-radius: 23px;
  border: 1.5px solid var(--line);
  background: #fffdf6;
  color: var(--ink);
  font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.qbtn:active { transform: scale(0.95); }
.qbtn.sel {
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  border-color: transparent;
}

.hint { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.center { text-align: center; }

.notice {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 15px;
}
.notice-err { background: rgba(176, 42, 42, 0.08); border: 1.5px solid var(--err); color: var(--err); }
.notice-ok  { background: rgba(28, 124, 63, 0.08); border: 1.5px solid var(--ok); color: var(--ok); }

/* شاشة النجاح داخل النافذة */
.success-head { text-align: center; padding-top: 6px; }
.checkmark { width: 64px; height: 64px; margin: 0 auto 6px; display: block; }
.checkmark circle {
  fill: none; stroke: var(--ok); stroke-width: 3;
  stroke-dasharray: 230; stroke-dashoffset: 230;
  animation: draw-check 0.6s var(--ease) forwards;
}
.checkmark path {
  fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw-check 0.4s var(--ease) 0.5s forwards;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.success-amount {
  font-size: 30px; font-weight: 800; color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.next-step { color: var(--gold-deep); font-weight: 700; margin-top: 8px; }

/* ============ سلايدر الحسابات ============ */
.accounts-block { margin-top: 18px; }

.accounts {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  gap: 12px;
  scrollbar-width: none;
  padding: 4px 2px;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.accounts::-webkit-scrollbar { display: none; }

/* عند تعدد الحسابات تظهر حافة البطاقة التالية كتلميح للسحب */
.accounts-multi .acc-card { flex-basis: calc(100% - 28px); }

.acc-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
}

.badge {
  display: inline-block;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  padding: 5px 16px;
  background: var(--gold-deep);
}
.badge.pm-stcpay { background: #4f008c; }
.badge.pm-rajhi  { background: #155a94; }

.holder { font-weight: 700; color: var(--ink); margin: 10px 0 8px; font-size: 16px; }

.acc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 8px 0 4px;
}

.bank-sub {
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  margin: -6px 0 4px;
}

.iban-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.iban {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory-2);
  border-radius: 10px;
  padding: 10px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: normal;
}
.copy-btn {
  min-width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.copy-btn:active { transform: scale(0.94); }
.copy-btn .ic-copy, .copy-btn .ic-done { display: inline-flex; align-items: center; justify-content: center; }
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn .ic-done { display: none; }
.copy-btn.copied { background: var(--ok); color: #fff; }
.copy-btn.copied .ic-copy { display: none; }
.copy-btn.copied .ic-done { display: inline-flex; }

.qr-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--gold-deep);
  font-family: inherit;
  font-size: 14px; font-weight: 700;
  padding: 9px 18px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.qr-mini:active { transform: scale(0.96); }
.qr-mini svg { width: 16px; height: 16px; }
.qr-mini .qr-ic, .qr-mini .qr-ic-close { display: inline-flex; }
.qr-mini .qr-ic-close { display: none; }
.qr-mini.open { border-style: solid; background: var(--ivory-2); }
.qr-mini.open .qr-ic { display: none; }
.qr-mini.open .qr-ic-close { display: inline-flex; }

/* صندوق الرمز داخل البطاقة نفسها */
.qr-box {
  margin-top: 12px;
  animation: qr-open 0.28s var(--ease);
}
.qr-box img {
  display: block;
  width: min(72%, 220px);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
@keyframes qr-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* النقاط: ازرار حقيقية بهدف لمس 28px والنقطة المرئية ترسم بداخلها */
.dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 6px;
}
.dots button {
  width: 28px; height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dots button::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 4px;
  background: rgba(41, 34, 20, 0.22);
  transition: all 0.25s var(--ease);
}
.dots button.on::before { background: var(--gold-deep); width: 20px; }
.dots button:focus-visible { outline: 3px solid var(--gold); outline-offset: -2px; border-radius: 8px; }

.sheet-foot {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
.inline-form { display: inline; }
.del-btn { color: var(--err); }

/* ============ التوست: popover حتى يعلو النوافذ المفتوحة ============ */
.toast {
  position: fixed;
  inset: auto;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: 88vw;
  margin: 0;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  background: var(--night);
  color: var(--on-night);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ القصاصات ============ */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: var(--z-backdrop); }
.confetti i {
  position: absolute; top: -20px;
  width: 7px; height: 11px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(600deg); opacity: 0.3; } }

/* ============ صفحة المسؤول ============ */
.admin-body { display: block; }
.admin-body .wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 48px; }

.card {
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px;
  margin-bottom: 16px;
}
.card h2 { color: var(--gold-deep); font-size: 20px; margin-bottom: 10px; font-family: 'El Messiri', 'Almarai', serif; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; }

.login-card { max-width: 380px; margin: 12vh auto 0; }
.login-card h1 {
  color: var(--gold-deep); font-size: 24px; margin-bottom: 12px; text-align: center;
  font-family: 'El Messiri', 'Almarai', serif;
}

.admin-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 16px; }
.admin-head h1 { font-size: 20px; color: var(--gold); font-family: 'El Messiri', 'Almarai', serif; }
.admin-head .btn-text { color: rgba(242, 234, 214, 0.7); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  color: var(--ink);
}
.stat-total { background: linear-gradient(135deg, #b8922a, var(--gold)); border: 0; }
.stat-total .stat-num, .stat-total .stat-label { color: #191204; }
.stat-num {
  display: block;
  font-size: clamp(19px, 6vw, 26px);
  font-weight: 800; color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--ink-2); }
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-total { grid-column: 1 / -1; }
}

.table-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.table-tools .btn { flex: 1; font-size: 13px; padding: 10px 6px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; color: var(--ink); }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); }
th { color: var(--gold-deep); user-select: none; white-space: nowrap; padding: 0; }
th button {
  background: none; border: 0; cursor: pointer;
  font: inherit; color: inherit; font-weight: 700;
  padding: 10px 8px; min-height: 44px;
}
td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.rm-btn { color: var(--err); min-height: 44px; padding: 8px 12px; }

@media (max-width: 639px) {
  #list thead { display: none; }
  #list, #list tbody { display: block; }
  #list tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  #list td { display: block; border: 0; padding: 2px 0; }
  #list td.num::after { content: " ريال"; font-weight: 400; color: var(--ink-2); }
}

.grand {
  margin-top: 12px;
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  border-radius: 12px;
  padding: 13px;
  text-align: center;
  font-size: 18px;
}

.empty { text-align: center; color: var(--ink-2); padding: 30px 16px; }

.value-row { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.value {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.btn-copy {
  background: linear-gradient(135deg, #b8922a, var(--gold));
  color: #191204;
  white-space: nowrap;
  min-width: 100px;
}
@media (max-width: 380px) {
  .value-row { flex-direction: column; }
  .btn-copy { width: 100%; }
}

.pm-title { color: var(--gold-deep); font-size: 17px; margin-top: 16px; font-family: 'El Messiri', 'Almarai', serif; }

/* ازرار قائمة اللوحة: بطاقات ضغط تفتح النوافذ */
.admin-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.menu-btn {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 12px 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 110px;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.menu-btn:active { transform: scale(0.97); }
.menu-btn svg { width: 28px; height: 28px; color: var(--gold-deep); }
.menu-btn span { font-weight: 700; font-size: 15px; }
.menu-btn small { color: var(--ink-2); font-size: 12px; }
.menu-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* نافذة عريضة لجدول السجل على الشاشات الكبيرة */
@media (min-width: 640px) {
  .sheet-wide { width: min(94vw, 620px); }
}

/* فحص رموز QR داخل اللوحة: عرض الصورة المرفوعة يدويا كما هي */
.qr-check { text-align: center; }
.qr-check img {
  display: block;
  width: min(60vw, 200px);
  margin: 8px auto 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.qr-missing {
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 16px 12px;
  margin-top: 8px;
  color: var(--ink-2);
}
.qr-check code, .qr-missing code {
  background: var(--ivory-2);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--ink); min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ============ تقليل الحركة ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .flourish path, .flourish circle,
  .checkmark circle, .checkmark path,
  .sheet[open] .sheet-inner, .qr-box, .toast { animation: none !important; }
  .flourish path { stroke-dashoffset: 0; }
  .flourish circle { opacity: 1; }
  .checkmark circle, .checkmark path { stroke-dashoffset: 0; }
  .confetti { display: none; }
  * { transition: none !important; }
}

/* ============ الدعوة ============ */
.couple {
  font-family: 'El Messiri', 'Almarai', serif;
  font-weight: 700;
  font-size: clamp(24px, 6.6vw, 36px);
  line-height: 1.5;
  color: var(--on-night);
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}
.couple span { display: block; }
.couple .amp { color: var(--gold); font-size: 0.8em; line-height: 1.2; }
.invite { font-size: 17px; color: var(--on-night); line-height: 1.9; margin: 4px auto 6px; max-width: 380px; }
.event-date {
  display: inline-block;
  font-family: 'El Messiri', 'Almarai', serif;
  font-weight: 700; font-size: 20px; color: var(--gold);
  border-top: 1px solid rgba(201, 162, 39, 0.4);
  border-bottom: 1px solid rgba(201, 162, 39, 0.4);
  padding: 6px 18px; margin: 4px 0 18px;
}
.venue {
  display: flex; align-items: center; gap: 12px;
  max-width: 340px; margin: 0 auto 14px; padding: 12px 16px;
  border: 1px solid rgba(201, 162, 39, 0.45); border-radius: 14px;
  color: var(--on-night); text-decoration: none; text-align: start;
  min-height: 44px;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.venue svg { width: 26px; height: 26px; flex: none; color: var(--gold); }
.venue b { display: block; font-size: 17px; }
.venue small { display: block; font-size: 13px; color: rgba(242, 234, 214, 0.7); }
@media (hover: hover) and (pointer: fine) { .venue:hover { background: rgba(201, 162, 39, 0.1); border-color: var(--gold); } }
.no-photo {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 340px; margin: 0 auto 22px; padding: 12px 14px;
  background: rgba(247, 241, 227, 0.06); border-radius: 12px;
  font-size: 14px; line-height: 1.9; color: rgba(242, 234, 214, 0.88); text-align: start;
}
.no-photo svg { width: 22px; height: 22px; flex: none; color: var(--gold); margin-top: 3px; }
.hero > .reveal:nth-child(11) { --i: 10; }
.hero > .reveal:nth-child(12) { --i: 11; }
.hero > .reveal:nth-child(13) { --i: 12; }

.bank-link { display: block; margin: 12px auto 0; color: var(--gold); font-size: 15px; text-decoration: underline; text-underline-offset: 5px; min-height: 44px; }

/* ============ تصميم بطاقة الدعوة (v11) ============ */
:root { --black: #000; --gold-hi: #e2c46b; }
body { background: var(--black); }

.stage {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 0 24px;
  position: relative;
}

/* الصورة في الاعلى ثم تذوب في المحتوى */
.photo {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  max-height: 78vh;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgba(0,0,0,.55) 72%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgba(0,0,0,.55) 72%, transparent 96%);
  animation: photoIn 0.9s var(--ease) both;
}
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
@keyframes photoIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

/* المحتوى يصعد فوق الجزء السفلي من الصورة */
.hero.card-frame {
  position: relative;
  margin: -34% auto 0;
  padding: 0 28px;
  max-width: 560px;
}
@media (min-width: 560px) { .hero.card-frame { margin-top: -190px; } }

/* الخطان الذهبيان الجانبيان كما في البطاقة */
body::before, body::after {
  content: ""; position: fixed; top: 6vh; bottom: 6vh; width: 1px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
  opacity: .7; z-index: 1;
}
body::before { right: max(14px, calc(50% - 300px)); }
body::after  { left:  max(14px, calc(50% - 300px)); }

.cal { display: block; margin: 0 auto; height: auto; max-width: 100%; }
.cal-dawa     { width: min(150px, 40vw); filter: drop-shadow(0 4px 18px rgba(0,0,0,.8)); }
.cal-blessing { width: min(430px, 88%); margin-top: 6px; }
.cal-wedding  { width: min(200px, 52vw); margin: 8px auto 6px; }
.cal-joy      { width: min(380px, 84%); margin: 26px auto 10px; }

.line { font-weight: 700; font-size: clamp(17px, 4.8vw, 21px); color: #fff; line-height: 1.7; margin-top: 12px; }

.facts {
  display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 16px;
  align-items: start; margin: 24px auto 0; max-width: 420px;
}
.facts::before { content: ""; grid-column: 2; grid-row: 1; background: rgba(255,255,255,.55); align-self: stretch; }
.fact:first-child { grid-column: 1; grid-row: 1; }
.fact:last-child  { grid-column: 3; grid-row: 1; }
.fact-h { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 19px; color: #fff; margin-bottom: 6px; }
.fact-h svg { width: 26px; height: 26px; color: var(--gold); }
.fact-v { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.8; }
.map-link { display: inline-block; margin-top: 4px; color: var(--gold-hi); font-size: 14px; text-underline-offset: 4px; min-height: 32px; }

.host-h { font-weight: 700; font-size: 20px; color: #fff; }
.host { font-family: 'El Messiri', 'Almarai', serif; font-weight: 700; font-size: clamp(20px, 5.6vw, 26px); color: var(--gold); margin-bottom: 24px; }

.no-photo { background: rgba(255,255,255,.06); }
.hero .btn-hero { margin-top: 4px; }
.foot { position: relative; z-index: 2; }

@media (max-width: 360px) {
  .facts { gap: 0 10px; }
  .fact-h { font-size: 17px; }
  .fact-v { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .photo { animation: none; } }
.hero > .reveal:nth-child(14) { --i: 13; }
.hero > .reveal:nth-child(15) { --i: 14; }
.hero > .reveal:nth-child(16) { --i: 15; }
.hero > .reveal:nth-child(17) { --i: 16; }
.hero > .reveal:nth-child(18) { --i: 17; }

/* v12: ارتفاع ثابت للصورة العلوية */
.photo { height: 400px; aspect-ratio: auto; max-height: none; }
.hero.card-frame { margin-top: -110px; }
@media (min-width: 560px) { .hero.card-frame { margin-top: -110px; } }
