/* مواقيت الصلاة: the zellige courtyard. Flat glaze colour, black grout lines, white lime plaster ground.
   The prayer day is a cut-tile instrument, never decoration. */
@font-face { font-family: 'Kufi'; src: url(/assets/fonts/reemkufi-ar.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Kufi'; src: url(/assets/fonts/reemkufi-lat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-ar-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-lat-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-ar-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-lat-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-ar-800.woff2) format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Text'; src: url(/assets/fonts/almarai-lat-800.woff2) format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Mushaf'; src: url(/assets/fonts/amiriquran-ar.woff2) format('woff2'); font-display: swap; }

:root {
  /* glaze */
  --cobalt: #1e4b9a;
  --cobalt-deep: #163a78;
  --emerald: #0f7a5c;
  --saffron: #e3a21a;
  --plum: #3a2440;
  /* plaster and ink */
  --ground: #f4f2ec;
  --tile: #ffffff;
  --ink: #17171a;
  --ink-2: #4a4e57;
  --grout: #1b1b1f;
  --grout-faint: #d9d5cb;
  --on-cobalt: #ffffff;
  --on-saffron: #1f1500;
  --link: #1e4b9a;
  /* type */
  --f-text: 'Text', 'Segoe UI', Tahoma, sans-serif;
  --f-head: 'Kufi', 'Text', 'Segoe UI', Tahoma, sans-serif;
  --f-quran: 'Mushaf', 'Amiri Quran', 'Traditional Arabic', serif;
  --t-meta: 0.875rem;  /* 14 */
  --t-body: 1rem;      /* 16 */
  --t-h3: 1.25rem;     /* 20 */
  --t-h2: 1.625rem;    /* 26 */
  --t-h1: 2.125rem;    /* 34 */
  --n-s: 1.25rem;      /* 20 */
  --n-m: 1.75rem;      /* 28 */
  --n-l: 2.5rem;       /* 40 */
  /* rhythm */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --gutter: 16px;
  --r: 3px;
  color-scheme: light;
}
@media (min-width: 900px) { :root { --t-h1: 2.75rem; --t-h2: 1.875rem; --n-l: 3.25rem; --gutter: 32px; } }
:root[data-theme="dark"] {
  --ground: #15111a; --tile: #211a28; --ink: #f2eee6; --ink-2: #bdb6c4; --grout: #0b090e; --grout-faint: #3a3242;
  --cobalt: #2a5cb3; --cobalt-deep: #1b3f80; --emerald: #2aa37f; --plum: #4a2f52; --link: #9cbcf2; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--cobalt) transparent; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--t-body)/1.75 var(--f-text); text-rendering: optimizeLegibility; }
::selection { background: var(--saffron); color: var(--on-saffron); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 700; line-height: 1.35; margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 var(--s3); }
img, svg { max-width: 100%; }
.num, time, .t { font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: isolate; }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--saffron); color: var(--on-saffron); padding: var(--s2) var(--s4); z-index: 50; }
.skip:focus { inset-inline-start: var(--s4); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header: the cobalt band ---------- */
.hd { background: var(--cobalt); color: var(--on-cobalt); border-bottom: 3px solid var(--grout); }
.hd-in { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--s4); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--s3); color: inherit; text-decoration: none; flex: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font: 700 1.25rem/1.1 var(--f-head); display: block; }
.brand small { display: block; font-size: 0.75rem; opacity: .85; direction: ltr; text-align: end; }
.hd-search { flex: 1; display: flex; max-width: 520px; margin-inline-start: auto; position: relative; }
.hd-search input { width: 100%; height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s4) 0 48px; font: 700 var(--t-body) var(--f-text); }
.hd-search input::placeholder { color: var(--ink-2); font-weight: 400; }
.hd-search button { position: absolute; inset-inline-end: 4px; top: 4px; bottom: 4px; width: 40px; border: 0; border-radius: 2px; background: var(--saffron); color: var(--on-saffron); cursor: pointer; display: grid; place-items: center; }
.hd-search button svg { width: 20px; height: 20px; }
.nav { display: flex; gap: var(--s1); }
.nav a { color: var(--on-cobalt); text-decoration: none; font-weight: 700; font-size: var(--t-meta); padding: 0 var(--s3); min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--r); }
.nav a:hover, .nav a[aria-current] { background: var(--cobalt-deep); color: #fff; }
.ask-bar { background: var(--cobalt-deep); border-bottom: 1px solid var(--grout); }
.ask-bar form { max-width: 1120px; margin: 0 auto; padding: var(--s2) var(--gutter); display: flex; gap: var(--s2); }
.ask-bar input { flex: 1; height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s4); font: 400 var(--t-body) var(--f-text); }
.ask-bar button { height: 44px; padding: 0 var(--s5); border: 2px solid var(--grout); border-radius: var(--r); background: var(--saffron); color: var(--on-saffron); font: 800 var(--t-body) var(--f-text); cursor: pointer; }
@media (max-width: 760px) { .nav { display: none; } .hd-in { flex-wrap: wrap; padding-bottom: var(--s3); } .hd-search { order: 3; flex: 1 0 100%; max-width: none; } }

/* ---------- crumbs ---------- */
.crumbs ol { list-style: none; margin: 0; padding: var(--s3) 0 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); font-size: var(--t-meta); color: var(--ink-2); }
.crumbs li + li::before { content: '›'; margin-inline-end: var(--s2); color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }

/* ---------- the town head ---------- */
.place-h { padding: var(--s5) 0 var(--s4); }
.place-h h1 { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.place-h h1 small { font: 400 var(--t-meta) var(--f-text); color: var(--ink-2); }
.dates { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s2); color: var(--ink-2); font-size: var(--t-meta); font-weight: 700; }
.dates span { display: inline-flex; gap: var(--s2); align-items: center; }
.dates i { width: 10px; height: 10px; display: inline-block; transform: rotate(45deg); background: var(--emerald); }
.dates i.h { background: var(--saffron); }
.place-h > :last-child { margin-bottom: 0; }
.place-h + .sec { margin-top: var(--s4); }

