:root{--ink:#111;--bg:#fff;--soft:#f6f4ef;--line:#111;--hl:#d9ccff;--ok:#0b6b3a;--err:#b3261e;--muted:#555}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:'Tajawal',system-ui,sans-serif;background:var(--bg);color:var(--ink);line-height:1.6;font-size:17px;font-weight:500;padding-bottom:40px}
h1,h2,.btn{font-family:'Marhey','Tajawal',sans-serif}
.wrap{max-width:1020px;margin:0 auto;padding:18px 16px}
header.top{text-align:center;padding:22px 0 8px}
header.top h1{font-size:clamp(30px,7vw,46px);line-height:1.4}
header.top h1 span{background:linear-gradient(transparent 52%,var(--hl) 52%,var(--hl) 88%,transparent 88%);padding:0 10px}
header.top p{font-size:19px;margin-top:6px;color:var(--muted)}
.cols{display:grid;gap:22px;margin-top:18px;grid-template-columns:minmax(0,1fr)}
html,body{overflow-x:hidden}
.cols>main,.cols>aside,section.step{min-width:0}
@media(min-width:860px){.cols{grid-template-columns:minmax(0,1fr) 340px;align-items:start}.stage{position:sticky;top:16px}}
section.step{border:3px solid var(--ink);border-radius:22px;padding:16px;margin-bottom:16px;background:#fff}
section.step h2{font-size:21px;margin-bottom:10px}
section.step h2 b{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--hl);border:3px solid var(--ink);margin-inline-end:8px;font-size:18px}
.hint{font-size:15px;color:var(--muted);margin-top:6px}
label{display:block;font-weight:700;margin:10px 0 4px}
input[type=text],input[type=url],input[type=tel],input[type=number],input:not([type]){width:100%;font:inherit;font-size:17px;padding:12px 14px;border:3px solid var(--ink);border-radius:14px;background:#fff;color:var(--ink)}
input[dir=ltr]{text-align:left}
.row{display:flex;gap:10px;align-items:stretch}
.row input{flex:1;min-width:0}
.btn{appearance:none;border:3px solid var(--ink);background:var(--hl);color:var(--ink);font-size:18px;font-weight:700;padding:11px 20px;border-radius:30px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px}
.btn:disabled{opacity:.5;cursor:default}
.btn.big{width:100%;font-size:21px;padding:14px}
.btn.alt{background:#fff}
.msg{margin-top:8px;font-size:16px;font-weight:700}
.msg.err{color:var(--err)}.msg.ok{color:var(--ok)}
.manual{margin-top:12px;padding-top:6px;border-top:3px dashed var(--ink)}
.icons{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.icobtn{width:56px;height:56px;border:3px solid var(--ink);border-radius:14px;background:#fff;display:grid;place-items:center;cursor:pointer;padding:0}
.icobtn[aria-pressed=true]{background:var(--hl)}
.icobtn .ico{width:30px;height:30px}
.ico{fill:none;stroke:var(--ink);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chk{display:flex;gap:10px;align-items:flex-start;font-weight:400;margin-top:10px}
.chk input{width:24px;height:24px;margin-top:3px;flex:none;accent-color:#111}
.result{border:3px solid var(--ink);border-radius:22px;padding:16px;background:var(--hl);margin-bottom:16px}
.result .link{direction:ltr;text-align:left;word-break:break-all;background:#fff;border:3px solid var(--ink);border-radius:14px;padding:10px 12px;margin:10px 0;font-size:16px}
.result .acts{display:flex;gap:10px;flex-wrap:wrap}
.result .acts .btn{flex:1;min-width:150px}
footer.terms{margin-top:22px;font-size:14px;color:var(--muted);text-align:center}
footer.terms details{margin-top:8px;text-align:right;max-width:640px;margin-inline:auto}
footer.terms summary{cursor:pointer;text-align:center}
footer.terms ol{padding-inline-start:22px;margin-top:8px}
[hidden]{display:none!important}

/* the card, with the product inside its empty slot; sizes use the card's own width so it always matches the art */
.wcard{position:relative;container-type:inline-size;width:100%;aspect-ratio:9/16;background:#fff;border-radius:14px;overflow:hidden;direction:rtl}
.wcard .art{position:absolute;inset:0;width:100%;height:100%;display:block}
.wcard .slot{position:absolute;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3cqw;overflow:hidden;border-radius:3cqw}
.wcard .pic{position:absolute;inset:3cqw;display:grid;place-items:center;overflow:hidden}
.wcard .pic img{width:100%;height:100%;object-fit:contain;display:block}
.wcard .ico.big{width:28cqw;height:28cqw;stroke-width:1.3}
.wcard .pname{font-weight:800;font-size:4.2cqw;line-height:1.25;text-align:center;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;width:100%}
.wcard .pprice{position:absolute;bottom:2cqw;left:50%;transform:translateX(-50%);z-index:1;font-weight:800;font-size:5cqw;line-height:1.1;background:var(--hl);border:.7cqw solid var(--ink);border-radius:6cqw;padding:.4cqw 3cqw .8cqw;direction:ltr;unicode-bidi:plaintext}
.stage .wcard{max-width:340px;margin:0 auto;border:3px solid var(--ink)}

/* receiver page */
body.recv{display:flex;flex-direction:column;align-items:center;min-height:100dvh;padding:10px 12px 18px;gap:12px;background:var(--soft)}
body.recv .wcard{width:min(100%,460px,calc((100dvh - 150px) * .5625));min-width:220px;box-shadow:0 6px 24px rgba(0,0,0,.12)}
.actions{width:min(100%,460px);display:flex;flex-direction:column;gap:10px}
.actions .btn{width:100%}
.actions .btn.buy{font-size:22px;padding:14px;background:#d9ccff}
.small{font-size:14px;color:var(--muted);text-align:center}
.addr{width:min(100%,460px);background:#fff;border:3px solid var(--ink);border-radius:18px;padding:12px;text-align:center}
.addr .code{font-family:ui-monospace,Menlo,monospace;font-size:30px;font-weight:700;letter-spacing:3px;direction:ltr;margin:4px 0}
.gone{max-width:420px;text-align:center;padding:60px 20px;font-size:20px}
.result h2{font-size:22px}
section.step h2 small{font-weight:400}
.btn.gap{margin-top:14px}
.hint.center{text-align:center}

/* card carousel: swipe on phones (scroll-snap), arrows on wider screens; the centred card is the chosen one */
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.chip{font:inherit;font-size:15px;font-weight:700;border:3px solid var(--ink);background:#fff;color:var(--ink);border-radius:20px;padding:4px 14px;cursor:pointer;min-height:38px}
.chip[aria-pressed=true]{background:var(--hl)}
.carwrap{position:relative;--w:min(50vw,210px);max-width:100%;overflow:hidden}
.car{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;padding:12px calc(50% - var(--w) / 2) 14px;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scroll-behavior:smooth}
.car::-webkit-scrollbar{display:none}
.pick{flex:none;width:var(--w);aspect-ratio:9/16;scroll-snap-align:center;scroll-snap-stop:always;border:3px solid #ccc;border-radius:16px;padding:0;background:var(--soft);cursor:pointer;overflow:hidden;opacity:.6;transform:scale(.92);transition:transform .2s,opacity .2s}
.pick img{width:100%;height:100%;object-fit:cover;display:block}
.pick[aria-selected=true]{border-color:var(--ink);box-shadow:0 0 0 4px var(--hl);opacity:1;transform:none}
.pick:focus-visible,.chip:focus-visible,.arrow:focus-visible,.icobtn:focus-visible,.btn:focus-visible{outline:4px solid #1a56db;outline-offset:2px}
.arrow{display:none;position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:46px;height:46px;border-radius:50%;border:3px solid var(--ink);background:#fff;font-size:30px;line-height:1;cursor:pointer;padding:0 0 4px}
.arrow.next{left:0}.arrow.prev{right:0}
@media(min-width:600px){.arrow{display:block}}
.count{text-align:center;font-weight:700;margin-top:2px}
.msg.soft{color:var(--muted);font-weight:400}
.tag-store{font-size:15px;color:var(--muted);margin-top:4px}
.from{font-size:22px;font-weight:800;text-align:center;padding:6px 10px;background:#fff;border:3px solid var(--ink);border-radius:14px}
.report{font-size:14px;color:var(--muted);text-decoration:underline;margin-top:4px}
.result .acts.del{margin-top:10px}.result .acts.del .btn{font-size:16px;min-height:42px}
.from bdi{direction:ltr;unicode-bidi:isolate}
@media(prefers-reduced-motion:reduce){.car{scroll-behavior:auto}.pick{transition:none}}

/* uploaded product picture: the box, the "ready" row, and the picture filling the card slot (cover: cropped to the slot shape) */
.up{margin-top:12px;border:3px dashed var(--ink);border-radius:18px;padding:16px;text-align:center;background:#faf9ff}
.up .big{font-family:'Marhey','Tajawal',sans-serif;font-size:19px;font-weight:800;margin-bottom:4px}
.up small{color:var(--muted);display:block;margin-bottom:10px;font-size:15px}
.chosen{display:flex;gap:12px;align-items:center;margin-top:12px;background:#f2fff6;border:3px solid var(--ok);border-radius:14px;padding:10px}
.chosen .th{width:56px;height:56px;border-radius:10px;overflow:hidden;border:2px solid var(--ink);flex:none;background:#fff}
.chosen .th img{width:100%;height:100%;object-fit:cover;display:block}
.chosen b{color:var(--ok)}
.chosen small{color:var(--muted);font-size:15px}
.chosen .acts{display:flex;gap:8px;margin-top:6px;flex-wrap:wrap}
.chosen .acts .btn{font-size:15px;min-height:38px;padding:4px 14px}
.wcard .pic.up{inset:0}
.wcard .pic.up{display:block}
.wcard .pic.up img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
