/* DAR AL-WAQAR — V5 — dedicated scene layout; no global application styling changed.
   Each illustrated card is ONE interactive image; all lettering is printed in the supplied original art.
   Desktop: single coordinated stage. Phone: deliberately re-composed 2+2+2 grid with explicit vertical zones.
*/
@font-face{font-family:'Waqar Original Hafs';src:url('../../books/assets/original-hafs.woff') format('woff');font-style:normal;font-weight:400;font-display:swap}
html.waqar-home-page{--waqar-h-header:60px;--waqar-h-footer:52px;overscroll-behavior:none}
html.waqar-home-page,html.waqar-home-page body{height:100%;margin:0;overflow:hidden!important}
html.waqar-home-page #root{height:100dvh!important;min-height:0!important;overflow:hidden!important}
html.waqar-home-page .main-inner{height:100%!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
html.waqar-home-page main{min-height:0!important;overflow:hidden!important}
html.waqar-home-page .waqar-illustrated-wrapper{flex:1 1 auto!important;height:100%!important;min-height:0!important;width:100%!important;max-width:none!important;padding:0!important;margin:0!important;overflow:hidden!important;display:flex!important}
.waqar-v3-header,.waqar-v3-home{font-family:'Cairo','Tajawal',sans-serif;box-sizing:border-box}
.waqar-v3-header *,.waqar-v3-home *{box-sizing:border-box}

/* Calm luminous navigation, matching the source's jade and gold. */
.waqar-v3-header{position:relative;z-index:25;isolation:isolate;width:100%;height:var(--waqar-h-header);flex:0 0 var(--waqar-h-header)!important;padding:0 clamp(15px,3.2vw,52px);display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(108deg,#116c58 0%,#137564 48%,#085146 100%);border-bottom:2px solid #f2ce86a6;box-shadow:0 5px 18px #00352630;color:#ffedba;overflow:hidden}
.waqar-v3-header::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(105deg,transparent 25%,#fff6b416 45%,transparent 60%);background-size:220% 100%;animation:waqarV5Shimmer 16s ease-in-out infinite}
.waqar-v3-brand{display:flex;align-items:center;gap:11px;font-size:clamp(20px,2vw,29px);font-weight:900;color:#ffe2a0;letter-spacing:-.6px;white-space:nowrap;text-shadow:0 2px 5px #072d225c}
.waqar-v3-brand-symbol{width:49px;height:49px;display:block;object-fit:contain;filter:drop-shadow(0 2px 3px #03292148)}
.waqar-v3-head-buttons{display:flex;align-items:center;direction:ltr;gap:10px}
.waqar-v3-tool{position:relative;display:grid;place-items:center;appearance:none;border:1px solid #e9d6a791;outline:0;border-radius:14px;width:42px;height:42px;flex:0 0 42px;padding:0;background:linear-gradient(140deg,#ffffff2f,#b5e1b815);box-shadow:inset 0 1px 0 #ffebbb6b,0 4px 8px #003f3026;color:#fff8e2;font-size:21px;cursor:pointer;transition:background .25s,box-shadow .25s,transform .26s}
.waqar-v3-tool:hover{background:#f4d08c39;transform:translateY(-2px);box-shadow:0 5px 16px #f2cc6a45}
.waqar-v3-tool:active{transform:translateY(0) scale(.95)}
.waqar-v3-tool:first-child:hover i{animation:waqarV5Gear 2s linear infinite}
.waqar-v3-tool:nth-child(2):hover i{animation:waqarV5Bell .7s ease}
.waqar-v3-theme{color:#ffe0a0}
.waqar-v3-notification{position:absolute;top:-3px;right:-3px;width:12px;height:12px;border-radius:50%;background:#f3485a;border:2px solid #166455;box-shadow:0 0 9px #ff7774}
.waqar-v3-tool:focus-visible,.waqar-v3-card:focus-visible,.waqar-v3-footer a:focus-visible{outline:3px solid #ffd97b;outline-offset:3px}

/* Architectural scene is unified behind cards and glowing ground shadows. */
.waqar-v3-home{position:relative;isolation:isolate;width:100%;min-height:0;flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden;background:#eac48b}
.waqar-v3-scene{position:relative;isolation:isolate;width:100%;min-height:0;flex:1 1 auto;overflow:hidden;background:linear-gradient(180deg,#ecdfc3,#cfa571)}
.waqar-v3-backdrop{position:absolute;inset:0;z-index:0;display:block;pointer-events:none;overflow:hidden;transition:opacity .7s ease}
.waqar-v3-backdrop img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 50%;animation:waqarV5Backdrop 26s ease-in-out infinite alternate}
.waqar-v3-day{opacity:1}.waqar-v3-night{opacity:0}
.waqar-v3-shadow-vignette{position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,#ffefd016 0%,transparent 29%,#e3bd820a 60%,#98613b22 100%),radial-gradient(ellipse 64% 48% at 50% 18%,#fffce84a,transparent 81%)}
.waqar-v3-scene::before{content:'';position:absolute;z-index:1;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 15%,#fffbd813 51%,transparent 77%);background-size:250% 100%;animation:waqarV5Shimmer 21s linear infinite}
.waqar-v3-scene::after{content:'';position:absolute;z-index:3;left:12%;right:12%;bottom:8%;height:21%;pointer-events:none;background:radial-gradient(ellipse at center,#f9e2af30,transparent 68%);mix-blend-mode:screen;animation:waqarV5GroundLight 5s ease-in-out infinite alternate}
.waqar-v3-carpet{position:absolute;z-index:2;top:43%;left:16.5%;width:67%;height:29%;object-fit:fill;opacity:.84;pointer-events:none;filter:drop-shadow(0 5px 10px #51391b65)}
.waqar-v3-plant{position:absolute;bottom:-7%;z-index:5;width:clamp(90px,11vw,180px);height:30%;object-fit:contain;object-position:bottom;pointer-events:none;filter:drop-shadow(0 4px 6px #39281646);transform-origin:50% 95%;animation:waqarV5Leaves 7s ease-in-out infinite alternate}
.waqar-v3-plant-left{left:-3%}.waqar-v3-plant-right{right:-3%;animation-delay:-3.2s}
.waqar-v3-lantern{position:absolute;z-index:5;top:-1%;width:clamp(38px,5vw,76px);height:27%;object-fit:contain;object-position:top;pointer-events:none;transform-origin:50% 0;filter:drop-shadow(0 0 9px #ffd26e77);animation:waqarV5Lantern 5s ease-in-out infinite alternate}
.waqar-v3-lantern-left{left:9.2%}.waqar-v3-lantern-right{right:9.2%;animation-delay:-2.7s}
.waqar-v3-hero{position:absolute;z-index:8;top:2.9%;left:29%;width:42%;height:25%;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;white-space:nowrap;gap:0;pointer-events:none;animation:waqarV5Show .9s both}
.waqar-v3-hero h1{margin:0;color:#074a3d;font-weight:900;letter-spacing:-.035em;font-size:clamp(25px,min(4vw,6.5vh),65px);line-height:1.19;text-shadow:0 2px 2px #ffefc5a3}
.waqar-v3-subhero{margin:0;color:#81501e;font-size:clamp(13px,min(2.15vw,3.4vh),32px);font-weight:800;line-height:1.35}
.waqar-v3-rule{display:flex;align-items:center;justify-content:center;gap:11px;width:59%;font-size:clamp(13px,2vw,25px);line-height:1.2;color:#9b6a36;margin:1px 0}
.waqar-v3-rule::before,.waqar-v3-rule::after{content:'';height:1px;flex:1;background:linear-gradient(90deg,transparent,#ad7b43)}
.waqar-v3-rule::after{transform:scaleX(-1)}
.waqar-v3-verse{font-family:'Waqar Original Hafs','Amiri',serif!important;color:#0b5a49;font-size:clamp(18px,min(2.65vw,4vh),38px);font-weight:400!important;direction:rtl;line-height:1.72!important;margin:0;text-shadow:0 1px 2px #fffde1c7;font-feature-settings:'liga' 1}
.waqar-v3-quran{position:absolute;z-index:6;left:32.1%;top:29%;width:35.8%;height:30.5%;object-fit:contain;object-position:center;pointer-events:none;filter:drop-shadow(0 7px 5px #52351a61);animation:waqarV5QuranEnter .9s both,waqarV5QuranFloat 7s .9s ease-in-out infinite alternate}

/* Whole illustrated cards are the actual hit targets: no repeated texts, circles or overlays. */
.waqar-v3-primary-row,.waqar-v3-secondary-row{position:absolute;z-index:10;pointer-events:none}
.waqar-v3-primary-row{inset:0}
.waqar-v3-card{box-sizing:border-box;pointer-events:auto;appearance:none;position:absolute;display:block;min-width:0;min-height:0;width:auto;height:auto;padding:0;margin:0;border:0;background:none;cursor:pointer;touch-action:manipulation;isolation:isolate;animation:waqarV5CardEnter .7s calc(.14s + var(--card-order)*.095s) both;transition:transform .36s cubic-bezier(.22,.8,.27,1);color:inherit}
.waqar-v3-card::before{content:'';position:absolute;z-index:-1;pointer-events:none;bottom:4%;left:12%;width:76%;height:11%;border-radius:50%;background:radial-gradient(ellipse,#50331698 0%,#3f2b1652 38%,transparent 73%);filter:blur(11px);opacity:.85;transform:translateY(7px);transition:filter .35s,opacity .35s,transform .35s}
.waqar-v3-card-image{display:block;width:100%;height:100%;object-fit:contain;object-position:center;user-select:none;pointer-events:none;filter:drop-shadow(0 3px 3px #42271045) drop-shadow(0 5px 5px #60401f30);transition:filter .35s,transform .35s}
.waqar-v3-card:hover{transform:translateY(-3px)}
.waqar-v3-card:hover::before{opacity:1;filter:blur(13px);transform:translateY(10px) scale(1.045)}
.waqar-v3-card:hover .waqar-v3-card-image{filter:drop-shadow(0 6px 9px #67411b8c) drop-shadow(0 0 5px #ffeeb094) brightness(1.035)}
.waqar-v3-card:active{transform:translateY(0) scale(.984)}
.waqar-v3-card:focus-visible{outline-offset:-4px;border-radius:15px}
.waqar-v3-teacher{left:6.3%;top:18.7%;width:22.5%;height:41%}
.waqar-v3-subscriber{right:6.3%;top:18.7%;width:22.5%;height:41%}
.waqar-v3-secondary-row{direction:ltr;left:5.9%;right:5.9%;top:61.5%;height:31.3%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;justify-items:stretch;gap:clamp(5px,1.3vw,22px)}
.waqar-v3-secondary{position:relative;width:100%;height:100%;direction:rtl}
.waqar-v3-card-plaque,.waqar-v3-arrow-halo{display:none!important}

/* A crafted footer is readable on both wide and narrow screens. */
.waqar-v3-footer{z-index:15;position:relative;flex:0 0 var(--waqar-h-footer);height:var(--waqar-h-footer);width:100%;display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:14px;padding:0 clamp(15px,3.8vw,55px);background:linear-gradient(107deg,#06473d 0%,#0f6858 48%,#06473d 100%);color:#fff4d7;border-top:2px solid #e5bf7dc7;box-shadow:0 -6px 19px #3a241329,inset 0 1px 0 #fff5d923;font-weight:700;font-size:clamp(11px,1vw,14px);line-height:1.45}
.waqar-v3-footer-copyright,.waqar-v3-footer-credit{white-space:nowrap}
.waqar-v3-footer-ornament{font-size:19px;letter-spacing:3px;color:#e9cd8a;opacity:.84;animation:waqarV5Ornament 5.2s ease-in-out infinite}
.waqar-v3-footer::after{content:'';pointer-events:none;position:absolute;top:0;left:25%;right:25%;height:1px;background:linear-gradient(90deg,transparent,#ffedb4bd,transparent)}
.waqar-v3-footer-credit{display:flex;align-items:center;justify-content:center;gap:5px}
.waqar-v3-footer-credit a{color:#ffe5a6;font-weight:900;text-decoration:none;border-bottom:1px solid #ecd086;transition:color .25s}
.waqar-v3-footer-credit a:hover{color:#fff;text-shadow:0 0 8px #ffd889}
.waqar-v3-heart{color:#ff988e;display:inline-block;animation:waqarV5Heart 2.4s ease-in-out infinite}

/* Night is a different sky; protect legibility while preserving the painted artwork. */
html[data-theme="dark"] .waqar-v3-header{background:linear-gradient(105deg,#155668,#226a70 45%,#164758);color:#ffebb8;border-bottom-color:#deb879;box-shadow:0 5px 20px #020c1e91}
html[data-theme="dark"] .waqar-v3-tool{background:linear-gradient(140deg,#ffffff2d,#3264777c);color:#fff3d1;border-color:#eecb8aa3;box-shadow:0 3px 9px #051f3370,inset 0 1px #fff7d24d}
html[data-theme="dark"] .waqar-v3-tool:hover{background:#81b3b055;box-shadow:0 0 14px #ffd88848}
html[data-theme="dark"] .waqar-v3-scene{background:#102332}
html[data-theme="dark"] .waqar-v3-day{opacity:0}
html[data-theme="dark"] .waqar-v3-night{opacity:1}
html[data-theme="dark"] .waqar-v3-shadow-vignette{background:linear-gradient(180deg,#05162969,transparent 31%,#05152868 75%,#071122ac),radial-gradient(ellipse at 50% 20%,#426d943b,transparent 64%)}
html[data-theme="dark"] .waqar-v3-carpet{filter:brightness(.58) saturate(.76) drop-shadow(0 5px 11px #000a)}
html[data-theme="dark"] .waqar-v3-lantern{filter:brightness(.96) saturate(1.26) drop-shadow(0 0 17px #ffc660aa)}
html[data-theme="dark"] .waqar-v3-plant{filter:brightness(.6) saturate(.75) drop-shadow(0 5px 7px #0009)}
html[data-theme="dark"] .waqar-v3-hero h1{color:#ffe2a1;text-shadow:0 3px 11px #041421d1}
html[data-theme="dark"] .waqar-v3-subhero{color:#f0d6a3;text-shadow:0 2px 7px #001621}
html[data-theme="dark"] .waqar-v3-rule{color:#edc991}
html[data-theme="dark"] .waqar-v3-verse{color:#fff0c6;text-shadow:0 2px 8px #000e}
html[data-theme="dark"] .waqar-v3-quran{filter:brightness(.84) saturate(.93) drop-shadow(0 7px 9px #0009)}
html[data-theme="dark"] .waqar-v3-card-image{filter:brightness(.88) saturate(.9) drop-shadow(0 5px 7px #0009)}
html[data-theme="dark"] .waqar-v3-card:hover .waqar-v3-card-image{filter:brightness(1.04) saturate(.95) drop-shadow(0 7px 8px #000a) drop-shadow(0 0 7px #f5d99185)}
html[data-theme="dark"] .waqar-v3-card::before{background:radial-gradient(ellipse,#000c18bf,transparent 74%)}
html[data-theme="dark"] .waqar-v3-footer{background:linear-gradient(107deg,#102e3e,#245d6c 48%,#102e3e);border-top-color:#e5c08b;color:#fceac6}

/* Tablet portrait / telephone: fixed non-overlapping zones, never forced into desktop percentages. */
@media(max-width:900px) and (orientation:portrait){
 html.waqar-home-page{--waqar-h-header:55px;--waqar-h-footer:67px}
 .waqar-v3-header{padding:0 13px}
 .waqar-v3-brand{font-size:clamp(18px,3.1vw,24px);gap:6px}
 .waqar-v3-brand-symbol{width:41px;height:41px}
 .waqar-v3-head-buttons{gap:8px}
 .waqar-v3-tool{width:38px;height:38px;flex-basis:38px;font-size:19px;border-radius:12px}
 .waqar-v3-backdrop img{object-position:50% 48%}
 .waqar-v3-hero{top:0.6%;left:4%;width:92%;height:18.3%}
 .waqar-v3-hero h1{font-size:clamp(22px,3.9vh,42px);line-height:1.19}
 .waqar-v3-subhero{font-size:clamp(12px,2.17vh,23px);line-height:1.3}
 .waqar-v3-rule{font-size:clamp(12px,1.8vh,19px);margin:0;width:38%}
 .waqar-v3-verse{font-size:clamp(16px,2.45vh,26px);line-height:1.52!important}
 .waqar-v3-lantern{top:0;left:auto;right:auto;width:clamp(31px,7vw,58px);height:19%;opacity:.92}
 .waqar-v3-lantern-left{left:2%}.waqar-v3-lantern-right{right:2%}
 .waqar-v3-carpet{left:15%;width:70%;top:25.5%;height:18%;object-fit:contain;opacity:.69}
 .waqar-v3-quran{left:17%;top:18.5%;width:66%;height:18.5%;max-width:none}
 .waqar-v3-primary-row{position:absolute;inset:auto;left:4%;right:4%;top:36.5%;height:24%;display:grid;direction:ltr;grid-template-columns:repeat(2,minmax(0,1fr));gap:1%;align-items:center;justify-items:stretch;z-index:9}
 .waqar-v3-teacher,.waqar-v3-subscriber{position:relative;inset:auto;left:auto;right:auto;top:auto;width:100%;height:100%;max-height:100%;direction:rtl}
 .waqar-v3-secondary-row{position:absolute;inset:auto;left:3%;right:3%;top:60.8%;height:37%;display:grid;direction:ltr;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:0.8% 1%;align-items:stretch;justify-items:stretch;z-index:9}
 .waqar-v3-secondary{position:relative;inset:auto;width:100%;height:100%;min-height:0;max-height:100%;direction:rtl}
 .waqar-v3-card-image{width:100%;height:100%;object-fit:contain}
 .waqar-v3-card::before{bottom:3%;filter:blur(6px)}
 .waqar-v3-plant{z-index:4;bottom:-6%;height:19%;width:clamp(64px,19vw,125px);opacity:.78}
 .waqar-v3-plant-left{left:-6%}.waqar-v3-plant-right{right:-6%}
 .waqar-v3-footer{height:var(--waqar-h-footer);flex-basis:var(--waqar-h-footer);padding:7px 10px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-size:clamp(10px,1.66vw,13px);line-height:1.35;text-align:center}
 .waqar-v3-footer-copyright,.waqar-v3-footer-credit{white-space:normal}
 .waqar-v3-footer-ornament{display:none}
}
@media(max-width:480px) and (orientation:portrait){
 html.waqar-home-page{--waqar-h-header:49px;--waqar-h-footer:69px}
 .waqar-v3-header{padding-inline:10px}
 .waqar-v3-brand{font-size:17px;gap:5px}
 .waqar-v3-brand-symbol{width:34px;height:34px}
 .waqar-v3-head-buttons{gap:6px}
 .waqar-v3-tool{width:33px;height:33px;flex-basis:33px;font-size:17px;border-radius:10px}
 .waqar-v3-hero{top:.7%;height:17.5%}
 .waqar-v3-hero h1{font-size:clamp(20px,3.85vh,34px)}
 .waqar-v3-subhero{font-size:clamp(11px,1.95vh,17px)}
 .waqar-v3-verse{font-size:clamp(14px,2.25vh,21px)}
 .waqar-v3-rule{font-size:clamp(11px,1.75vh,15px)}
 .waqar-v3-quran{top:18.1%;height:18.3%;left:15%;width:70%}
 .waqar-v3-carpet{top:26%;height:15%;left:12%;width:76%;opacity:.58}
 .waqar-v3-primary-row{top:36.6%;height:23.2%;left:2%;right:2%;gap:0}
 .waqar-v3-secondary-row{top:59.2%;height:37%;left:1.6%;right:1.6%;gap:0.5% 0}
 .waqar-v3-lantern{height:17%;width:37px}
 .waqar-v3-footer{font-size:clamp(11.5px,3.1vw,13px);gap:3px;padding:8px 9px}
}
/* The absolutely smallest displays get a safe vertical scroll rather than clipped cards.
   Scrolling is intentionally limited to very short portrait windows. */
@media(max-width:600px) and (orientation:portrait) and (max-height:715px){
 html.waqar-home-page,html.waqar-home-page body{height:auto!important;overflow-y:auto!important;overflow-x:hidden!important}
 html.waqar-home-page #root{position:relative!important;inset:auto!important;bottom:auto!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
 html.waqar-home-page #root > div{overflow:visible!important;height:auto!important;min-height:100dvh!important}
 html.waqar-home-page .main-inner,html.waqar-home-page main{height:auto!important;min-height:0!important;overflow:visible!important}
 html.waqar-home-page .waqar-illustrated-wrapper{height:auto!important;min-height:0!important;overflow:visible!important}
 .waqar-v3-home{height:auto;min-height:0;overflow:visible}
 .waqar-v3-scene{flex:none;min-height:675px;height:675px;overflow:hidden}
}
/* Landscape phones: preserve attractive scene and avoid chopping off the lower four cards. */
@media(max-height:570px) and (orientation:landscape){
 html.waqar-home-page{--waqar-h-header:43px;--waqar-h-footer:38px}
 .waqar-v3-brand{font-size:18px}.waqar-v3-brand-symbol{width:32px;height:32px}
 .waqar-v3-tool{width:30px;height:30px;flex-basis:30px;font-size:16px}
 .waqar-v3-hero{top:0;height:26%}.waqar-v3-hero h1{font-size:clamp(19px,5.2vh,34px)}
 .waqar-v3-subhero{font-size:clamp(12px,3vh,18px)}
 .waqar-v3-verse{font-size:clamp(14px,3.5vh,22px)}
 .waqar-v3-teacher,.waqar-v3-subscriber{top:21%;height:39%}
 .waqar-v3-secondary-row{top:59%;height:34%}
 .waqar-v3-footer{font-size:10px}
}
.waqar-extra-remove{border:1px solid #fca5a5;background:#fff5f5;color:#991b1b;border-radius:9px;padding:5px 11px;font-weight:800}
.waqar-add-surah{width:100%;min-height:43px;padding:10px;border:1.5px dashed #34a48b;background:#edfdf7;border-radius:12px;color:#075b43;font-size:13px;font-weight:900;transition:background .2s,transform .2s}
.waqar-add-surah:hover{background:#cff7e8;transform:translateY(-2px)}
@keyframes waqarV5CardEnter{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes waqarV5Show{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
@keyframes waqarV5QuranEnter{from{opacity:0;transform:translateY(13px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes waqarV5QuranFloat{from{translate:0 0}to{translate:0 -4px}}
@keyframes waqarV5Backdrop{from{transform:scale(1)}to{transform:scale(1.023)}}
@keyframes waqarV5GroundLight{from{opacity:.46}to{opacity:.94}}
@keyframes waqarV5Shimmer{from{background-position:210% 0}to{background-position:-160% 0}}
@keyframes waqarV5Lantern{from{transform:rotate(-2deg)}to{transform:rotate(2deg)}}
@keyframes waqarV5Leaves{from{rotate:-1.2deg}to{rotate:1.2deg}}
@keyframes waqarV5Bell{0%,100%{transform:rotate(0)}40%{transform:rotate(-12deg)}75%{transform:rotate(10deg)}}
@keyframes waqarV5Gear{to{transform:rotate(360deg)}}
@keyframes waqarV5Heart{0%,100%{transform:scale(1)}50%{transform:scale(1.12)}}
@keyframes waqarV5Ornament{from{opacity:.55}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.waqar-v3-scene *, .waqar-v3-scene::before,.waqar-v3-scene::after,.waqar-v3-header::before,.waqar-v3-footer *{animation:none!important;transition:none!important}.waqar-v3-card:hover{transform:none}}
@media print{html.waqar-home-page #root{height:auto!important;overflow:visible!important}.waqar-v3-home{height:auto;overflow:visible}.waqar-v3-scene{aspect-ratio:16/9;height:auto}}


/* ============================================================
   V8 — Mobile visibility / safe-area / subscriber art cache reset
   Limits only the home view; does not affect assessment or login views.
   ============================================================ */
.waqar-v3-active-backdrop{opacity:1!important}
.waqar-v3-active-backdrop img{height:100%;width:100%;display:block}
html.waqar-home-page,html.waqar-home-page body{max-width:100%;overflow-x:hidden!important}
.waqar-v3-home,.waqar-v3-scene,.waqar-v3-header,.waqar-v3-footer{max-width:100%;min-width:0}
.waqar-v3-card,.waqar-v3-card-image{max-width:100%}
.waqar-v3-footer{padding-bottom:max(4px,env(safe-area-inset-bottom,0px))}

/* On narrow portrait phones prioritise legible cards and complete footer. */
@media (max-width:600px) and (orientation:portrait){
 html.waqar-home-page{--waqar-h-header:clamp(48px,7.2dvh,55px);--waqar-h-footer:76px}
 .waqar-v3-hero{top:.7%;height:18.4%}
 .waqar-v3-primary-row{top:36%;height:24.7%;left:1.8%;right:1.8%;gap:1%}
 .waqar-v3-secondary-row{top:60.8%;height:36.2%;left:1.8%;right:1.8%;gap:.6% .8%}
 .waqar-v3-card-image{object-fit:contain}
 .waqar-v3-footer{box-sizing:border-box;flex-shrink:0;min-height:var(--waqar-h-footer);height:auto;line-height:1.5;gap:4px;padding:8px 12px max(9px,env(safe-area-inset-bottom,0px));font-size:clamp(11px,3vw,13px)}
 .waqar-v3-footer-copyright,.waqar-v3-footer-credit{white-space:normal;overflow-wrap:anywhere;text-align:center}
}
/* Short and/or small portrait devices need vertical space rather than clipping content.
   710px scene is a minimum; only the home route scrolls, never crops any card. */
@media (max-width:600px) and (orientation:portrait) and (max-height:820px){
 html.waqar-home-page,html.waqar-home-page body{height:auto!important;min-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important}
 html.waqar-home-page #root{position:relative!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;inset:auto!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
 html.waqar-home-page #root > div{display:flex!important;flex-direction:column!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
 html.waqar-home-page .main-inner,html.waqar-home-page main{height:auto!important;min-height:0!important;overflow:visible!important;flex:none!important}
 html.waqar-home-page .waqar-illustrated-wrapper{flex:none!important;height:auto!important;min-height:0!important;overflow:visible!important}
 .waqar-v3-home{flex:none!important;display:flex;flex-direction:column;height:auto!important;min-height:0!important;overflow:visible!important}
 .waqar-v3-scene{flex:none!important;height:max(680px,calc(100dvh - var(--waqar-h-header) - var(--waqar-h-footer)))!important;min-height:680px!important;overflow:hidden!important}
 .waqar-v3-footer{flex:none!important;height:auto!important;min-height:76px!important}
}
/* Landscape phones/tablets: ensure content can be scrolled instead of being squashed behind footer. */
@media (orientation:landscape) and (max-height:620px){
 .waqar-v3-secondary-row{top:61%;height:34%}
 html.waqar-home-page,html.waqar-home-page body{height:auto!important;min-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important}
 html.waqar-home-page #root{position:relative!important;inset:auto!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
 html.waqar-home-page #root>div,html.waqar-home-page .main-inner{height:auto!important;min-height:100dvh!important;overflow:visible!important}
 html.waqar-home-page main,html.waqar-home-page .waqar-illustrated-wrapper{flex:none!important;height:auto!important;overflow:visible!important}
 .waqar-v3-home{flex:none!important;height:auto!important;overflow:visible!important}
 .waqar-v3-scene{flex:none!important;height:max(590px,calc(100dvh - var(--waqar-h-header) - var(--waqar-h-footer)))!important;min-height:590px!important;overflow:hidden!important}
 .waqar-v3-footer{flex:none!important;min-height:50px!important;height:auto!important;flex-wrap:wrap!important;justify-content:center!important;gap:3px 15px!important;padding:8px 12px!important;font-size:11px!important}
}
@media (max-width:340px) and (orientation:portrait){
 .waqar-v3-header{padding-inline:7px}
 .waqar-v3-brand{font-size:15px;gap:2px}
 .waqar-v3-brand-symbol{width:30px;height:30px}
 .waqar-v3-head-buttons{gap:3px}
 .waqar-v3-tool{width:32px;height:32px;flex-basis:32px}
 .waqar-v3-primary-row{left:1%;right:1%;gap:0}
 .waqar-v3-secondary-row{left:.8%;right:.8%;gap:0}
}
/* Less GPU overdraw while retaining the same illustrated animation style. */
.waqar-v3-card-image{backface-visibility:hidden}
@media (prefers-reduced-motion:reduce){.waqar-v3-active-backdrop img{animation:none!important}}

/* Portal order correction: teacher left, subscriber right — desktop and mobile. */
@media (min-width:901px) {
  .waqar-v3-primary-row .waqar-v3-teacher { left:6.3%; right:auto; }
  .waqar-v3-primary-row .waqar-v3-subscriber { right:6.3%; left:auto; }
}
@media (max-width:900px) and (orientation:portrait) {
  .waqar-v3-primary-row .waqar-v3-teacher { grid-column:1; order:1; }
  .waqar-v3-primary-row .waqar-v3-subscriber { grid-column:2; order:2; }
}
