/* ============================================================
   إقرار — بوابة المنسوبين (تصميم للجوال أولاً · ثم يتّسع للحاسوب)
   يعتمد على style.css و hero.css؛ لا يعدّل شيئاً فيهما
   ============================================================ */

body.portal {
  min-height: 100vh; min-height: 100dvh;
  background-attachment: scroll;               /* الخلفية الثابتة ثقيلة على الجوال */
  -webkit-tap-highlight-color: transparent;
}
.portal .btn { min-height: 48px; }
.portal .btn.sm { min-height: 48px; padding: 8px 16px; }
.portal .btn.icon { width: 48px; height: 48px; }
.portal input:not([type=checkbox]):not([type=radio]) { min-height: 50px; font-size: 16px; }   /* 16px تمنع تكبير iOS */
.portal .pledge input[type=checkbox] { width: 24px; height: 24px; margin-top: 3px; }
.portal .search input { padding-right: 44px; }
.spin.sm { width: 18px; height: 18px; border-width: 3px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.papp { overflow-x: clip; }

/* حاوية الصفحة — هوامش آمنة للجوال المشقوق */
.pc {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left));
}
.pc.nr { max-width: 860px; }

/* ============================================================
   بوابة الدخول
   ============================================================ */
.pgate {
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.pgate .gridfloor { height: 62%; }
.pg-hero { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 22px; padding: 4px 4px 24px; color: #e6f2f6; }
.pg-hero .brand { padding: 0; }
.pg-scene { display: none; }
.pbadge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 15px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: #f3d98f;
  background: rgba(200,160,74,.14); box-shadow: 0 0 0 1px rgba(233,201,120,.35) inset;
}
.pg-cap h1 { font-size: 40px; line-height: 1.2; margin: 14px 0 10px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 18px 30px rgba(0,0,0,.35); }
.pg-cap h1 em { font-style: normal; background: linear-gradient(180deg, #f6e3a4, #c8a04a); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.pg-cap p { margin: 0; color: #b7d0da; font-size: 15.5px; line-height: 2; max-width: 520px; }
.pg-side { position: relative; z-index: 2; width: 100%; max-width: 460px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.pg-card { padding: 22px 18px 20px; color: var(--ink); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--sh-3); }
.pg-card h2 { color: var(--ink); font-size: 30px; line-height: 1.1; }
.pg-card .muted { color: var(--ink-3); }
.pg-hd { display: flex; align-items: center; gap: 14px; }
.pg-hd .cube, .ps-hd .cube {
  --c1: #22c69c; --c2: #0e7c66; --c3: #075846;
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; color: #fff; border-radius: 16px;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 2px 2px rgba(255,255,255,.55), inset 0 -5px 8px rgba(0,0,0,.2), 0 7px 0 -1px var(--c3), 0 14px 16px -6px rgba(11,34,48,.4);
  transform: translateY(-3px) rotate(-3deg);
}
.pg-hd .cube svg, .ps-hd .cube svg { width: 25px; height: 25px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)); }
#gerr:empty { display: none; }
.pg-verify {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 0 20px; cursor: pointer;
  font-weight: 600; font-size: 14.5px; color: #e6f2f6; border-radius: 16px; border: 0;
  background: rgba(255,255,255,.1); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset, 0 4px 0 rgba(0,0,0,.25), 0 16px 22px -10px rgba(0,0,0,.5);
  transition: transform .12s, box-shadow .12s;
}
.pg-verify:active { transform: translateY(3px); box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset, 0 1px 0 rgba(0,0,0,.25); }
.pg-verify svg { width: 20px; height: 20px; color: #e9c978; }
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 15% { transform: translateX(8px); } 30% { transform: translateX(-7px); } 50% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

.psplash { position: relative; z-index: 2; flex: 1; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 30px 20px; }
.psplash h2 { font-size: 26px; }
.psplash p { margin: 0; color: #a9c5d0; max-width: 340px; }
.psplash .mark { filter: drop-shadow(0 12px 10px rgba(0,0,0,.4)); animation: floaty3 3s ease-in-out infinite; }
@keyframes floaty3 { 50% { transform: translateY(-8px); } }

@media (min-width: 980px) {
  .pgate { display: grid; grid-template-columns: 1.1fr 1fr; padding: 0; }
  .pg-hero { padding: 30px clamp(28px, 4vw, 60px) 34px; justify-content: space-between; gap: 6px; }
  .pg-scene { display: grid; place-items: center; flex: 1; min-height: 470px; }
  .pg-scene .scene { height: 500px; }
  .pg-cap { max-width: 520px; }
  .pg-cap h1 { font-size: 46px; }
  .pg-side {
    max-width: none; margin: 0; justify-content: center; align-items: center; padding: 30px 22px; color: var(--ink);
    background: radial-gradient(700px 400px at 100% 0, #d6efe8, transparent 60%), radial-gradient(600px 400px at 0 100%, #f1e7cf, transparent 60%), #eef3f5;
  }
  .pg-card { width: min(440px, 100%); padding: 30px 28px 26px; }
  .pg-verify { color: var(--ink-2); background: #fff; box-shadow: 0 1px 0 #fff inset, 0 4px 0 #c5d2d9, 0 14px 20px -10px rgba(11,34,48,.3); backdrop-filter: none; }
  .pg-verify svg { color: var(--gold-3); }
}

/* ============================================================
   الهيكل: شريط داكن مائل نحو الفاتح
   ============================================================ */
.phero {
  position: relative; overflow: hidden; padding: env(safe-area-inset-top, 0px) 0 64px;
  border-radius: 0 0 34px 34px; box-shadow: 0 9px 0 #04141d, 0 34px 44px -20px rgba(4,20,29,.6);
}
.phero .gridfloor { height: 80%; opacity: .35; }
.pbar { position: relative; z-index: 6; display: flex; align-items: center; gap: 10px; min-height: 68px; }
.pbar .spacer { flex: 1; }
.brand-s { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; }
.brand-s .mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 5px 4px rgba(0,0,0,.35)); }
.brand-s b { display: block; font-family: var(--disp); font-size: 22px; line-height: 1; }
.brand-s small { display: block; font-size: 11.5px; color: #9cbccb; margin-top: 3px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pback, .pmbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; min-width: 48px; padding: 0 14px 0 16px; cursor: pointer;
  font-weight: 600; font-size: 14.5px; color: #fff; border: 0; border-radius: 16px;
  background: rgba(255,255,255,.13); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset, 0 4px 0 rgba(0,0,0,.28), 0 14px 18px -8px rgba(0,0,0,.5);
  transition: transform .12s, box-shadow .12s;
}
.pback:active, .pmbtn:active { transform: translateY(3px); box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset, 0 1px 0 rgba(0,0,0,.28); }
.pback svg { width: 20px; height: 20px; }
.pmbtn { padding: 0; width: 48px; }
.av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #3a2806;
  background: linear-gradient(145deg, #f3d98f, #c8a04a); box-shadow: inset 0 2px 2px rgba(255,255,255,.55), 0 3px 0 #8f6d1e; }

.pmenu-wrap { position: relative; }
.ppop {
  position: absolute; top: calc(100% + 12px); left: 0; z-index: 30; width: min(290px, calc(100vw - 32px)); padding: 8px; border-radius: 20px; color: var(--ink);
  background: linear-gradient(180deg, #fff, #f5f9fa); box-shadow: var(--sh-3); animation: pop3d .32s cubic-bezier(.2,1.1,.3,1); transform-origin: 20% 0;
}
.ppop[hidden] { display: none !important; }
.ppop-hd { padding: 12px 14px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.ppop-hd b { display: block; font-size: 15px; line-height: 1.6; }
.ppop-hd small { display: block; color: var(--ink-3); font-size: 12.5px; }
.ppop button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: transparent; color: var(--ink); font-weight: 600; font-size: 14.5px; text-align: right; }
.ppop button svg { width: 21px; height: 21px; color: var(--ink-3); }
.ppop button:hover, .ppop button:active { background: #eef3f5; }
.ppop button.dan { color: var(--dan); }
.ppop button.dan svg { color: var(--dan); }

.phero-body { position: relative; z-index: 3; padding-top: 6px; }
.pgreet small { display: block; color: #9fd9c7; font-size: 14px; font-weight: 500; }
.pgreet h1 { font-size: 40px; line-height: 1.25; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 16px 28px rgba(0,0,0,.35); overflow-wrap: anywhere; }
.pjob { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 14px; border-radius: 99px; font-size: 13.5px; color: #f3d98f;
  background: rgba(200,160,74,.14); box-shadow: 0 0 0 1px rgba(233,201,120,.32) inset; }
.pjob svg { width: 16px; height: 16px; }

.pmain { position: relative; z-index: 4; padding-top: 0; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.pfoot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--ink-3); text-align: center; }
.pfoot button { border: 0; background: none; cursor: pointer; color: var(--pri); font-weight: 600; min-height: 44px; padding: 0 8px; font-size: 13px; }

/* ============================================================
   الرئيسية: البطاقة الملخِّصة
   ============================================================ */
.psum { margin-top: -50px; padding: 18px 16px 16px; }
.psum-row { display: flex; align-items: center; gap: 14px; }
.psum-ring { flex: none; }
.psum .ring3 { width: 112px; height: 112px; }
.psum .ring3 .val { font-size: 24px; }
.pcnts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.pcnt { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 14px; color: var(--ink-2); }
.pcnt i { width: 24px; height: 24px; flex: none; border-radius: 8px; background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), 0 3px 0 var(--c3), 0 6px 6px -2px rgba(11,34,48,.3); transform: translateY(-2px); }
.pcnt.g { --c1: #22c69c; --c2: #0e7c66; --c3: #075846; }
.pcnt.a { --c1: #f5c95c; --c2: #d28a0a; --c3: #8c5c04; }
.pcnt.n { --c1: #c3cfd6; --c2: #93a5b0; --c3: #6b7f8b; }
.pcnt span { flex: 1; min-width: 0; line-height: 1.5; }
.pcnt b { font-family: var(--disp); font-size: 26px; line-height: 1; color: var(--ink); }
.pnext {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 11px 14px; min-height: 60px; border-radius: 16px; color: #5b4204;
  background: linear-gradient(180deg, #fdf6df, #f9edc7); border: 1px solid #ecd691; box-shadow: 0 4px 0 #ecd691, 0 12px 16px -8px rgba(140,98,4,.35);
  transition: transform .12s, box-shadow .12s;
}
a.pnext:active { transform: translateY(3px); box-shadow: 0 1px 0 #ecd691; }
.pnext .pn-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; color: #3a2806;
  background: linear-gradient(145deg, #f3d98f, #c8a04a); box-shadow: inset 0 2px 2px rgba(255,255,255,.55), 0 3px 0 #8f6d1e; }
.pnext .pn-ic svg { width: 21px; height: 21px; }
.pnext div { flex: 1; min-width: 0; line-height: 1.6; }
.pnext b { display: block; font-size: 14.5px; }
.pnext small { display: block; font-size: 12.5px; color: #8a6a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnext > svg { width: 20px; height: 20px; flex: none; }
.pnext.ok { background: linear-gradient(180deg, #e9f8f2, #d8f0e6); border-color: #b5e0cf; color: #0b6b4c; box-shadow: 0 4px 0 #b5e0cf; font-weight: 600; font-size: 14.5px; }
.pnext.ok .pn-ic { color: #fff; background: linear-gradient(145deg, #22c69c, #0e7c66); box-shadow: inset 0 2px 2px rgba(255,255,255,.55), 0 3px 0 #075846; }

/* أدوات التصفية */
.pctl { display: flex; flex-direction: column; gap: 14px; margin: 22px 0 16px; }
.pctl .search { min-width: 0; }
.pseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.pseg button { min-height: 48px; padding: 6px 8px; font-size: 14px; line-height: 1.4; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.pseg .n { margin-right: 4px; min-width: 24px; text-align: center; }
.pcats { display: flex; gap: 9px; overflow-x: auto; padding: 3px 2px 12px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pcats::-webkit-scrollbar { display: none; }
.pcats:empty { display: none; }
.pcat {
  flex: none; min-height: 44px; padding: 0 18px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2);
  background: linear-gradient(180deg, #fff, #eef3f5); border: 1px solid var(--line-2); box-shadow: 0 1px 0 #fff inset, 0 3px 0 #c9d6dd, 0 8px 10px -6px rgba(11,34,48,.3);
  transition: transform .12s, box-shadow .12s;
}
.pcat:active { transform: translateY(3px); box-shadow: 0 1px 0 #fff inset, 0 0 0 #c9d6dd; }
.pcat.on { color: #fff; border-color: #0a6a56; background: linear-gradient(180deg, #1fc39c, #0e7c66); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 3px 0 #075846, 0 8px 10px -6px rgba(11,34,48,.4); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
@media (min-width: 640px) { .pseg { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* بطاقة التعميم في القائمة */
.pcard { display: block; color: inherit; margin-bottom: 14px; padding: 16px 62px 14px 18px; -webkit-user-drag: none; }
.pcard::before {                              /* مؤشّر الحالة — قرص ملوّن على الحافة */
  content: ''; position: absolute; right: 12px; top: 18px; bottom: 18px; width: 6px; border-radius: 6px;
  background: linear-gradient(180deg, var(--a1), var(--a2)); box-shadow: 0 3px 0 var(--a3), 0 6px 8px -3px rgba(11,34,48,.3);
}
.pcard { --a1: #c3cfd6; --a2: #93a5b0; --a3: #6b7f8b; }
.pcard.st-pend { --a1: #f5c95c; --a2: #d28a0a; --a3: #8c5c04; }
.pcard.st-late { --a1: #ee7a70; --a2: #c0392b; --a3: #8a2218; }
.pcard.st-done { --a1: #22c69c; --a2: #0e7c66; --a3: #075846; }
.pcard.st-view { --a1: #8ec1f2; --a2: #2b6cb0; --a3: #174a7f; }
.pcard h3 { font-family: var(--ui); font-size: 16.5px; font-weight: 700; line-height: 1.7; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.pc-meta .pdate { display: inline-flex; align-items: center; gap: 5px; }
.pc-meta .tag { display: inline-flex; align-items: center; gap: 5px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pc-go {
  position: absolute; left: 12px; top: 50%; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--ink-2);
  background: linear-gradient(180deg, #fff, #e9f0f3); box-shadow: 0 1px 0 #fff inset, 0 4px 0 #c5d2d9, 0 10px 12px -6px rgba(11,34,48,.3);
  transform: translateY(-50%); transition: transform .15s;
}
.pc-go svg { width: 20px; height: 20px; }
.pcard:hover .pc-go { transform: translate(-3px, -50%); }
.pcard:active { transform: translateY(2px) scale(.996); }
.pcard.st-pend .pc-go, .pcard.st-late .pc-go { color: #fff; background: linear-gradient(180deg, #1fc39c, #0e7c66); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 0 #075846, 0 10px 12px -6px rgba(11,34,48,.3); }

/* ============================================================
   شاشة التعميم
   ============================================================ */
.chero .cchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; color: #d8ece6; line-height: 1.9;
  background: rgba(255,255,255,.12); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset; }
.gchip svg { width: 15px; height: 15px; }
.chero h1 { font-size: 30px; line-height: 1.6; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 14px 24px rgba(0,0,0,.35); overflow-wrap: anywhere; }
.chero .cmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; font-size: 13.5px; color: #a9c5d0; }
.chero .cmeta span.d { display: inline-flex; align-items: center; gap: 6px; }
.chero .cmeta svg { width: 16px; height: 16px; }

.cgrid { display: flex; flex-direction: column; gap: 18px; margin-top: -34px; }
.ccol { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.scol { min-width: 0; }
.plead { padding: 16px 18px; border-radius: 18px; background: linear-gradient(180deg, #f4faf8, #eaf5f1); border: 1px solid #cfe6de; border-right: 6px solid var(--pri);
  box-shadow: 0 4px 0 #cfe6de, 0 16px 22px -14px rgba(11,34,48,.3); }
.plead b { display: flex; align-items: center; gap: 8px; color: #0b6b4c; font-size: 14px; margin-bottom: 4px; }
.plead p { margin: 0; line-height: 2; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }

/* عارض الملف */
.pv-hd { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f2f7f8); }
.pv-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pv-t > svg { width: 30px; height: 30px; color: var(--pri); flex: none; }
.pv-t b { display: block; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.pv-t small { display: block; color: var(--ink-3); font-size: 12px; }
.pv-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-act .btn { padding: 8px 10px; font-size: 13.5px; }
.pv-frame { position: relative; background: #dfe8ec; }
.pv-frame::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, #e4ecef 30%, #f3f7f9 50%, #e4ecef 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.pv-frame iframe { position: relative; display: block; width: 100%; height: 72vh; height: min(78dvh, 900px); min-height: 440px; border: 0; background: transparent; }
.pv-img { padding: 12px; background: #dfe8ec; text-align: center; }
.pv-img img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 6px 0 #c5d2d9, 0 20px 26px -14px rgba(11,34,48,.4); background: #fff; }
.pv-mob { padding: 20px 16px 18px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.pv-mob p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.pv-mob .fcube { --c1: #f3d98f; --c2: #c8a04a; --c3: #8f6d1e; width: 74px; height: 74px; margin: 6px auto 4px; display: grid; place-items: center; color: #4a3407; border-radius: 22px;
  background: linear-gradient(145deg, var(--c1), var(--c2)); box-shadow: inset 0 2px 2px rgba(255,255,255,.55), inset 0 -5px 8px rgba(0,0,0,.15), 0 9px 0 -1px var(--c3), 0 18px 20px -8px rgba(11,34,48,.4); transform: rotate(-4deg); }
.pv-mob .fcube svg { width: 36px; height: 36px; }
.pv-mob .frame-host:empty { display: none; }
.pv-mob .frame-host { margin: 4px -16px -18px; }
.pv-note { padding: 10px 16px 14px; font-size: 12.5px; color: var(--ink-3); text-align: center; background: #f7fafb; border-top: 1px solid var(--line); }

/* الخطاب المكتوب — ورقة رسمية */
.paper {
  position: relative; padding: 22px 20px 26px; border-radius: 16px; color: #16262f; font-family: var(--doc); font-size: 17.5px; line-height: 2.05;
  background: linear-gradient(180deg, #fffefb, #fbf8ef); border: 1px solid #e6dfc6;
  box-shadow: 0 1px 0 #fff inset, 0 7px 0 #ddd5b8, 0 26px 34px -16px rgba(60,44,8,.4);
}
.paper::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 7px; border-radius: 16px 16px 0 0; background: linear-gradient(90deg, #0e7c66, #17b38d 55%, #c8a04a); }
.pp-hd { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; border-bottom: 2px solid #0e7c66; }
.pp-org { flex: 1; min-width: 0; font-family: var(--ui); }
.pp-org small { display: block; font-size: 11.5px; color: #5b7183; line-height: 1.7; }
.pp-org b { display: block; font-size: 15px; color: #0b2230; line-height: 1.6; }
.pp-hd img { height: 54px; width: auto; max-width: 90px; object-fit: contain; }
.pp-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 2px 0; font-family: var(--ui); font-size: 12.5px; color: #5b7183; }
.pp-ttl { font-family: var(--disp); font-size: 25px; line-height: 1.6; text-align: center; margin: 12px 0 6px; color: #0b2230; overflow-wrap: anywhere; }
.paper p { margin: 8px 0; text-align: justify; overflow-wrap: anywhere; }
.paper .pp-dear { margin-top: 14px; }
.pp-sign { display: flex; align-items: flex-end; justify-content: flex-start; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 12px; border-top: 1px dotted #cbd8e2; font-family: var(--ui); }
.pp-sign small { display: block; font-size: 12px; color: #5b7183; }
.pp-sign b { display: block; font-size: 14.5px; line-height: 1.7; }
.pp-sign img { max-height: 64px; max-width: 150px; }

/* ============================================================
   لوحة التوقيع
   ============================================================ */
.psign { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 18px; }
.ps-hd { display: flex; align-items: center; gap: 14px; }
.ps-hd h3 { font-family: var(--disp); font-size: 25px; line-height: 1.2; }
.ps-hd small { display: block; color: var(--ink-3); font-size: 12.5px; }
.pready { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #eef3f5; box-shadow: inset 0 2px 5px rgba(11,34,48,.1); }
.pready .rd { display: flex; align-items: flex-start; gap: 12px; }
.pready .rk { width: 26px; height: 26px; flex: none; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; line-height: 1;
  background: #d3dee4; box-shadow: inset 0 2px 3px rgba(11,34,48,.22); transition: background .3s, box-shadow .3s; }
.pready .rd.ok .rk { background: linear-gradient(145deg, #22c69c, #0e7c66); box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 3px 0 #075846; }
.pready .rd.ok .rk::after { content: '✓'; }
.pready .rt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.pready .rd.ok .rt { color: #0b6b4c; font-weight: 600; }
.pready .b3 { margin: 8px 0 2px; }
.pready .rh { display: block; font-size: 12px; color: var(--ink-3); }
.pledge { -webkit-user-select: none; user-select: none; }
.psign .f em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.psign .sigpad .sheet { height: 220px; }
.psign .sigpad .tools .btn { flex: 1; }
.pwhy { margin-top: 10px; font-size: 12.5px; line-height: 1.8; color: var(--ink-3); text-align: center; }
.pwhy.ok { color: #0b6b4c; font-weight: 600; }
#serr:empty { display: none; }
#serr { margin-bottom: 12px; }

/* بطاقة «تم التوقيع» / «للاطّلاع فقط» */
.pdone-card { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 18px; }
.pd-top { display: flex; align-items: center; gap: 14px; }
.pd-top h3 { font-family: var(--disp); font-size: 25px; line-height: 1.3; margin-bottom: 2px; }
.seal-mini { width: 70px; height: 70px; flex: none; filter: drop-shadow(0 6px 4px rgba(80,55,5,.4)); transform: rotate(-6deg); }
.seal-mini svg, .seal3d svg { width: 100%; height: 100%; display: block; }
.pd-sig { display: grid; place-items: center; min-height: 110px; padding: 10px; border-radius: 16px; background: linear-gradient(180deg, #fffefb, #f8f4e8); border: 1px solid #dfd6b8;
  box-shadow: 0 1px 0 #fff inset, 0 5px 0 #d9cfa9, 0 16px 22px -12px rgba(60,44,8,.4); }
.pd-sig img { max-width: 100%; max-height: 120px; }
.pd-kv { display: grid; gap: 10px; margin: 0; }
.pd-kv > div { padding: 10px 14px; border-radius: 14px; background: #eef3f5; box-shadow: inset 0 2px 4px rgba(11,34,48,.08); }
.pd-kv dt { font-size: 12px; color: var(--ink-3); }
.pd-kv dd { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.pd-kv dd.mono { font-size: 20px; letter-spacing: 1px; color: #0b6b4c; }

/* شريط التوقيع السفلي على الجوال */
.pdock {
  position: fixed; z-index: 50; right: 0; left: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(12,53,73,.96), rgba(6,27,39,.98)); backdrop-filter: blur(8px);
  box-shadow: 0 -1px 0 rgba(255,255,255,.14), 0 -14px 30px -10px rgba(4,20,29,.6); animation: dockIn .4s cubic-bezier(.2,1,.3,1);
}
.pdock[hidden] { display: none; }
.pdock .pd-t { flex: 1; min-width: 0; color: #cfe1e8; font-size: 13px; line-height: 1.5; }
.pdock .pd-t b { display: block; color: #fff; font-size: 14px; }
.pdock .btn { flex: none; padding: 8px 18px; }
@keyframes dockIn { from { transform: translateY(100%); } }
body.hasdock #toast { bottom: 96px; }

/* ============================================================
   شاشة النجاح — ختم ذهبي يهبط بارتداد
   ============================================================ */
.pwin {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; overflow-y: auto; perspective: 1400px;
  background: radial-gradient(700px 500px at 50% 20%, rgba(23,179,141,.35), transparent 65%), radial-gradient(600px 500px at 80% 90%, rgba(200,160,74,.3), transparent 60%), rgba(4,20,29,.86);
  backdrop-filter: blur(8px); animation: fadeIn .25s;
}
.pwin-card {
  width: min(430px, 100%); margin: auto; padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--ink); border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f3f8f9); box-shadow: var(--sh-3), 0 0 0 1px rgba(255,255,255,.5) inset; animation: pop3d .55s cubic-bezier(.2,1.1,.3,1);
}
.pwin-card h2 { font-size: 30px; color: var(--ink); line-height: 1.3; }
.pwin-card > p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.stampwrap { position: relative; width: 176px; height: 176px; margin: 0 auto 8px; display: grid; place-items: center; }
.seal3d { position: relative; z-index: 2; width: 136px; height: 136px; filter: drop-shadow(0 10px 6px rgba(80,55,5,.45)); transform-origin: 50% 60%; animation: stamp 1s cubic-bezier(.2,.9,.25,1) .18s both; }
.stampwrap .sh { position: absolute; bottom: 8px; left: 50%; width: 128px; height: 24px; margin-left: -64px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40,28,4,.42), transparent); animation: shad 1s ease-out .18s both; }
.stampwrap .ripple { position: absolute; inset: 12px; border-radius: 50%; border: 3px solid rgba(200,160,74,.75); opacity: 0; animation: ripple 1.1s ease-out .78s both; }
.stampwrap .ripple.r2 { animation-delay: 1s; border-color: rgba(23,179,141,.6); }
@keyframes stamp {
  0%   { opacity: 0; transform: translateY(-200px) scale(1.9) rotate(-26deg); }
  50%  { opacity: 1; transform: translateY(0) scale(.84) rotate(5deg); }
  64%  { transform: translateY(-10px) scale(1.08) rotate(-3deg); }
  80%  { transform: translateY(0) scale(.97) rotate(-7deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(-6deg); }
}
@keyframes shad { 0% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.3); } 100% { opacity: .85; transform: scale(1); } }
@keyframes ripple { 0% { opacity: .95; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.7); } }
.dno { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 16px 0 10px; padding: 14px 12px 12px; border-radius: 18px;
  background: linear-gradient(180deg, #fbf7ea, #f5eed6); border: 1px dashed #c8a04a; box-shadow: 0 4px 0 #e0cf94; }
.dno small { color: #7a5a10; font-size: 12.5px; }
.dno b { font-size: 34px; line-height: 1.2; letter-spacing: 2px; color: #4a3407; user-select: all; }
.dno .btn { margin-top: 4px; }
.dwhen { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.dwhen svg { width: 16px; height: 16px; flex: none; }
.pwin-act { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   حالة عامة
   ============================================================ */
.pmain .empty { padding: 40px 12px; }
.pmain .empty .btn { min-width: 180px; }
.pmain > .card.pad-err { margin-top: -34px; }

/* ============================================================
   الشاشات الأوسع
   ============================================================ */
@media (min-width: 720px) {
  .phero { padding-bottom: 76px; }
  .pgreet h1 { font-size: 50px; }
  .chero h1 { font-size: 38px; }
  .psum { padding: 22px 26px; margin-top: -58px; }
  .psum .ring3 { width: 132px; height: 132px; }
  .psum .ring3 .val { font-size: 28px; }
  .psum-row { gap: 30px; }
  .pcnt { font-size: 15px; }
  .pcard { padding: 18px 66px 16px 22px; }
  .pv-hd { flex-direction: row; align-items: center; justify-content: space-between; }
  .pv-act { display: flex; }
  .pv-frame iframe { height: 78vh; height: min(80dvh, 900px); }
  .paper { padding: 34px 40px 36px; font-size: 19px; }
  .pp-ttl { font-size: 30px; }
}
@media (min-width: 1000px) {
  .cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; margin-top: -40px; }
  .scol { position: sticky; top: 16px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 4px 14px 34px; margin: -4px -14px -34px; }
  .pdock { display: none !important; }
  body.hasdock #toast { bottom: 24px; }
}
@media (max-width: 999px) { body.hasdock .pmain { padding-bottom: 110px; } }
@media (max-width: 380px) {
  .pgreet h1 { font-size: 34px; }
  .chero h1 { font-size: 26px; }
  .psum .ring3 { width: 100px; height: 100px; }
  .psum-row { gap: 10px; }
  .pcnt { font-size: 13px; }
  .paper { font-size: 16.5px; padding: 20px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .seal3d, .stampwrap .sh, .stampwrap .ripple, .shake, .psplash .mark, .pdock { animation: none !important; }
  .stampwrap .ripple { display: none; }
}
