* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #fcfbf9; color: #3b2a26; font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif; line-height: 1.6; }
main { max-width: 640px; margin: 0 auto; padding: 24px 20px 48px; }
h1 { font-size: 28px; margin: 0 0 4px; }
.fact { color: #7a6a64; margin: 0 0 12px; }
.intro { margin: 0 0 20px; }
.days { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
button { font: inherit; color: inherit; background: #fff; border: 1px solid #e3dcd6; border-radius: 8px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
button.sel { background: #6fa898; color: #fff; border-color: #6fa898; }
button:disabled { cursor: default; }
.label { color: #7a6a64; font-size: 14px; margin: 0; }
h2 { font-size: 21px; margin: 2px 0 12px; }
.row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #ece6e1; }
.row .n { color: #7a6a64; min-width: 22px; }
.en { font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; }
.ar { color: #7a6a64; }
.q { padding: 12px 0; border-bottom: 1px solid #ece6e1; }
.qt { font-weight: 600; margin: 0 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ok { color: #0a7c72; margin: 8px 0 0; }
.no { color: #7a6a64; margin: 8px 0 0; }
.score { font-weight: 600; margin: 16px 0 8px; }
section { margin-bottom: 32px; }
.prog .row { justify-content: space-between; }
.note { color: #7a6a64; font-size: 14px; }
.tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.tabs button { flex: 1; font-weight: 600; }
.sp { display: flex; gap: 6px; margin-top: 6px; }
.sp button { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.line { padding: 12px 0; border-bottom: 1px solid #ece6e1; }
.line .who { color: #7a6a64; font-size: 13px; }
.line.b .en { color: #1f5f52; }
.msg { background: #f4efe9; border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 8px 0; min-height: 0; }
.msg:empty { display: none; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
/* larger text for phones */
body { font-size: 19px; line-height: 1.7; }
h1 { font-size: 32px; }
h2 { font-size: 25px; }
button { padding: 12px 16px; min-height: 48px; }
.sp button { font-size: 18px; min-height: 46px; padding: 8px 16px; }
.label { font-size: 16px; }
.who { font-size: 16px; }
.note { font-size: 17px; }
.msg { font-size: 17px; }
.opts button { text-align: start; }
.opts, .tools, .days, .sp { max-width: 100%; }
button { max-width: 100%; overflow-wrap: anywhere; }
/* Q&A pairs, bolder text */
.pair { border: 1px solid #e3dcd6; border-radius: 12px; background: #fff; padding: 4px 14px 12px; margin: 14px 0; }
.pair .line { border-bottom: 0; padding: 10px 0 4px; }
.pair .line.b { border-top: 2px dashed #cfe3dc; margin-top: 6px; padding-top: 12px; }
.who { font-weight: 700; color: #5b4a44; }
.en { font-weight: 800; font-size: 21px; color: #2a1a16; line-height: 1.5; }
.line.b .en { color: #14584a; }
.ar { font-weight: 700; color: #4a3b36; font-size: 19px; }
.qt { font-weight: 800; }
.opts button { font-weight: 700; }
button { font-weight: 700; }
h1, h2 { font-weight: 800; }
/* colors: question red, reply green, Arabic black */
.pair .line:not(.b) .en { color: #c4161c; }
.pair .line.b .en { color: #12782f; }
.pair .ar { color: #000; }
.who { color: #000; }
/* beginners corner */
.tabs button { font-size: 17px; padding: 10px 6px; }
.bitem { border: 1px solid #e3dcd6; border-radius: 12px; background: #fff; padding: 10px 14px 12px; margin: 12px 0; }
.bigch { font-size: 40px; font-weight: 800; color: #c4161c; direction: ltr; text-align: start; line-height: 1.2; }
.bw { font-size: 26px; color: #12782f; }
.bitem .ar { color: #000; font-weight: 800; font-size: 21px; }
.tip { margin: 6px 0 0; font-weight: 700; color: #000; background: #f4efe9; border-radius: 8px; padding: 8px 10px; font-size: 17px; }
.swatch { width: 100%; height: 56px; border-radius: 10px; border: 2px solid #3b2a26; margin: 6px 0; }
.cats button { font-size: 17px; }
.art { width: 150px; height: 150px; margin: 6px auto; }
.art svg { width: 100%; height: 100%; display: block; }
.picbtn { width: 31%; min-width: 96px; height: auto; padding: 6px; }
.picbtn svg { width: 100%; height: auto; display: block; }
.picbtn.sel { background: #cfe3dc; }
.opts { gap: 10px; }
.picbtn.good { border: 4px solid #1b8a3a; background: #e3f5e8; }
.picbtn.badp { border: 4px solid #c62828; background: #fde8e8; }
.scene { width: 100%; max-width: 340px; margin: 8px auto 12px; }
.scene svg { width: 100%; height: auto; display: block; }
.step h2 { font-size: 23px; }
.cen { font-size: 26px; font-weight: 800; margin: 6px 0 2px; direction: ltr; text-align: center; unicode-bidi: isolate; }
.cq { color: #c4161c; }
.cr { color: #12782f; }
.cmean { font-size: 21px; font-weight: 800; color: #111; text-align: center; margin: 0 0 10px; }
.sp { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.rec { background: #e3f1ec; border-color: #6fa898; font-weight: 700; }
.rep { text-align: center; margin: 10px 0; }
.pbar { height: 10px; background: #ece6e1; border-radius: 6px; margin: 6px 0 14px; overflow: hidden; }
.pfill { height: 100%; background: #6fa898; }
.nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 8px; }
.nav button { flex: 1; font-weight: 700; }
.lvl { border: 1px solid #e3dcd6; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.lvl.soon { opacity: .85; }
.lvl h2 { font-size: 20px; margin: 0 0 6px; }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 12px; background: #eee; color: #555; }
.badge.ready { background: #cdeed6; color: #0d5a25; }
.badge.partial { background: #fdebc2; color: #7a4d00; }
.units { margin-top: 10px; }
.unit { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #f0ebe6; font-weight: 600; }
.unit.on { background: #f1f8f5; }
.optw { font-weight: 700; font-size: 18px; }
.optw.good { border: 3px solid #1b8a3a; background: #e3f5e8; }
.optw.badp { border: 3px solid #c62828; background: #fde8e8; }
.ordq { padding: 10px 0; border-bottom: 1px solid #ece6e1; }
.ans { min-height: 52px; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 2px dashed #bbb; border-radius: 10px; margin-bottom: 8px; }
.bank { display: flex; flex-wrap: wrap; gap: 6px; }
.w { font-weight: 800; font-size: 19px; }
.pair { padding: 6px 0; border-bottom: 1px solid #ece6e1; }
.tabs button { flex: 1 1 0; padding: 10px 4px; font-size: 16px; font-weight: 700; }
.w, .optw { direction: ltr; unicode-bidi: isolate; }
.scene svg text { direction: ltr; unicode-bidi: isolate; }
.ubtns { display: flex; gap: 6px; flex-wrap: wrap; }

.scene { width: 100%; max-width: 340px; margin: 8px auto; }
.scene svg { width: 100%; height: auto; display: block; border-radius: 12px; }
.unit.on { flex-direction: column; align-items: stretch; padding: 10px 8px; gap: 10px; }
.ubtns { display: flex; flex-wrap: wrap; gap: 8px; }
.ubtns button { flex: 1 1 100%; }

.pic { width: 64px; height: 64px; flex: 0 0 64px; }
.pic svg { width: 100%; height: 100%; display: block; }

.brand { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.brand h1 { margin: 0; }
.brand .tag { margin: 2px 0 0; color: #b57a00; font-weight: 700; font-size: 16px; }
.brand .logo { border-radius: 14px; flex: 0 0 56px; }

.sharebtn { display: block; width: 100%; margin: 4px 0 12px; background: #fff8d9; border-color: #e5b93a; color: #7a5200; }

/* Pi Browser only */
.inpi .sharebtn { display: none !important; }
.pibar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 2px solid #4a3fd0; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.pibar-on { padding-bottom: 64px; }
.pibtn { background: #4a3fd0; color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 15px; font-family: inherit; }
.pibtn:disabled { opacity: .7; }
.pilinks a { color: #4a3fd0; font-weight: 700; }
