/* ===================== الأساس ===================== */
:root{
  --sea:#1B7FA8;
  --sea-deep:#146A8C;
  --sea-soft:#E4F3F9;
  --sky:#7FD3E8;
  --sky-soft:#EAF8FC;
  --sand:#FDF3E3;
  --sand-soft:#FBF1E1;
  --paper:#FBFDFF;
  --ink:#0F3B4C;
  --muted:#5E8090;
  --coral:#FF8A5B;
  --coral-deep:#DE6437;
  --coral-soft:#FFEDE4;
  --mint:#4FB3A5;
  --mint-soft:#E6F6F3;
  --ok:#1E8E5A;
  --ok-soft:#E7F7EE;
  --line:rgba(15,59,76,.10);
  --shadow:0 8px 24px rgba(15,59,76,.08);
  --shadow-lg:0 16px 40px rgba(15,59,76,.13);
  --r:24px;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;min-height:100vh;color:var(--ink);
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:16px;line-height:1.7;
  background:radial-gradient(120% 55% at 50% 0%,#DCF1F9 0%,#EEF8FC 42%,#F6FBFD 100%) fixed;
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;
}
button,input,textarea{font:inherit;color:inherit}
button{border:0;background:none;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation}
h1,h2,h3,h4,p{margin:0}
svg{display:block}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
:focus-visible{outline:3px solid rgba(27,127,168,.45);outline-offset:2px;border-radius:8px}

/* ===================== الهيكل ===================== */
.shell{
  max-width:560px;margin:0 auto;min-height:100vh;background:var(--paper);
  position:relative;overflow-x:hidden;box-shadow:0 0 80px rgba(15,59,76,.08);
}
@media(min-width:640px){ .shell{border-inline:1px solid var(--line)} }

.app-header{
  position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:12px 18px;background:rgba(251,253,255,.97);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{
  width:44px;height:44px;border-radius:15px;background:var(--sky-soft);
  display:grid;place-items:center;flex:none;overflow:hidden;
}
.brand-mark svg{width:34px;height:34px}
.brand-name{font-family:'Cairo',sans-serif;font-weight:800;font-size:18px;line-height:1.3;letter-spacing:0}
.brand-sub{font-size:11.5px;color:var(--muted);line-height:1.4}
.header-dot{width:9px;height:9px;border-radius:50%;background:var(--sky);box-shadow:0 0 0 5px rgba(127,211,232,.22);flex:none}

#main{padding:18px 18px 116px}
.view{animation:viewIn .3s ease both}
@keyframes viewIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* ===================== الواجهة الرئيسية ===================== */
.hero{
  position:relative;border-radius:28px;padding:20px 20px 40px;overflow:hidden;
  background:linear-gradient(165deg,#E9F7FC 0%,#F5FBFE 58%,#FDF6EA 100%);
  border:1px solid rgba(127,211,232,.55);
}
.hero-kicker{display:inline-block;font-size:12.5px;font-weight:700;color:var(--sea);background:rgba(255,255,255,.75);padding:4px 12px;border-radius:999px;margin-bottom:10px}
.hero-title{font-family:'Cairo',sans-serif;font-weight:900;font-size:25px;line-height:1.5;color:var(--ink);letter-spacing:0}
.hl{background:linear-gradient(transparent 62%,rgba(127,211,232,.65) 62%);padding-inline:2px;border-radius:3px}
.hero-row{display:flex;align-items:flex-end;gap:10px;margin-top:10px}
.hero-desc{flex:1;min-width:0;font-size:14px;line-height:1.85;color:#3F6371}
.hero-art{width:82px;flex:none;animation:floaty 5s ease-in-out infinite}
.hero-art svg{width:100%;height:auto}
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.hero-waves{position:absolute;bottom:0;left:0;width:100%;height:46px}

.cta-card{
  display:flex;align-items:center;gap:14px;width:100%;text-align:start;
  margin-top:16px;padding:16px;border-radius:22px;color:#fff;
  background:linear-gradient(135deg,#1B7FA8,#3BA9CE);
  box-shadow:0 12px 26px rgba(27,127,168,.28);
  transition:transform .16s ease,box-shadow .16s ease;
}
.cta-card:active{transform:scale(.985);box-shadow:0 6px 16px rgba(27,127,168,.26)}
@media(hover:hover){.cta-card:hover{transform:translateY(-2px);box-shadow:0 16px 32px rgba(27,127,168,.32)}}
.cta-icon{width:46px;height:46px;border-radius:15px;background:rgba(255,255,255,.18);display:grid;place-items:center;flex:none}
.cta-icon svg{width:24px;height:24px}
.cta-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.cta-text b{font-family:'Cairo',sans-serif;font-weight:800;font-size:16.5px;line-height:1.4}
.cta-text small{font-size:12px;color:rgba(255,255,255,.85);line-height:1.5}
.cta-arrow{flex:none;opacity:.8}
.cta-arrow svg{width:20px;height:20px}

.block-title{font-family:'Cairo',sans-serif;font-weight:800;font-size:16px;margin:24px 0 12px;color:var(--ink)}

.nav-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.nav-card{
  display:flex;flex-direction:column;justify-content:space-between;gap:12px;
  background:#fff;border:1px solid var(--line);border-radius:22px;padding:14px;
  text-align:start;min-height:126px;
  box-shadow:0 2px 8px rgba(15,59,76,.05);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.nav-card:active{transform:scale(.98)}
@media(hover:hover){.nav-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:rgba(127,211,232,.9)}}
.nav-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:var(--sky-soft);color:var(--sea);flex:none}
.nav-icon svg{width:22px;height:22px}
.nav-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.nav-title{font-family:'Cairo',sans-serif;font-weight:800;font-size:14.5px;line-height:1.45;color:var(--ink)}
.nav-sub{font-size:11.5px;line-height:1.5;color:var(--muted)}
.nav-card.lost .nav-icon{background:var(--coral-soft);color:var(--coral-deep)}
.nav-card.lost .nav-title{color:#8C3A1B}
.nav-card.feature{
  grid-column:1 / -1;flex-direction:row;align-items:center;min-height:98px;
  background:linear-gradient(135deg,#1B7FA8,#3BA9CE);border-color:transparent;color:#fff;
  box-shadow:0 10px 24px rgba(27,127,168,.26);
}
.nav-card.feature .nav-icon{background:rgba(255,255,255,.18);color:#fff}
.nav-card.feature .nav-title{color:#fff;font-size:16px}
.nav-card.feature .nav-sub{color:rgba(255,255,255,.85)}
.nav-card.wide{grid-column:1 / -1;flex-direction:row;align-items:center;min-height:88px}
.nav-badge{
  display:inline-block;font-size:10.5px;font-weight:700;background:rgba(255,255,255,.9);
  color:var(--sea);padding:2px 9px;border-radius:999px;margin-bottom:4px;width:fit-content;
}

.privacy-strip{
  display:flex;align-items:flex-start;gap:10px;margin-top:18px;padding:13px 15px;
  background:var(--sand);border:1px solid #F2E4CD;border-radius:18px;
}
.privacy-strip p{font-size:12.5px;line-height:1.75;color:#6B5638}
.ps-icon{color:#A9885C;flex:none;margin-top:2px}
.ps-icon svg{width:18px;height:18px}

/* ===================== رؤوس الصفحات ===================== */
.view-head{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.view-title{font-family:'Cairo',sans-serif;font-weight:800;font-size:22px;line-height:1.4;letter-spacing:0}
.view-sub{font-size:13px;color:var(--muted);line-height:1.6;margin-top:2px}
.back-btn{
  width:44px;height:44px;border-radius:14px;background:#fff;border:1px solid var(--line);
  display:grid;place-items:center;color:var(--sea);flex:none;box-shadow:0 2px 8px rgba(15,59,76,.06);
  transition:background .16s,transform .16s;
}
.back-btn:active{transform:scale(.94);background:var(--sky-soft)}
.back-btn svg{width:20px;height:20px}

/* ===================== الأهداف ===================== */
.goal-list{display:flex;flex-direction:column;gap:12px}
.goal{background:#fff;border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:0 2px 10px rgba(15,59,76,.05)}
.goal-ic{
  width:46px;height:46px;border-radius:15px;background:var(--sky-soft);color:var(--sea);
  display:grid;place-items:center;margin-bottom:10px;
}
.goal-ic svg{width:24px;height:24px}
.goal-ic.mint{background:var(--mint-soft);color:var(--mint)}
.goal-ic.sand{background:var(--sand);color:#B38A52}
.goal h3{font-family:'Cairo',sans-serif;font-weight:800;font-size:17px;margin-bottom:4px}
.goal p{font-size:14px;line-height:1.85;color:#456774}

.quote-card{
  margin-top:18px;padding:22px 18px;border-radius:22px;text-align:center;
  background:linear-gradient(150deg,#FDF3E3,#FBF8F2);border:1px dashed #E7D5B6;
}
.quote-card p{font-family:'Cairo',sans-serif;font-weight:800;font-size:17px;color:#7A5A2E;line-height:1.7}
.quote-card span{display:block;margin-top:6px;font-size:12px;color:#A9885C}

/* ===================== خارج المنزل ===================== */
.spot-list{display:flex;flex-direction:column;gap:12px}
.spot{background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px 18px;box-shadow:0 2px 10px rgba(15,59,76,.05)}
.spot-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.spot-ic{width:38px;height:38px;border-radius:13px;background:var(--sky-soft);color:var(--sea);display:grid;place-items:center;flex:none}
.spot-ic svg{width:20px;height:20px}
.spot h3{font-family:'Cairo',sans-serif;font-weight:800;font-size:16px}
.bullets{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px}
.bullets li{
  position:relative;padding-inline-start:18px;font-size:13.8px;line-height:1.8;color:#456774;
}
.bullets li::before{
  content:'';position:absolute;inset-inline-start:2px;top:11px;width:7px;height:7px;
  border-radius:50%;background:var(--sky);
}

.checklist{display:flex;flex-direction:column;gap:8px}
.check-item{
  display:flex;align-items:center;gap:11px;width:100%;text-align:start;
  background:#fff;border:1.5px solid var(--line);border-radius:16px;padding:12px 14px;
  min-height:52px;font-size:14px;font-weight:500;color:var(--ink);
  transition:background .18s,border-color .18s,transform .14s;
}
.check-item:active{transform:scale(.99)}
.ci-box{
  width:24px;height:24px;border-radius:8px;border:1.8px solid #C6DEE8;flex:none;
  display:grid;place-items:center;color:transparent;transition:background .18s,border-color .18s,color .18s;
}
.ci-box svg{width:15px;height:15px}
.check-item.done{background:var(--mint-soft);border-color:#A9DFD6}
.check-item.done .ci-box{background:var(--mint);border-color:var(--mint);color:#fff}
.check-item.done span:last-child{color:#2C6A61;text-decoration:line-through;text-decoration-thickness:1.5px;text-decoration-color:rgba(79,179,165,.6)}
.link-btn{
  display:block;margin:10px auto 0;padding:10px 14px;min-height:44px;
  font-size:13px;font-weight:700;color:var(--sea);border-radius:12px;
}
.link-btn:active{background:var(--sky-soft)}

.turtle-tip{
  display:flex;gap:12px;align-items:flex-start;margin-top:20px;
  background:linear-gradient(150deg,#EAF8FC,#F6FCFE);border:1px solid rgba(127,211,232,.5);
  border-radius:22px;padding:16px;
}
.tt-art{width:56px;flex:none}
.tt-art svg{width:100%;height:auto}
.turtle-tip p{font-size:13.5px;line-height:1.85;color:#37606F}
.turtle-tip b{color:var(--sea)}

/* ===================== إذا ضاع طفلي ===================== */
.alert-banner{
  display:flex;gap:11px;align-items:flex-start;padding:14px 16px;border-radius:20px;
  background:var(--coral-soft);border:1px solid #FFD3BE;margin-bottom:16px;
}
.alert-banner span{color:var(--coral-deep);flex:none;margin-top:2px}
.alert-banner svg{width:20px;height:20px}
.alert-banner p{font-size:13.5px;line-height:1.8;color:#8C3A1B}

.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0}
.steps li{position:relative;display:flex;gap:14px;padding-bottom:18px}
.steps li::before{
  content:'';position:absolute;inset-inline-start:17px;top:38px;bottom:0;width:2px;
  background:linear-gradient(#BFE4F0,transparent);border-radius:2px;
}
.steps li:last-child::before{display:none}
.step-n{
  width:36px;height:36px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:var(--sea);color:#fff;font-family:'Cairo',sans-serif;font-weight:800;font-size:15px;
  box-shadow:0 4px 10px rgba(27,127,168,.25);position:relative;z-index:1;
}
.steps b{display:block;font-family:'Cairo',sans-serif;font-weight:800;font-size:15.5px;margin-bottom:3px;line-height:1.5}
.steps p{font-size:13.5px;line-height:1.8;color:#456774}

.emergency{background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px;box-shadow:var(--shadow);margin-top:4px}
.em-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.em-ic{width:38px;height:38px;border-radius:13px;background:var(--coral-soft);color:var(--coral-deep);display:grid;place-items:center;flex:none}
.em-ic svg{width:19px;height:19px}
.em-head h3{font-family:'Cairo',sans-serif;font-weight:800;font-size:15.5px}
.em-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.em-btn{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  min-height:64px;border-radius:16px;text-decoration:none;
  background:var(--coral);color:#fff;box-shadow:0 6px 14px rgba(255,138,91,.28);
  transition:transform .15s,background .18s;
}
.em-btn:active{transform:scale(.96);background:var(--coral-deep)}
.em-btn b{font-family:'Cairo',sans-serif;font-weight:900;font-size:19px;line-height:1.2;direction:ltr}
.em-btn span{font-size:11px;color:rgba(255,255,255,.92);line-height:1.3;text-align:center}
.em-note{font-size:11.5px;color:var(--muted);margin-top:10px;line-height:1.7}

.announce{margin-top:16px;background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px;box-shadow:var(--shadow)}
.announce h3{font-family:'Cairo',sans-serif;font-weight:800;font-size:15.5px;margin-bottom:4px}
.announce-sub{font-size:12.5px;color:var(--muted);line-height:1.7;margin-bottom:10px}
.announce .input{margin-bottom:10px}

/* ===================== قواعد السلامة ===================== */
.rules-list{display:flex;flex-direction:column;gap:12px}
.rule-card{
  display:flex;align-items:center;gap:13px;width:100%;text-align:start;
  background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px;
  box-shadow:0 2px 10px rgba(15,59,76,.05);
  transition:transform .16s,box-shadow .18s,border-color .18s;
}
.rule-card:active{transform:scale(.985)}
@media(hover:hover){.rule-card:hover{box-shadow:var(--shadow);border-color:rgba(127,211,232,.9)}}
.rule-ic{width:44px;height:44px;border-radius:15px;background:var(--sky-soft);color:var(--sea);display:grid;place-items:center;flex:none}
.rule-ic svg{width:22px;height:22px}
.rule-text{flex:1;min-width:0;font-family:'Cairo',sans-serif;font-weight:800;font-size:15px;line-height:1.75;color:var(--ink)}
.rule-card .chev{color:#B4CCD6;flex:none}
.rule-card .chev svg{width:18px;height:18px}

.rule-modal{
  position:fixed;inset:0;z-index:80;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:26px;padding:34px 24px;text-align:center;
  background:linear-gradient(160deg,#0F3B4C 0%,#1B7FA8 62%,#2E9BC0 100%);
  color:#fff;animation:fadeIn .25s ease;
}
.rm-close{
  position:absolute;top:18px;inset-inline-end:18px;width:48px;height:48px;border-radius:16px;
  background:rgba(255,255,255,.16);color:#fff;display:grid;place-items:center;
  transition:background .18s,transform .16s;
}
.rm-close:active{transform:scale(.94);background:rgba(255,255,255,.28)}
.rm-close svg{width:22px;height:22px}
.rm-art{width:130px;animation:floaty 4.5s ease-in-out infinite}
.rm-art svg{width:100%;height:auto}
.rm-text{font-family:'Cairo',sans-serif;font-weight:900;font-size:24px;line-height:1.75;max-width:420px}
.rm-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.btn-light{background:rgba(255,255,255,.95);color:var(--sea);box-shadow:0 8px 20px rgba(0,0,0,.18)}

/* ===================== البطاقة ===================== */
.form-card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:18px;box-shadow:var(--shadow)}
.field{margin-bottom:14px}
.field label{display:block;font-size:13.5px;font-weight:700;margin-bottom:6px;color:#284E5E}
.field .hint{font-size:11.5px;color:var(--muted);font-weight:500}
.input{
  width:100%;min-height:52px;border-radius:14px;border:1.5px solid #D9E9F0;background:#fff;
  padding:12px 14px;font-size:16px;color:var(--ink);
  transition:border-color .18s,box-shadow .18s,background .18s;
}
.input::placeholder{color:#9DB4BF;font-size:14px}
.input:focus{outline:none;border-color:var(--sea);box-shadow:0 0 0 4px rgba(27,127,168,.12)}
.input[dir=ltr]{text-align:right;font-variant-numeric:tabular-nums}
textarea.input{min-height:78px;resize:vertical;line-height:1.7}
.field-error{display:none;color:var(--coral-deep);font-size:12px;margin-top:5px;font-weight:700}
.field.invalid .input{border-color:var(--coral);background:#FFF9F6}
.field.invalid .field-error{display:block}

.card-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 12px;flex-wrap:wrap}
.switch{
  display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:7px 14px 7px 10px;
  background:#fff;border:1px solid var(--line);border-radius:999px;
  font-size:12.5px;font-weight:700;color:#41636F;
}
.switch .track{width:38px;height:22px;border-radius:999px;background:#D9E9F0;position:relative;transition:background .2s;flex:none}
.switch .track::after{
  content:'';position:absolute;top:3px;inset-inline-end:3px;width:16px;height:16px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(15,59,76,.3);transition:transform .22s ease;
}
.switch[aria-checked=true] .track{background:var(--sea)}
.switch[aria-checked=true] .track::after{transform:translateX(-16px)}
.flip-btn{
  display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:8px 14px;
  background:var(--sky-soft);border-radius:999px;font-size:12.5px;font-weight:700;color:var(--sea);
  transition:background .18s,transform .16s;
}
.flip-btn:active{transform:scale(.96);background:#D8F0F8}
.flip-btn svg{width:17px;height:17px}

.pcard{perspective:1400px}
.pcard-inner{
  position:relative;width:100%;aspect-ratio:.72;
  transform-style:preserve-3d;transition:transform .7s cubic-bezier(.2,.75,.2,1);
}
.pcard.flipped .pcard-inner{transform:rotateY(180deg)}
.face{
  position:absolute;inset:0;border-radius:26px;overflow:hidden;
  backface-visibility:hidden;-webkit-backface-visibility:hidden;
  box-shadow:var(--shadow-lg);display:flex;flex-direction:column;
}
.face-front{
  padding:18px;color:#fff;
  background:linear-gradient(158deg,#1B7FA8 0%,#2196BD 46%,#4FB8D4 100%);
}
.cf-top{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative;z-index:2}
.cf-pill{
  font-size:11.5px;font-weight:700;color:#fff;background:rgba(255,255,255,.2);
  padding:4px 12px;border-radius:999px;
}
.cf-turtle{width:44px;height:44px;flex:none}
.cf-turtle svg{width:100%;height:auto}
.cf-mid{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;text-align:center;position:relative;z-index:2;padding:8px 4px}
.cf-name{font-family:'Cairo',sans-serif;font-weight:900;font-size:clamp(22px,7vw,30px);line-height:1.35;color:#fff;word-break:break-word}
.cf-age{
  font-size:13px;font-weight:700;color:#fff;background:rgba(255,255,255,.18);
  padding:4px 14px;border-radius:999px;
}
.cf-foot{
  display:flex;align-items:center;gap:7px;justify-content:center;position:relative;z-index:2;
  font-size:11.5px;font-weight:500;color:rgba(255,255,255,.92);text-align:center;
}
.cf-heart{display:inline-flex;color:var(--coral)}
.cf-heart svg{width:14px;height:14px}
.cf-wave{position:absolute;bottom:0;left:0;width:100%;height:60px}

.face-back{
  transform:rotateY(180deg);padding:16px;background:#fff;border:1.5px solid var(--line);
  gap:10px;justify-content:center;
}
.cb-head{
  font-family:'Cairo',sans-serif;font-weight:800;font-size:13.5px;line-height:1.6;
  color:var(--sea);background:var(--sky-soft);border-radius:14px;padding:9px 12px;text-align:center;
}
.crow{display:flex;align-items:center;gap:10px;padding:2px 2px}
.crow-ic{width:32px;height:32px;border-radius:11px;background:var(--sand);color:#B3894F;display:grid;place-items:center;flex:none}
.crow-ic svg{width:16px;height:16px}
.crow-body{display:flex;flex-direction:column;min-width:0;flex:1}
.crow-label{font-size:10.5px;color:var(--muted);line-height:1.4}
.crow-val{
  font-family:'Cairo',sans-serif;font-weight:800;font-size:14.5px;color:var(--ink);
  direction:ltr;text-align:right;unicode-bidi:isolate;line-height:1.5;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.cb-health{
  background:var(--sand);border-radius:14px;padding:8px 12px;display:flex;flex-direction:column;gap:1px;
}
.cb-health-label{font-size:10.5px;color:#A9885C}
.cb-health-val{font-size:12px;font-weight:700;color:#6B5638;line-height:1.55}
.cb-foot{
  display:flex;align-items:center;justify-content:center;gap:6px;
  font-size:11px;color:var(--muted);margin-top:auto;padding-top:2px;
}

.card-note{font-size:11.5px;color:var(--muted);text-align:center;margin:12px 0 14px;line-height:1.7}
.card-actions{display:flex;flex-direction:column;gap:10px}
.card-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ===================== الأزرار ===================== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:52px;padding:0 18px;border-radius:16px;
  font-size:16px;font-weight:700;background:var(--sea);color:#fff;
  box-shadow:0 6px 16px rgba(27,127,168,.22);
  transition:transform .15s ease,background .18s ease,box-shadow .18s ease,opacity .18s;
}
.btn:active{transform:scale(.98)}
.btn svg{width:20px;height:20px}
.btn:disabled{opacity:.55;box-shadow:none;pointer-events:none}
.btn-ghost{background:#fff;color:var(--sea);border:1.5px solid rgba(27,127,168,.32);box-shadow:none}
.btn-ghost:active{background:var(--sky-soft)}
.btn-ghost.danger{color:var(--coral-deep);border-color:rgba(255,138,91,.55)}
.btn-ghost.danger:active{background:var(--coral-soft)}
.btn-soft{background:var(--sky-soft);color:var(--sea);box-shadow:none}
.btn-soft:active{background:#D8F0F8}
.btn-block{width:100%}

/* ===================== الاختبار ===================== */
.quiz-head{justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:8px}
.best-badge{
  font-size:11.5px;font-weight:700;color:#7A5A2E;background:var(--sand);
  border:1px solid #F0E0C6;padding:5px 12px;border-radius:999px;white-space:nowrap;
}
.quiz-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.quiz-count{font-size:12.5px;font-weight:700;color:var(--sea)}
.quiz-score{font-size:12px;font-weight:700;color:var(--muted)}
.quiz-progress{height:8px;border-radius:999px;background:#E4EFF4;overflow:hidden;margin-bottom:16px}
.quiz-progress span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#7FD3E8,#1B7FA8);transition:width .35s ease}

.q-card{background:#fff;border:1px solid var(--line);border-radius:24px;padding:18px;box-shadow:var(--shadow)}
.q-text{font-family:'Cairo',sans-serif;font-weight:800;font-size:17px;line-height:1.7;margin-bottom:14px;color:var(--ink)}
.opt{
  display:flex;align-items:center;gap:11px;width:100%;text-align:start;
  min-height:56px;padding:13px 15px;border-radius:16px;margin-bottom:10px;
  border:1.5px solid #DCEBF1;background:#fff;
  font-size:14.5px;font-weight:500;line-height:1.65;color:var(--ink);
  transition:border-color .18s,background .18s,transform .14s,opacity .18s;
}
.opt:active{transform:scale(.99)}
@media(hover:hover){.opt:not(:disabled):hover{border-color:rgba(127,211,232,.95);background:#FAFEFF}}
.opt .mark{
  width:26px;height:26px;border-radius:50%;border:1.5px solid #CFE4EC;color:#7C97A3;
  display:grid;place-items:center;flex:none;font-size:12px;font-weight:800;font-family:'Cairo',sans-serif;
  transition:background .18s,color .18s,border-color .18s;
}
.opt:last-child{margin-bottom:0}
.opt.correct{background:var(--ok-soft);border-color:#9BD9BA;color:#14603C}
.opt.correct .mark{background:var(--ok);border-color:var(--ok);color:#fff}
.opt.wrong{background:var(--coral-soft);border-color:#FFC3A8;color:#8C3A1B}
.opt.wrong .mark{background:var(--coral-deep);border-color:var(--coral-deep);color:#fff}
.opt.dim{opacity:.5}

.explain{
  margin-top:14px;background:var(--sand);border:1px solid #F0E2CB;border-radius:18px;
  padding:14px;font-size:13.5px;line-height:1.85;color:#6B5638;
  animation:viewIn .26s ease both;
}
.explain b{display:block;margin-bottom:4px;font-family:'Cairo',sans-serif;font-size:14px;color:#7A5A2E}
#nextBtn{margin-top:14px}

.result{background:#fff;border:1px solid var(--line);border-radius:24px;padding:24px 18px;text-align:center;box-shadow:var(--shadow)}
.score-ring{
  width:144px;height:144px;border-radius:50%;margin:0 auto 16px;
  display:grid;place-items:center;
}
.score-inner{
  width:114px;height:114px;border-radius:50%;background:#fff;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:0;box-shadow:inset 0 2px 10px rgba(15,59,76,.06);
}
.score-inner b{font-family:'Cairo',sans-serif;font-weight:900;font-size:34px;line-height:1.1;color:var(--sea)}
.score-inner span{font-size:11.5px;color:var(--muted)}
.result-title{font-family:'Cairo',sans-serif;font-weight:800;font-size:19px;margin-bottom:6px}
.result-msg{font-size:14px;line-height:1.85;color:#456774;margin-bottom:16px}
.result-actions{display:flex;flex-direction:column;gap:10px}

/* ===================== الشريط السفلي ===================== */
.bottom-nav{
  position:fixed;bottom:0;left:0;right:0;z-index:50;max-width:560px;margin:0 auto;
  display:flex;justify-content:space-around;gap:2px;padding:8px 8px 10px;
  background:#fff;border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(15,59,76,.06);
}
.nav-btn{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:52px;padding:5px 2px;border-radius:14px;color:#7C97A3;
  font-size:10.5px;font-weight:700;transition:color .18s,background .18s;
}
.nav-btn svg{width:22px;height:22px}
.nav-btn.active{color:var(--sea);background:var(--sky-soft)}
.nav-btn:active{background:var(--sky-soft)}

/* ===================== توست ===================== */
.toast{
  position:fixed;bottom:92px;left:50%;transform:translate(-50%,14px);
  background:var(--ink);color:#fff;padding:10px 18px;border-radius:999px;
  font-size:13.5px;font-weight:700;z-index:90;max-width:86vw;text-align:center;
  opacity:0;pointer-events:none;transition:opacity .24s ease,transform .24s ease;
  box-shadow:0 10px 24px rgba(15,59,76,.3);line-height:1.6;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ===================== الطباعة ===================== */
.print-area{display:none}
@media print{
  body{background:#fff}
  .shell,.toast,.rule-modal{display:none!important}
  .print-area{display:block!important}
  @page{margin:12mm}
  .print-sheet{display:flex;gap:8mm;justify-content:center;align-items:flex-start;flex-wrap:wrap}
  .pc{
    width:82mm;min-height:112mm;border-radius:8mm;padding:8mm 7mm;
    display:flex;flex-direction:column;gap:5mm;
    border:1.2mm solid #1B7FA8;color:#0F3B4C;page-break-inside:avoid;
  }
  .pc-front{background:#1B7FA8;color:#fff;border-color:#1B7FA8;justify-content:space-between}
  .pc-label{font-size:9pt;opacity:.9}
  .pc-name{font-family:'Cairo',sans-serif;font-weight:900;font-size:24pt;line-height:1.3}
  .pc-age{font-size:12pt;opacity:.95}
  .pc-slogan{font-size:9pt;opacity:.9;border-top:0.4mm solid rgba(255,255,255,.4);padding-top:3mm}
  .pc-h{font-family:'Cairo',sans-serif;font-weight:800;font-size:12pt;color:#1B7FA8;line-height:1.6}
  .pc-row{display:flex;flex-direction:column;gap:0.5mm;border-bottom:0.3mm dashed #CFE0E8;padding-bottom:2mm}
  .pc-row b{font-size:8pt;font-weight:700;color:#5E8090}
  .pc-row span{font-family:'Cairo',sans-serif;font-weight:800;font-size:14pt;direction:ltr;unicode-bidi:isolate}
  .pc-health{background:#FDF3E3;border-radius:3mm;padding:3mm}
  .pc-health b{display:block;font-size:8pt;color:#A9885C}
  .pc-health span{font-size:10pt;font-weight:700;color:#6B5638}
  .pc-thanks{font-size:9pt;color:#5E8090;text-align:center;margin-top:auto}
}

/* ===================== تفضيل تقليل الحركة ===================== */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .pcard-inner{transition:none}
}