/* ---------- the home hero: the next prayer and today's five times for the visitor's town ---------- */
.hero-day { margin-top: var(--s5); }
.day.hero { grid-template-columns: minmax(0, 1fr); gap: var(--s3); align-items: stretch; }
@media (min-width: 900px) { .day.hero { grid-template-columns: 380px minmax(0, 1fr); gap: var(--s4); } }
.hero-next { display: grid; gap: var(--s1); align-content: center; padding: var(--s5); background: var(--cobalt); color: #fff; border: 2px solid var(--grout); border-radius: var(--r); }
.day.hero .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-where { margin: 0; font-size: var(--t-meta); color: #dbe5f7; }
.hero-where a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.hero-where .flag { margin-inline: var(--s1); }
.hero-lbl { margin: var(--s3) 0 0; font-weight: 700; font-size: var(--t-meta); color: #dbe5f7; }
.hero-n { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.hero-n .nm { font: 700 var(--t-h1)/1.2 var(--f-head); }
.hero-n .tm { font: 800 var(--n-l)/1 var(--f-text); }
.hero-next .cd { margin: 0; font-size: var(--t-body); font-weight: 700; color: #fff; }
.hero-next .cd b { font-size: var(--n-s); }
.hero-sub { margin: var(--s3) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--t-meta); color: var(--ink-2); }
.hero-sub .btn { min-height: 44px; }
.home-lede { margin-top: var(--s5); }

/* ---------- the day dial (signature) ---------- */
.day { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 900px) { .day { grid-template-columns: 360px minmax(0, 1fr); gap: var(--s6); } }
.dial { position: relative; width: min(340px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.dial svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dial .ring { fill: var(--tile); stroke: var(--grout); stroke-width: 2; }
.dial .night { fill: var(--plum); }
.dial .tick { stroke: var(--grout-faint); stroke-width: 1; }
.dial .kite { stroke: var(--grout); stroke-width: 2; stroke-linejoin: round; }
.dial .kite.past { fill: var(--emerald); }
.dial .kite.next { fill: var(--saffron); }
.dial .kite.later { fill: var(--tile); }
.dial .kite.sun { fill: var(--grout-faint); }
.dial .hand-case { stroke: var(--grout); stroke-width: 9; stroke-linecap: round; }
.dial .hand { stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.dial .now-tag rect { fill: var(--grout); stroke: #fff; stroke-width: 2; }
.dial .now-tag text { font: 800 13px var(--f-text); fill: #fff; }
.dial-wrap { display: grid; gap: var(--s3); justify-items: center; }
.dial-key { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4); margin: 0; padding: 0; font-size: var(--t-meta); font-weight: 700; color: var(--ink-2); }
.dial-key li { display: inline-flex; align-items: center; gap: var(--s2); }
.dial-key i { width: 14px; height: 14px; border: 2px solid var(--grout); transform: rotate(45deg) scale(.8); background: var(--tile); }
.dial-key i.past { background: var(--emerald); }
.dial-key i.next { background: var(--saffron); }
.dial-key i.night { background: var(--plum); }
.dial-help { margin: 0; max-width: 34ch; text-align: center; font-size: var(--t-meta); color: var(--ink-2); }
.dial .hub { fill: var(--grout); }
.dial .lbl { font: 700 13px var(--f-text); fill: var(--ink); }
.dial-c { position: absolute; inset: 27%; border-radius: 50%; display: grid; place-items: center; text-align: center; background: var(--ground); border: 2px solid var(--grout); padding: var(--s2); }
.dial-c .nm { font: 700 var(--t-h3)/1.2 var(--f-head); }
.dial-c .tm { font: 800 var(--n-m)/1 var(--f-text); }
.dial-c .cd { font: 700 var(--t-meta)/1.3 var(--f-text); color: var(--ink-2); margin-top: var(--s1); }
.dial-c .cd b { color: var(--ink); }

/* ---------- the six tiles ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--grout); background: var(--grout); gap: 2px; border-radius: var(--r); overflow: hidden; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles li { background: var(--tile); padding: var(--s3) var(--s3) var(--s4); display: flex; flex-direction: column; gap: 2px; min-height: 92px; }
.tiles .pn { font: 700 var(--t-meta)/1.4 var(--f-head); color: var(--ink-2); }
.tiles .pt { font: 800 var(--n-m)/1.1 var(--f-text); font-variant-numeric: tabular-nums; }
.tiles .pe { font-size: 0.8125rem; color: var(--ink-2); }
.tiles li.past { background: var(--emerald); color: #fff; }
.tiles li.past .pn, .tiles li.past .pe { color: #e6f4ee; }
.tiles li.next { background: var(--saffron); color: var(--on-saffron); }
.tiles li.next .pn, .tiles li.next .pe { color: var(--on-saffron); }
.tiles li.sun .pt { font-size: var(--n-s); }
.method { margin: var(--s3) 0 0; font-size: var(--t-meta); color: var(--ink-2); }
.method b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.btn { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); font: 700 var(--t-meta) var(--f-text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ground); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.btn-main { background: var(--cobalt); color: #fff; }
.btn-main:hover { background: var(--cobalt-deep); color: #fff; }

/* ---------- sections, tables ---------- */
.sec { margin-top: var(--s7); }
@media (max-width: 699px) { .sec { margin-top: var(--s6); } }
.sec > h2 { margin-bottom: var(--s3); }
.sec > p { max-width: 70ch; }
.note { font-size: var(--t-meta); color: var(--ink-2); }
.tbl-wrap { overflow-x: auto; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-meta); }
.tbl th, .tbl td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--grout-faint); text-align: start; white-space: nowrap; }
.tbl thead th { background: var(--ground); font-weight: 700; color: var(--ink-2); position: sticky; top: 0; }
.tbl td.t, .tbl th.t { font-weight: 700; font-size: var(--t-body); }
/* times are set left-to-right, which turns "start" into left; pin them to the header's edge, and centre the capitals grid */
.tbl td.t, .tbl th.t { text-align: right; }
.tbl.cap td.t, .tbl.cap thead th:not(:first-child) { text-align: center; }
.tbl tr.today td, .tbl tr.today th { background: color-mix(in srgb, var(--saffron) 22%, var(--tile)); }
.tbl tr.fri th { color: var(--emerald); }
@media (max-width: 699px) {
  .tbl.cap .x-m { display: none; }
  .tbl.cap th, .tbl.cap td { padding: var(--s2) var(--s1); }
  .tbl.cap tbody th, .tbl.cap thead th:first-child { padding-inline: var(--s3) var(--s2); }
  .tbl.cap tbody th { white-space: normal; line-height: 1.4; }
  .tbl.cap tbody th .note { display: block; font-size: 0.75rem; }
}
.grid2 { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.box { background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); padding: var(--s4); }
.box h3, .box h2.h3 { margin-bottom: var(--s2); }
h2.h3 { font-size: var(--t-h3); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.facts li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--grout-faint); }
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--ink-2); }
.facts b { font-variant-numeric: tabular-nums; }
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
.links a { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--t-meta); }
.links a:hover { border-color: var(--grout); }
.links small { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- qibla ---------- */
.qibla { display: grid; gap: var(--s4); align-items: center; }
@media (min-width: 700px) { .qibla { grid-template-columns: 220px 1fr; } }
.compass { width: 220px; aspect-ratio: 1; margin: 0 auto; }
.compass .face { fill: var(--tile); stroke: var(--grout); stroke-width: 2; }
.compass .needle { fill: var(--emerald); stroke: var(--grout); stroke-width: 1.5; }
.compass .n { font: 700 14px var(--f-text); fill: var(--ink); }

/* ---------- faq ---------- */
.faq details { border-top: 1px solid var(--grout-faint); }
.faq details:last-of-type { border-bottom: 1px solid var(--grout-faint); }
.faq summary { cursor: pointer; padding: var(--s3) 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); min-height: 44px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; width: 10px; height: 10px; border: 2px solid var(--ink-2); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s cubic-bezier(.2,.8,.2,1); flex: none; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { color: var(--ink-2); max-width: 70ch; }

/* ---------- footer ---------- */
.ft { margin-top: var(--s8); background: var(--plum); color: #efe8f1; border-top: 3px solid var(--grout); }
.ft-in { max-width: 1120px; margin: 0 auto; padding: var(--s6) var(--gutter); display: grid; gap: var(--s5); }
@media (min-width: 900px) { .ft-in { grid-template-columns: 1.4fr 1fr 1fr; } }
.ft a { color: #fff; }
.ft p, .ft li { font-size: var(--t-meta); }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.ft .credit { grid-column: 1 / -1; border-top: 1px solid #5d4366; padding-top: var(--s4); color: #d9cfdd; font-size: 0.8125rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* search suggestions */
.hd-list { position: absolute; top: 48px; inset-inline: 0; z-index: 30; list-style: none; margin: 0; padding: 4px; background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); box-shadow: 0 8px 24px rgba(20, 15, 25, .22); }
.hd-list a { display: flex; justify-content: space-between; gap: var(--s3); min-height: 44px; align-items: center; padding: 0 var(--s3); color: var(--ink); text-decoration: none; font-weight: 700; border-radius: 2px; }
.hd-list a small { color: var(--ink-2); font-weight: 400; }
.hd-list li[aria-selected="true"] a, .hd-list a:hover { background: var(--ground); }
.lede { margin-top: var(--s4); max-width: 70ch; }

/* widgets builder */
.wg { display: grid; gap: var(--s5); align-items: start; grid-template-columns: minmax(0, 1fr); }
.wg > * { min-width: 0; }
@media (min-width: 960px) { .wg { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.wg-f { display: grid; gap: var(--s4); }
.wg-f fieldset { border: 0; margin: 0; padding: 0; }
.wg-f legend, .fld > span { font-weight: 700; font-size: var(--t-meta); color: var(--ink-2); margin-bottom: var(--s1); display: block; }
.fld { position: relative; display: block; }
.fld input, .fld textarea { width: 100%; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: var(--s2) var(--s3); font: 700 var(--t-body) var(--f-text); min-height: 44px; }
.fld textarea { font: 400 var(--t-meta)/1.6 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border: 2px solid var(--grout-faint); border-radius: var(--r); background: var(--tile); font-weight: 700; font-size: var(--t-meta); cursor: pointer; }
.chip input:checked + span { background: var(--cobalt); border-color: var(--grout); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.wg-prev { border: 2px dashed var(--grout-faint); border-radius: var(--r); padding: var(--s4); }
.wg-prev iframe { width: 100%; border: 0; display: block; }
.steps { margin: 0; padding-inline-start: var(--s5); display: grid; gap: var(--s2); max-width: 70ch; }

/* ---------- Ramadan ---------- */
.ramadan-box { display: grid; gap: var(--s4); align-items: end; background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); padding: var(--s5); background-image: linear-gradient(var(--plum), var(--plum)); background-size: 100% 6px; background-repeat: no-repeat; }
.ramadan-box h2 { margin-bottom: var(--s2); }
.ramadan-box p { max-width: 70ch; }
.ramadan-box .facts { margin-top: var(--s3); }
@media (min-width: 900px) { .ramadan-box { grid-template-columns: minmax(0, 1fr) auto; } }
.count { display: inline-flex; align-items: baseline; gap: var(--s2); margin-top: var(--s3); padding: var(--s2) var(--s4); background: var(--plum); color: #f4eef5; border: 2px solid var(--grout); border-radius: var(--r); font-weight: 700; }
.count b { font-size: var(--n-s); color: var(--saffron); }
.tbl.imsak td.em { color: var(--cobalt); font-size: var(--n-s); }
.tbl.imsak tr.ten th, .tbl.imsak tr.ten td { background: color-mix(in srgb, var(--plum) 9%, var(--tile)); }
.tbl.imsak tr.today th, .tbl.imsak tr.today td { background: color-mix(in srgb, var(--saffron) 22%, var(--tile)); }
.inline-search { display: flex; gap: var(--s2); margin-top: var(--s4); max-width: 640px; }
.inline-search input { flex: 1; min-width: 0; height: 48px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s4); font: 700 var(--t-body) var(--f-text); }
.inline-search .btn { min-height: 48px; }
.answer { margin-top: var(--s4); max-width: 70ch; padding: var(--s4) var(--s5); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); font-size: 1.125rem; line-height: 1.8; }
.prose { max-width: 72ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); line-height: 1.9; }
.prose ul, .prose ol { padding-inline-start: var(--s5); }
.prose li { margin-bottom: var(--s2); }
.prose blockquote { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); }
.prose blockquote.ayah { font: 400 1.375rem/2.1 var(--f-quran); text-align: center; border-color: var(--emerald); }
.prose blockquote.hadith { border-color: var(--saffron); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: var(--s4); font-size: var(--t-meta); }
.prose th, .prose td { border: 1px solid var(--grout-faint); padding: var(--s2) var(--s3); text-align: start; }
.prose > .tbl-wrap, .prose > .grid2 { max-width: none; margin-bottom: var(--s4); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards a { display: grid; gap: var(--s1); height: 100%; padding: var(--s4); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--grout); }
.cards span { color: var(--ink-2); font-size: var(--t-meta); line-height: 1.7; }
.sources ul { margin: 0; padding-inline-start: var(--s5); font-size: var(--t-meta); color: var(--ink-2); display: grid; gap: var(--s1); }
.sources a { overflow-wrap: anywhere; }

@media print {
  .hd, .ask-bar, .crumbs, .ft, .actions, .inline-search, .count, .faq, .no-print, ins.adsbygoogle { display: none !important; }
  body { background: #fff; }
  .tbl-wrap { border: 1px solid #000; overflow: visible; }
  .tbl th, .tbl td { padding: 3px 6px; }
  .tbl thead th { position: static; }
  .sec { margin-top: 12px; }
}
.tbl.imsak thead small { display: block; font-weight: 400; font-size: 0.75rem; }
@media (max-width: 699px) { .tbl.imsak .o { display: none; } .tbl.imsak th, .tbl.imsak td { padding: var(--s2) 6px; } .tbl.imsak td.em { font-size: 1.125rem; } }
@media print { .tbl.imsak .o { display: table-cell !important; } }
@media (max-width: 699px) { .tbl.imsak .mo { display: none; } }

/* ---------- studio: the designer ---------- */
.studio { display: grid; gap: var(--s5); margin-top: var(--s4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .studio { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: 'stage panel' 'bar panel'; } .st-stage { grid-area: stage; position: sticky; top: var(--s4); } .st-panel { grid-area: panel; } .st-bar { grid-area: bar; } }
.st-frame { background: repeating-conic-gradient(var(--grout-faint) 0 25%, var(--ground) 0 50%) 0 0 / 22px 22px; border: 2px solid var(--grout); border-radius: var(--r); padding: var(--s4); display: grid; place-items: center; }
.st-frame canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; box-shadow: 0 10px 30px rgba(20, 15, 25, .25); background: #fff; }
.st-status { min-height: 1.5em; margin-top: var(--s2); font-size: var(--t-meta); color: var(--ink-2); }
.st-panel { display: grid; gap: var(--s5); }
.st-panel fieldset { border: 0; margin: 0; padding: 0 0 var(--s5); border-bottom: 1px solid var(--grout-faint); display: grid; gap: var(--s3); }
.st-panel fieldset:last-of-type { border-bottom: 0; }
.st-panel legend { font: 700 var(--t-h3)/1.3 var(--f-head); color: var(--ink); margin-bottom: var(--s3); padding: 0; }
.st-panel select { width: 100%; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
.st-help { display: block; font-size: var(--t-meta); color: var(--ink-2); margin-top: var(--s1); }
.st-town { position: relative; }
.st-town .hd-list { top: 72px; }
.st-logo { display: flex; flex-wrap: wrap; gap: var(--s2); }
.st-logo label.btn { position: relative; }
.st-swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s2); }
.sw { position: relative; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw span { display: block; aspect-ratio: 1; border: 2px solid var(--grout-faint); border-radius: var(--r); background: linear-gradient(135deg, var(--p) 0 58%, var(--a) 58% 100%); }
.sw input:checked + span { border-color: var(--grout); box-shadow: 0 0 0 3px var(--tile), 0 0 0 5px var(--grout); }
.sw input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 3px; }
.st-colors { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.st-colors input[type="color"] { padding: 2px; height: 44px; cursor: pointer; }
.st-bar { display: flex; flex-wrap: wrap; gap: var(--s2); }
.st-bar .btn svg { width: 20px; height: 20px; }
@media (max-width: 959px) {
  .st-frame canvas { max-height: 56vh; }
  .st-bar { position: sticky; bottom: 0; z-index: 20; background: var(--ground); padding: var(--s2) 0; border-top: 2px solid var(--grout); margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .st-bar .btn { flex: 1 1 0; justify-content: center; padding: 0 var(--s2); }
}
.ready { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.ready li { background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); padding: var(--s4); }
.ready li p { margin: 0 0 var(--s1); }
.ready .ayah-t { font: 400 1.375rem/2 var(--f-quran); }
.cards.occ { margin-top: var(--s4); }
.st-print { display: none; }
@media print {
  body.st-printing > *:not(.st-print) { display: none !important; }
  body.st-printing .st-print { display: block; width: 100%; height: auto; max-height: 100vh; object-fit: contain; margin: 0 auto; }
  @page { margin: 0; size: A4 portrait; }
}

/* ---------- engagement: your towns, nudges, the alerts sheet, the adhan screen ---------- */
.my-towns { margin-top: var(--s4); }
.my-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.my-list a { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.my-list a:hover { background: var(--ground); }
.my-next { display: inline-flex; gap: var(--s1); align-items: baseline; color: var(--ink-2); font-size: var(--t-meta); }
.my-next b { color: var(--cobalt); font-size: var(--n-s); }
.nudge { position: fixed; z-index: 60; inset-inline: var(--s3); bottom: var(--s3); max-width: 560px; margin-inline: auto; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4); background: var(--plum); color: #f4eef5; border: 2px solid var(--grout); border-radius: var(--r); box-shadow: 0 10px 28px rgba(20, 15, 25, .3); animation: nudge-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.nudge p { margin: 0; flex: 1; font-weight: 700; font-size: var(--t-meta); line-height: 1.6; }
.nudge .btn-main { background: var(--saffron); color: var(--on-saffron); flex: none; }
.nudge .btn-main:hover { background: #f0b53a; color: var(--on-saffron); }
.x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: var(--r); }
.x svg { width: 20px; height: 20px; }
.x:hover { background: rgba(255, 255, 255, .12); }
@keyframes nudge-in { from { transform: translateY(16px); opacity: 0; } }
.sheet { width: min(520px, calc(100vw - 2 * var(--s3))); max-height: 90vh; border: 2px solid var(--grout); border-radius: var(--r); padding: 0; background: var(--ground); color: var(--ink); box-shadow: 0 16px 40px rgba(20, 15, 25, .35); }
.sheet::backdrop { background: rgba(23, 18, 28, .55); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s4); background: var(--cobalt); color: #fff; border-bottom: 2px solid var(--grout); }
.sheet-h h2 { font-size: var(--t-h3); margin: 0; }
.sheet > p, .sheet > ol, .sheet-f { padding: 0 var(--s4); }
.sheet > p:first-of-type, .sheet-f { padding-top: var(--s4); }
.sheet-f { display: grid; gap: var(--s4); padding-bottom: var(--s4); }
.sheet-f p { margin: 0; }
.sheet-f fieldset { border: 0; padding: 0; margin: 0; }
.sheet-f legend { font-weight: 700; font-size: var(--t-meta); color: var(--ink-2); margin-bottom: var(--s2); }
.sheet-f select { width: 100%; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
.sheet > ol { padding-bottom: var(--s2); }
.sheet > .note { padding-bottom: var(--s4); }
.btn.on { background: var(--emerald); color: #fff; }
.adhan-screen { position: fixed; inset: 0; z-index: 80; display: grid; place-content: center; justify-items: center; gap: var(--s4); padding: var(--s5); text-align: center; background: var(--plum); color: #f4eef5; }
.adhan-screen h2 { font-size: clamp(2rem, 8vw, 3.5rem); color: #fff; margin: 0; }
.adhan-screen .a-time { font: 800 clamp(3rem, 14vw, 6rem)/1 var(--f-text); color: var(--saffron); margin: 0; }
.adhan-screen .a-place { margin: 0; font-weight: 700; }
.adhan-screen .btn { min-width: 220px; justify-content: center; }
.adhan-screen .btn-main { background: var(--saffron); color: var(--on-saffron); }

/* ---------- reference pages: qibla, hijri, methods, developers, report ---------- */
.qibla-tool { display: grid; gap: var(--s5); align-items: center; margin-top: var(--s4); }
@media (min-width: 800px) { .qibla-tool { grid-template-columns: 340px 1fr; } }
.compass.big { width: min(320px, 82vw); }
.compass .tk { stroke: var(--grout-faint); stroke-width: 1.5; }
.compass .kaaba { fill: var(--grout); }
.qibla-tool .compass .needle { transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.qibla-tool.aligned .compass .face { fill: color-mix(in srgb, var(--emerald) 18%, var(--tile)); }
.qt-big { margin: 0; display: flex; align-items: baseline; gap: var(--s2); font: 800 var(--n-l)/1 var(--f-text); font-variant-numeric: tabular-nums; }
.qt-big small { font: 700 var(--t-meta) var(--f-text); color: var(--ink-2); }
.qt-line { font-weight: 700; max-width: 52ch; }
.qt-side { display: grid; gap: var(--s3); }
.h3 { font-size: var(--t-h3); margin-bottom: var(--s3); }
.conv { display: grid; gap: var(--s3); }
.conv select { width: 100%; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
.conv-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.conv-out { margin: 0; min-height: 1.6em; font: 700 var(--t-h3)/1.4 var(--f-head); color: var(--cobalt); }
.tbl.cal td { text-align: center; vertical-align: top; padding: var(--s2) var(--s1); white-space: normal; }
.tbl.cal td b { display: block; font-size: var(--t-body); }
.tbl.cal td small { display: block; color: var(--ink-2); font-size: 0.75rem; }
.tbl.cal td.today { background: color-mix(in srgb, var(--saffron) 26%, var(--tile)); }
.tbl.methods td, .tbl.api td { white-space: normal; }
.badge { display: inline-block; padding: 2px var(--s2); border-radius: var(--r); font-size: 0.8125rem; font-weight: 700; border: 1px solid; }
.badge.ok { color: #0b5e46; border-color: var(--emerald); background: color-mix(in srgb, var(--emerald) 12%, var(--tile)); }
.badge.mid { color: #6b4a00; border-color: var(--saffron); background: color-mix(in srgb, var(--saffron) 16%, var(--tile)); }
.badge.low { color: var(--ink-2); border-color: var(--grout-faint); background: var(--ground); }
code { font: 400 0.875rem/1.5 ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
pre.code { background: var(--grout); color: #f1ede4; padding: var(--s4); border-radius: var(--r); overflow-x: auto; text-align: left; }
pre.code code { color: inherit; }
.report { display: grid; gap: var(--s4); max-width: 720px; margin-top: var(--s4); }
.report .conv-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.report select, .report input, .report textarea { width: 100%; }
.report select { min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 599px) { .tbl.methods th:nth-child(2), .tbl.methods td:nth-child(2) { display: none; } }
.compass [data-needle].hide { opacity: 0; }
.conv .conv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1.2fr); }
.mpick { margin-top: var(--s3); padding: var(--s3) var(--s4); background: color-mix(in srgb, var(--saffron) 12%, var(--tile)); border: 2px solid var(--grout); border-radius: var(--r); display: grid; gap: var(--s3); }
.mpick-h { margin: 0; font-weight: 700; font-size: var(--t-meta); }
.mpick-row { display: grid; gap: var(--s2); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
.mpick-row .btn { min-height: 44px; }
.mpick select { width: 100%; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s2); font: 700 var(--t-meta) var(--f-text); }
@media (max-width: 599px) { .mpick-row { grid-template-columns: 1fr 1fr; } .mpick-row .fld:first-child { grid-column: 1 / -1; } }
.prose blockquote.ayah cite { display: block; margin-top: var(--s2); font: 700 var(--t-meta)/1.5 var(--f-text); font-style: normal; color: var(--ink-2); }
.start-switch { margin-top: var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--grout-faint); border-radius: var(--r); background: var(--tile); }
.start-switch p { margin: 0; flex: 1 1 320px; font-size: var(--t-meta); }

/* ---------- the Quran ---------- */
.surahs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.surahs a { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: var(--s3); align-items: center; min-height: 64px; padding: var(--s2) var(--s3); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.surahs a:hover { border-color: var(--grout); }
.surahs .sn { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; position: relative; isolation: isolate; color: #fff; font: 700 0.875rem var(--f-text); }
.surahs .sn::before { content: ''; position: absolute; inset: 6px; z-index: -1; transform: rotate(45deg); background: var(--emerald); border: 2px solid var(--grout); }
.surahs b { font: 700 var(--t-body)/1.4 var(--f-head); }
.surahs small { color: var(--ink-2); font-size: 0.8125rem; }
.qplayer { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: end; gap: var(--s2) var(--s3); margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); }
.qplayer .fld { flex: 1 1 220px; }
.qplayer .fld-s { flex: 0 1 120px; }
.qplayer select { width: 100%; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
.qp-ctl { display: flex; gap: var(--s2); }
.qplayer [aria-pressed="true"] { background: var(--emerald); color: #fff; }
.qplayer .note { flex-basis: 100%; margin: 0; min-height: 0; }
.qplayer .note:empty { display: none; }
.qtools { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.mushaf { --qsize: 1.75rem; margin-top: var(--s4); padding: var(--s5) var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); box-shadow: inset 0 0 0 6px var(--tile), inset 0 0 0 8px var(--emerald); }
.basmala { text-align: center; font: 400 calc(var(--qsize) * 1.05)/2 var(--f-quran); margin: 0 0 var(--s3); }
.verses { font: 400 var(--qsize)/2.3 var(--f-quran); text-align: justify; margin: 0; max-width: none; }
.ay { cursor: pointer; border-radius: 6px; transition: background-color .2s ease; }
.ay:hover { background: color-mix(in srgb, var(--emerald) 8%, transparent); }
.ay.here { background: color-mix(in srgb, var(--saffron) 22%, transparent); }
.ay.now { background: color-mix(in srgb, var(--emerald) 20%, transparent); }
.an { font-family: var(--f-quran); color: var(--emerald); white-space: nowrap; }
.sj { color: var(--plum); }
.pg { display: block; text-align: center; margin: var(--s4) 0 var(--s2); font: 700 0.8125rem/1 var(--f-text); color: var(--ink-2); letter-spacing: 0; }
.pg::before, .pg::after { content: ''; display: inline-block; width: 48px; height: 1px; background: var(--grout-faint); vertical-align: middle; margin: 0 var(--s2); }
.verses > .pg:first-child { margin-top: 0; }
.qnav { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
.quran-credit { margin-top: var(--s6); }
.khatma-box .kh-bar { height: 14px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); overflow: hidden; }
.khatma-box .kh-bar span { display: block; height: 100%; width: 0; background: var(--emerald); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.khatma-box p { margin: var(--s3) 0 0; font-weight: 700; }
.khatma-start .chips { align-items: center; }
.ask-big { display: flex; gap: var(--s2); margin-top: var(--s4); max-width: 760px; }
.ask-big input { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s4); font: 700 var(--t-body) var(--f-text); }
.ask-big .btn { min-height: 52px; padding: 0 var(--s5); }
.answer-box .answer p { margin: 0 0 var(--s2); }
.answer-box .cite { font-size: 0.8125rem; text-decoration: none; font-weight: 700; }
.ask-src { padding-inline-start: var(--s5); display: grid; gap: var(--s1); }
.qa-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); } .qa-list a { font-weight: 700; }

/* ---------- the site-wide Quran player: mini bar that expands ---------- */
.mplayer { position: fixed; z-index: 70; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; pointer-events: none; }
.mplayer > * { pointer-events: auto; }
body.has-mplayer { padding-bottom: 76px; }
body.has-mplayer .nudge { bottom: 84px; }
.mp-bar { position: relative; background: var(--plum); color: #f4eef5; border-top: 3px solid var(--grout); box-shadow: 0 -8px 24px rgba(20, 15, 25, .25); }
.mp-in { display: flex; align-items: center; gap: var(--s3); max-width: 1120px; margin: 0 auto; padding: var(--s2) var(--gutter); min-height: 68px; }
.mp-play, .mp-big { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--grout); background: var(--saffron); color: var(--on-saffron); cursor: pointer; }
.mp-play svg { width: 22px; height: 22px; }
.mp-txt { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--s2); min-height: 48px; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.mp-meta { grid-column: 1; display: flex; gap: var(--s3); min-width: 0; font-size: var(--t-meta); color: #d9cfdd; }
.mp-time { flex: none; direction: ltr; font-variant-numeric: tabular-nums; }
.mp-chev { grid-column: 2; grid-row: 1 / 3; display: grid; place-items: center; width: 32px; height: 32px; color: #d9cfdd; }
.mp-chev svg { width: 20px; height: 20px; }
.mp-txt:hover .mp-chev, .mp-txt:focus-visible .mp-chev { color: #fff; }
.mp-txt:hover .mp-title { text-decoration: underline; text-underline-offset: 3px; }
.mp-speed { direction: ltr; flex: none; min-width: 56px; min-height: 44px; padding: 0 var(--s3); border: 2px solid rgba(255, 255, 255, .5); border-radius: var(--r); background: transparent; color: #fff; font: 700 var(--t-meta) var(--f-text); font-variant-numeric: tabular-nums; cursor: pointer; }
.mp-speed:hover { background: rgba(255, 255, 255, .14); }
.mp-speed[data-fast] { border-color: var(--saffron); color: var(--saffron); }
.mp-close { color: #d9cfdd; }
.mp-bar button:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
@media (max-width: 479px) { .mp-time { display: none; } .mp-in { gap: var(--s2); } }
.mp-title { grid-column: 1; color: #fff; font: 700 var(--t-body)/1.3 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: transparent; color: inherit; cursor: pointer; }
.mp-icon svg { width: 22px; height: 22px; }
.mp-icon:hover { background: rgba(255, 255, 255, .12); }
.mp-prog { position: absolute; inset-inline: 0; top: 0; height: 4px; background: rgba(255, 255, 255, .18); }
.mp-prog span { display: block; height: 100%; width: 0; background: var(--saffron); }
.mp-x { display: flex; flex-direction: column; gap: var(--s3); height: min(86vh, 700px); overflow: hidden; padding: var(--s3) var(--s4) var(--s4); background: var(--ground); color: var(--ink); border-top: 3px solid var(--grout); box-shadow: 0 -12px 32px rgba(20, 15, 25, .3); animation: mp-up .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes mp-up { from { transform: translateY(24px); opacity: 0; } }
.mplayer.open .mp-bar { display: none; }
.mp-x-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.mp-x-title { margin: 0; text-align: center; font-size: var(--t-h3); }
.mp-x-text { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); font: 400 clamp(1.375rem, 4.2vw, 1.75rem)/2.2 var(--f-quran); text-align: center; overscroll-behavior: contain; }
.mp-x-text:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.mp-bsm { margin: 0 0 var(--s3); }
.mp-verses { margin: 0; max-width: none; }
.mp-ay { border-radius: 6px; padding: 0 2px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color .2s ease; }
.mp-ay:hover { background: color-mix(in srgb, var(--emerald) 8%, transparent); }
.mp-ay.now { background: color-mix(in srgb, var(--saffron) 40%, transparent); }
.mp-an { color: var(--emerald); font-size: .72em; white-space: nowrap; padding-inline: .15em; }
.mp-speeds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s1); }
.mp-sp { direction: ltr; min-width: 0; min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); font: 700 var(--t-meta) var(--f-text); font-variant-numeric: tabular-nums; cursor: pointer; }
.mp-sp[aria-pressed="true"] { background: var(--emerald); color: #fff; }
.mp-x-num { margin: 0; text-align: center; font-size: var(--t-meta); color: var(--ink-2); min-height: 1.4em; }
.mp-x-seek { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; font-size: var(--t-meta); color: var(--ink-2); }
.mp-seek { width: 100%; accent-color: var(--emerald); direction: ltr; transform: scaleX(-1); }
.mp-x-ctl { display: flex; justify-content: center; align-items: center; gap: var(--s5); }
.mp-x-ctl .mp-icon { width: 52px; height: 52px; border: 2px solid var(--grout); border-radius: 50%; background: var(--tile); }
.mp-big { width: 72px; height: 72px; }
.mp-big svg { width: 32px; height: 32px; }
.mp-x-foot { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); }
.mp-rec { min-height: 44px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); color: var(--ink); padding: 0 var(--s3); font: 700 var(--t-body) var(--f-text); }
@media (min-width: 900px) { .mp-x { max-width: 720px; margin-inline: auto; width: 100%; border-inline: 3px solid var(--grout); border-radius: var(--r) var(--r) 0 0; } }
@media print { .mplayer { display: none !important; } }
.mp-x > *, .mp-x-foot > * { min-width: 0; }
.mp-rec { width: 100%; }
.mp-x-foot .btn { white-space: nowrap; }

/* ---------- adhkar ---------- */
.dhikr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); counter-reset: dh; }
.dhikr { background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); padding: var(--s4); transition: background-color .25s ease, border-color .25s ease; }
.dhikr.done { background: color-mix(in srgb, var(--emerald) 8%, var(--tile)); border-color: var(--emerald); }
.dt { margin: 0; font: 400 1.25rem/2.1 var(--f-text); max-width: none; }
.dt.quran-t { font: 400 1.5rem/2.2 var(--f-quran); }
.fnref { font-size: 0.7em; color: var(--emerald); font-weight: 700; margin-inline-start: 2px; }
.dbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s3); }
.dcount { display: inline-flex; align-items: baseline; gap: var(--s1); min-width: 88px; min-height: 48px; justify-content: center; padding: 0 var(--s4); border: 2px solid var(--grout); border-radius: 999px; background: var(--saffron); color: var(--on-saffron); font: 800 var(--n-s)/1 var(--f-text); cursor: pointer; }
.dcount small { font: 700 0.8125rem var(--f-text); }
.dhikr.done .dcount { background: var(--emerald); color: #fff; }
.dcount:active { transform: scale(.96); }
.dshare { min-height: 40px; }
.fn { margin: var(--s3) 0 0; padding-inline-start: var(--s5); font-size: var(--t-meta); color: var(--ink-2); display: grid; gap: var(--s1); border-top: 1px solid var(--grout-faint); padding-top: var(--s2); }
.dprogress { position: sticky; top: 0; z-index: 12; margin-top: var(--s3); padding: var(--s3) var(--s4); background: var(--ground); border: 2px solid var(--grout); border-radius: var(--r); display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s3); align-items: center; }
.dprogress .kh-bar { grid-column: 1 / -1; height: 10px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); overflow: hidden; }
.dprogress .kh-bar span { display: block; height: 100%; width: 0; background: var(--emerald); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.dprogress p { margin: 0; font-weight: 700; font-size: var(--t-meta); }
.now-card { display: grid; gap: var(--s1); padding: var(--s5); background: var(--plum); color: #f4eef5; border: 2px solid var(--grout); border-radius: var(--r); text-decoration: none; }
.now-card b { font: 700 var(--t-h2)/1.2 var(--f-head); color: #fff; }
.now-card:hover { background: #4a2f52; color: #f4eef5; }
.adhkar-feat a b { font-family: var(--f-head); }
.adhkar-credit { margin-top: var(--s6); }
.tasbih, .salawat { display: grid; gap: var(--s4); justify-items: center; margin-top: var(--s4); }
.tasbih-btn { width: min(300px, 78vw); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--grout); background: radial-gradient(circle at 50% 40%, #fff, var(--tile) 60%); box-shadow: inset 0 0 0 10px var(--emerald), 0 10px 30px rgba(20, 15, 25, .2); display: grid; place-content: center; justify-items: center; gap: var(--s1); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; color: var(--ink); }
.tasbih-btn:active { transform: scale(.98); }
.tasbih.full .tasbih-btn { box-shadow: inset 0 0 0 10px var(--saffron), 0 10px 30px rgba(20, 15, 25, .2); }
.tb-phrase { font: 700 var(--t-h3)/1.3 var(--f-head); max-width: 80%; text-align: center; }
.tb-count { font: 800 clamp(3rem, 14vw, 4.5rem)/1 var(--f-text); color: var(--emerald); }
.tb-target { font-size: var(--t-meta); color: var(--ink-2); }
.tasbih .box { width: min(420px, 100%); }
.sw-total { display: grid; justify-items: center; gap: var(--s1); margin: 0; text-align: center; }
.sw-total b { font: 800 clamp(2.5rem, 10vw, 3.5rem)/1 var(--f-text); color: var(--emerald); }
.asma { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.asma li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); }
.asma b { font: 400 1.375rem/1.6 var(--f-quran); }
.an2 { color: var(--emerald); font-weight: 700; min-width: 2ch; }

/* the menu on phones: one scrolling row under the search */
@media (max-width: 760px) {
  .nav { display: flex; order: 4; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); gap: var(--s1); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; background: var(--cobalt-deep); }
}

/* ---------- your page ---------- */
.me-today { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.me-tile { display: grid; gap: 2px; align-content: start; min-height: 112px; padding: var(--s3) var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); color: var(--ink); text-decoration: none; }
a.me-tile:hover { background: var(--ground); }
a.me-tile.prayer:hover, a.me-tile.prayer:focus-visible { background: var(--cobalt-deep); color: #fff; }
.me-tile.prayer { background: var(--cobalt); color: #fff; }
.me-tile.prayer .mt-h, .me-tile.prayer .mt-s { color: #dbe5f7; }
.mt-h { font: 700 var(--t-meta)/1.4 var(--f-head); color: var(--ink-2); }
.mt-n { font: 800 var(--n-m)/1.15 var(--f-text); font-variant-numeric: tabular-nums; }
.mt-s { font-size: var(--t-meta); color: var(--ink-2); }
.me-cal { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; max-width: 520px; direction: rtl; }
.me-day { aspect-ratio: 1; border: 2px solid var(--grout); background: var(--tile); transform: rotate(45deg) scale(.72); cursor: pointer; padding: 0; }
.me-day.l1 { background: color-mix(in srgb, var(--emerald) 35%, var(--tile)); }
.me-day.l2 { background: color-mix(in srgb, var(--emerald) 70%, var(--tile)); }
.me-day.l3 { background: var(--emerald); }
.me-day.today { outline: 3px solid var(--saffron); outline-offset: 2px; }
.me-day:focus-visible { outline: 3px solid var(--cobalt); }
.me-cal-d { font-size: var(--t-meta); color: var(--ink-2); margin-top: var(--s3); }
.me-intro { margin: 0 0 var(--s3); font-size: var(--t-meta); color: var(--ink-2); max-width: 520px; }
.me-ends { display: flex; justify-content: space-between; max-width: 520px; margin-top: var(--s1); font-size: var(--t-meta); color: var(--ink-2); }
.me-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s3) 0 0; padding: 0; font-size: var(--t-meta); color: var(--ink-2); }
.me-legend li { display: inline-flex; align-items: center; gap: var(--s2); }
.me-legend i { width: 14px; height: 14px; border: 2px solid var(--grout); background: var(--tile); transform: rotate(45deg) scale(.8); }
.me-legend i.l1 { background: color-mix(in srgb, var(--emerald) 35%, var(--tile)); }
.me-legend i.l2 { background: color-mix(in srgb, var(--emerald) 70%, var(--tile)); }
.me-legend i.l3 { background: var(--emerald); }
.me-bar-l { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin: 0 0 var(--s2); font-size: var(--t-meta); color: var(--ink-2); }
.me-bar-l b { font-size: var(--t-body); color: var(--ink); }
.me-q .kh-bar { height: 14px; border: 2px solid var(--grout); border-radius: var(--r); background: var(--tile); overflow: hidden; margin-bottom: var(--s3); }
.me-q .kh-bar span { display: block; height: 100%; background: var(--emerald); }
.me-backup label.btn { position: relative; }
.dhikr.hdth .nb { font-weight: 700; color: var(--emerald); }
.isnad { margin-top: var(--s2); font-size: var(--t-meta); color: var(--ink-2); }
.isnad summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.isnad p { margin: var(--s1) 0 0; line-height: 1.9; }
.links.chs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } .sec > h2 a { color: inherit; text-decoration: none; }
.adhkar-time { margin-top: var(--s3); padding: var(--s3) var(--s4); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); font-weight: 700; color: var(--ink); }

/* ---------- the header on phones: brand and search on one line, the sections as one row of tabs ---------- */
@media (max-width: 760px) {
  .hd { border-bottom-width: 2px; }
  .hd-in { flex-wrap: wrap; gap: var(--s2) var(--s3); min-height: 0; padding: var(--s2) var(--gutter) 0; }
  .brand { order: 1; gap: var(--s2); }
  .brand svg { width: 30px; height: 30px; }
  .brand b { font-size: 1.0625rem; }
  .brand small { display: none; }
  .hd-search { order: 2; flex: 1 1 0; min-width: 0; max-width: none; margin: 0; }
  .hd-search input { height: 42px; padding-inline-end: var(--s3); padding-inline-start: 46px; font-size: 0.9375rem; text-overflow: ellipsis; }
  .hd-search button { width: 36px; }
  .hd-list { top: 46px; }
  .nav { order: 3; flex: 1 0 100%; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
    -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; background: none; border-radius: 0; min-height: 42px; padding: 0 var(--s3); border-bottom: 3px solid transparent; font-size: 0.9375rem; color: #dbe5f7; }
  .nav a:first-child { padding-inline-start: 0; }
  .nav a:hover { background: none; color: #fff; }
  .nav a[aria-current] { background: none; color: #fff; border-bottom-color: var(--saffron); }
  .ask-bar { display: none; }
}

/* ---------- Muslims in the world ---------- */
.mw-hero { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mw-stat { display: grid; gap: var(--s1); padding: var(--s4); background: var(--tile); border: 2px solid var(--grout); border-radius: var(--r); }
.mw-stat:first-child { background: var(--emerald); color: #fff; }
.mw-stat:first-child span { color: #e3f1eb; }
.mw-stat b { font: 800 var(--n-m)/1.1 var(--f-text); }
.mw-stat span { font-size: var(--t-meta); color: var(--ink-2); }
.mw-top { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.mw-top li { display: grid; grid-template-columns: 32px 1fr auto; grid-template-rows: auto auto; column-gap: var(--s3); align-items: baseline; padding: var(--s3) var(--s4); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); }
.mw-top .n { grid-row: 1 / 3; font-weight: 800; color: var(--emerald); }
.mw-top a { font-weight: 700; }
.mw-top small { grid-column: 2 / 4; color: var(--ink-2); }
.mw-auths { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.mw-auth h3 { margin: 0 0 var(--s1); }
.mw-auth h3 small { font: 400 var(--t-meta) var(--f-text); color: var(--ink-2); }
.mw-auth p { margin: var(--s1) 0 0; }
.mw-auth .badge { margin-inline-end: var(--s1); }
.mw-cia { font-size: var(--t-meta); background: var(--tile); border: 1px solid var(--grout-faint); border-radius: var(--r); padding: var(--s3); text-align: left; }
.country-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

/* ---------- the header tabs: everything fits, the rest under المزيد ---------- */
.more { display: none; }
@media (max-width: 760px) {
  .hd-in { position: relative; }
  .nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .nav .nav-x { display: none; }
  .nav a, .more summary { justify-content: center; text-align: center; padding: 0 2px; font-size: 0.875rem; white-space: nowrap; }
  .nav a:first-child { padding-inline-start: 2px; }
  .more { display: block; position: static; }
  .more summary { list-style: none; display: flex; align-items: center; gap: 4px; min-height: 42px; color: #dbe5f7; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; }
  .more summary::-webkit-details-marker { display: none; }
  .more summary::after { content: ''; width: 7px; height: 7px; border: 2px solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
  .more[open] summary { color: #fff; border-bottom-color: var(--saffron); }
  .more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
  .more-panel { position: absolute; inset-inline: 0; top: 100%; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; background: var(--grout); border-top: 2px solid var(--grout); box-shadow: 0 12px 28px rgba(20, 15, 25, .3); }
  .more-panel a { display: flex; align-items: center; min-height: 52px; padding: 0 var(--s4); background: var(--cobalt-deep); color: #fff; font-weight: 700; font-size: 0.9375rem; text-decoration: none; border: 0; justify-content: flex-start; }
  .more-panel a[aria-current] { background: var(--saffron); color: var(--on-saffron); }
}

/* ---------- flags: each set like a glazed tile in black grout ---------- */
.flag { display: inline-flex; flex: none; width: 30px; height: 22px; padding: 2px; background: var(--tile); border: 2px solid var(--grout); border-radius: 2px; vertical-align: middle; }
.flag img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.flag-sm { width: 22px; height: 16px; padding: 1px; border-width: 1.5px; margin-inline-end: var(--s1); }
.flag-lg { width: 56px; height: 42px; padding: 3px; border-width: 3px; outline: 2px solid var(--saffron); outline-offset: 2px; margin-inline-end: var(--s1); }
.links a.cflag { display: flex; justify-content: flex-start; gap: var(--s3); }
.links a.cflag small { margin-inline-start: auto; }
a.cflag { display: inline-flex; align-items: center; gap: var(--s2); }
h1.with-flag { display: flex; align-items: center; gap: var(--s3); }
h1.with-flag .flag-lg { align-self: center; }
.tbl th a.cflag { gap: var(--s1); }
.mw-top a.cflag { gap: var(--s2); }
@media (max-width: 600px) { .flag-lg { width: 44px; height: 33px; } }
@media (max-width: 600px) { .tbl .flag-sm { display: none; } }

/* ================= UI pass: every page, phone and desktop ================= */
:root { --t-small: 0.75rem; }
b, strong { font-weight: 700; }
h1, h2, h3, .surahs b, .tb-phrase, .now-card b { word-spacing: .12em; }
.tiles .pn, .mt-h { font-family: var(--f-text); }
.lede, .prose p, .note { text-wrap: pretty; }
.flag-lg { outline: 0; }

/* fields: Arabic dots and hamza need a taller line box than the browser default or they are clipped */
:is(input, select, textarea):not([type="range"]):not([type="radio"]):not([type="checkbox"]) { line-height: 1.5; }
.hd-search input, .ask-bar input { height: auto; min-height: 44px; padding-block: var(--s2); font-size: var(--t-body); }
.ask-big input, .inline-search input { height: auto; min-height: 52px; padding-block: var(--s2); }
.hd-search input, .ask-bar input, .ask-big input, .inline-search input, .fld input, .report input, .report select, .report textarea, .mpick select { font-weight: 400; }
.mpick select { font-size: var(--t-body); }
::placeholder { overflow: visible; text-overflow: clip; font-weight: 400; color: var(--ink-2); }
.st-panel .fld textarea { font: 400 var(--t-body)/1.7 var(--f-text); }
[data-out]:empty, .st-help:empty { display: none; }

/* one scale: 12, 14, 16, 20, 26, 34 */
.links small, .surahs small, .dcount small, .pg, .mw-top small, .answer-box .cite, .tiles .pe, .badge, .ft .credit { font-size: var(--t-meta); }
.brand small, .tbl.cal td small, .tbl.imsak thead small, .tbl.cap tbody th .note { font-size: var(--t-small); }
.dial .lbl { font-size: 15px; }
.dial .now-tag text { font-size: 14px; }

/* tap targets */
.crumbs a { display: inline-block; padding-block: 12px; margin-block: -12px; }
.ft li a { display: inline-flex; align-items: center; min-height: 44px; }
.ft ul { gap: 0; }
.nav a, .more summary { min-height: 44px; }
.hd-search button { top: 0; bottom: 0; inset-inline-end: 0; width: 48px; border-radius: 0; border-inline-start: 2px solid var(--grout); }
.dshare, .isnad summary { min-height: 44px; }
.dbar a.note, .qa-list a { display: inline-flex; align-items: center; min-height: 44px; }
.tbl tbody th a { display: inline-block; padding-block: var(--s2); }
.mw-top li { position: relative; }
.mw-top a::after { content: ''; position: absolute; inset: 0; }
.mw-top li:hover { border-color: var(--grout); }

/* choices read as controls; cards and list tiles answer a hover */
.chip span { border-color: var(--ink-2); }
.chip input:checked + span { border-color: var(--grout); }
.khatma-start .btn-main { flex-basis: 100%; justify-content: center; margin-top: var(--s2); }
.cards a { align-content: start; }
.cards a:hover, .surahs a:hover, .links a:hover { background: var(--ground); }
.cards a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.prose h2 { margin: var(--s6) 0 var(--s3); }
.prose h2:first-child { margin-top: 0; }
.prose .ready { padding: 0; }
.prose .ready li { margin: 0; }
.ready li { background: none; border: 0; border-bottom: 1px solid var(--grout-faint); border-radius: 0; padding: var(--s3) 0; }
.box + .note, .tbl-wrap + .note, .facts + .note, .mushaf + .note, .dhikr-list + .note { margin-top: var(--s3); }
.grid2 { align-items: start; }
.tiles li.sun { background: var(--ground); }

/* tables: a table that scrolls says so with a soft edge; badges are labels, not buttons */
.tbl-wrap { background: linear-gradient(to left, var(--tile) 30%, transparent) right / 24px 100% no-repeat local, linear-gradient(to right, var(--tile) 30%, transparent) left / 24px 100% no-repeat local, radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .18), transparent) right / 10px 100% no-repeat scroll, radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .18), transparent) left / 10px 100% no-repeat scroll var(--tile); }
.badge { white-space: nowrap; border-color: transparent; }
.bd-s { display: none; }
.tbl.wrapcells th, .tbl.wrapcells td { white-space: normal; }
.tbl.methods td.t, .tbl.methods td:nth-child(4) { font-size: var(--t-meta); font-weight: 700; }
@media (min-width: 700px) { #month .tbl th small { display: none; } }
@media (max-width: 699px) {
  .tbl th, .tbl td { padding-inline: var(--s2); }
  #month .tbl .hj, #month .tbl .sr { display: none; }
  #month .tbl th[scope="row"] small { display: block; font: 400 var(--t-meta)/1.4 var(--f-text); color: var(--ink-2); }
  .tbl.qb .x-m { display: none; }
  .tbl.reg th:nth-child(2), .tbl.reg td:nth-child(2), .tbl.reg th:nth-child(5), .tbl.reg td:nth-child(5) { display: none; }
  .tbl.reg th, .tbl.reg td { white-space: normal; }
  .tbl.api thead { display: none; }
  .tbl.api, .tbl.api tbody, .tbl.api tr, .tbl.api th, .tbl.api td { display: block; width: 100%; }
  .tbl.api tr { display: grid; gap: var(--s1); padding: var(--s3); border-bottom: 1px solid var(--grout-faint); }
  .tbl.api th, .tbl.api td { padding: 0; border: 0; }
  .tbl.api td:nth-child(2) { order: -1; font-weight: 700; }
}
@media (max-width: 599px) {
  .bd-s { display: inline; }
  .bd-l { display: none; }
  .tbl.cal { table-layout: fixed; }
  .tbl.cal th { padding: var(--s2) 0; white-space: normal; text-align: center; font-size: var(--t-small); }
  .tbl.cal td { padding: var(--s2) 0; }
  .facts.ev li { grid-template-columns: 1fr; gap: var(--s1); }
  .mw-hero { grid-template-columns: 1fr 1fr; }
  .mw-hero > :first-child { grid-column: 1 / -1; }
}
.facts.ev li { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: var(--s2) var(--s4); }
.facts.ev b small { display: block; font-weight: 400; font-size: var(--t-meta); color: var(--ink-2); }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; }
.mw-top { max-width: 720px; }
.mw-country { margin-top: var(--s5); }
.mw-country h2 { font-size: var(--t-h3); }
.qt-big:has([data-bearing]:empty) { display: none; }

/* the town page */
@media (max-width: 699px) { .dial { width: min(290px, 76vw); } .compass.big { width: min(240px, 64vw); } }
.mpick-d { margin-top: var(--s3); }
.mpick-d > summary { display: inline-flex; list-style: none; }
.mpick-d[open] > summary { margin-bottom: var(--s3); }
@media (min-width: 900px) { .ramadan-box { grid-template-columns: minmax(0, 1fr); align-items: start; } .ramadan-box .facts { max-width: 560px; } .ramadan-box > .btn { justify-self: start; } }
.nl { white-space: nowrap; }

/* the Quran, adhkar and counters */
.basmala { font-size: var(--qsize); }
.qhint { margin: var(--s2) 0 0; }
@media (max-width: 699px) { .qplayer { position: static; } .verses { text-align: start; } .mushaf { --qsize: 1.625rem; } }
@media (min-width: 900px) { .mushaf { max-width: 780px; margin-inline: auto; } .dhikr-list, .dprogress { max-width: 820px; } }
.dcount { gap: var(--s2); align-items: center; }
.dhikr.done .dcount small { display: none; }
.dcheck { width: 22px; height: 22px; }
.dreset { min-height: 44px; border: 0; background: none; color: var(--link); text-decoration: underline; font: 700 var(--t-meta) var(--f-text); cursor: pointer; }
.more-btn { margin-top: var(--s3); }
.facts.box { padding: var(--s2) var(--s4); }
.tasbih-btn { grid-template-columns: minmax(0, 1fr); padding-inline: 12%; }
.tb-phrase { max-width: none; }
@media (max-width: 699px) { .tasbih [data-phrases] { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; } }

/* "صفحتي": the month as a grid of 44px targets */
.me-today { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.me-tile.prayer { grid-column: 1 / -1; }
.mt-h { font: 700 var(--t-meta)/1.4 var(--f-text); }
.me-cal { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 700px) { .me-cal { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; } }
.me-day { position: relative; transform: none; background: none; border: 0; min-height: 44px; }
.me-day.l1, .me-day.l2, .me-day.l3 { background: none; }
.me-day::before { content: ''; position: absolute; inset: 18%; transform: rotate(45deg); border: 2px solid var(--grout); background: var(--tile); }
.me-day.l1::before { background: color-mix(in srgb, var(--emerald) 35%, var(--tile)); }
.me-day.l2::before { background: color-mix(in srgb, var(--emerald) 70%, var(--tile)); }
.me-day.l3::before { background: var(--emerald); }
.me-day.today { outline: 0; }
.me-day.today::before { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* the studio: the preview, the buttons and their message stay together */
.st-stage { display: grid; gap: var(--s3); }
.st-bar .btn { white-space: nowrap; }
.st-status { flex-basis: 100%; margin: 0; min-height: 0; }
.st-status:empty { display: none; }
@media (min-width: 960px) { .studio { grid-template-areas: 'stage panel'; } .st-frame canvas { max-height: calc(100vh - 220px); } }
@media (max-width: 959px) {
  .st-stage { display: contents; }
  .st-frame { position: sticky; top: 0; z-index: 10; padding: var(--s2); order: 1; }
  .st-frame canvas { max-height: 30vh; }
  .st-panel { order: 2; }
  .st-bar { order: 3; }
}
@media (max-width: 599px) { .st-swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sw span { aspect-ratio: 2 / 1; min-height: 44px; } }

/* every page keeps its footer at the bottom, even when it is short */
body { min-height: 100dvh; display: flex; flex-direction: column; }
#page { flex: 1 0 auto; }
.ask-big + .links.q, .links.q { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 959px) { .wg-prev { order: -1; } }
@media (min-width: 960px) { .wg-prev { position: sticky; top: var(--s4); } }
.tasbih > *, .salawat > * { min-width: 0; max-width: 100%; }
.tasbih [data-phrases] .chip { flex: none; }
.tasbih [data-phrases] .chip span { white-space: nowrap; }
@media (max-width: 699px) { .tasbih [data-phrases] { max-width: 100%; padding-bottom: var(--s1); } }
/* country cards: flag, then the name with its count under it, so every card is one height */
.links a.cflag { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--s3); padding-block: var(--s2); }
.links a.cflag .flag { grid-row: 1 / 3; }
.links a.cflag small { grid-column: 2; margin-inline-start: 0; }
.links a.cflag > span:not(.flag) { grid-column: 2; }
/* the footer lists sit in two columns on a phone */
@media (max-width: 699px) { .ft ul { grid-template-columns: 1fr 1fr; column-gap: var(--s4); } }
.links a.cflag { align-content: center; row-gap: 0; }
@media (max-width: 699px) {
  .tbl th, .tbl td:not(.t) { white-space: normal; }
  #month .tbl td.t { padding-inline: var(--s1); }
}
@media (max-width: 699px) { #month .tbl th[scope="row"] { white-space: nowrap; } #month .tbl th[scope="row"] small { white-space: nowrap; } }
@media (max-width: 699px) { #month .tbl thead th, #month .tbl td { padding-inline: var(--s1); } #month .tbl th[scope="row"], #month .tbl thead th:first-child { padding-inline: var(--s2); } #month .tbl td.t { font-size: var(--t-meta); } }
