/* تطبيق المشاركين (PWA) — جوال أولاً */
@font-face { font-family:'RKufi'; src:url('/assets/fonts/kufi-400.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'RKufi'; src:url('/assets/fonts/kufi-700.woff2') format('woff2'); font-weight:700; font-display:swap; }
:root {
  --night:#072a20; --night2:#0e4d38; --brand:#1a936f; --brand2:#6ee7a8; --soft:#d9efe6; --mut2:#b3dfcc;
  --bg:#f5f2ec; --card:#ffffff; --line:#e7e5e4; --txt:#1c1917; --mut:#78716c;
  --green:#15803d; --red:#b91c1c; --blue:#1d4ed8;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; padding:0; }
body { font-family:'RKufi','Segoe UI',Tahoma,Arial,sans-serif; background:var(--bg); color:var(--txt); line-height:1.8; padding-bottom:76px; }
.app-shell { max-width:640px; margin:0 auto; min-height:100vh; background:var(--bg); }
/* الترويسة */
.app-head { position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:10px; padding:10px 14px;
  background:linear-gradient(135deg,var(--night),var(--night2)); color:var(--soft); box-shadow:0 2px 10px rgba(0,0,0,.25); }
.app-head img { width:40px; height:40px; border-radius:10px; background:#fff; padding:2px; }
.app-head .t { flex:1; min-width:0; }
.app-head .t b { display:block; font-size:13px; line-height:1.4; }
.app-head .t span { font-size:10px; color:var(--mut2); }
.icon-btn { background:rgba(255,255,255,.12); border:0; color:var(--soft); border-radius:10px; padding:6px 10px; font-size:14px; cursor:pointer; position:relative; }
.icon-btn .dot { position:absolute; top:2px; left:2px; min-width:18px; height:18px; border-radius:9px; background:var(--red); color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; padding:0 4px; }
/* المحتوى */
#app-view { padding:14px 14px 20px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin:0 0 12px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.card h3 { margin:0 0 8px; font-size:14px; }
.muted { color:var(--mut); font-size:11px; }
.row { display:flex; gap:8px; align-items:center; }
.grow { flex:1; min-width:0; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
/* الأزرار والنماذج */
.btn { display:inline-block; border:0; border-radius:12px; padding:11px 16px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; text-decoration:none; text-align:center; }
.btn:active { transform:scale(.98); }
.btn-primary { background:linear-gradient(135deg,var(--brand),var(--night2)); color:#fff; width:100%; }
.btn-gold { background:linear-gradient(135deg,#f5c542,#d4a017); color:#3b2f10; width:100%; }
.btn-green { background:var(--green); color:#fff; }
.btn-red { background:var(--red); color:#fff; }
.btn-gray { background:#e7e5e4; color:var(--txt); }
.btn-blue { background:var(--blue); color:#fff; }
.btn-sm { padding:7px 12px; font-size:11px; border-radius:10px; }
.btn[disabled] { opacity:.55; }
label.lbl { display:block; font-weight:700; font-size:11px; margin:12px 0 4px; }
input[type=text],input[type=password],input[type=email],input[type=number],input[type=tel],select,textarea {
  width:100%; border:2px solid var(--line); border-radius:12px; padding:10px 12px; font-family:inherit; font-size:13px; background:#fff; color:var(--txt); }
input[type=file] { width:100%; font-size:11px; padding:8px 4px; }
textarea { min-height:90px; resize:vertical; }
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--brand); }
.check { display:flex; gap:8px; align-items:flex-start; margin-top:12px; font-size:12px; }
.check input { width:20px; height:20px; margin-top:4px; accent-color:var(--brand); }
.file-box { border:2px dashed #d6d3d1; border-radius:12px; padding:10px; margin-top:8px; background:#fafaf9; }
.file-box b { font-size:12px; }
.file-hint { font-size:10px; color:var(--mut); margin:4px 0 0; }
.alert { border-radius:12px; padding:10px 14px; margin:0 0 12px; font-size:12px; }
.alert-error { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; }
.alert-ok { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.alert-info { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; }
/* الشارات والقوائم */
.badge { display:inline-block; border-radius:8px; padding:2px 10px; font-size:10px; font-weight:700; }
.b-green{background:#dcfce7;color:#166534}.b-red{background:#fee2e2;color:#991b1b}.b-blue{background:#dbeafe;color:#1e40af}
.b-amber{background:#fef3c7;color:#92400e}.b-gray{background:#e7e5e4;color:#44403c}.b-gold{background:#fef3c7;color:#92400e;border:1px solid #d4a017}
.list-item { display:flex; gap:10px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px; margin-bottom:10px; text-decoration:none; color:inherit; }
.list-item .ico { font-size:26px; }
.list-item b { display:block; font-size:13px; }
.list-item small { color:var(--mut); font-size:10px; }
/* العارض المصغر */
.pv img { width:100%; border-radius:10px; }
.pv video,.pv audio { width:100%; border-radius:10px; }
.pv iframe { width:100%; height:420px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.pv-actions { display:flex; gap:8px; margin-top:8px; }
.pv-actions .btn { flex:1; }
/* شريط التقدم */
.progress { height:10px; background:#e7e5e4; border-radius:6px; overflow:hidden; margin-top:10px; display:none; }
.progress > div { height:100%; width:0; background:linear-gradient(90deg,var(--brand),var(--brand2)); transition:width .2s; }
/* التنقل السفلي */
.app-nav { position:fixed; bottom:0; left:0; right:0; z-index:50; background:var(--night); display:flex; max-width:640px; margin:0 auto;
  border-top:2px solid var(--brand); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); }
.app-nav a { flex:1; text-align:center; color:#d6d3d1; text-decoration:none; font-size:10px; padding:4px 0; border-radius:10px; position:relative; }
.app-nav a .i { display:block; font-size:18px; }
.app-nav a.active { color:var(--brand2); background:rgba(26,147,111,.25); }
.app-nav a .dot { position:absolute; top:0; left:calc(50% - 20px); min-width:18px; height:18px; border-radius:9px; background:var(--red); color:#fff; font-size:10px; font-weight:700; }
/* التنبيهات */
#app-toast { position:fixed; bottom:90px; left:16px; right:16px; max-width:608px; margin:0 auto; z-index:99; display:none;
  background:var(--night); color:var(--soft); border-radius:12px; padding:12px 16px; text-align:center; font-size:12px; box-shadow:0 4px 20px rgba(0,0,0,.3); }
.spin { text-align:center; padding:30px; color:var(--mut); }
.spin::after { content:''; display:block; width:34px; height:34px; margin:10px auto 0; border-radius:50%; border:4px solid var(--line); border-top-color:var(--brand); animation:sp 1s linear infinite; }
@keyframes sp { to { transform:rotate(360deg); } }
.cond-list { margin:8px 0 0; padding:0; list-style:none; counter-reset:c; display:flex; flex-direction:column; gap:6px; font-size:11px; }
.cond-list li { counter-increment:c; position:relative; padding-right:30px; }
.cond-list li::before { content:counter(c); position:absolute; right:0; top:2px; width:22px; height:22px; border-radius:7px; background:var(--night); color:var(--brand2); font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.hero { background:linear-gradient(135deg,var(--night),var(--night2)); color:var(--soft); border-radius:16px; padding:20px 16px; margin-bottom:12px; text-align:center; }
.hero img { width:64px; height:64px; border-radius:16px; background:#fff; padding:4px; }
.hero h2 { margin:8px 0 4px; font-size:16px; }
.hero p { margin:0; font-size:11px; color:var(--mut2); }
.step { display:flex; gap:10px; margin-top:10px; font-size:12px; }
.step .n { flex-shrink:0; width:28px; height:28px; border-radius:50%; background:var(--brand); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; }
pre.ref { direction:ltr; text-align:left; background:var(--night); color:var(--brand2); border-radius:10px; padding:8px 12px; font-size:10px; overflow-x:auto; }

/* ===== ثيمات رسمية (مشتركة مع الموقع عبر sqf-theme) ===== */
html[data-theme="navy"]{--night:#0a1830;--night2:#142f56;--brand:#2b6cb0;--brand2:#7fb3e8;--soft:#d8e6f5;--mut2:#a9c6e4}
html[data-theme="maroon"]{--night:#2a0d0d;--night2:#4d1a1a;--brand:#a83a3a;--brand2:#e89a9a;--soft:#f3d9d9;--mut2:#dfaeae}
html[data-theme="charcoal"]{--night:#121216;--night2:#26262e;--brand:#63636e;--brand2:#b5b5c0;--soft:#e4e4e7;--mut2:#c0c0c9}
.theme-btn{background:#fff;border:2px solid var(--line)!important;color:var(--txt)}
.theme-btn.active{border-color:var(--brand)!important;box-shadow:0 0 0 2px var(--brand2)}
body.native{zoom:.875} /* درجتان فقط داخل تطبيق الأندرويد */
/* زر رفع الملفات الموحد — أيقونة بارزة */
.filepick { display:flex; align-items:center; gap:12px; border:2px dashed var(--brand); background:#f0faf5; border-radius:14px; padding:12px 14px; cursor:pointer; }
.filepick:active { transform:scale(.99); }
.filepick .fp-icon { font-size:30px; line-height:1; flex-shrink:0; }
.filepick .fp-body { flex:1; min-width:0; }
.filepick .fp-title { font-weight:700; color:var(--night); font-size:13px; }
.filepick .fp-name { font-size:11px; color:var(--mut); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filepick .fp-hint { font-size:10px; color:#a8a29e; }
.filepick.has-file { border-style:solid; background:#eefbf3; }
.filepick.has-file .fp-name { color:var(--green); font-weight:700; }
.filepick input[type=file] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }

/* ===== معالج التقديم متعدد الخطوات ===== */
.wizard-steps { display:flex; align-items:flex-start; gap:4px; margin:12px 0 16px; }
.wstep { flex:1; background:none; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:4px; padding:2px; color:var(--mut); font-size:11px; font-family:inherit; }
.wstep .wn { width:30px; height:30px; border-radius:50%; background:#e7e5e4; color:#57534e; font-weight:700; display:flex; align-items:center; justify-content:center; font-size:14px; border:2px solid transparent; }
.wstep.active { color:var(--night); font-weight:700; }
.wstep.active .wn { background:var(--brand); color:#fff; border-color:var(--brand2); box-shadow:0 0 0 3px var(--soft); }
.wstep.done { color:var(--green); }
.wstep.done .wn { background:var(--green); color:#fff; }
.wline { flex:0 0 18px; height:2px; background:#e7e5e4; margin-top:16px; border-radius:2px; }
.wpage { display:none; }
.wpage.active { display:block; animation:wzin .25s ease; }
@keyframes wzin { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.wnav { display:flex; justify-content:space-between; gap:8px; margin-top:16px; }
.wnav .btn { flex:1; }
/* جدول المراجعة المصغر */
table.mini { width:100%; border-collapse:collapse; font-size:12px; }
table.mini th, table.mini td { border-bottom:1px solid var(--line); padding:8px 6px; text-align:right; }
table.mini th { color:var(--mut); font-weight:700; white-space:nowrap; }
