/* Shared small-screen layout and touch controls. */
html{ -webkit-text-size-adjust:100%;scroll-padding-top:20px}img,video{max-width:100%;height:auto}input,textarea,select{max-width:100%}button,a{touch-action:manipulation}body{overflow-wrap:break-word}
@media(max-width:900px){
body{min-height:100svh}main,.shell,main>*{min-width:0}
body.landing header,body.landing footer{padding-left:max(22px,env(safe-area-inset-left));padding-right:max(22px,env(safe-area-inset-right))}
body.landing main{width:100%;padding:28px 24px 48px;min-height:0}body.landing h1{font-size:clamp(42px,10vw,64px);gap:12px 22px;margin:16px 0 24px}body.landing .heading-arabic{line-height:1.5}body.landing .intro{font-size:clamp(18px,3.5vw,21px);line-height:1.65;margin-bottom:30px}body.landing .ornament{margin-bottom:18px}body.landing .counter-button{min-height:52px}body.landing .card{min-height:100px}body.landing footer{padding-bottom:max(22px,env(safe-area-inset-bottom))}
}
@media(max-width:760px){
button,input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px}
button,.icon-button,.secondary-button,.primary-button,.text-button,.chip,.ds-button,.dp-button,.ff-button,.dx-icon-button,.ff-icon-button,.dp-icon-button{min-height:44px}
.icon-button,.dx-icon-button,.ff-icon-button,.dp-icon-button{min-width:44px}
.sidebar{width:min(300px,calc(100vw - 48px));height:100dvh;overscroll-behavior:contain;padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(24px,env(safe-area-inset-bottom))}.sidebar .brand{margin-bottom:28px}.navigation a{font-size:15px;min-height:48px}.nav-label{font-size:11px}
.topbar{height:auto;min-height:112px;padding:12px 16px;display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px 10px;align-items:center}.menu-toggle{margin:0}.breadcrumb{font-size:13px;min-width:0;overflow-wrap:anywhere}.topbar-actions{grid-column:1/-1;display:flex;gap:8px;width:100%;min-width:0}.search-box{flex:1;min-width:0;border:1px solid var(--line);border-radius:9px;padding:0 10px;min-height:44px;background:var(--surface)}.search-box input{width:100%;min-width:0;font-size:16px;min-height:44px}.language-select{padding-left:0;border:0;flex:none}.language-select select{min-height:44px;font-size:14px}.topbar-actions>.icon-button{padding:10px;min-width:44px}.search-box:focus-within{outline-offset:2px}
.shell main{padding:24px 16px 32px;min-height:calc(100svh - 190px)}.greeting-row{gap:12px;align-items:flex-start}.greeting{font-size:14px}.date{font-size:11px}.hero{padding:26px 22px;min-height:290px}.hero-copy{max-width:90%}.hero h1{font-size:clamp(30px,8vw,40px)}.hero p{font-size:14px;max-width:290px}.hero .eyebrow{font-size:10px}.hero-art{opacity:.22;right:-40px;width:64%}.hero-copy .primary-button{font-size:14px;min-height:46px}
.section-heading{flex-wrap:wrap;gap:10px}.section-heading p,.page-heading p{font-size:14px;line-height:1.65}.text-button{font-size:13px}.category-card{min-height:112px;padding:18px 26px 18px 56px}.category-title{font-size:14px;line-height:1.4}.category-count{font-size:11px}.category-icon{left:12px;top:20px}.category-arrow{top:24px;right:8px}.daily-meaning,.practice-card p,.gentle-card p,.stats-card p{font-size:14px;line-height:1.75}.daily-card-footer{font-size:12px;gap:12px;flex-wrap:wrap}.eyebrow{font-size:11px}
.dua-grid,.dp-grid,.ff-grid,.ds-grid,.dx-guides,.edition-feed,.port-routines,.port-chapters{grid-template-columns:minmax(0,1fr)}.dua-card h2{font-size:18px}.dua-card-bottom{flex-wrap:wrap;gap:10px;font-size:12px}.chip,.secondary-button{font-size:13px}.filter-chips,.counter-chips{flex-wrap:wrap}.page-heading h1{font-size:30px;overflow-wrap:anywhere}
.counter-layout{grid-template-columns:minmax(0,1fr)}.shell .counter-button{width:min(240px,100%);height:auto;aspect-ratio:1}.counter-aside{grid-template-columns:minmax(0,1fr)}.counter-bottom{flex-wrap:wrap;gap:12px}.counter-arabic{overflow-wrap:anywhere}.counter-meaning{font-size:15px;line-height:1.7}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}#reader{width:min(680px,calc(100vw - 24px));margin:auto}.reader-header,.reader-body{padding:22px 18px}.reader-header{padding-right:60px}.reader-header h2{font-size:23px}.reader-arabic,.shahadah-arabic,.dp-reading-arabic{overflow-wrap:anywhere}.reader-toolbar,.reader-navigation{padding:14px 18px;flex-wrap:wrap;gap:12px}.reader-tools,.reader-actions,.reader-actions-left,.reader-navigation{min-width:0}.reader-tools{gap:8px}.reader-actions{gap:12px}.reader-sequence{padding:0 18px 16px}.reader-repetition{min-height:52px}.reader-reference,.reader-note{font-size:13px;overflow-wrap:anywhere}.reader-transliteration,.reader-translation{line-height:1.85}.shahadah-footer{flex-wrap:wrap}
.dp-toolbar,.dp-backup-actions,.dp-dialog-actions,.ff-heading-actions,.ff-dialog-actions,.ds-action-row,.ds-font-row,.ds-reminder-row{flex-wrap:wrap;gap:12px}.ds-toggle-row{gap:16px}.dp-field input,.dp-field textarea,.ff-field input{font-size:16px}.ds-description,.ds-small,.dp-dialog-note,.ff-dialog-note{font-size:14px;line-height:1.65}.site-footer{font-size:12px;line-height:1.7;padding-bottom:max(24px,env(safe-area-inset-bottom))}.site-footer button{font-size:13px}.toast{max-width:calc(100vw - 32px);width:max-content;bottom:max(20px,env(safe-area-inset-bottom));font-size:14px;white-space:normal}
body.prayer-page header{padding:18px 20px;flex-wrap:wrap;gap:14px}body.prayer-page .back{min-height:44px;display:inline-flex;align-items:center}body.prayer-page main{padding:32px 20px 48px}body.prayer-page h1{font-size:clamp(32px,8vw,48px)}body.prayer-page .card{min-height:88px;font-size:25px}body.prayer-page .prayers a{min-height:44px;display:inline-flex;align-items:center}body.prayer-page .notice{padding:24px}body.prayer-page footer{padding:24px 20px max(24px,env(safe-area-inset-bottom))}
}
@media(max-width:480px){body.landing main{padding:24px 20px 40px}body.landing header{padding-top:20px;padding-bottom:20px}body.landing .card{padding:22px}body.landing .card h2{font-size:26px}body.landing .counter-button{width:100%}.categories{grid-template-columns:minmax(0,1fr)}.category-card{min-height:88px;padding-left:66px}.category-icon{top:24px;left:18px}.category-arrow{top:34px;right:18px}.category-title{font-size:15px}.category-count{font-size:12px}.hero-copy{max-width:100%}.ds-theme-options{grid-template-columns:minmax(0,1fr)}.dx-feelings{grid-template-columns:repeat(2,minmax(0,1fr))}body.prayer-page .grid{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

@media(max-width:760px){.counter-chips .chip{font-size:13px;line-height:1.5;padding:10px 12px;max-width:100%;white-space:normal}.target-select{font-size:14px;flex-wrap:wrap;gap:8px}.target-select select{min-height:44px;font-size:16px}}

/* Compact tasbih tap target at every viewport size. */
.shell .counter-button{width:180px;max-width:100%;height:auto;aspect-ratio:1;margin-left:auto;margin-right:auto}
.shell .counter-button .counter-number{font-size:50px}
@media(max-width:760px){.shell .counter-button{width:160px}.shell .counter-button .counter-number{font-size:44px}}

/* A consistent route back to the main Faida page on every screen. */
body{padding-bottom:80px}
.faida-home{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:35;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 16px;background:#213e35;color:#fff;border:1px solid #f7f8f466;border-radius:999px;box-shadow:0 4px 16px #10271c26;text-decoration:none;font:600 14px/1.3 system-ui,sans-serif;touch-action:manipulation}
.faida-home svg{display:block;flex:none}.faida-home:hover{background:#315749}.faida-home:focus-visible{outline:3px solid #aa8a51;outline-offset:4px}
@media print{.faida-home{display:none}}

/* Home belongs in page navigation, rather than a floating overlay. */
.faida-home.home-top{position:static;box-shadow:none;z-index:auto;flex:none;min-height:44px;padding:10px 14px;font-size:14px}
body{padding-bottom:0}
@media(max-width:760px){.topbar-actions .home-top{padding:10px;gap:6px}.topbar-actions .home-top svg{width:18px;height:18px}}

.page-number{display:inline-block;margin-left:auto;padding-left:18px;white-space:nowrap;font:500 12px/1.6 system-ui,sans-serif;color:inherit;font-variant-numeric:tabular-nums}
body.landing footer,body.prayer-page footer{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.site-footer .page-number{flex:none}

.sidebar .brand{justify-content:center;margin-left:0;margin-right:0}.sidebar .brand .faida-brand-logo{display:block;width:170px;max-width:100%;height:auto;object-fit:contain}



/* Counter phrases follow the shared Arabic font preference. */
.shell .counter-card .counter-arabic[lang="ar"]{font-family:var(--arabic-font)!important;font-feature-settings:normal;font-variant-ligatures:normal}

/* Mobile-first counter controls: native touch rendering cannot mask state colours. */
.counter-phrase-picker{display:grid;gap:8px;text-align:left;font-size:13px;color:var(--muted)}
.counter-phrase-picker select{display:block;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);font:inherit;font-size:16px}
.shell .counter-card .counter-chips{display:none}
.shell .counter-button,.prayer-page .slide-count{-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;background-image:none;transition:none;touch-action:manipulation}
.shell .counter-button[data-final-taps="true"],.prayer-page .slide-count[data-final-taps="true"]{background-color:#e5cc91;color:#213e35;box-shadow:0 0 0 4px #aa8a5155;outline:2px solid #aa8a51;outline-offset:2px}
.shell .counter-button[data-final-taps="true"]:is(:active,:hover,:focus),.prayer-page .slide-count[data-final-taps="true"]:is(:active,:hover,:focus){background-color:#e5cc91;color:#213e35}
.shell .counter-button[data-final-taps="true"] small{color:#213e35}
.shell .counter-button:focus-visible,.prayer-page .slide-count:focus-visible{outline:3px solid #aa8a51;outline-offset:6px}
@media(min-width:761px){.counter-phrase-picker{display:none}.shell .counter-card .counter-chips{display:flex}}
@media(max-width:760px){
.shell .counter-card .counter-arabic{margin:20px 0 10px;line-height:1.8;font-size:32px}
.shell .counter-meaning{margin:10px 0 20px}.shell .counter-card{padding:20px 16px}.shell .counter-sub{margin:18px 0}.shell .counter-bottom{margin-top:20px;padding-top:18px}
.shell main,.prayer-page main{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
.port-name{min-width:0}.port-name-arabic,.port-name strong{overflow-wrap:anywhere}
.reader-tools,.font-controls{flex-wrap:wrap}.site-footer{overflow-wrap:anywhere}.slide-status>span{min-width:0}
}

@media(max-width:760px){body.prayer-page header{padding:14px 16px;gap:8px;flex-direction:row;align-items:center}.prayer-page header .back{font-size:13px}.slide-size{gap:6px}.slide-size button{padding:10px;min-width:44px}}

/* Page 080: compact title and spacing below the header. */
body.prayer-page.prayer-index main{padding-top:16px}
body.prayer-page.prayer-index h1{font-size:28px;line-height:1.2;margin:0 0 12px}
@media(min-width:761px){body.prayer-page.prayer-index main{padding-top:24px}body.prayer-page.prayer-index h1{font-size:36px}}
