:root {
  --bg: #f5eee2;
  --surface: #fffaf1;
  --surface-2: #f1e7d6;
  --ink: #2c2a24;
  --ink-2: #5a5448;
  --muted: #8c8576;
  --line: #eadfca;
  --gold: #b3863b;
  --gold-soft: #f3e5c6;
  --gold-light: #e6c98c;
  --green: #2f5e4b;
  --green-soft: #e2ebe2;
  --on-green: #fffaf1;
  --hero-1: #3c6d58;
  --hero-2: #22473a;
  --hero-ink: #fffaf0; --hero-ink-2: rgba(251, 245, 232, .82); --hero-eyebrow: #e6c98c; --deco: #e6c98c;
  --ring-track: rgba(255, 250, 240, .16); --ring-arc: #e6c98c; --hero-shadow: rgba(34, 71, 58, .28);
  --page-top: #f6f6f8; --page-bottom: #f8f8f9; --day: 1;
  --ok: #2f7a52;
  --ok-soft: #e0efe3;
  --bad: #b3402e;
  --bad-soft: #f8e1dc;
  --shadow: 0 1px 2px rgba(90, 66, 30, .05), 0 8px 22px rgba(90, 66, 30, .08);
  --radius: 20px;
  /* titles in Fustat; everything else (reading text, labels, buttons, tables, the chart) in IBM Plex Sans Arabic */
  --font-ui: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-display: "Fustat", system-ui, sans-serif;
  --font-sub: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;   /* small titles */
  --text-scale: 1;
  --night: 0; --bg-top: var(--bg); --sky-glow: rgba(255, 253, 240, .55);
  --hero-glow: rgba(255, 244, 214, .10); --lantern-light: rgba(255, 226, 160, .55);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1320; --surface: #121d2e; --surface-2: #1a283c; --ink: #edf1f6; --ink-2: #c3ccd8;
    --muted: #8b97a8; --line: #24344a; --gold: #d9b46c; --gold-soft: #3a3122; --gold-light: #e6c98c;
    --green: #7cc6f0; --green-soft: #17303d; --on-green: #0b1620; --hero-1: #1b3a5a; --hero-2: #0f2238;
    --hero-ink: #fffaf0; --hero-ink-2: rgba(251, 245, 232, .82); --hero-eyebrow: #e6c98c; --deco: #e6c98c;
    --page-top: #102a47; --page-bottom: #0b1320; --day: 0; --ring-track: rgba(255, 250, 240, .16); --ring-arc: #e6c98c; --hero-shadow: rgba(0, 0, 0, .35);
    --night: 1; --bg-top: #102a47; --sky-glow: rgba(124, 198, 240, .16); --hero-glow: rgba(230, 201, 140, .20); --lantern-light: rgba(255, 214, 130, .95);
    --ok: #6cc596; --ok-soft: #173826; --bad: #ef8a76; --bad-soft: #3d1f1a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1320; --surface: #121d2e; --surface-2: #1a283c; --ink: #edf1f6; --ink-2: #c3ccd8;
  --muted: #8b97a8; --line: #24344a; --gold: #d9b46c; --gold-soft: #3a3122; --gold-light: #e6c98c;
  --green: #7cc6f0; --green-soft: #17303d; --on-green: #0b1620; --hero-1: #1b3a5a; --hero-2: #0f2238;
    --hero-ink: #fffaf0; --hero-ink-2: rgba(251, 245, 232, .82); --hero-eyebrow: #e6c98c; --deco: #e6c98c;
    --page-top: #102a47; --page-bottom: #0b1320; --day: 0; --ring-track: rgba(255, 250, 240, .16); --ring-arc: #e6c98c; --hero-shadow: rgba(0, 0, 0, .35);
    --night: 1; --bg-top: #102a47; --sky-glow: rgba(124, 198, 240, .16); --hero-glow: rgba(230, 201, 140, .20); --lantern-light: rgba(255, 214, 130, .95);
  --ok: #6cc596; --ok-soft: #173826; --bad: #ef8a76; --bad-soft: #3d1f1a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: calc(16px * var(--text-scale)); line-height: 1.6;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- POC strip and header ---------- */
.poc-strip {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: var(--gold-soft); color: var(--ink); font-size: 13px; padding: 6px 16px; text-align: center;
}
.poc-strip button {
  border: 1px solid var(--gold); background: transparent; border-radius: 999px; padding: 1px 10px;
  font-size: 12.5px; cursor: pointer; color: var(--ink);
}
.poc-strip button.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
a.day-tile.locked { cursor: pointer; }
.next-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 6px;
  color: var(--muted); font-size: calc(14px * var(--text-scale)); text-align: center;
}
.next-hint svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--gold); }
.empty .btn { margin-top: 8px; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--gold); display: inline-flex; }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 40px; height: 36px;
  padding: 0 10px; cursor: pointer; font-weight: 600; font-size: 14px;
  /* centre an icon or label exactly, rather than letting an svg sit on the text baseline */
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn > svg { display: block; flex: 0 0 auto; }
.streak-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
}
.streak-chip svg { color: var(--gold); }

main { max-width: 680px; margin: 0 auto; padding: 16px; outline: none; }

/* ---------- day hero ---------- */
.hero { padding: 6px 2px 14px; }
.hero-eyebrow { color: var(--muted); font-size: calc(14px * var(--text-scale)); }
.hero-title { font-size: calc(28px * var(--text-scale)); font-weight: 700; margin: 2px 0 2px; line-height: 1.3; }
.hero-juz { color: var(--ink-2); font-size: calc(15px * var(--text-scale)); }
.progress-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
  position: sticky; top: var(--top-h, 57px); z-index: 10;
  transition: padding .2s, box-shadow .2s;
}
.progress-card.stuck { padding: 9px 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); border-radius: 0 0 var(--radius) var(--radius); border-top-color: transparent; }
.progress-card.stuck .progress-head { margin-bottom: 6px; }
.progress-card.stuck .progress-legend { margin-top: 5px; font-size: calc(12px * var(--text-scale)); line-height: 1.5; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.progress-head strong { font-size: calc(15px * var(--text-scale)); }
.progress-head span { color: var(--muted); font-size: calc(14px * var(--text-scale)); font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.bar i { height: 8px; border-radius: 4px; background: var(--surface-2); transition: background .3s; }
.bar i.on { background: var(--green); }
.bar i.on.qa { background: var(--gold); }
.progress-legend { display: flex; gap: 14px; margin-top: 8px; color: var(--muted); font-size: calc(12.5px * var(--text-scale)); }
.progress-legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

.done-banner {
  display: flex; gap: 12px; align-items: center; background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.done-banner p { margin: 0; font-weight: 600; }

/* ---------- items ---------- */
.items { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.item-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0;
  cursor: pointer; text-align: start;
}
.item-text { flex: 1; min-width: 0; }
.item-label { display: block; color: var(--muted); font-size: calc(13px * var(--text-scale)); line-height: 1.4; }
.item-title { display: block; font-weight: 600; font-size: calc(16.5px * var(--text-scale)); line-height: 1.45; }
.chev { flex: 0 0 auto; color: var(--muted); transition: transform .25s; }
.item[data-open="1"] .chev { transform: rotate(180deg); }
.item-body {
  padding: 0 16px 16px; font-family: var(--font-read); font-size: calc(16.5px * var(--text-scale)); line-height: 1.9;
}
html[lang="en"] .item-body { font-family: var(--font-ui); line-height: 1.7; font-size: calc(16.5px * var(--text-scale)); }
.item-body p { margin: 0 0 .7em; }
.item-body ul { margin: 0 0 .7em; padding-inline-start: 1.2em; }
.item-body li { margin-bottom: .35em; }
.item-body .src { color: var(--muted); font-family: var(--font-ui); font-size: calc(13.5px * var(--text-scale)); line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 8px; }
html[lang="ar"] em { font-style: normal; font-weight: 600; }
html[lang="ar"] .src em, html[lang="ar"] .item-body .src { font-weight: 400; }

/* ---------- quiz ---------- */
.quiz-meta { color: var(--muted); font-size: calc(13.5px * var(--text-scale)); }
.q { border-top: 1px solid var(--line); padding: 16px; }
.q:first-child { border-top: 0; }
.q-tag { display: inline-block; font-size: calc(12.5px * var(--text-scale)); color: var(--gold); background: var(--gold-soft); padding: 1px 10px; border-radius: 999px; margin-bottom: 6px; }
.q-stem { font-family: var(--font-read); font-size: calc(16.5px * var(--text-scale)); line-height: 1.85; margin: 0 0 10px; font-weight: 600; }
html[lang="en"] .q-stem { font-family: var(--font-ui); line-height: 1.6; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: start; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; line-height: 1.6;
}
.opt .letter {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); font-weight: 600; font-size: calc(13.5px * var(--text-scale));
}
.opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.opt[aria-pressed="true"] .letter { background: var(--green); border-color: var(--green); color: #fff; }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.dim { opacity: .6; }
.q-actions { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.btn {
  border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 600; cursor: pointer; background: var(--green); color: #fff;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.gold { background: var(--gold); }
.btn.danger { background: var(--bad); color: var(--bg); }
.result { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: calc(14.5px * var(--text-scale)); }
.result.ok { background: var(--ok-soft); }
.result.no { background: var(--bad-soft); }
.result strong { display: block; }
.result .ans { color: var(--ink-2); font-size: calc(13.5px * var(--text-scale)); }

.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 18px; height: 18px; }
.stars .f { color: var(--gold); }
.stars .e { color: var(--line); }
.stars.big svg { width: 40px; height: 40px; }

/* ---------- days list ---------- */
.section-title { font-size: calc(22px * var(--text-scale)); font-weight: 700; margin: 4px 0 12px; }
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.day-tile {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  text-align: center; cursor: pointer; box-shadow: var(--shadow); min-height: 104px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: inherit;
}
.day-tile .n { font-size: calc(24px * var(--text-scale)); font-weight: 700; line-height: 1; }
.day-tile .s { font-size: calc(12px * var(--text-scale)); color: var(--muted); }
.day-tile .wd { font-size: calc(11.5px * var(--text-scale)); font-weight: 600; color: var(--gold); margin-bottom: 2px; }
.day-tile .g { font-size: calc(12px * var(--text-scale)); font-weight: 600; color: var(--ink-2); margin-top: -2px; font-variant-numeric: lining-nums; }
.day-tile.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft), var(--shadow); }
.day-tile.locked { opacity: .45; cursor: default; box-shadow: none; }
.day-tile.full .n { color: var(--green); }
.mini { width: 70%; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.mini b { display: block; height: 100%; background: var(--green); }

/* ---------- me ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: calc(16px * var(--text-scale)); }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat .v { font-size: calc(30px * var(--text-scale)); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: calc(13.5px * var(--text-scale)); }
.rules { margin: 0; padding-inline-start: 1.2em; color: var(--ink-2); font-size: calc(14.5px * var(--text-scale)); }
.rules li { margin-bottom: 4px; }
.muted { color: var(--muted); }
.track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.track b { display: block; height: 100%; background: var(--gold); }
.log { font-size: calc(13.5px * var(--text-scale)); color: var(--ink-2); max-height: 220px; overflow: auto; margin: 0; padding-inline-start: 1.1em; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; color: var(--muted);
  text-decoration: none; font-size: 12.5px; font-weight: 500;
}
.bottom-nav a[aria-current="page"] { color: var(--green); }
.bottom-nav svg { width: 24px; height: 24px; }

/* ---------- sheet, toast ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 25, .45); z-index: 40; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; max-width: 680px; margin: 0 auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,.2); animation: up .25s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { margin: 0 0 6px; font-size: calc(20px * var(--text-scale)); }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: calc(14px * var(--text-scale)); color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper output { min-width: 90px; text-align: center; font-weight: 700; font-size: calc(18px * var(--text-scale)); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.celebrate { text-align: center; padding: 8px 4px 4px; }
.celebrate .moon { color: var(--gold); }
.celebrate h2 { font-size: calc(22px * var(--text-scale)); margin: 10px 0 6px; line-height: 1.5; }
.celebrate p { color: var(--ink-2); margin: 6px 0; }
.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); inset-inline: 16px; margin: 0 auto; max-width: 420px;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-size: calc(14px * var(--text-scale)); text-align: center;
  z-index: 35; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.noscript { padding: 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-top h2 { margin: 0; }
.sheet-top .seg button { padding: 6px 12px; font-size: calc(14px * var(--text-scale)); }
.theme-btn { display: inline-grid; place-items: center; padding: 0; width: 40px; color: var(--gold); }
.theme-btn svg { width: 20px; height: 20px; }
#themeSlot { display: inline-flex; }
.sheet-controls { display: flex; align-items: center; gap: 8px; }

/* ---------- today tab day number, side menu ---------- */
.bottom-nav .nav-day { fill: currentColor; font-family: var(--font-display); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: lining-nums; }
.menu-btn { display: inline-grid; place-items: center; padding: 0; width: 40px; color: var(--ink); }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 42; width: min(320px, 86vw); overflow: auto;
  background: var(--surface); box-shadow: 0 0 30px rgba(0,0,0,.25); display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  animation: slide-ltr .22s ease-out;
}
[dir="rtl"] .drawer { animation-name: slide-rtl; }
@keyframes slide-ltr { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-rtl { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* the menu's title and close button stay at the top while the menu scrolls under them */
.drawer-head { position: sticky; top: calc(-14px - env(safe-area-inset-top)); z-index: 3;
  margin: calc(-14px - env(safe-area-inset-top)) -16px 4px; padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.drawer-head h2 { margin: 0; font-size: calc(20px * var(--text-scale)); }
.close-x { display: inline-grid; place-items: center; padding: 0; width: 40px; color: var(--ink-2); }
.account { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); flex: 0 0 auto; }
.acc-name { font-weight: 700; font-size: calc(17px * var(--text-scale)); }
.acc-country { font-size: calc(14px * var(--text-scale)); }
.btn.wide { width: 100%; }
.drawer-sub { margin: 22px 0 2px; font-size: calc(15px * var(--text-scale)); color: var(--muted); font-weight: 600; }
.drawer .seg button { padding: 7px 12px; font-size: calc(14px * var(--text-scale)); }
.drawer-foot { margin-top: auto; padding-top: 20px; }
.drawer-foot p { font-size: calc(12.5px * var(--text-scale)); margin: 10px 0 0; text-align: center; }

/* ---------- divider at the top of an opened item ---------- */
.orn-rule { display: flex; align-items: center; gap: 10px; color: var(--gold); margin: 0 0 12px; }
.orn-rule i { flex: 1; height: 1px; background: linear-gradient(to var(--orn-dir, left), transparent, color-mix(in srgb, var(--gold) 55%, transparent)); }
.orn-rule i:last-child { --orn-dir: right; }
[dir="ltr"] .orn-rule i { --orn-dir: right; }
[dir="ltr"] .orn-rule i:last-child { --orn-dir: left; }
.orn-rule svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Noor-style theme: cream, deep green, gold; serif headings ---------- */
body {
  background: radial-gradient(110% 50% at 78% -6%, var(--sky-glow), transparent 62%) no-repeat,
    linear-gradient(var(--page-top), var(--page-bottom) 560px) no-repeat, var(--page-bottom);
}
/* a faint starfield, shown only at night (dark mode) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: calc(var(--night) * .9);
  background-image:
    radial-gradient(circle at 18px 26px, rgba(255,255,255,.75) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 141px 88px, rgba(255,255,255,.55) 0 .7px, transparent 1.3px),
    radial-gradient(circle at 77px 170px, rgba(255,255,255,.6) 0 .6px, transparent 1.2px),
    radial-gradient(circle at 203px 40px, rgba(255,236,190,.8) 0 1px, transparent 1.7px),
    radial-gradient(circle at 260px 210px, rgba(255,255,255,.5) 0 .7px, transparent 1.3px),
    radial-gradient(circle at 330px 120px, rgba(255,255,255,.65) 0 .9px, transparent 1.5px);
  background-size: 233px 241px, 307px 263px, 199px 211px, 389px 347px, 283px 293px, 433px 401px;
}
.top { background: color-mix(in srgb, var(--page-top) 72%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 50%, transparent); }
.brand-name { font-family: var(--font-display); font-size: 25px; color: var(--green); letter-spacing: 0; }
.icon-btn, .streak-chip { border-radius: 999px; border-color: var(--line); background: var(--surface); }
.menu-btn, .theme-btn { width: 40px; }
.btn { border-radius: 999px; background: var(--green); color: var(--on-green); padding: 11px 22px; box-shadow: 0 4px 12px color-mix(in srgb, var(--green) 25%, transparent); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); box-shadow: none; }
.btn.gold { background: var(--gold); color: var(--on-green); }
.btn.danger { background: var(--bad); color: var(--bg); box-shadow: none; }
.seg { border-radius: 999px; background: var(--surface); }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--on-green); border-radius: 999px; }
.sheet h2, .drawer-head h2, .section-title, .celebrate h2, .card h3 { font-family: var(--font-display); }
.sheet h2, .drawer-head h2 { font-size: calc(24px * var(--text-scale)); }
.section-title { font-size: calc(28px * var(--text-scale)); }
.card h3 { font-size: calc(20px * var(--text-scale)); }
.sheet { border-radius: 26px 26px 0 0; background: var(--surface); }
.poc-strip button.primary { color: var(--on-green); }

/* hero card: a daytime sky in light mode, the night sky in dark mode */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--hero-ink);
  background: linear-gradient(155deg, var(--hero-1), var(--hero-2)); border-radius: 26px;
  padding: 20px 22px 22px; margin-bottom: 14px; box-shadow: 0 10px 26px var(--hero-shadow);
}
.hero-eyebrow { color: var(--hero-eyebrow); font-size: calc(14px * var(--text-scale)); font-weight: 600; }
.hero-title { font-family: var(--font-display); font-size: calc(32px * var(--text-scale)); line-height: 1.35; margin: 2px 0 4px; color: var(--hero-ink); font-weight: 700; }
.hero-juz { color: var(--hero-ink-2); font-size: calc(14.5px * var(--text-scale)); max-width: 30em; }
.deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; color: var(--deco); }
.deco .mandala { position: absolute; }
.deco .cres { position: absolute; top: 10px; inset-inline-end: -8px; width: 140px; height: 140px; opacity: .5; }
.hero:not(.hero-center) { min-height: 162px; }
.deco .mandala { bottom: -64px; inset-inline-start: -54px; width: 132px; height: 132px; opacity: .2; animation: spin 180s linear infinite reverse; }
.deco .sparkle { position: absolute; width: 12px; height: 12px; opacity: .8; }
.deco .sparkle:nth-child(3) { top: 18px; inset-inline-end: 132px; }
.deco .sparkle:nth-child(4) { bottom: 22px; inset-inline-end: 26px; width: 9px; height: 9px; opacity: .55; }
@keyframes spin { to { transform: rotate(360deg); } }

/* journey: the streak ring */
.hero-center { text-align: center; padding-bottom: 20px; }
.hero-center .hero-title { font-size: calc(28px * var(--text-scale)); }
.ring { position: relative; width: 156px; height: 156px; margin: 8px auto 10px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
[dir="rtl"] .ring svg { transform: rotate(-90deg) scaleY(-1); }
.ring-track { fill: none; stroke: var(--ring-track); stroke-width: 7; }
.ring-arc { fill: none; stroke: var(--ring-arc); stroke-width: 7; stroke-linecap: round; }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-n { font-family: var(--font-display); font-size: 54px; line-height: 1; color: var(--hero-ink); font-weight: 700; }
.ring-l { font-size: 13px; color: var(--hero-ink-2); margin-top: 6px; max-width: 110px; line-height: 1.35; }
.stat { border-radius: var(--radius); }
.stat .v { font-family: var(--font-display); font-size: calc(34px * var(--text-scale)); display: flex; align-items: center; gap: 6px; }
.stat .v .stars svg { width: 24px; height: 24px; }

/* progress card */
.progress-card { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.progress-head strong { font-family: var(--font-display); font-size: calc(19px * var(--text-scale)); }
.bar i { height: 7px; border-radius: 99px; }

/* item rows: gold section icon, serif title, green check */
.items { gap: 12px; }
.item { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 80%, transparent); transition: border-color .25s, box-shadow .25s; }
.item[data-open="1"] { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-soft) 70%, transparent), var(--shadow); }
.item-head { padding: 13px 16px; gap: 14px; }
.item-ic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--gold-soft) 65%, var(--surface)); color: var(--gold);
}
.item-ic svg { width: 26px; height: 26px; }
.item-title { font-family: var(--font-display); font-weight: 700; font-size: calc(19px * var(--text-scale)); line-height: 1.45; }
html[lang="en"] .item-title { font-size: calc(20px * var(--text-scale)); }
.item-label { font-size: calc(12.5px * var(--text-scale)); }
.status { flex: 0 0 auto; display: inline-flex; }
.status svg { width: 28px; height: 28px; }
.st-c { fill: none; stroke: color-mix(in srgb, var(--gold) 45%, var(--line)); stroke-width: 1.4; transition: fill .25s, stroke .25s; }
.st-t { fill: none; stroke: color-mix(in srgb, var(--gold) 55%, var(--line)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status:not(.on) .st-t { opacity: 0; }
.status.on .st-c { fill: var(--green); stroke: var(--green); }
.status.on .st-t { stroke: var(--on-green); stroke-width: 2.4; }
.item.quiz.seen .item-ic { background: var(--gold); color: var(--on-green); }
.opt { border-radius: 16px; }
.opt[aria-pressed="true"] .letter, .opt.right .letter { color: var(--on-green); }
.done-banner { border-radius: var(--radius); }

/* days grid */
.day-tile { border-radius: 18px; border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.day-tile .n { font-family: var(--font-display); font-size: calc(28px * var(--text-scale)); }

/* bottom nav */
.bottom-nav { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
.bottom-nav a[aria-current="page"] { color: var(--green); font-weight: 600; }
/* lining figures in headings and numbers */
.hero-title, .ring-n, .stat .v, .day-tile .n, .item-title, .section-title, .card h3, .sheet h2, .progress-head strong, .brand-name { font-variant-numeric: lining-nums; }
.stat-row { margin-bottom: 12px; }

/* Fustat for the brand and headings */
.brand-name { font-weight: 800; font-size: 24px; }
.hero-title { font-weight: 800; font-size: calc(29px * var(--text-scale)); }
.hero-center .hero-title { font-size: calc(26px * var(--text-scale)); }
.item-title { font-weight: 700; font-size: calc(17px * var(--text-scale)); }
html[lang="en"] .item-title { font-size: calc(17px * var(--text-scale)); }
.ring-n { font-weight: 800; font-size: 50px; }
.stat .v { font-weight: 800; font-size: calc(30px * var(--text-scale)); }
.section-title, .card h3, .sheet h2, .drawer-head h2, .celebrate h2, .progress-head strong { font-weight: 700; }
.card h3 { font-size: calc(18px * var(--text-scale)); }
.sheet h2, .drawer-head h2 { font-size: calc(22px * var(--text-scale)); }
.progress-head strong { font-size: calc(16.5px * var(--text-scale)); }
.day-tile .n { font-weight: 800; font-size: calc(26px * var(--text-scale)); }
.progress-head span { font-variant-numeric: normal; }

/* the calligraphic crescent: Ruqaa letters, subset to the three words it uses */
.cres-text { font-family: "Aref Ruqaa", serif; font-weight: 700; }
.cres-wrap { display: block; width: 132px; height: 132px; margin: 0 auto; color: var(--gold); }
.cres-wrap .cres { width: 100%; height: 100%; }
.hero-center .deco .cres { top: 6px; width: 150px; height: 150px; opacity: .38; }

/* the calligraphic crescent «مبارك عليكم الشهر» (crescent.webp, the owner's Gemini image), shown in gold through a mask;
   it replaces the drawn crescent */
.deco .cres, .cres-wrap .cres { display: none; }
.cres-img {
  display: block; position: absolute; background: currentColor;
  -webkit-mask: url(assets/crescent.webp) center / contain no-repeat; mask: url(assets/crescent.webp) center / contain no-repeat;
}
.deco .cres-img { top: 10px; inset-inline-end: -8px; width: 140px; height: 140px; opacity: .55; }
.hero-center .deco .cres-img { top: 6px; width: 150px; height: 150px; opacity: .42; }
.cres-wrap { position: relative; }
.cres-wrap .cres-img { inset: 0; }

/* ---------- Ramadan nights: moonlight, a lantern, twinkling stars ---------- */
.deco .glow { position: absolute; top: -40px; inset-inline-end: -40px; width: 260px; height: 220px; background: radial-gradient(closest-side, var(--hero-glow), transparent); }
.deco .lantern {
  position: absolute; top: -2px; inset-inline-end: 132px; width: 20px; height: 54px; color: var(--gold-light);
  transform-origin: 50% 0; animation: sway 5.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 calc(var(--night) * 6px) var(--lantern-light));
}
.lantern-glass { fill: var(--lantern-light); opacity: calc(.35 + var(--night) * .45); }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
/* on the journey card the lantern hangs inside the crescent's hollow, clear of the corner ornament */
.hero-center .deco .lantern { inset-inline-end: 78px; }
.deco .tw { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff6df; box-shadow: 0 0 6px rgba(255, 240, 200, .9); opacity: calc(var(--night) * .75); animation: twinkle 3.2s ease-in-out infinite; }
.deco .tw:nth-of-type(2) { top: 16px; inset-inline-start: 38%; animation-delay: .4s; }
.deco .tw:nth-of-type(3) { top: 42px; inset-inline-start: 22%; width: 2px; height: 2px; animation-delay: 1.3s; }
.deco .tw:nth-of-type(4) { top: 12px; inset-inline-start: 12%; animation-delay: 2.1s; }
.deco .tw:nth-of-type(5) { bottom: 18px; inset-inline-start: 46%; width: 2px; height: 2px; animation-delay: .9s; }
.deco .tw:nth-of-type(6) { top: 30px; inset-inline-end: 44%; width: 2px; height: 2px; animation-delay: 2.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(.6); filter: brightness(.7); } 50% { transform: scale(1.15); filter: brightness(1.3); } }

/* hanging lanterns, butterflies and a flowering vine in the lower corner (corner-lanterns.webp, the owner's Gemini image),
   drawn in gold through a mask; it replaces the mandala and does not turn */
.deco .mandala { display: none; }
.deco .corner-img {
  display: block; position: absolute; bottom: -40px; inset-inline-start: 0; width: 136px; height: 249px; opacity: .5;
  background: currentColor; -webkit-mask: url(assets/corner-lanterns.webp) right bottom / contain no-repeat; mask: url(assets/corner-lanterns.webp) right bottom / contain no-repeat;
}
/* the artwork's corner is bottom-right; mirror it when the card's corner is bottom-left (English) */
[dir="ltr"] .deco .corner-img { transform: scaleX(-1); }
/* the box is 1.44x the old one and sits partly below the card: the new artwork draws its lanterns and butterflies smaller
   and higher up, so this keeps them at their old size and position (the lowest vines are clipped by the card) */
.hero-center .deco .corner-img { bottom: -65px; width: 222px; height: 406px; opacity: .45; }
/* the corner mandala (live site) fades out toward its tips, and no longer turns */
.deco .mandala { animation: none; }
.deco .mandala {
  -webkit-mask: radial-gradient(closest-side, #000 38%, rgba(0, 0, 0, .55) 62%, transparent 100%);
  mask: radial-gradient(closest-side, #000 38%, rgba(0, 0, 0, .55) 62%, transparent 100%);
}
/* keep the hero text clear of the lantern corner */
.hero:not(.hero-center) { padding-inline-start: 84px; }
.hero-center .hero-juz { padding-inline: 64px; }

/* English: mirror the crescent so its hollow faces into the card, as it does in Arabic */
[dir="ltr"] .deco .cres, [dir="ltr"] .deco .cres-img { transform: scaleX(-1); }

/* the sun-warm glow behind the crescent reads as daylight; in the light sky the ornaments sit a little stronger */
.hero .sparkle { color: var(--deco); }

/* light mode: a sunset over the mosque (bg-mosque-sunset.jpg, the owner's Gemini image) filling the screen, fixed;
   it is cut from the sides on narrow screens so the mosque and the walkers stay in view.
   bg-mosque.jpg, sky-sea.svg and sky-day.svg are earlier alternatives. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--day);
  /* a pale veil over the lower part softens the figures behind the text near the bottom */
  background: linear-gradient(rgba(248, 248, 249, 0) 55%, rgba(248, 248, 249, .6) 82%, rgba(248, 248, 249, .7)),
    url(assets/bg-mosque-sunset.jpg) center bottom / cover no-repeat;
}

/* ---------- the Ramadan timetable (imsakia) ---------- */
.fast-times { display: flex; gap: 22px; margin-top: 12px; }
.fast-times span { display: block; font-size: calc(13px * var(--text-scale)); font-weight: 600; color: var(--hero-eyebrow); }
.fast-times strong { font-size: calc(24px * var(--text-scale)); font-weight: 800; color: var(--hero-ink); font-variant-numeric: lining-nums tabular-nums; }
.imsak-place .field { margin: 0; }
.imsak-place p { font-size: calc(13px * var(--text-scale)); margin: 8px 0 0; }
.imsak-card { padding-inline: 10px; }
.imsak-card h3 { padding-inline: 6px; }
.table-wrap { overflow-x: auto; }
.imsak-table { width: 100%; border-collapse: collapse; font-size: calc(13px * min(var(--text-scale), var(--table-scale-max, 1.06))); font-variant-numeric: lining-nums tabular-nums; }
.imsak-table thead th { font-size: calc(11.5px * min(var(--text-scale), var(--table-scale-max, 1.06))); font-weight: 600; color: var(--muted); padding: 4px 2px 8px; white-space: nowrap; }
.imsak-table td, .imsak-table tbody th { text-align: center; padding: 7px 2px; border-top: 1px solid var(--line); white-space: nowrap; }
.imsak-table tbody th { font-weight: 400; line-height: 1.15; }
.imsak-table tbody th b { display: block; font-size: calc(14px * min(var(--text-scale), var(--table-scale-max, 1.06))); font-weight: 700; }
.imsak-table tbody th small { display: block; font-size: calc(10.5px * min(var(--text-scale), var(--table-scale-max, 1.06))); color: var(--muted); }
.imsak-table tbody th i { display: block; font-style: normal; font-size: calc(10.5px * min(var(--text-scale), var(--table-scale-max, 1.06))); font-weight: 600; color: var(--gold); }
/* weekday, day number and date: a little air between the three lines */
.imsak-table tbody th { padding-block: 9px; line-height: 1.3; }
.imsak-table tbody th b { margin-block: 3px; }
/* the two times that bound the fast */
.imsak-table .c-imsak, .imsak-table .c-maghrib { color: var(--green); font-weight: 700; }
/* Fridays: a faint gold wash, lighter than today's row so today still stands out */
.imsak-table tr.fri td, .imsak-table tr.fri th { background: color-mix(in srgb, var(--gold) 4%, transparent); }
.imsak-table tr.fri th i { font-weight: 800; }
.imsak-table tr.now td, .imsak-table tr.now th { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.imsak-table tr.now th b { color: var(--green); }
.imsak-note { font-size: calc(12.5px * var(--text-scale)); margin: 10px 6px 0; line-height: 1.6; }

/* ---------- calendar: Fridays carry a soft gold tint ---------- */
/* Fridays: the same tile as other days, a touch warmer */
.day-tile.fri { background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.day-tile.fri .wd { font-weight: 800; }

/* ---------- timetable chart: Imsak and Iftar through the month ----------
   series colours checked for colour-blind separation and contrast on each surface (dataviz validator) */
:root { --chart-imsak: #1f7a55; --chart-iftar: #b07f2e; --chart-fast: #7a5cc0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-imsak: #2f96d4; --chart-iftar: #b98935; --chart-fast: #c8649a; } }
:root[data-theme="dark"] { --chart-imsak: #2f96d4; --chart-iftar: #b98935; --chart-fast: #c8649a; }
.chart-sub { font-size: calc(12.5px * var(--text-scale)); margin: -2px 0 10px; line-height: 1.6; }
.chart-wrap { position: relative; }
.fast-chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; font-family: var(--font-ui); }
.fast-chart .grid { stroke: var(--line); stroke-width: 1; }
/* lining digits only: this font's tabular setting also widens the space before «ص/م» and AM/PM */
/* the chart is drawn 1:1 in CSS pixels, so these sizes are what you see, matched to the timetable below it:
   panel titles as the table's column headers (11.5px), axis labels as its times (13px) */
.fast-chart .tick { fill: var(--muted); font-size: 13px; font-variant-numeric: lining-nums; }
.fast-chart .axis-cap { font-size: 10.5px; font-variant-numeric: normal; }
.fast-chart .ct-title { fill: var(--muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: lining-nums; }
.fast-chart .ct-name { fill: var(--ink); font-weight: 700; }
.fast-chart .ln, .fast-chart .sw { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fast-chart .sw { stroke-width: 3; }
.fast-chart .imsak { stroke: var(--chart-imsak); }
.fast-chart .iftar { stroke: var(--chart-iftar); }
.fast-chart .dot { stroke: var(--surface); stroke-width: 2; }
.fast-chart .dot.imsak { fill: var(--chart-imsak); }
.fast-chart .dot.iftar { fill: var(--chart-iftar); }
.fast-chart .ct-hover { display: none; }
.fast-chart .ct-hover.on { display: inline; }
.fast-chart .ct-cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.fast-chart .ct-hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); z-index: 2; pointer-events: none; white-space: nowrap;
  display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.chart-tip[hidden] { display: none; }
.chart-tip .k { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }
.chart-tip .k.imsak { background: var(--chart-imsak); }
.chart-tip .k.iftar { background: var(--chart-iftar); }
.chart-tip .k.fast { background: var(--chart-fast); }
.fast-chart .fast { stroke: var(--chart-fast); }
.fast-chart .dot.fast { fill: var(--chart-fast); }
/* the band: each day's fast as a bar on the full clock; today's bar at full strength */
.fast-chart .band { fill: var(--chart-fast); opacity: .38; }
.fast-chart .band.now { opacity: 1; }
.fast-chart .sw-box.fast { fill: var(--chart-fast); stroke: none; }
/* chart numbers use the timetable's fixed-width digits; only the digits, so word spaces stay normal */
.fast-chart .tn { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- the daily self-review (ورد المحاسبة) ---------- */
.bottom-nav a span { font-size: 11.5px; white-space: nowrap; }
.wird-score { display: flex; align-items: center; gap: 12px; margin-top: 12px;
  margin-inline-end: 96px; }   /* the bar stretches, but stops before the crescent on that side */
.wird-score strong { font-size: calc(18px * var(--text-scale)); font-weight: 800; color: var(--hero-ink); font-variant-numeric: lining-nums; white-space: nowrap; }
.wird-bar { flex: 1; height: 8px;
  border-radius: 4px; background: color-mix(in srgb, var(--hero-ink) 18%, transparent); overflow: hidden; }
.wird-bar b { display: block; height: 100%; border-radius: 4px; background: var(--gold-light, var(--gold)); }
.wird-days { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.wird-days span { font-weight: 700; }
.wird-days .icon-btn { width: 40px; height: 40px; min-width: 0; padding: 0; }
.wird-days .icon-btn[disabled] { opacity: .35; cursor: default; }
.wird-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.wird-head h3 { margin: 0; }
.wird-head span { font-size: calc(13px * var(--text-scale)); font-variant-numeric: lining-nums; }
/* survey rows: the item, then its three answers side by side as a pill switch */
.wird-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.wird-head + .wird-q { border-top: 0; }
.wird-label { flex: 1 1 auto; min-width: 0; font-size: calc(15.5px * var(--text-scale)); line-height: 1.4; }
.wird-scale { flex: 0 0 auto; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.wird-scale button {
  font: inherit; font-size: calc(12.5px * var(--text-scale)); font-weight: 600; padding: 6px 10px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.wird-scale button.on.opt-top { background: var(--green); color: var(--on-green); }
.wird-scale button.on.opt-good { background: color-mix(in srgb, var(--green) 28%, var(--surface)); color: var(--ink); }
.wird-scale button.on.opt-mid { background: color-mix(in srgb, var(--gold) 32%, var(--surface)); color: var(--ink); }
.wird-scale button.on.opt-low { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); color: var(--ink); }
.wird-note {
  width: 100%; font: inherit; font-size: calc(15px * var(--text-scale)); line-height: 1.7; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical;
}
.wird-sub { font-size: calc(13px * var(--text-scale)); margin: -2px 0 10px; }
.wird-month { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.wd-cell {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line);
  font: inherit; font-size: 12.5px; font-weight: 600; font-variant-numeric: lining-nums; color: var(--ink); background: var(--surface); cursor: pointer; padding: 0;
}
/* one hue, deeper as more of the day is done */
.wd-cell.l1 { background: color-mix(in srgb, var(--green) 18%, var(--surface)); }
.wd-cell.l2 { background: color-mix(in srgb, var(--green) 38%, var(--surface)); }
.wd-cell.l3 { background: color-mix(in srgb, var(--green) 62%, var(--surface)); color: var(--on-green, #fff); }
.wd-cell.l4 { background: var(--green); color: var(--on-green, #fff); border-color: var(--green); }
.wd-cell.cur { outline: 2px solid var(--gold); outline-offset: 1px; }
.wd-cell.x { opacity: .4; cursor: default; }
/* brothers' prayers have four answers: the item on its own line, the answers across the full width below it */
.wird-q.wide { flex-wrap: wrap; gap: 8px; }
.wird-q.wide .wird-label { flex-basis: 100%; }
.wird-q.wide .wird-scale { width: 100%; }
.wird-q.wide .wird-scale button { flex: 1; padding-inline: 4px; }
/* the one-time brother/sister question at the top of the prayer card */
.wird-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin: 6px 0 4px;
  border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, var(--surface)); font-size: calc(14px * var(--text-scale)); }
/* the band section's title row folds it open and closed */
.fast-chart .ct-toggle { cursor: pointer; outline: none; }
.fast-chart .ct-toggle-hit { fill: transparent; }
.fast-chart .ct-chev { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fast-chart .ct-toggle:hover .ct-chev, .fast-chart .ct-toggle:focus-visible .ct-chev { stroke: var(--ink); }
.fast-chart .ct-toggle:focus-visible .ct-toggle-hit { fill: color-mix(in srgb, var(--gold) 12%, transparent); }

/* swiping between tabs: the new page slides in a little from the side the finger came from */
@keyframes slide-in-r { from { transform: translateX(32px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes slide-in-l { from { transform: translateX(-32px); opacity: .2; } to { transform: none; opacity: 1; } }
#view.slide-r { animation: slide-in-r .22s ease-out; }
#view.slide-l { animation: slide-in-l .22s ease-out; }
@media (prefers-reduced-motion: reduce) { #view.slide-r, #view.slide-l { animation: none; } }

/* ---------- type levels: Fustat for big and mid-size titles, Readex Pro for small titles, IBM Plex Sans Arabic for the rest ---------- */
.card h3, .item-title, .progress-head strong, .q-stem, .wird-days span { font-family: var(--font-display); }
.item-label, .hero-eyebrow, .q-tag, .drawer-sub, .wird-label { font-family: var(--font-sub); }

/* the verse on the leaderboard and self-review cards */
.aya { margin: 12px 0; padding: 12px 14px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); }
.aya blockquote { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: calc(21px * var(--text-scale)); line-height: 1.9; color: var(--green); }
.aya figcaption { margin-top: 2px; font-size: calc(12.5px * var(--text-scale)); color: var(--muted); }
/* three scores in a row on the Journey page */
.stat-row.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row.three .stat .v { font-size: calc(26px * var(--text-scale)); }
.stat-row.three .stat .l { font-size: calc(12px * var(--text-scale)); }
/* the bottom nav's labels in Fustat, like the titles */
.bottom-nav a span { font-family: var(--font-display); font-weight: 600; }
/* "you and 2,254 others…": a row of faces and the line, on the leaderboard card */
.together { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); }
.together p { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: calc(15.5px * var(--text-scale)); line-height: 1.5; color: var(--ink); }
.faces { flex: 0 0 auto; display: inline-flex; }
.faces i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); margin-inline-start: -9px; }
.faces i:first-child { margin-inline-start: 0; background: var(--green); }
.faces i:nth-child(2) { background: var(--gold); }
.faces i:nth-child(3) { background: color-mix(in srgb, var(--green) 45%, var(--gold)); }
.together-note { margin: 6px 2px 12px; font-size: calc(12px * var(--text-scale)); color: var(--muted); }
/* the daily "what is worth competing for" verse: quieter, under the leaderboard text */
.aya.small { margin: 12px 0 0; padding: 8px 12px; background: none; border-style: dashed; }
.aya.small blockquote { font-size: calc(17px * var(--text-scale)); color: var(--ink-2); }
/* the three leaderboard habits: one "together" row each; a row with a streak running is a touch stronger */
.together-list { display: grid; gap: 8px; }
.together:not(.on) { background: color-mix(in srgb, var(--green-soft) 55%, var(--surface)); }
.together:not(.on) p { font-weight: 500; color: var(--ink-2); }
/* the tag beside the self-review items that count on the leaderboard */
.on-board { display: inline-block; vertical-align: middle; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px;
  font-family: var(--font-sub); font-size: calc(11px * var(--text-scale)); font-weight: 500; color: var(--gold); background: var(--gold-soft); white-space: nowrap; }
/* "Today's title": a small label over the day's verse */
.day-title { padding: 14px 16px 6px; }
.day-title-label { display: block; font-family: var(--font-sub); font-size: calc(13px * var(--text-scale)); font-weight: 500; color: var(--gold); margin-bottom: 2px; }
.day-title .aya { margin: 6px 0 8px; }
.day-title .aya blockquote { font-size: calc(23px * var(--text-scale)); }

/* ---------- "A message from the Quran": a Ramadan night ---------- */
.aya .orn, .msg-aya .orn { color: var(--gold); font-weight: 400; }
.msg {
  position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: 12px; border-radius: 24px; border: 0;
  color: var(--hero-ink); box-shadow: 0 10px 26px var(--hero-shadow);
  --gold: var(--gold-light);   /* the lighter gold reads better on the night sky */
  /* the night sky, with a soft moonlit glow at the top */
  background: radial-gradient(60% 45% at 50% 0%, var(--hero-glow), transparent 70%), linear-gradient(160deg, var(--hero-1), var(--hero-2));
}
/* twinkling stars */
.msg-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.msg-sky i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff6df; box-shadow: 0 0 6px rgba(255, 240, 200, .9);
  opacity: .8; animation: twinkle 3.4s ease-in-out infinite; }
.msg-sky i:nth-child(1) { top: 14%; inset-inline-start: 22%; }
.msg-sky i:nth-child(2) { top: 30%; inset-inline-start: 9%; width: 2px; height: 2px; animation-delay: .7s; }
.msg-sky i:nth-child(3) { top: 10%; inset-inline-end: 24%; animation-delay: 1.4s; }
.msg-sky i:nth-child(4) { top: 36%; inset-inline-end: 8%; width: 2px; height: 2px; animation-delay: 2.1s; }
.msg-sky i:nth-child(5) { bottom: 16%; inset-inline-start: 7%; width: 2px; height: 2px; animation-delay: 1s; }
.msg-sky i:nth-child(6) { bottom: 12%; inset-inline-end: 9%; width: 2px; height: 2px; animation-delay: 2.6s; }
/* two fanous lanterns hanging from the top corners, swaying */
.msg-lantern { position: absolute; top: 0; z-index: 1; width: 17px; height: 48px; color: var(--gold-light, var(--gold)); }
.msg-lantern.s { inset-inline-start: 7px; }
.msg-lantern.e { inset-inline-end: 7px; }
.msg-lantern .lantern { width: 100%; height: 100%; transform-origin: 50% 0; animation: sway 5.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px var(--lantern-light)); }
.msg-lantern.e .lantern { animation-delay: -2.7s; }
/* the verse's column: between the two lanterns, under the crescent (no frame) */
.msg-arch { position: relative; margin: 0 22px; padding: 30px 4px 6px; }
.msg-moon { position: absolute; top: 8px; left: 50%; width: 22px; height: 22px; margin-left: -11px; color: var(--gold); transform: rotate(-18deg);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 60%, transparent)); }
.msg-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.msg-label {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold);
  font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); font-weight: 600;
}
.msg-label svg { width: 10px; height: 10px; }
.msg-juz { font-family: var(--font-sub); font-size: calc(12px * var(--text-scale)); color: var(--hero-ink-2); }
.msg-aya { margin: 12px 0 8px; font-family: var(--font-display); font-weight: 600; font-size: calc(28px * var(--text-scale)); line-height: 1.75; color: var(--hero-ink); }
.msg-aya .orn { margin: 0 3px; }
/* when a verse wraps, split it into even lines rather than leaving one word alone */
.msg-aya { text-wrap: balance; }
.msg-meaning { margin: 0 4px 10px; font-size: calc(13.5px * var(--text-scale)); line-height: 1.6; color: var(--hero-ink-2); font-style: italic; }
.msg-ref { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); color: var(--gold); }
.msg-ref i { flex: 0 1 56px; height: 1px; background: linear-gradient(to right, transparent, color-mix(in srgb, var(--gold) 70%, transparent), transparent); }
@media (prefers-reduced-motion: reduce) { .msg-sky i, .msg-lantern .lantern { animation: none; } }
/* the earned title under the Journey ring, and the next one */
.title-line { font-family: var(--font-display); font-weight: 600; font-size: calc(15.5px * var(--text-scale)); color: var(--hero-ink); }
.title-next { margin-top: 4px; font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); color: var(--hero-eyebrow); }

/* ---------- the titles legend on the Journey page ---------- */
.titles-sub { font-size: calc(13px * var(--text-scale)); margin: -2px 0 10px; line-height: 1.6; }
.titles { list-style: none; margin: 0; padding: 0; }
.tl { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl:first-child { border-top: 0; }
.tl-days { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1.05;
  border: 1.5px solid var(--line); color: var(--muted); }
.tl-days b { font-family: var(--font-display); font-size: 18px; font-weight: 800; font-variant-numeric: lining-nums; }
.tl-days small { font-size: 10px; }
.tl-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-text strong { font-family: var(--font-display); font-size: calc(16.5px * var(--text-scale)); font-weight: 700; }
.tl-text small { font-size: calc(12px * var(--text-scale)); color: var(--muted); line-height: 1.5; }
.tl-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-sub); font-size: calc(12px * var(--text-scale)); color: var(--muted); white-space: nowrap; }
.tl-check { width: 14px; height: 14px; border-radius: 50%; background: var(--green); position: relative; }
.tl-check::after { content: ''; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 6.5px; border: solid var(--on-green); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
/* earned: green ring; the current title: gold, a touch stronger; titles ahead: quieter */
.tl.earned .tl-days { border-color: var(--green); color: var(--green); }
.tl.current .tl-days { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.tl.current .tl-status { color: var(--gold); font-weight: 600; }
.tl.current .tl-check { background: var(--gold); }
.tl.ahead .tl-text strong { color: var(--ink-2); }

/* the self-review's top card stays under the header while scrolling; once pinned it folds to a compact strip
   (the day, the score and the bar), so answers below can be seen adding up */
.wird-hero { position: sticky; top: var(--top-h, 57px); z-index: 10; }
.wird-hero.stuck { min-height: 0; padding-block: 10px 12px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 20px var(--hero-shadow); }
.wird-hero.stuck .hero-eyebrow, .wird-hero.stuck .hero-juz, .wird-hero.stuck .deco { display: none; }
.wird-hero.stuck .hero-title { font-size: calc(19px * var(--text-scale)); line-height: 1.3; margin: 0; }
.wird-hero.stuck .wird-score { margin-top: 6px; margin-inline-end: 0; }
.wird-hero.stuck .wird-score strong { font-size: calc(15px * var(--text-scale)); }
.wird-hero.stuck { padding-inline-start: 22px; }

/* the side menu's account card: a link to the account page */
.account-link { text-decoration: none; color: inherit; cursor: pointer; }
.account-link .acc-go { margin-inline-start: auto; color: var(--muted); flex: 0 0 auto; }
.account-link:hover .acc-go, .account-link:focus-visible .acc-go { color: var(--green); }
/* the account page */
.account-page .account { margin-bottom: 12px; }
.account-note { font-size: calc(12.5px * var(--text-scale)); margin: 10px 0 0; text-align: center; }
.btn.ghost.drawer-reset { color: var(--bad); }
.wird-gender { margin: 0 0 8px; font-size: calc(13px * var(--text-scale)); }
.account-page .acct-logout { margin-top: 12px; color: var(--bad); }
/* the reset button reads as a warning, not a primary action */
.btn.ghost.drawer-reset { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
/* a row in the side menu that opens a page (the leaderboard) */
.menu-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 4px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: inherit; text-decoration: none; }
.menu-row .avatar { color: var(--gold); }
.menu-row-label { font-family: var(--font-display); font-weight: 700; font-size: calc(16px * var(--text-scale)); }
.menu-row .acc-go { margin-inline-start: auto; color: var(--muted); flex: 0 0 auto; }
.menu-row:hover .acc-go, .menu-row:focus-visible .acc-go { color: var(--green); }
.board-page .board > h3 { display: none; }   /* the page title already names it */
/* the settings row: the label opens the settings page; the arrow unfolds the settings right in the menu */
.menu-row.split { padding: 0; gap: 0; }
.menu-row-main { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: inherit; text-decoration: none; }
.row-expand { flex: 0 0 auto; align-self: stretch; display: grid; place-items: center; width: 52px; padding: 0; border: 0;
  border-inline-start: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; border-radius: 0; }
.row-expand:hover, .row-expand:focus-visible, .menu-row.open .row-expand { color: var(--green); }
.row-expand .acc-go { margin: 0; color: inherit; }
.menu-row.open { border-end-start-radius: 0; border-end-end-radius: 0; }
.menu-settings { margin: -5px 0 4px; padding: 2px 14px 6px; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); background: var(--bg); }
.menu-settings .field { margin: 10px 0; }

/* ---------- the About page ---------- */
.about-intro { text-align: center; padding: 22px 18px 18px; color: var(--hero-ink); border: 0; box-shadow: 0 10px 26px var(--hero-shadow);
  background: radial-gradient(60% 50% at 50% 0%, var(--hero-glow), transparent 70%), linear-gradient(160deg, var(--hero-1), var(--hero-2)); }
.about-moon { width: 26px; height: 26px; color: var(--gold-light, var(--gold)); transform: rotate(-18deg); }
.about-brand { font-family: var(--font-display); font-weight: 800; font-size: calc(30px * var(--text-scale)); margin-top: 2px; }
.about-motto { margin: 10px 4px 12px; font-family: var(--font-display); font-weight: 600; font-size: calc(18px * var(--text-scale)); line-height: 1.8; color: var(--gold-light, var(--gold)); }
.about-lead { margin: 0; font-size: calc(15px * var(--text-scale)); line-height: 1.8; color: var(--hero-ink-2); }
.about-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 8px; line-height: 1.75; font-size: calc(15px * var(--text-scale)); }
.about-list li::marker { color: var(--gold); }
.about-note { font-size: calc(13px * var(--text-scale)); text-align: center; margin: 0 0 12px; padding: 10px 14px; line-height: 1.7;
  border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 88%, transparent); }
/* vision and mission on the About page */
.vm { display: grid; gap: 14px; }
.vm-row { display: flex; align-items: flex-start; gap: 12px; }
.vm-row + .vm-row { padding-top: 14px; border-top: 1px solid var(--line); }
.vm-row h3 { margin: 2px 0 4px; }
.vm-row p { margin: 0; line-height: 1.8; font-size: calc(15.5px * var(--text-scale)); }

/* ---------- prayer times through the year ----------
   six series in the reference palette's fixed order (validated for colour-blind separation on these surfaces);
   each line is also named at its end, and a table gives the values */
:root { --p-fajr: #2a78d6; --p-sunrise: #eb6834; --p-dhuhr: #1baf7a; --p-asr: #eda100; --p-maghrib: #e87ba4; --p-isha: #008300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --p-fajr: #3987e5; --p-sunrise: #d95926; --p-dhuhr: #199e70; --p-asr: #c98500; --p-maghrib: #d55181; --p-isha: #0ca30c; } }
:root[data-theme="dark"] { --p-fajr: #3987e5; --p-sunrise: #d95926; --p-dhuhr: #199e70; --p-asr: #c98500; --p-maghrib: #d55181; --p-isha: #0ca30c; }
.pt-chart .p-fajr { stroke: var(--p-fajr); } .pt-chart .dot.p-fajr { fill: var(--p-fajr); }
.pt-chart .p-sunrise { stroke: var(--p-sunrise); } .pt-chart .dot.p-sunrise { fill: var(--p-sunrise); }
.pt-chart .p-dhuhr { stroke: var(--p-dhuhr); } .pt-chart .dot.p-dhuhr { fill: var(--p-dhuhr); }
.pt-chart .p-asr { stroke: var(--p-asr); } .pt-chart .dot.p-asr { fill: var(--p-asr); }
.pt-chart .p-maghrib { stroke: var(--p-maghrib); } .pt-chart .dot.p-maghrib { fill: var(--p-maghrib); }
.pt-chart .p-isha { stroke: var(--p-isha); } .pt-chart .dot.p-isha { fill: var(--p-isha); }
.pt-chart .sw { stroke-width: 3; fill: none; stroke-linecap: round; }
.pt-chart .pt-name { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.chart-tip .k.p-fajr { background: var(--p-fajr); } .chart-tip .k.p-sunrise { background: var(--p-sunrise); }
.chart-tip .k.p-dhuhr { background: var(--p-dhuhr); } .chart-tip .k.p-asr { background: var(--p-asr); }
.chart-tip .k.p-maghrib { background: var(--p-maghrib); } .chart-tip .k.p-isha { background: var(--p-isha); }
.pt-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pt-controls .field { margin: 6px 0; }
.pt-controls .field.wide { grid-column: 1 / -1; }
.pt-chart .pt-clock { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.pt-clock-note { margin: -4px 0 10px; padding: 6px 10px; border-radius: 10px; background: var(--gold-soft); font-size: calc(12.5px * var(--text-scale)); line-height: 1.6; }
/* today on the year chart: a solid accent line and a label (the touch line stays dashed) */
.pt-chart .pt-today line { stroke: var(--green); stroke-width: 1.5; }
.pt-chart .pt-today text { fill: var(--green); font-size: 11px; font-weight: 700; }
.pt-chart .pt-today .dot { stroke: var(--surface); stroke-width: 2; }
/* the longest and shortest day, and the longest night, on the year chart: a dotted line with an icon on top */
.pt-chart .pt-sol line { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 2 3; }
.sol-sun circle { fill: var(--gold); stroke: var(--gold); stroke-width: 1.2; }
.sol-sun path { stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; fill: none; }
.sol-moon { fill: var(--gold); }
.pt-sol-note { display: grid; gap: 4px; margin: -4px 0 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--line)); font-size: calc(12.5px * var(--text-scale)); line-height: 1.6; }
.pt-sol-note span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pt-sol-note b { font-weight: 700; }
.pt-sol-note small { color: var(--muted); font-size: calc(11.5px * var(--text-scale)); }
.sol-ico { width: 14px; height: 14px; flex: 0 0 auto; overflow: visible; }
/* when today is the year's longest or shortest day or night */
.sol-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  font-family: var(--font-display); font-weight: 600; font-size: calc(14.5px * var(--text-scale)); line-height: 1.6; }
.sol-banner .sol-ico { width: 20px; height: 20px; }
.sol-banner.night { color: var(--hero-ink); border: 0; background: linear-gradient(160deg, var(--hero-1), var(--hero-2)); }
.sol-banner.night .sol-moon { fill: var(--gold-light, var(--gold)); }

/* ---------- the lunar calendar ---------- */
.moon-ico { display: block; width: 100%; height: 100%; overflow: visible; }
.moon-dark { fill: color-mix(in srgb, var(--hero-2) 80%, #000); }   /* the unlit part: the app's night green */
.moon-lit { fill: #f4dd9e; }
.moon-rim { fill: none; stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: .8; }
/* today's moon, on the same night sky as the day page's "tonight's moon": the drawn moon, stars, cream and gold */
.moon-card { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 18px;
  color: #eef1fb; border: 1px solid rgba(255, 246, 220, .08); box-shadow: var(--shadow);
  background: radial-gradient(120% 100% at 15% 15%, #2c3a68 0%, #17213f 50%, #0b1026 100%); }
[dir="rtl"] .moon-card { background: radial-gradient(120% 100% at 85% 15%, #2c3a68 0%, #17213f 50%, #0b1026 100%); }
.moon-big { width: 128px; height: 128px; }
.moon-big .mx-moon { width: 100%; height: 100%; }
.moon-card.intro .mx-moon { animation: mxRise 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.moon-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.moon-info .moon-label { font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); color: #e6c98c; }
.moon-info strong { font-family: var(--font-display); font-size: calc(22px * var(--text-scale)); color: #fff8e6; }
.moon-info span { font-size: calc(13.5px * var(--text-scale)); color: #c9d0e6; }
.moon-hijri { color: #e6c98c !important; font-weight: 600; }
.moon-next { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 246, 220, .1);
  font-size: calc(13px * var(--text-scale)); color: #c9d0e6; }
.moon-next span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.moon-next .moon-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.moon-next b { color: #fff8e6; }
.moon-card .moon-dark { fill: #26304d; }
.moon-card .moon-lit { fill: #f6e7bd; }
.moon-card .moon-rim { stroke: rgba(255, 246, 220, .25); stroke-width: 1; }
@media (max-width: 360px) { .moon-big { width: 104px; height: 104px; } }
@media (prefers-reduced-motion: reduce) { .moon-card.intro .mx-moon { animation: none; } }
/* the month grid */
.ln-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ln-nav > div { text-align: center; display: flex; flex-direction: column; }
.ln-nav strong { font-family: var(--font-display); font-size: calc(18px * var(--text-scale)); }
.ln-nav small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.ln-nav .icon-btn { width: 40px; height: 40px; min-width: 0; padding: 0; }
.ln-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ln-head { text-align: center; font-family: var(--font-sub); font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.ln-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.ln-day b { font-family: var(--font-display); font-size: 14px; line-height: 1.1; font-variant-numeric: lining-nums; }
.ln-day .moon-ico { width: 20px; height: 20px; }
.ln-day small { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.ln-day.mt { background: color-mix(in srgb, var(--green) 6%, var(--surface)); }
.ln-day.white { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.ln-day.full { border: 1.5px solid var(--gold); }
.ln-day.new { border: 1.5px dashed var(--muted); }
.ln-day.today { outline: 2px solid var(--green); outline-offset: 1px; }
.ln-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: calc(12px * var(--text-scale)); color: var(--ink-2); }
.ln-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.lg.today { outline: 2px solid var(--green); outline-offset: 1px; }
.lg.mt { background: color-mix(in srgb, var(--green) 6%, var(--surface)); }
.lg.white { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.lg.full { border: 1.5px solid var(--gold); }
.lg.new { border: 1.5px dashed var(--muted); }
.ln-white p { margin: 4px 0 0; line-height: 1.8; font-size: calc(15px * var(--text-scale)); }
.ln-white .muted { font-size: calc(13px * var(--text-scale)); }
.sol-banner span.sol-ico { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; }

/* ---- the year page: Ramadan's shading, estimated stretches, clock changes, the Hijri row, the key, export */
.pt-chart .pt-ram { fill: color-mix(in srgb, var(--gold) 13%, transparent); }
.pt-chart .ln.est { stroke-dasharray: 5 4; }
.pt-chart .pt-clock-lbl { fill: var(--muted); font-size: 10.5px; font-weight: 700; }
.pt-chart .pt-hijri { fill: var(--muted); font-size: 10.5px; }
.pt-chart .pt-hijri.ram { fill: color-mix(in srgb, var(--gold) 70%, var(--ink)); font-weight: 700; }
.sol-sun.short circle { fill: none; }
.sol-sun.short path { stroke-width: 1.2; }
.sol-moon.short { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: calc(12px * var(--text-scale)); color: var(--ink-2); }
.pt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pt-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pt-key.ram { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.pt-key.est { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }
.pt-method { margin: 8px 0 0; font-size: calc(12px * var(--text-scale)); line-height: 1.6; }
.chart-tip .tip-est { color: var(--muted); font-style: normal; font-size: 11px; }
.chart-tip .tip-sep { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.pt-table td.est { color: var(--muted); }
.pt-table tr.ram td, .pt-table tr.ram th { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.print-only { display: none; }

/* the Journey page's link to the leaderboard (the board itself lives on its own page) */
.board-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.board-link-text { display: grid; gap: 2px; min-width: 0; }
.board-link-text b { font-family: var(--font-display); font-weight: 700; font-size: calc(17px * var(--text-scale)); }
.board-link-text small { color: var(--muted); font-size: calc(13px * var(--text-scale)); line-height: 1.6; }
.board-link .acc-go { margin-inline-start: auto; color: var(--muted); flex: 0 0 auto; }
.board-link:hover .acc-go, .board-link:focus-visible .acc-go { color: var(--green); }

/* installing the app: a button and a line of why, in the settings */
.install-row { display: grid; gap: 6px; }
.install-row .btn { justify-self: start; }
.install-row small { font-size: calc(12.5px * var(--text-scale)); line-height: 1.6; }
.install-steps { margin: 0 0 14px; padding-inline-start: 1.4em; display: grid; gap: 6px; line-height: 1.7; }

/* Imsak and Iftar reminders (timetable page) */
.remind-card { display: grid; gap: 8px; }
.remind-card h3 { margin: 0; }
.remind-sub, .remind-note { margin: 0; font-size: calc(13px * var(--text-scale)); line-height: 1.7; }
.remind-card .btn { justify-self: start; }

/* the fasting log (self-review page) and making up days */
.fast-card .wird-sub { margin: 6px 0 0; }
.wd-cell.nf { position: relative; }
/* the review outside Ramadan: the day's fasting reasons, the question, tomorrow's sunnah fast; on the month's grid,
   a dot under a sunnah fast day and a gold ring on a day fasted */
.fy-why { margin: 2px 0 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line)); }
.fy-why.fy-caution { background: color-mix(in srgb, var(--bad) 7%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.fy-why.fy-caution strong { color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.fy-why strong { display: block; font-family: var(--font-display); font-weight: 700; color: var(--green); }
.fy-text { margin: 4px 0 0; line-height: 1.8; }
.fy-src { margin: 2px 0 0; font-size: calc(12.5px * var(--text-scale)); }
.fy-tomorrow { margin: 10px 0 0; font-weight: 600; color: color-mix(in srgb, var(--gold) 70%, var(--ink)); }
.wd-cell.sn, .wd-cell.fz { position: relative; }
.wd-cell.sn::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold); }
.wd-cell.fz { box-shadow: inset 0 0 0 2px var(--gold); }
.wd-cell.fb { opacity: .55; }
.fy-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: calc(12.5px * var(--text-scale)); color: var(--muted); }
.fy-key { display: inline-flex; align-items: center; gap: 6px; }
.fy-key i { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); position: relative; }
.fy-key i.sn::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.fy-key i.fz { box-shadow: inset 0 0 0 2px var(--gold); border-color: transparent; }
.wd-cell.nf::after { content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.qada-card { display: grid; gap: 8px; }
.qada-card h3, .qada-line { margin: 0; }
.qada-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.qada-card .wird-bar { display: block; }
.qada-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qada-card .wird-bar { background: var(--line); height: 8px; border-radius: 4px; overflow: hidden; }
.qada-card .wird-bar b { background: var(--green); }

/* the khatma tracker (self-review page) */
.khatma-card { display: grid; gap: 8px; }
.khatma-card .wird-head { margin: 0; }
.khatma-page { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.khatma-page input { width: 6.5em; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
  font: inherit; font-size: calc(17px * var(--text-scale)); font-variant-numeric: tabular-nums; text-align: center; }
.khatma-where { margin: 0; }
.khatma-card .wird-bar { display: block; background: var(--line); height: 8px; border-radius: 4px; overflow: hidden; }
.khatma-card .wird-bar b { background: var(--green); }

/* the tasbīḥ counter (a sheet from the self-review page) */
.wird-head .tasbih-open { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; min-height: 34px; margin-inline-start: auto; font-size: calc(13.5px * var(--text-scale)); }
.wird-head .tasbih-open svg { color: var(--gold); }
.tasbih-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.tasbih-chips .chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: calc(13.5px * var(--text-scale)); cursor: pointer; }
.tasbih-chips .chip.on { background: var(--green); color: var(--on-green, #fff); border-color: var(--green); }
.tasbih-phrase { margin: 6px 0 10px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: calc(22px * var(--text-scale)); line-height: 1.6; color: var(--green); text-wrap: balance; }
.tasbih-phrase.muted { font-family: inherit; font-weight: 400; font-size: calc(14px * var(--text-scale)); color: var(--muted); }
.tasbih-tap { position: relative; display: grid; place-items: center; width: 190px; height: 190px; margin: 0 auto; border: 0; border-radius: 50%;
  background: var(--gold-soft); color: var(--ink); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tasbih-tap:active { transform: scale(.97); }
.tasbih-tap:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.tasbih-tap svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tasbih-tap .ts-track { fill: none; stroke: var(--line); stroke-width: 8; }
.tasbih-tap .ts-arc { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .2s; }
.ts-n { position: relative; direction: ltr; unicode-bidi: isolate; font-family: var(--font-display); font-weight: 800; font-size: 46px; font-variant-numeric: tabular-nums; }
.ts-n small { font-size: 18px; color: var(--muted); font-weight: 600; }
.tasbih-total { text-align: center; margin: 10px 0 0; }
.tasbih-done { text-align: center; margin: 6px 0; color: var(--green); font-weight: 700; }
.tasbih-src { font-size: calc(12.5px * var(--text-scale)); line-height: 1.7; margin: 10px 0 0; }
@media (prefers-reduced-motion: reduce) { .tasbih-tap .ts-arc { transition: none; } .tasbih-tap:active { transform: none; } }

/* sharing the day's message (a button under the verse) */
.msg-share { display: flex; width: fit-content; align-items: center; gap: 6px; margin: 12px auto 0; padding: 6px 14px; min-height: 36px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: transparent; color: var(--gold); font: inherit; font-family: var(--font-sub);
  font-size: calc(13px * var(--text-scale)); cursor: pointer; }
.msg-share:hover, .msg-share:focus-visible { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.msg-share:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.msg-share:disabled { opacity: .6; }

/* Zakāt al-Fiṭr (Today page, from day 25 to Eid) */
.zakat-card { display: grid; gap: 8px; }
.zakat-card h3, .zakat-sub, .zakat-total { margin: 0; }
.zakat-sub { font-size: calc(13px * var(--text-scale)); line-height: 1.7; }
.zakat-card .field small { font-size: calc(12.5px * var(--text-scale)); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper output { min-width: 2.2em; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: calc(22px * var(--text-scale)); font-variant-numeric: tabular-nums; }
.stepper .icon-btn { font-size: 22px; line-height: 1; }
.zakat-card input[type=number] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; max-width: 14em; }
.zakat-total { color: var(--green); line-height: 1.7; }
.zakat-notes { margin: 4px 0 0; padding-inline-start: 1.2em; display: grid; gap: 4px; font-size: calc(12.5px * var(--text-scale)); line-height: 1.7; color: var(--muted); }

/* the last ten nights: the hero turns to night, and a card with the night, the odd nights and the duʿāʾ */
body.season-ten { --hero-1: #2b3266; --hero-2: #141a3c; }
.ten-card { display: grid; gap: 10px; }
.ten-card h3, .ten-card p { margin: 0; }
.ten-now { font-family: var(--font-display); font-weight: 700; font-size: calc(17px * var(--text-scale)); line-height: 1.6; color: var(--green); }
.ten-nights { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.ten-n { display: grid; place-items: center; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); line-height: 1.2; }
.ten-n b { font-family: var(--font-display); font-size: calc(16px * var(--text-scale)); }
.ten-n small { font-size: 10.5px; color: var(--gold); }
.ten-n.odd { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.ten-n.past { opacity: .5; }
.ten-n.cur { outline: 2px solid var(--green); outline-offset: 1px; opacity: 1; }
.ten-src { font-size: calc(12.5px * var(--text-scale)); line-height: 1.7; }
/* a du'a in a double gold frame (as the mushaf's border): a warm glow at its top, the label a small gold pill, the
   source under a dotted rule */
.ten-dua { position: relative; display: grid; gap: 8px; padding: 16px 18px 12px; border-radius: 18px; text-align: center;
  background: radial-gradient(120% 85% at 50% 0%, color-mix(in srgb, var(--gold) 16%, var(--surface)) 0%, var(--surface) 72%);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px color-mix(in srgb, var(--gold) 26%, transparent), 0 6px 18px color-mix(in srgb, var(--gold) 12%, transparent); }
.ten-dua-label { justify-self: center; padding: 3px 12px; border-radius: 999px; font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); font-weight: 600;
  color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.ten-dua .ten-src { margin: 2px 6px 0; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--gold) 35%, transparent); }
.ten-dua-text { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: calc(22px * var(--text-scale)); line-height: 1.8; color: var(--ink); }
.ten-dua-meaning { margin: 0; font-style: italic; color: var(--ink-2); }
/* the Eid page */
.eid-hero .eid-moon { display: block; width: 44px; margin: 0 auto 4px; color: var(--hero-eyebrow); }
.eid-sub { margin: 4px 0 10px; font-size: calc(13px * var(--text-scale)); line-height: 1.7; }
.eid-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.shawwal-card, .after-card { display: grid; gap: 8px; }
.shawwal-card h3, .after-card h3, .shawwal-card p, .after-card p { margin: 0; }
.shawwal-hadith { line-height: 1.8; }
.sh-days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 360px; }
.sh-day { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-family: var(--font-display); font-weight: 700; font-size: calc(16px * var(--text-scale)); cursor: pointer; }
.sh-day.on { background: var(--green); border-color: var(--green); color: var(--on-green, #fff); }
.sh-day:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.after-card .chip:disabled { opacity: .45; cursor: default; }
.after-list { margin: 0; padding-inline-start: 1.4em; display: grid; gap: 4px; font-weight: 600; }

/* privacy notes under the profile form's fields */
.form-note { margin: -4px 0 4px; font-size: calc(12.5px * var(--text-scale)); line-height: 1.7; }

/* the tasbīḥ page: a large ring to tap, as wide as the phone allows */
.tasbih-page { display: grid; gap: 8px; text-align: center; }
.tasbih-page .tasbih-chips { justify-content: center; }
.tasbih-day { margin: 0; font-size: calc(13px * var(--text-scale)); }
.tasbih-page .tasbih-tap { width: min(78vw, 340px); height: min(78vw, 340px); margin: 6px auto; }
.tasbih-page .ts-n { font-size: clamp(48px, 16vw, 76px); }
.tasbih-page .ts-n small { font-size: clamp(18px, 5vw, 26px); }
.tasbih-page .tasbih-mark { justify-self: center; }
.tasbih-page .tasbih-src { text-align: start; }
/* the dhikr's virtues, folded under the counter */
.ts-virtues { text-align: start; margin-top: 6px; border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.ts-virtues summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.ts-virtues summary::-webkit-details-marker { display: none; }
.ts-virtues summary::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.ts-virtues[open] summary::after { transform: rotate(-135deg); }
.ts-virtues summary .ts-set-title { flex: 1; }
.ts-virt-n { font-size: calc(12px * var(--text-scale)); color: var(--gold); background: var(--gold-soft, transparent); border-radius: 999px; padding: 2px 10px; }
.ts-virt-list { margin: 0; padding: 0 14px 4px; padding-inline-start: 34px; display: grid; gap: 12px; }
.ts-virt-list li { line-height: 1.85; }
:root[lang="ar"] .ts-virt-list { list-style-type: arabic-indic; }
.ts-virt-list li::marker { color: var(--gold); font-weight: 700; }
.ts-virt-list p { margin: 0; font-size: calc(14.5px * var(--text-scale)); }
.ts-virt-list small { display: block; font-size: calc(12px * var(--text-scale)); }
.ts-virt-list li.aya-v p { font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(18px * var(--text-scale)); line-height: 2.1; color: var(--green); }
.ts-virt-note { margin: 4px 14px 12px; font-size: calc(11.5px * var(--text-scale)); }
.tasbih-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.ts-focus-btn, .ts-reset-btn { display: inline-flex; align-items: center; gap: 6px; }
.tasbih-actions .btn { padding-inline: 14px; }
/* focus mode: the phrase and the ring on the whole screen, the rest hidden; a tap anywhere counts */
.ts-focus-exit, .ts-focus-hint, .ts-auto-tick.ts-focus-tick { display: none; }
/* in focus, counting by itself: the bar filling to the next count, under the ring (the row with it is hidden) */
body.ts-focus .ts-auto-tick.ts-focus-tick { display: block; justify-self: center; width: min(260px, 60vw); margin: 6px 0 0; }
body.ts-focus header.top, body.ts-focus .bottom-nav, body.ts-focus .poc-strip, body.ts-focus .fast-bar { display: none !important; }
body.ts-focus #view { padding-top: 0; padding-bottom: 0; }
body.ts-focus #view > .section-title, body.ts-focus #view > .ts-hist-card, body.ts-focus #view > .ts-set-card,
body.ts-focus .tasbih-page > :not(.tasbih-phrase, .tasbih-tap, .ts-focus-tick, .ts-parts, .tasbih-total, .tasbih-done, .ts-focus-exit, .ts-focus-hint) { display: none !important; }
body.ts-focus .tasbih-page { min-height: 100dvh; align-content: center; background: transparent; border: 0; box-shadow: none; padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.ts-focus .tasbih-page .tasbih-tap { width: min(84vw, 62dvh, 520px); height: min(84vw, 62dvh, 520px); }
body.ts-focus .tasbih-page .ts-n { font-size: clamp(56px, 18vw, 110px); }
body.ts-focus .tasbih-phrase { font-size: calc(26px * var(--text-scale)); }
body.ts-focus .ts-focus-exit { display: inline-flex; position: fixed; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 30; }
body.ts-focus .ts-focus-hint { display: block; font-size: calc(12.5px * var(--text-scale)); margin: 4px 0 0; }
a.tasbih-open { text-decoration: none; color: inherit; }
/* the count and the dhikr's words in the text face, where «٥» and «بحمده» read clearly at any size */
.tasbih-phrase, .ts-n { font-family: var(--font-ui); }
.tasbih-phrase { font-weight: 700; }
.ts-n { font-weight: 700; }

.tasbih-sound { justify-items: center; text-align: center; }
.tasbih-sound .seg { justify-content: center; }

/* the user's own adhkār: their chips, the add form, the delete button */
.tasbih-chips .chip.add { border-style: dashed; color: var(--green); }
.tasbih-chips .chip.add.on { color: var(--on-green, #fff); }
.ts-add { display: grid; gap: 8px; text-align: start; }
.ts-add input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.ts-add .ts-quick { justify-content: flex-start; margin: 0; }
.ts-add-msg { margin: 0; font-size: calc(12.5px * var(--text-scale)); }
.tasbih-actions { flex-wrap: wrap; gap: 8px; }
.ts-del.confirm { border-color: var(--bad); color: var(--bad); }

/* a goal for adhkār with no set number */
.ts-goal { display: grid; gap: 6px; justify-items: center; }
.ts-goal-label { font-weight: 600; font-size: calc(14px * var(--text-scale)); }
.ts-goal .tasbih-chips { margin: 0; justify-content: center; }
.ts-goal small { font-size: calc(12px * var(--text-scale)); }
.ts-goal-other { display: inline-flex; align-items: center; gap: 6px; cursor: text; }
.ts-goal-other input { width: 4.5em; padding: 2px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; text-align: center; }
.ts-goal-other.on input { background: var(--surface); color: var(--ink); }

/* the dhikr history (under the counter) */
.ts-history { display: grid; gap: 10px; }
.ts-history h3, .ts-history h4, .ts-history p { margin: 0; }
.ts-history h4 { font-family: var(--font-sub); font-size: calc(14px * var(--text-scale)); color: var(--ink-2); margin-top: 4px; }
.ts-hist-stats .stat .l { font-size: calc(12px * var(--text-scale)); }
.ts-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; height: 92px; padding-bottom: 16px; }
.ts-bar { position: relative; display: flex; align-items: flex-end; height: 100%; text-decoration: none; color: inherit; }
.ts-bar i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--green); min-height: 2px; }
.ts-bar.empty i { background: var(--line); }
.ts-bar small { position: absolute; bottom: -16px; inset-inline: 0; text-align: center; font-size: 9.5px; color: var(--muted); }
.ts-bar:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ts-per { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ts-per li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ts-per b { font-variant-numeric: tabular-nums; }
.ts-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ts-days li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: background .4s; }
.ts-days li.flash { background: var(--gold-soft); }
.ts-day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ts-day-head strong { margin-inline-start: auto; font-size: calc(17px * var(--text-scale)); color: var(--green); }
.ts-day-items { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: calc(13px * var(--text-scale)); color: var(--ink-2); margin-top: 4px !important; }
.ts-hist-note { font-size: calc(12px * var(--text-scale)); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .ts-days li { transition: none; } }
.ts-hist-stats .stat .v, .ts-per b, .ts-day-head strong { font-family: var(--font-ui); font-weight: 700; }

.tasbih-sound small { display: block; margin-top: 4px; font-size: calc(12px * var(--text-scale)); }

.tasbih-tap .ts-tick { stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.ts-goal .ts-split { margin-top: 6px; }
.ts-split .tasbih-chips { justify-content: center; margin: 2px 0 0; }

/* the parts' own small counter: a line inside the ring, and a bar of parts under it */
.ts-n-wrap { position: relative; display: grid; justify-items: center; gap: 2px; }
.ts-part-n { font-family: var(--font-ui); font-weight: 600; font-size: clamp(12px, 3.6vw, 15px); color: var(--green); font-variant-numeric: tabular-nums; }
.ts-parts { display: flex; gap: 4px; width: min(78vw, 340px); margin: 2px auto 0; }
.ts-parts span { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 4px; }
.ts-parts i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .2s; }
@media (prefers-reduced-motion: reduce) { .ts-parts i { transition: none; } }

/* the tasbīḥ ring's colours as tokens: light keeps green on gold-cream; dark is night blue with a glowing gold arc */
:root { --ts-disc: var(--gold-soft); --ts-track: var(--line); --ts-arc: var(--green); --ts-glow: none; --ts-part: var(--green); --ts-bar: var(--gold); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ts-disc: radial-gradient(circle at 50% 42%, #22385a 0%, #16243b 62%, #111c2e 100%);
    --ts-track: rgba(230, 201, 140, .14); --ts-arc: #e6c98c; --ts-glow: drop-shadow(0 0 5px rgba(230, 201, 140, .5));
    --ts-part: #e6c98c; --ts-bar: #e6c98c;
  }
}
:root[data-theme="dark"] {
  --ts-disc: radial-gradient(circle at 50% 42%, #22385a 0%, #16243b 62%, #111c2e 100%);
  --ts-track: rgba(230, 201, 140, .14); --ts-arc: #e6c98c; --ts-glow: drop-shadow(0 0 5px rgba(230, 201, 140, .5));
  --ts-part: #e6c98c; --ts-bar: #e6c98c;
}
.tasbih-tap { background: var(--ts-disc); }
.tasbih-tap .ts-track { stroke: var(--ts-track); }
.tasbih-tap .ts-arc { stroke: var(--ts-arc); filter: var(--ts-glow); }
.ts-part-n { color: var(--ts-part); }
.ts-parts span { background: var(--ts-track); }
.ts-parts i { background: var(--ts-bar); }

/* the counter's settings, folded into one section */
.ts-settings { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: start; }
.ts-settings summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.ts-settings summary::-webkit-details-marker { display: none; }
.ts-settings summary::after { content: ""; margin-inline-start: auto; align-self: center; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.ts-settings[open] summary::after { transform: rotate(-135deg); }
.ts-settings summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 12px; }
.ts-set-title { font-family: var(--font-sub); font-weight: 600; }
.ts-set-sum { font-size: calc(12.5px * var(--text-scale)); }
.ts-set-body { display: grid; gap: 10px; padding: 0 14px 14px; }
/* the counter's settings as rows: an icon and the label at the start, the choices across the row, a note under them,
   a hairline between rows */
.ts-settings:not(.ts-opts) .ts-set-body { gap: 0; padding-top: 2px; }
.ts-settings:not(.ts-opts) .ts-set-body > .tasbih-sound { display: grid; justify-items: stretch; gap: 8px; text-align: start; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.ts-settings:not(.ts-opts) .ts-set-body > .tasbih-sound:first-child { border-top: 0; padding-top: 6px; }
.field > .ts-row-label, .ts-row-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: calc(14.5px * var(--text-scale)); color: var(--ink); }
.ts-row-label svg { flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 9px; color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); }
.ts-settings:not(.ts-opts) .tasbih-sound .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; justify-content: stretch; }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button { min-width: 0; padding-inline: 8px; white-space: normal; line-height: 1.3; }
.ts-settings:not(.ts-opts) .tasbih-sound small { margin-top: 0; text-align: start; }
/* the choices in the settings: a soft track; the chosen one a raised tile, green, with a check */
.ts-settings:not(.ts-opts) .tasbih-sound .seg, .set-rows .seg {
  gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button, .set-rows .seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  color: var(--ink-2); font: inherit; font-weight: 500; transition: background-color .15s, color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button:hover:not([aria-pressed="true"]), .set-rows .seg button:hover:not([aria-pressed="true"]) {
  background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button[aria-pressed="true"], .set-rows .seg button[aria-pressed="true"] {
  border-radius: 10px; background: var(--surface); color: var(--green); font-weight: 700;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--green) 55%, transparent), 0 2px 8px color-mix(in srgb, var(--green) 16%, transparent), 0 1px 2px rgba(0, 0, 0, .08); }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button[aria-pressed="true"]::before, .set-rows .seg button[aria-pressed="true"]::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ts-settings:not(.ts-opts) .tasbih-sound .seg button:focus-visible, .set-rows .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* three choices or more: no check (the raised tile says it), a little smaller, so each stays on one line */
.ts-settings:not(.ts-opts) .tasbih-sound .seg:has(> button:nth-child(3)) button, .set-rows .seg:has(> button:nth-child(3)) button {
  padding-inline: 6px; font-size: calc(14.5px * var(--text-scale)); }
.ts-settings:not(.ts-opts) .tasbih-sound .seg:has(> button:nth-child(3)) button::before, .set-rows .seg:has(> button:nth-child(3)) button::before { display: none; }
@media (prefers-reduced-motion: reduce) { .ts-settings .seg button, .set-rows .seg button { transition: none; } }
.ts-settings:not(.ts-opts) .ts-auto-info { margin: 0; }
.ts-settings:not(.ts-opts) .ts-auto-sub { margin-top: 4px; }
/* on the settings page: the section is the card itself */
.settings-ts { padding: 4px 6px; }
.settings-ts > .ts-settings { border: 0; background: transparent; }
.settings-ts > .ts-settings > summary .ts-set-title { font-family: var(--font-display); font-size: calc(19px * var(--text-scale)); }
/* the side menu: a row to the counter's settings */
.menu-sublink { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.menu-sublink svg:first-child { width: 20px; height: 20px; color: var(--gold); flex: none; }
.menu-sublink + .menu-sublink { margin-top: 6px; }
.menu-settings .menu-sublink:first-child { margin-top: 8px; }
.menu-sublink span { flex: 1; }
@media (prefers-reduced-motion: reduce) { .ts-settings summary::after { transition: none; } }

/* tapping anywhere: no double-tap zoom, no text selection; the ring pulses on each count */
body.ts-anywhere { touch-action: manipulation; }
body.ts-anywhere #view { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.ts-anywhere #view input, body.ts-anywhere #view textarea { -webkit-user-select: text; user-select: text; }
.tasbih-tap.pulse { animation: ts-pulse .18s ease-out; }
@keyframes ts-pulse { 0% { transform: scale(.97); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tasbih-tap.pulse { animation: none; } }

/* the settings summary: a chip per choice, with its icon */
.ts-settings summary { align-items: center; }
.ts-set-sum { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; order: 3; }
.ts-sum-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: calc(12px * var(--text-scale)); color: var(--ink-2); line-height: 1.5; }
.ts-sum-item svg { color: var(--gold); flex: 0 0 auto; }

.ts-days li.all-done { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.ts-day-done { margin: 6px 0 0 !important; font-weight: 600; color: var(--green); font-size: calc(13px * var(--text-scale)); line-height: 1.7; }

/* the total for each dhikr as horizontal bars */
.ts-per li { display: grid; gap: 4px; padding: 6px 0; border-bottom: 0; }
.ts-per-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ts-per-head span { min-width: 0; overflow-wrap: anywhere; }
.ts-per-bar { display: block; height: 10px; border-radius: 5px; background: var(--ts-track, var(--line)); overflow: hidden; }
.ts-per-bar i { display: block; height: 100%; border-radius: 5px; background: var(--ts-arc, var(--green)); }
.ts-per li { grid-template-columns: 1fr; justify-content: stretch; }
.ts-bar i { background: var(--ts-arc, var(--green)); }

button.menu-row.install-menu { width: 100%; font: inherit; text-align: start; cursor: pointer; }

/* ---- the Journey dashboard */
.dash-today h3 { margin: 0 0 10px; }
.dash-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.dash-chip { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: inherit; text-decoration: none; }
.dash-chip small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.dash-chip b { font-family: var(--font-ui); font-size: calc(16px * var(--text-scale)); }
.dash-chip.ok { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.dash-chip.ok b { color: var(--green); }
.dash-chip.mid { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.dash-tile { position: relative; display: grid; gap: 2px; align-content: start; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.dash-ico { color: var(--gold); display: inline-flex; }
.dash-ico svg { width: 20px; height: 20px; }
.dash-t { font-family: var(--font-sub); font-size: calc(13px * var(--text-scale)); color: var(--ink-2); }
.dash-big { font-family: var(--font-ui); font-weight: 700; font-size: calc(22px * var(--text-scale)); line-height: 1.3; color: var(--green); }
.dash-sub { color: var(--muted); font-size: calc(12px * var(--text-scale)); line-height: 1.5; }
.dash-go { position: absolute; top: 12px; inset-inline-end: 10px; color: var(--muted); }
.dash-tile:hover .dash-go, .dash-tile:focus-visible .dash-go { color: var(--green); }
.dash-season { display: grid; gap: 4px; position: relative; color: inherit; text-decoration: none; }
.dash-season b { font-family: var(--font-display); font-size: calc(16px * var(--text-scale)); }
.dash-season span { color: var(--ink-2); font-size: calc(13.5px * var(--text-scale)); line-height: 1.7; }
.dash-season.ten { background: linear-gradient(135deg, #2b3266, #141a3c); color: #fffaf0; border-color: transparent; }
.dash-season.ten span { color: rgba(255, 250, 240, .85); }
.dash-season .dash-go { top: 14px; }
.dash-cal h3 { margin: 0 0 10px; }
.dc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dc-head { text-align: center; font-size: 11px; color: var(--muted); }
.dc-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: inherit; text-decoration: none; overflow: hidden; }
.dc-day b { font-family: var(--font-ui); font-size: calc(13px * var(--text-scale)); font-variant-numeric: tabular-nums; }
.dc-day.future { opacity: .4; }
.dc-day.cur { outline: 2px solid var(--green); outline-offset: 1px; }
.dc-pk { position: absolute; top: 4px; inset-inline-start: 4px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.dc-day.pk-full .dc-pk, .dc-legend .dc-pk.full { background: var(--green); }
.dc-day.pk-part .dc-pk, .dc-legend .dc-pk.part { background: var(--gold); }
.dc-nf { position: absolute; top: 1px; inset-inline-end: 4px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--bad); }
.dc-w { position: absolute; inset-inline: 4px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--line); }
.dc-w i { display: block; height: 100%; border-radius: 2px; background: var(--ts-arc, var(--green)); }
.dc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: calc(12px * var(--text-scale)); color: var(--ink-2); }
.dc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dc-legend .dc-pk { position: static; display: inline-block; }
.dc-wl { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--ts-arc, var(--green)); }
.dc-nfl { color: var(--bad); }
.dash-fold summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: calc(16px * var(--text-scale)); }
.dash-fold-titles > summary { list-style: none; margin-bottom: 12px; }
.dash-fold-titles > summary::-webkit-details-marker { display: none; }
.dash-fold-titles[open] > summary { margin-bottom: 8px; }

/* a dashboard tile that opens in place: the panel spans the row below it */
.dash-tiles { grid-auto-flow: row dense; }
button.dash-tile { font: inherit; text-align: start; cursor: pointer; width: 100%; }
.dash-tile.dash-exp.open { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.dash-chev { transition: transform .2s; }
.dash-exp.open .dash-chev { transform: rotate(180deg); }
.dash-detail { grid-column: 1 / -1; display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background: var(--surface); box-shadow: var(--shadow); }
.dash-detail h4 { margin: 4px 0 0; font-family: var(--font-sub); font-size: calc(14px * var(--text-scale)); color: var(--ink-2); }
.dash-detail p { margin: 0; }
.fs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fs-stat { display: grid; justify-items: center; padding: 8px 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.fs-stat b { font-family: var(--font-ui); font-size: calc(22px * var(--text-scale)); }
.fs-stat.y b { color: var(--green); } .fs-stat.n b { color: var(--bad); }
.fs-stat small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.fs-of { font-size: calc(12px * var(--text-scale)); text-align: center; }
.fs-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.fs-d { display: grid; place-items: center; aspect-ratio: 1; border-radius: 7px; font-size: 11px; font-family: var(--font-ui); border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); }
.fs-d.y { background: var(--green); border-color: var(--green); color: var(--on-green, #fff); }
.fs-d.n { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); color: var(--bad); }
.fs-d.future { opacity: .35; }
.fs-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(12px * var(--text-scale)); color: var(--ink-2); }
.fs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fs-k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); background: var(--bg); }
.fs-k.y { background: var(--green); border-color: var(--green); }
.fs-k.n { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.fs-why { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fs-why li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.fs-qada { line-height: 1.7; }
.fs-bar { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fs-bar i { display: block; height: 100%; background: var(--green); }
.fs-go { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .dash-chev { transition: none; } }
.fs-go { text-decoration: none; }

/* the fast: counted by default; one button records an excused day */
.fast-on { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-weight: 600; color: var(--green); line-height: 1.7; }
.fast-tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: var(--on-green, #fff); font-size: 14px; flex: 0 0 auto; }
.fast-off { margin: 4px 0 8px; font-weight: 600; color: color-mix(in srgb, var(--gold) 70%, var(--ink)); line-height: 1.7; }
.fast-excuse, .fast-undo { justify-self: start; }
.fast-card { display: grid; }
.fast-card.excused { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.fs-stats.two { grid-template-columns: repeat(2, 1fr); }

/* the making-up summary in the fasting panel links to the making-up card */
.fs-qada-link { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: inherit; text-decoration: none; }
.fs-qada-link h4 { margin: 0; }
.fs-qada-link:hover, .fs-qada-link:focus-visible { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.fs-qada-go { justify-self: end; font-size: calc(12.5px * var(--text-scale)); font-weight: 600; color: var(--green); }
.qada-card { transition: box-shadow .4s, border-color .4s; }
.khatma-card.flash, .qada-card.flash {border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent); }
@media (prefers-reduced-motion: reduce) { .qada-card { transition: none; } }

/* the other tiles' details */
.fs-d.p { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); color: var(--ink); }
a.fs-d { text-decoration: none; }
.fs-k.p { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.fs-why.bars li.d-bar { display: grid; gap: 4px; border-bottom: 0; }
.fs-why.bars li.d-bar > div { display: flex; justify-content: space-between; }
.mini-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; align-items: end; height: 44px; }
.mini-bar { display: flex; align-items: flex-end; height: 100%; }
.mini-bar i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--ts-arc, var(--green)); }
.mini-bar.future i { background: var(--line); }
.fs-stat b { overflow-wrap: anywhere; text-align: center; }
.fs-why.bars li.d-bar { grid-template-columns: 1fr; justify-content: stretch; }
.fs-why.bars li.d-bar > div { gap: 10px; }

/* ---- the morning and evening adhkār page */
.seg-tabs { display: flex; margin: 0 0 12px; }
.seg-tabs .seg-link { flex: 1; text-align: center; padding: 9px 12px; border-radius: 999px; color: inherit; text-decoration: none; font-weight: 600; }
.seg-tabs .seg-link.on { background: var(--green); color: var(--on-green, #fff); }
.dk-top { display: grid; gap: 8px; }
.dk-top p { margin: 0; }
.dk-when { font-size: calc(12.5px * var(--text-scale)); }
.dk-all { display: grid; gap: 10px; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.dk-all p { margin: 0; font-weight: 700; color: var(--green); }
.dk-all .btn { justify-self: start; }
.dk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dk-card { display: grid; gap: 8px; }
.dk-card.done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.dk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dk-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 13px; }
.dk-title { font-family: var(--font-sub); }
.dk-times { margin-inline-start: auto; font-size: calc(12.5px * var(--text-scale)); }
.dk-text { margin: 0; font-family: var(--font-ui); font-weight: 600; font-size: calc(20px * var(--text-scale)); line-height: 2.05; color: var(--ink); text-align: start; }
.dk-text .orn { color: var(--gold); margin: 0 3px; }
.dk-en { margin: 0; font-size: calc(14px * var(--text-scale)); line-height: 1.7; color: var(--ink-2); font-style: italic; }
.dk-virtue { margin: 0; font-size: calc(13.5px * var(--text-scale)); line-height: 1.8; padding: 8px 10px; border-radius: 10px; background: var(--gold-soft); }
.dk-src { margin: 0; font-size: calc(12px * var(--text-scale)); }
.dk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dk-count { min-width: 92px; min-height: 48px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--green); background: transparent; color: var(--green);
  font: inherit; font-family: var(--font-ui); font-weight: 700; font-size: calc(18px * var(--text-scale)); cursor: pointer; touch-action: manipulation; }
.dk-count small { font-size: .7em; opacity: .75; }
.dk-count.ok { background: var(--green); color: var(--on-green, #fff); }
.dk-count:active { transform: scale(.97); }
.dk-note { font-size: calc(12.5px * var(--text-scale)); margin: 12px 0 0; }
.dk-link { margin-inline-start: 6px; font-size: calc(12.5px * var(--text-scale)); color: var(--green); font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .dk-count:active { transform: none; } }

.dk-text .ayah-end { color: var(--gold); font-weight: 400; font-size: .8em; margin: 0 2px; }

/* today's adhkār: both sets in one box */
.dash-chip-ad { display: grid; gap: 4px; }
.dk-halves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dk-halves a { display: grid; gap: 0; color: inherit; text-decoration: none; padding: 2px 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.dk-halves a span { font-size: calc(11px * var(--text-scale)); color: var(--muted); }
.dk-halves a b { font-family: var(--font-ui); font-size: calc(15px * var(--text-scale)); }
.dk-halves a.ok b { color: var(--green); }
/* today's boxes: one row where the card is wide enough (tablets), two columns on phones, one on the narrowest */
.dash-today { container-type: inline-size; }
.dash-chips:has(.dash-chip-ad) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 520px) { .dash-chips:has(.dash-chip-ad) { grid-template-columns: 1fr 1fr 1fr 1.6fr; } }
@container (max-width: 299px) { .dash-chips:has(.dash-chip-ad) { grid-template-columns: 1fr; } }
/* the month's adhkār: a day split morning (top) / evening (bottom) */
.dk-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.dk-day i, .dk-k i { position: absolute; inset-inline: 0; height: 50%; display: block; }
.dk-day i.am, .dk-k i.am { top: 0; } .dk-day i.pm, .dk-k i.pm { bottom: 0; }
.dk-day i.y, .dk-k i.y { background: var(--green); }
.dk-day i.p, .dk-k i.p { background: color-mix(in srgb, var(--gold) 45%, var(--surface)); }
.dk-day i.u, .dk-k i.u { background: transparent; }
.dk-day b { position: relative; font-family: var(--font-ui); font-size: 11px; color: var(--ink); text-shadow: 0 0 3px var(--surface); }
.dk-day.future { opacity: .35; }
.dk-k { position: relative; display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); overflow: hidden; }
/* the month tiles: three per row on tablets and wider (the page is at most 680px), one per row on the narrowest phones */
@media (min-width: 720px) { .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 359px) { .dash-tiles { grid-template-columns: 1fr; } }
/* the last tile, when it is alone on its row, fills the row (tiles are buttons; the opened panels are divs) */
.dash-tiles > button.dash-tile:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .dash-tiles > button.dash-tile:last-of-type:nth-of-type(odd) { grid-column: auto; }
  .dash-tiles > button.dash-tile:last-of-type:nth-of-type(3n+1) { grid-column: 1 / -1; }
}

/* today's adhkār box: the total; morning and evening appear on hover, focus, or a tap */
.dash-chip-ad .dk-sum { display: grid; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.dash-chip-ad .dk-sum small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.dash-chip-ad .dk-sum b { font-family: var(--font-ui); font-size: calc(16px * var(--text-scale)); }
.dash-chip-ad.ok .dk-sum b { color: var(--green); }
.dash-chip-ad .dk-halves { display: none; }
.dash-chip-ad.open .dk-halves, .dash-chip-ad:focus-within .dk-halves { display: grid; }
@media (hover: hover) { .dash-chip-ad:hover .dk-halves { display: grid; } }

/* today's boxes: the figure at rest; details on hover, focus, or a tap */
.dash-chip-x { display: grid; gap: 6px; align-content: start; }
.dash-chip-x .x-sum { display: grid; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; width: 100%; }
.dash-chip-x .x-sum small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.dash-chip-x .x-sum b { font-family: var(--font-ui); font-size: calc(16px * var(--text-scale)); }
.dash-chip-x.ok .x-sum b { color: var(--green); }
.dash-chip-x .x-more { display: none; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.dash-chip-x.open .x-more, .dash-chip-x:focus-within .x-more { display: grid; }
@media (hover: hover) { .dash-chip-x:hover .x-more { display: grid; } }
.x-line { display: flex; justify-content: space-between; gap: 8px; font-size: calc(12.5px * var(--text-scale)); }
.x-line span { color: var(--ink-2); }
.x-line b { font-family: var(--font-ui); }
.x-line.ok b { color: var(--green); }
.x-note { font-size: calc(12px * var(--text-scale)); color: var(--muted); }
.x-go { margin-top: 2px; font-size: calc(12.5px * var(--text-scale)); font-weight: 600; color: var(--green); text-decoration: none; }
.dash-chip-x .dk-halves { display: grid; }
.dash-chips:has(.dash-chip-x) { align-items: start; }
.dash-chips:has(.dash-chip-x) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 520px) { .dash-chips:has(.dash-chip-x) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 299px) { .dash-chips:has(.dash-chip-x) { grid-template-columns: 1fr; } }

/* today's boxes open with motion: the details slide down while their lines fade in, one after another */
.dash-chip-x .x-more { display: grid; max-height: 0; opacity: 0; overflow: hidden; padding-top: 0; border-top-color: transparent;
  transform: translateY(-4px); transition: max-height .3s ease, opacity .2s ease, padding-top .3s ease, transform .3s ease, border-color .3s ease; }
.dash-chip-x.open .x-more, .dash-chip-x:focus-within .x-more { max-height: 260px; opacity: 1; padding-top: 6px; border-top-color: var(--line); transform: none; }
@media (hover: hover) { .dash-chip-x:hover .x-more { max-height: 260px; opacity: 1; padding-top: 6px; border-top-color: var(--line); transform: none; } }
.dash-chip-x .x-more > * { opacity: 0; transform: translateY(-3px); transition: opacity .25s ease, transform .25s ease; }
.dash-chip-x.open .x-more > *, .dash-chip-x:focus-within .x-more > * { opacity: 1; transform: none; }
@media (hover: hover) { .dash-chip-x:hover .x-more > * { opacity: 1; transform: none; } }
.dash-chip-x .x-more > :nth-child(1) { transition-delay: .06s; } .dash-chip-x .x-more > :nth-child(2) { transition-delay: .1s; }
.dash-chip-x .x-more > :nth-child(3) { transition-delay: .14s; } .dash-chip-x .x-more > :nth-child(4) { transition-delay: .18s; }
.dash-chip-x .x-more > :nth-child(5) { transition-delay: .22s; }
.dash-chip-x { transition: border-color .25s ease, box-shadow .25s ease; }
.dash-chip-x.open { box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 10%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .dash-chip-x .x-more, .dash-chip-x .x-more > *, .dash-chip-x { transition: none; }
}

.ts-per-sub { font-size: calc(11.5px * var(--text-scale)); }
.ts-per-bar.free i { background: color-mix(in srgb, var(--gold) 55%, var(--surface)); }
.ts-per li.met .ts-per-head b { color: var(--green); }

/* the goals across the month: a row per dhikr, a cell per day (sequential shades of one hue) */
.tg-wrap { overflow-x: auto; margin: 0 -2px; padding-bottom: 2px; }
.tg { display: grid; gap: 4px; min-width: 420px; }
.tg-row { display: grid; grid-template-columns: minmax(84px, 7.5em) 1fr 2.6em; align-items: center; gap: 8px; }
.tg-name { font-size: calc(12px * var(--text-scale)); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(7px, 1fr); gap: 2px; }
.tg-c { display: block; height: 16px; border-radius: 3px; background: var(--line); }
.tg-c.l1 { background: color-mix(in srgb, var(--ts-arc, var(--green)) 25%, var(--surface)); }
.tg-c.l2 { background: color-mix(in srgb, var(--ts-arc, var(--green)) 45%, var(--surface)); }
.tg-c.l3 { background: color-mix(in srgb, var(--ts-arc, var(--green)) 70%, var(--surface)); }
.tg-c.l4 { background: var(--ts-arc, var(--green)); }
.tg-c.future { background: transparent; border: 1px dashed var(--line); }
.tg-met { font-family: var(--font-ui); font-size: calc(12px * var(--text-scale)); text-align: end; }
.tg-axis .tg-cells span { font-size: 9.5px; color: var(--muted); text-align: center; font-family: var(--font-ui); }
.tg-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 8px 0 0 !important; font-size: calc(11.5px * var(--text-scale)); color: var(--muted); }
.tg-legend .tg-c { display: inline-block; width: 14px; height: 12px; }
.tg-legend span { margin: 0 4px; }

/* the goals grid fits the card: the days met sit under each name, and the cells narrow to fit the month */
.tg { min-width: 0; gap: 6px; }
.tg-row { grid-template-columns: minmax(70px, 6.5em) 1fr; gap: 6px; }
.tg-name { display: grid; gap: 0; }
.tg-name > span { overflow: hidden; text-overflow: ellipsis; }
.tg-met { text-align: start; color: var(--green); font-size: calc(11.5px * var(--text-scale)); }
.tg-cells { grid-auto-columns: minmax(4px, 1fr); gap: 1.5px; }
.tg-c { height: 18px; border-radius: 2px; }
.tg-axis .tg-cells span { min-width: 0; width: 0; overflow: visible; display: flex; justify-content: center; white-space: nowrap; }
.tg-cells > * { min-width: 0; }

/* the goals across the month as lines */
.tg-chart .tg-target { stroke: var(--ink-2); stroke-dasharray: 4 4; opacity: .7; }
.tg-chart .ln.tgs { stroke-width: 2; fill: none; }
.tg-chart .dot { stroke: var(--surface); stroke-width: 1.2; }
.tg-legend2 { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0 !important; font-size: calc(12px * var(--text-scale)); color: var(--ink-2); }
.tg-legend2 span { display: inline-flex; align-items: center; gap: 6px; }
.tg-legend2 b { font-family: var(--font-ui); color: var(--ink); }
.tg-sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.tg-sw.p-fajr { background: var(--p-fajr); } .tg-sw.p-sunrise { background: var(--p-sunrise); } .tg-sw.p-dhuhr { background: var(--p-dhuhr); }
.tg-sw.p-asr { background: var(--p-asr); } .tg-sw.p-maghrib { background: var(--p-maghrib); } .tg-sw.p-isha { background: var(--p-isha); }
.tg-axisnote { font-size: calc(11.5px * var(--text-scale)); margin: 4px 0 0 !important; }

.tg-free { margin: 8px 0 0 !important; padding: 8px 10px; border-radius: 10px; background: var(--gold-soft); font-size: calc(12.5px * var(--text-scale)); line-height: 1.8; }
.tg-free a { color: var(--green); font-weight: 600; }
.ts-goal { transition: box-shadow .4s; border-radius: 12px; }
.ts-goal.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }

/* the adhkār recitation from YouTube, loaded on tap */
.dk-yt { display: grid; gap: 8px; }
.dk-yt-btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.dk-yt-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; max-width: 100%; }
.dk-yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dk-yt-note { margin: 0; font-size: calc(12px * var(--text-scale)); }

.dk-weak { margin: 0; padding: 6px 10px; border-radius: 8px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); font-size: calc(12px * var(--text-scale)); line-height: 1.7; color: var(--ink-2); }

.dk-file { gap: 8px; }
.dk-file-title { font-weight: 700; font-family: var(--font-sub); }
.dk-file audio { width: 100%; }

/* the dhikr being recited: a gold ring and a soft glow; the player stays at the top while scrolling */
.dk-card { scroll-margin-top: calc(var(--top-h, 64px) + 96px); transition: box-shadow .3s, border-color .3s; }
.dk-card.playing { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent), var(--shadow); }
.dk-card.playing .dk-num { background: var(--gold); color: #fff; }
.dk-file { position: sticky; top: calc(var(--top-h, 64px) + 8px); z-index: 3; }
.dk-seek { padding: 6px 12px; min-height: 40px; font-size: calc(13px * var(--text-scale)); }
@media (prefers-reduced-motion: reduce) { .dk-card { transition: none; } }
.dk-text { font-weight: 400; }

.dk-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dk-rate > span { font-size: calc(12.5px * var(--text-scale)); color: var(--muted); margin-inline-end: 4px; }
.dk-rate .chip { padding: 4px 12px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-family: var(--font-ui); font-size: calc(13px * var(--text-scale)); cursor: pointer; }
.dk-rate .chip.on { background: var(--green); color: var(--on-green, #fff); border-color: var(--green); }

/* the khatma goal */
.kh-goal { display: grid; gap: 4px; }
.kh-goal > span { font-size: calc(13px * var(--text-scale)); color: var(--ink-2); }
.kh-goal .tasbih-chips { margin: 0; }
.kh-total { display: grid; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--line); }
.kh-total > span { font-weight: 600; font-size: calc(13.5px * var(--text-scale)); }
/* the goal bar, one segment per khatma, filled in turn */
.wird-bar.kh-goalbar { display: flex; flex: none; gap: 3px; background: none; overflow: visible; }
.wird-bar.kh-goalbar i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.wird-bar.kh-goalbar b { background: var(--gold); border-radius: 4px; }
/* the khatma in the Journey tile: today's portion, then the goal */
.kh-dash-today { display: grid; gap: 4px; margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); }
.kh-dash-today.done { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.kh-dash-today strong { font-size: calc(14.5px * var(--text-scale)); }
.kh-dash-today.done strong { color: var(--green); }
.kh-dash-today span { font-size: calc(12.5px * var(--text-scale)); color: var(--ink-2); }
.kh-dash-goal { display: grid; gap: 4px; margin: 6px 0 10px; }
.kh-dash-goal > span { font-size: calc(13px * var(--text-scale)); font-weight: 600; }
.dash-detail .kh-chart { margin-top: 8px; }
.kh-which { margin: 10px 0 6px; font-size: calc(14.5px * var(--text-scale)); }
.kh-which small { font-weight: 400; font-size: calc(12.5px * var(--text-scale)); }

/* today's portion of the khatma */
.kh-today { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); }
.kh-today-label { font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); color: var(--gold); }
.kh-today strong { font-size: calc(16px * var(--text-scale)); line-height: 1.6; }
.kh-today-range { font-size: calc(13px * var(--text-scale)); color: var(--ink-2); }
.kh-today .wird-bar { display: block; background: color-mix(in srgb, var(--gold) 20%, var(--surface)); height: 8px; border-radius: 4px; overflow: hidden; }
.kh-today .wird-bar b { background: var(--green); }
.kh-today.done { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.kh-today.done strong { color: var(--green); }
/* the khatma by day: what was read (solid), today's portion (an outline, filled as you read), the plan (light, dashed) */
.kh-chart { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.kh-chart h4 { margin: 0; font-size: calc(14px * var(--text-scale)); }
.kh-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; height: 120px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.kh-bar { position: relative; display: block; height: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.kh-bar i { position: absolute; inset-inline: 0; bottom: 0; display: block; border-radius: 3px 3px 0 0; }
.kh-bar.past i { background: var(--green); }
.kh-bar.past.none::after { content: ''; position: absolute; inset-inline: 1px; bottom: 0; height: 4px; border-top: 2px dotted var(--muted); opacity: .5; }
.kh-bar.today i { background: var(--green); }
.kh-bar.today i.goal { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border: 1.5px solid var(--gold); border-bottom: 0; box-sizing: border-box; }
.kh-bar.plan i { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--gold) 70%, var(--line)); border-bottom: 0; box-sizing: border-box; }
.kh-bar small { position: absolute; bottom: -17px; inset-inline: -4px; text-align: center; font-size: 9.5px; color: var(--muted); }
.kh-bar.today small { color: var(--gold); font-weight: 700; }
.kh-bar:hover i, .kh-bar.sel i { filter: brightness(1.12); }
.kh-bar.sel::before { content: ''; position: absolute; inset: -2px -1px; border-radius: 4px; background: color-mix(in srgb, var(--gold) 14%, transparent); }
.kh-bar:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-radius: 3px; }
.kh-chart-read { margin: 4px 0 0; min-height: 1.6em; font-size: calc(13.5px * var(--text-scale)); font-weight: 600; }
.kh-k { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; box-sizing: border-box; }
.kh-k.past { background: var(--green); }
.kh-k.today { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border: 1.5px solid var(--gold); }
.kh-k.plan { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); border: 1px dashed var(--gold); }
.kh-how {margin-top: 4px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--gold) 40%, var(--line)); font-size: calc(12.5px * var(--text-scale)); color: var(--ink-2); line-height: 1.7; }
.kh-ahead {font-size: calc(13px * var(--text-scale)); color: var(--green); font-weight: 600; }

/* ---------- the tasbīḥ counting by itself: start / pause under the ring, a bar filling to the next count ---------- */
.ts-auto-row { display: grid; justify-items: center; gap: 6px; margin-top: 10px; }
/* the counting-by-itself button: a disc with play or pause, the label and its pace; running, it turns soft green,
   the disc gold and breathing, and the bar to the next count runs along its foot */
.ts-auto-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px; min-width: min(280px, 100%);
  padding: 7px; padding-inline-end: 22px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05); transition: background-color .2s, border-color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.ts-auto-btn:hover { border-color: var(--green); box-shadow: 0 3px 12px color-mix(in srgb, var(--green) 18%, transparent); }
.ts-auto-btn:active { transform: scale(.98); }
.ts-auto-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ts-auto-ico { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); color: var(--on-green, #fff); box-shadow: 0 2px 8px color-mix(in srgb, var(--green) 35%, transparent); transition: background-color .2s; }
.ts-auto-txt { display: grid; gap: 1px; line-height: 1.35; }
.ts-auto-txt b { font-weight: 700; font-size: calc(15px * var(--text-scale)); }
.ts-auto-txt small { color: var(--muted); font-size: calc(12px * var(--text-scale)); }
.ts-auto-btn.on { background: color-mix(in srgb, var(--green-soft) 80%, var(--surface)); border-color: var(--green); }
.ts-auto-btn.on .ts-auto-ico { background: var(--gold); color: #fff; animation: tsAutoBreathe 2.4s ease-in-out infinite; }
@keyframes tsAutoBreathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 50%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
/* the time to the next count: a fill sweeping across the whole button, from its start side, under the disc and label */
.ts-auto-btn .ts-auto-tick.ts-auto-in { position: absolute; inset: 0; width: auto; height: auto; border-radius: inherit; background: transparent; z-index: 0; pointer-events: none; }
.ts-auto-btn .ts-auto-in i { border-radius: 0; background: color-mix(in srgb, var(--green) 24%, transparent); }
.ts-auto-ico, .ts-auto-txt { position: relative; z-index: 1; }
.ts-auto-row > small::first-letter { text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { .ts-auto-btn.on .ts-auto-ico { animation: none; } .ts-auto-btn:active { transform: none; } }
.ts-auto-tick { display: block; width: min(220px, 70%); height: 4px; border-radius: 2px; background: var(--ts-track, var(--line)); overflow: hidden; }
.ts-auto-tick i { display: block; height: 100%; width: 100%; border-radius: 2px; background: var(--ts-arc, var(--green)); transform-origin: left center; animation: tsAutoFill linear forwards; }
[dir="rtl"] .ts-auto-tick i { transform-origin: right center; }
@keyframes tsAutoFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ts-auto-row small { font-size: calc(12.5px * var(--text-scale)); text-align: center; }
.tasbih-tap.auto { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent); }
.ts-auto-set { gap: 8px; }
.ts-auto-info { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 12px; padding: 10px 12px; border-radius: 12px; text-align: start;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--gold-soft); font-size: calc(13px * var(--text-scale)); line-height: 1.7; }
.ts-auto-info svg { flex: none; margin-top: 3px; color: var(--gold); }
.ts-auto-sec { display: flex; justify-content: space-between; align-items: baseline; width: 100%; gap: 10px; font-size: calc(13.5px * var(--text-scale)); }
.ts-auto-sec output { font-weight: 700; font-variant-numeric: tabular-nums; }
#tsAutoSec { width: 100%; accent-color: var(--green); }
.ts-auto-sub { display: block; margin-top: 14px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ts-auto-tick i { animation: none; transform: none; } }
/* the dhikr timer under the count: the time of this sitting, a finish button; after it, the last sitting's time and pace */
.ts-timer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; margin-top: 8px; color: var(--muted); }
.ts-timer #tsTimer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: calc(17px * var(--text-scale)); letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.ts-timer.on { color: var(--ink); }
.ts-timer.on svg { color: var(--gold); }
.ts-timer small { flex-basis: 100%; text-align: center; font-size: calc(12.5px * var(--text-scale)); }
.ts-timer-stop { min-height: 32px; padding: 3px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: calc(13.5px * var(--text-scale)); cursor: pointer; }
.ts-timer-stop:hover { background: var(--gold-soft); }
.ts-timer-stop:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the self-review's Qur'an group: a line with today's khatma portion, opening the khatma page */
.kh-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); font-size: calc(14px * var(--text-scale)); }
.kh-line svg { flex: none; color: var(--gold); }
.kh-line > span:first-of-type { flex: 1; min-width: 0; }
.kh-line-go { flex: none; font-size: calc(12.5px * var(--text-scale)); color: var(--green); font-weight: 600; white-space: nowrap; }
.kh-line-go::after { content: ' ›'; }
[dir="rtl"] .kh-line-go::after { content: ' ‹'; }
.kh-line.done { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.kh-line:hover { border-color: var(--gold); }
.kh-line:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- tonight's moon on the day page: a night sky in both themes, the moon large, the month in a ribbon ---------- */
.mx-card { position: relative; display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 4px 14px; margin-bottom: 14px; padding: 14px 16px 12px;
  border-radius: var(--radius); overflow: hidden; isolation: isolate; text-decoration: none; color: #eef1fb;
  background: radial-gradient(120% 100% at 15% 15%, #2c3a68 0%, #17213f 50%, #0b1026 100%); box-shadow: var(--shadow);
  border: 1px solid rgba(255, 246, 220, .08); }
[dir="rtl"] .mx-card { background: radial-gradient(120% 100% at 85% 15%, #2c3a68 0%, #17213f 50%, #0b1026 100%); }
.mx-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.mx-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.mx-sky i { position: absolute; border-radius: 50%; background: #fff; opacity: .55; }
.mx-sky i.tw { animation: mxTwinkle 3.6s ease-in-out infinite; }
@keyframes mxTwinkle { 0%, 100% { opacity: .2; } 50% { opacity: .95; } }
.mx-moon { width: 128px; height: 128px; display: block; filter: drop-shadow(0 0 18px rgba(255, 236, 190, .18)); }
.mx-card.intro .mx-moon { animation: mxRise 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes mxRise { from { transform: translateY(10px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.mx-info { display: grid; gap: 2px; min-width: 0; }
.mx-label { font-family: var(--font-sub); font-size: calc(12.5px * var(--text-scale)); letter-spacing: .02em; color: #e6c98c; }
.mx-phase { font-family: var(--font-display, inherit); font-size: calc(22px * var(--text-scale)); line-height: 1.3; color: #fff8e6; }
.mx-facts { font-size: calc(13.5px * var(--text-scale)); color: #c9d0e6; }
.mx-pct { color: #fff8e6; font-variant-numeric: tabular-nums; }
.mx-hint { margin-top: 4px; font-size: calc(13px * var(--text-scale)); line-height: 1.6; color: #e6c98c; }
.mx-ribbon { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1px; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 246, 220, .1); }
.mx-r { flex: 0 1 11px; width: 11px; height: 11px; opacity: .38; transition: transform .2s; }
.mx-r.past { opacity: .8; }
.mx-r.now { opacity: 1; transform: scale(1.7); filter: drop-shadow(0 0 4px rgba(255, 236, 190, .9)); }
.mx-r .moon-dark { fill: #26304d; }
.mx-r .moon-lit { fill: #f6e7bd; }
.mx-r .moon-rim { stroke: rgba(255, 246, 220, .25); stroke-width: 1; }
@media (max-width: 360px) { .mx-card { grid-template-columns: 104px 1fr; } .mx-moon { width: 104px; height: 104px; } }
@media (prefers-reduced-motion: reduce) { .mx-sky i.tw, .mx-card.intro .mx-moon { animation: none; } }

/* ---------- the mushaf: a page of the Madinah mushaf set in text, framed like print ---------- */
.mx-tools .field select, .mx-tools .field input { width: 100%; }
.mx-pagef input { text-align: center; }
.mx-settings { display: grid; gap: 10px; }
.mx-settings h3 { margin: 0; }
.mx-size .seg { justify-content: center; }
.mx-size .seg button { min-width: 3.2em; }
.mx-page { --mx-ink: #2b2417; --mx-paper: #fdf8ea; --mx-gold: #b3863b;
  position: relative; margin: 0 0 14px; padding: 18px 16px 14px; border-radius: 6px; color: var(--mx-ink);
  background: radial-gradient(120% 90% at 50% 0%, #fffdf4 0%, var(--mx-paper) 60%, #f6edd3 100%);
  border: 2px solid var(--mx-gold); box-shadow: inset 0 0 0 4px var(--mx-paper), inset 0 0 0 5px color-mix(in srgb, var(--mx-gold) 70%, transparent), var(--shadow); }
:root[data-theme="dark"] .mx-page, .theme-dark .mx-page { --mx-ink: #f3ead2; --mx-paper: #1c2233; background: radial-gradient(120% 90% at 50% 0%, #252c40 0%, #1c2233 60%, #161b29 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mx-page { --mx-ink: #f3ead2; --mx-paper: #1c2233; background: radial-gradient(120% 90% at 50% 0%, #252c40 0%, #1c2233 60%, #161b29 100%); } }
.mx-top { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px 8px; margin-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--mx-gold) 55%, transparent);
  font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(15px * var(--text-scale)); color: var(--mx-gold); }
.mx-body { font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(23px * var(--mx-scale, 1) * var(--text-scale)); line-height: 2.25; }
.mx-text { margin: 0; text-align: justify; text-align-last: center; word-spacing: .04em; }
.mx-end { display: inline-flex; align-items: center; justify-content: center; width: 1.75em; height: 1.75em; margin: 0 .06em;
  font-size: .62em; line-height: 1; vertical-align: .18em; color: var(--mx-gold); font-family: 'Amiri', 'Amiri Quran', serif; font-weight: 700;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23b3863b' stroke-width='1.6'%3E%3Ccircle cx='20' cy='20' r='14'/%3E%3Cpath d='M20 2l4.5 6.5L32 6l-.5 7.5L38 20l-6.5 4.5L32 32l-7.5-.5L20 38l-4.5-6.5L8 32l.5-7.5L2 20l6.5-4.5L8 8l7.5.5z'/%3E%3C/g%3E%3C/svg%3E"); }
.mx-sura { margin: 10px 0 6px; padding: 4px 10px; text-align: center; border: 1.5px solid var(--mx-gold); border-radius: 4px; line-height: 1.5;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--mx-gold) 16%, transparent), transparent);
  font-size: .9em; color: var(--mx-ink); }
.mx-sura span { display: inline-block; padding: 0 16px; background: var(--mx-paper); border-radius: 999px; line-height: 1.6; }
/* the surah's name in the middle of its band, both ways */
.mx-sura { display: flex; align-items: center; justify-content: center; }
.mx-sura span { line-height: .5; padding: .1em 16px .76em; }   /* Amiri Quran's letters sit low in their line (measured): more room below than above, so the name's body is in the middle at any size */
.mx-end i { font-style: normal; line-height: 1; }
.mx-end.d2 i { font-size: .8em; }
.mx-end.d3 i { font-size: .64em; letter-spacing: -.02em; }
.mx-basmalah { margin: 4px 0 2px; text-align: center; font-size: .95em; }
.mx-foot { display: flex; justify-content: center; margin-top: 8px; }
.mx-num { min-width: 2.2em; padding: 2px 10px; border: 1px solid color-mix(in srgb, var(--mx-gold) 70%, transparent); border-radius: 999px; text-align: center;
  font-family: 'Amiri', serif; font-size: calc(15px * var(--text-scale)); color: var(--mx-gold); }
/* the Complex's page images: the page itself, without the text view's frame; light pages stay light at night */
.mx-page.has-img { padding: 0; border: 0; background: #fff; box-shadow: var(--shadow); overflow: hidden; border-radius: 8px; max-width: 560px; margin-inline: auto; }
.mx-img { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 1430; }
.mx-mode { display: grid; gap: 6px; justify-items: start; }
.mx-mode small { display: block; }
/* the mushaf's four ways to show it: two by two, so each name stays on one line on a phone */
.mx-mode4 .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; width: 100%; max-width: 440px; box-sizing: border-box; border-radius: 18px; }
.mx-mode4 .seg button, .mx-mode4 .seg button[aria-pressed="true"] { border-radius: 14px; white-space: nowrap; padding: 8px 10px; }
/* three ways: in three columns, a long name on two lines in its rounded box */
.mx-mode3 .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; width: 100%; max-width: 440px; box-sizing: border-box; border-radius: 18px; }
.mx-mode3 .seg button, .mx-mode3 .seg button[aria-pressed="true"] { border-radius: 14px; padding: 7px 8px; line-height: 1.3; }
.mx-nav { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.mx-nav .btn { display: inline-flex; align-items: center; gap: 6px; }
.mx-actions { display: grid; gap: 10px; justify-items: start; }
.mx-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.mx-actions .btn.on { border-color: var(--gold); background: var(--gold-soft); }
.mx-actions h3 { margin: 6px 0 0; }
.mx-here { margin: 0; color: var(--green); font-weight: 600; }
.mx-loading { text-align: center; padding: 30px 16px; }
.kh-read { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; text-decoration: none; }
@media (min-width: 720px) { .mx-page { padding: 26px 30px 18px; } .mx-tools { grid-template-columns: auto 1fr; align-items: center; } }

/* size labels (A−, A+, A++) keep their order in Arabic too */
[data-action="scale"], [data-action="mushaf-size"] { direction: ltr; unicode-bidi: isolate; }

/* the page images at night: inverted (light letters on dark), the hues turned back so the frame stays green, and
   blended onto the night blue so the paper takes the app's colour; "light" keeps the printed page */
:root[data-theme="dark"] .mx-page.has-img:not(.keep-light) { background: #141b2d; }
:root[data-theme="dark"] .mx-page.has-img:not(.keep-light) .mx-img { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mx-page.has-img:not(.keep-light) { background: #141b2d; }
  :root:not([data-theme="light"]) .mx-page.has-img:not(.keep-light) .mx-img { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
}

/* the mushaf in the Complex's font: the page drawn as the printed one, at the same places (sized by the page's width) */
.mx-page.has-font { container-type: inline-size; }
.mx-fpage { position: relative; aspect-ratio: 1000 / 1430; background: #fff; -webkit-user-select: none; user-select: none; }
.mx-fpage > * { position: absolute; }
.mx-fband { background: #c0e2c9; border-radius: 1.4cqw; }
.mx-finner { background: #fff; }
.mx-fhead { display: flex; justify-content: space-between; align-items: center; font: 2.9cqw/1 'Amiri Quran', 'Amiri', serif; color: #1b1b18; }
.mx-fnum { display: flex; justify-content: center; align-items: center; font: 2.6cqw/1 'Amiri', serif; color: #1b1b18; }
.mx-fslot > .qy-line { width: 100%; height: 100%; }
.mx-page.has-font .qy-ftext { font-size: calc(var(--mx-lw) * .985 / var(--mx-fem) * var(--fx, 1)); }
.mx-page.has-font .qy-ftext .qy-fdim { opacity: 1; }
:root[data-theme="dark"] .mx-page.has-font:not(.keep-light) .mx-fpage { background: transparent; }
:root[data-theme="dark"] .mx-page.has-font:not(.keep-light) .mx-finner { background: #141b2d; }
:root[data-theme="dark"] .mx-page.has-font:not(.keep-light) .mx-fband { background: #1f3a2b; }
:root[data-theme="dark"] .mx-page.has-font:not(.keep-light) :is(.mx-fhead, .mx-fnum, .qy-ftext) { color: #e4e9e5; }
:root[data-theme="dark"] .mx-page.has-font:not(.keep-light) .qy-line:not(.qy-fline) { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mx-page.has-font:not(.keep-light) .mx-fpage { background: transparent; }
  :root:not([data-theme="light"]) .mx-page.has-font:not(.keep-light) .mx-finner { background: #141b2d; }
  :root:not([data-theme="light"]) .mx-page.has-font:not(.keep-light) .mx-fband { background: #1f3a2b; }
  :root:not([data-theme="light"]) .mx-page.has-font:not(.keep-light) :is(.mx-fhead, .mx-fnum, .qy-ftext) { color: #e4e9e5; }
  :root:not([data-theme="light"]) .mx-page.has-font:not(.keep-light) .qy-line:not(.qy-fline) { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
}

/* ---------- the qiyam view: a quarter on one page, from the mushaf's own lines ---------- */
.qy-sheet, .qy-end { --qy-w: min(calc(100vw - 32px), 760px); width: var(--qy-w); box-sizing: border-box;
  /* wider than the app's column: centred on it (an auto margin would let it spill to one side) */
  margin-left: calc((100% - var(--qy-w)) / 2); margin-right: calc((100% - var(--qy-w)) / 2); }
.qy-sheet { margin-bottom: 12px; padding: 12px 0 10px; background: #fff; color: #24402f; border-radius: 10px; box-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qy-head { display: grid; justify-items: center; gap: 2px; margin: 0 16px 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(46,107,69,.22); text-align: center; }
.qy-head b { font-family: 'Amiri', serif; font-size: calc(19px * var(--text-scale)); color: #2e6b45; }
.qy-head small { color: #6d7d72; font-size: calc(12.5px * var(--text-scale)); }
.qy-part { position: relative; overflow: hidden; width: 100%; }
.qy-part img { position: absolute; display: block; max-width: none; height: auto; }
.qy-part.qy-open { width: 66%; margin: 4px auto; }
.qy-dim { position: absolute; background: #fff; opacity: .74; pointer-events: none; }
.qy-pg, .qy-foot { display: flex; align-items: center; gap: 10px; margin: 1px 18px; color: #8b998f; font-family: 'Amiri', serif; font-size: calc(13px * var(--text-scale)); }
.qy-pg::before, .qy-pg::after { content: ''; flex: 1; border-top: 1px dashed rgba(46,107,69,.3); }
.qy-foot { justify-content: center; margin-top: 6px; }
.qy-end { display: grid; gap: 8px; margin-bottom: 14px; }
.qy-next { display: grid; gap: 2px; justify-items: center; text-align: center; }
.qy-next small { font-family: 'Amiri', serif; font-weight: 400; font-size: calc(15px * var(--text-scale)); opacity: .9; }
.qy-juz { margin: 10px 4px 2px; font-size: calc(13px * var(--text-scale)); color: var(--muted); }
.qy-juz:first-child { margin-top: 0; }
.qy-row small span { font-family: 'Amiri', serif; }
body.mx-reading #view > .qy-sheet, body.mx-reading #view > .qy-end { flex: none; }
body.qy-reading #view { justify-content: flex-start; }
body.qy-reading.mx-focus .qy-end { margin-bottom: 40px; }
/* the whole quarter on the screen: fixed over the page, the bars floating above; the lines in columns from the right */
body.qy-fitmode { overflow: hidden; }
.qy-sheet.qy-fit { position: fixed; inset: 0; z-index: 20; width: auto; margin: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column;
  padding: calc(6px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  touch-action: none; overscroll-behavior: none; }
.qy-fit-head { display: flex; justify-content: center; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 4px; text-align: center; line-height: 1.3; }
.qy-fit-head b { font-family: 'Amiri', serif; font-size: 15px; color: #2e6b45; }
.qy-fit-head small { font-size: 11.5px; color: #7d8b81; }
.qy-fit-head .qy-turn { display: none; flex-basis: 100%; color: #b07a1e; }
.qy-fit.qy-small .qy-fit-head .qy-turn { display: block; }
.qy-cols { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qy-colwrap { display: flex; align-items: flex-start; gap: var(--qy-gap); }
.qy-col { position: relative; display: flex; flex-direction: column; }
.qy-col + .qy-col::before { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--qy-gap) / -2); border-inline-start: 1px solid rgba(46,107,69,.22); }
.qy-line { position: relative; overflow: hidden; width: 100%; flex: none; }
.qy-line img { position: absolute; display: block; max-width: none; height: auto; }
.qy-newpage::after { content: attr(data-pg); position: absolute; top: 0; inset-inline: 0; border-top: 1px dashed rgba(46,107,69,.35); font: 9px/1.2 'Amiri', serif; color: #8b998f; text-align: end; pointer-events: none; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-line:not(.qy-fline) { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-line:not(.qy-fline) { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
}
/* the font option: a line of words in its page's font, spread to the line's ends; the words of the quarters either
   side faded; at night, light letters (no inverting) */
.qy-fline { overflow: visible; display: flex; align-items: center; }
.qy-ftext { width: 100%; display: flex; justify-content: space-between; align-items: center; white-space: nowrap; font-size: calc(var(--qy-fs, 20px) * var(--fx, 1)); line-height: 1; color: #16160f; font-feature-settings: normal; }
.qy-ftext.qy-fcenter { justify-content: center; gap: .14em; }
.qy-ftext .qy-fdim { opacity: .26; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-ftext { color: #e4e9e5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-ftext { color: #e4e9e5; }
}
/* the quarter flowing: the words across the whole width, the size set so all of it fits */
.qy-flow { width: 100%; line-height: 1.7; color: #16160f; font-feature-settings: normal; word-spacing: -.1em; }
.qy-flow-p { margin: 0; text-align: justify; }
.qy-flow-heads { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 .5em; padding: .1em 0; }
.qy-flow-head { width: min(100%, calc(1.15em * 9.31)); }
.qy-flow-head .qy-line { width: 100%; }
.qy-flow-sura { padding: 0 1.2em; text-align: center; font: .62em/1.8 'Amiri Quran', 'Amiri', serif; color: #2e6b45; background: rgba(192,226,201,.55); border-radius: .4em; word-spacing: normal; }
.qy-flow-basm { background: none; color: inherit; line-height: 1.8; }
.qy-flow-pg { font: .34em/1 'Amiri', serif; color: #8b998f; vertical-align: super; padding: 0 .2em; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-flow { color: #e4e9e5; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-flow-sura:not(.qy-flow-basm) { color: #8fd0a6; background: rgba(31,58,43,.8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-flow { color: #e4e9e5; }
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-flow-sura:not(.qy-flow-basm) { color: #8fd0a6; background: rgba(31,58,43,.8); }
}
/* flowing in the mushaf's frame: the quarter in the page of the mushaf's «نص بخط المجمع» (its gold double frame, its
   paper, by day or night as the app's theme), on the app's background; the surah, quarter and juz' along its top, the
   quarter's pages in its foot, the surahs' headings and the basmalah in text */
#qyFit.qy-flowmode { background: transparent; color: inherit; padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left)); }
.qy-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; padding: 14px 14px 10px; }
@media (min-width: 720px) { .qy-frame { padding: 20px 26px 14px; } }
#qyFit .qy-frame .qy-fit-head { justify-content: space-between; align-items: baseline; gap: 6px 10px; text-align: start; line-height: 1.4; padding: 0 4px 6px; margin-bottom: 6px; }
#qyFit .qy-frame .qy-fit-head b { font-family: 'Amiri Quran', 'Amiri', serif; font-size: inherit; color: var(--mx-gold); }
.qy-frame .qy-cols { flex: 1; min-height: 0; }
.qy-frame .mx-foot { margin-top: 6px; }
#qyFit .qy-frame .qy-flow { color: var(--mx-ink); font-family: 'Amiri Quran', 'Amiri', serif; }
.qy-frame .qy-flow-pg { color: color-mix(in srgb, var(--mx-gold) 80%, transparent); }
/* the headings' spacing in the letters' size (not fixed pixels), so a quarter of many short surahs still fits */
.qy-frame .qy-flow .mx-sura { margin: .2em 0 0; padding: .1em .4em; font-size: .78em; line-height: 1.45; border-width: 1px; word-spacing: normal; }
/* light pages at night (the qiyam's «الصفحات في الوضع الليلي: فاتحة»): the frame's page stays the day's paper */
:root[data-theme="dark"] .qy-sheet.keep-light .qy-frame { --mx-ink: #2b2417; --mx-paper: #fdf8ea; background: radial-gradient(120% 90% at 50% 0%, #fffdf4 0%, var(--mx-paper) 60%, #f6edd3 100%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qy-sheet.keep-light .qy-frame { --mx-ink: #2b2417; --mx-paper: #fdf8ea; background: radial-gradient(120% 90% at 50% 0%, #fffdf4 0%, var(--mx-paper) 60%, #f6edd3 100%); }
}
.qy-frame .qy-flow .mx-basmalah { margin: 0; font-size: .8em; line-height: 1.6; word-spacing: normal; }
/* at night: the lines inverted as the mushaf's pages are (with their faded parts, so these take the page's colour) */
:root[data-theme="dark"] .qy-sheet:not(.keep-light) { background: #141b2d; color: #dfe7e1; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-part { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
:root[data-theme="dark"] .qy-sheet:not(.keep-light) .qy-head b { color: #8fd0a6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) { background: #141b2d; color: #dfe7e1; }
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-part { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.94); mix-blend-mode: screen; }
  :root:not([data-theme="light"]) .qy-sheet:not(.keep-light) .qy-head b { color: #8fd0a6; }
}

/* ---------- the mushaf: index, search, scrubber, focus mode, two-page spread, verse menu ---------- */
.mx-tools { display: grid; gap: 12px; grid-template-columns: 1fr; }
.mx-tool-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.mx-tool-btns .btn { display: inline-flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.mx-scrub { display: grid; gap: 6px; }
.mx-scrub-where { font-weight: 600; font-size: calc(14px * var(--text-scale)); text-align: center; }
#mxScrub, #qyScrub { width: 100%; accent-color: var(--green); }
.mx-spread { margin-bottom: 14px; }
/* the spread is wider than the page column: centred on the screen by equal negative margins (the same either way) */
.mx-spread.two { --mx-w: min(1180px, 94vw, calc((100vh - 120px) * 1.4)); display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: var(--mx-w);
  margin-left: calc((100% - var(--mx-w)) / 2); margin-right: calc((100% - var(--mx-w)) / 2); }
/* the two pages as one open mushaf: a single card and shadow, and a soft spine at the fold (no line between them) */
.mx-spread.two { position: relative; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.mx-spread.two .mx-page.has-img { max-width: none; margin: 0; border-radius: 0; box-shadow: none; border: 0; }
.mx-spread.two::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 64px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,.05) 30%, rgba(0,0,0,.13) 47%, rgba(0,0,0,.16) 50%, rgba(0,0,0,.13) 53%, rgba(0,0,0,.05) 70%, rgba(0,0,0,0) 100%); }
:root[data-theme="dark"] .mx-spread.two:not(.keep-light) { background: #141b2d; }
:root[data-theme="dark"] .mx-spread.two:not(.keep-light)::after { background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.18) 45%, rgba(0,0,0,.28) 50%, rgba(0,0,0,.18) 55%, rgba(0,0,0,0)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mx-spread.two:not(.keep-light) { background: #141b2d; }
  :root:not([data-theme="light"]) .mx-spread.two:not(.keep-light)::after { background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.18) 45%, rgba(0,0,0,.28) 50%, rgba(0,0,0,.18) 55%, rgba(0,0,0,0)); }
}
.mx-nav { align-items: center; }
.mx-where { min-width: 3em; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.mx-focus-hint { text-align: center; font-size: calc(12.5px * var(--text-scale)); margin: -6px 0 14px; }
.mx-v { cursor: pointer; border-radius: 6px; transition: background .2s; }
.mx-v:hover, .mx-v:focus-visible { background: color-mix(in srgb, var(--mx-gold) 18%, transparent); outline: none; }
.mx-v.flash { background: color-mix(in srgb, var(--mx-gold) 34%, transparent); }
/* the text in the Complex's fonts: their letters a little smaller than the Amiri they replace, the line as tall */
.mx-qw { font-size: 1.12em; line-height: 1; font-feature-settings: normal; }
/* focus mode: only the page and the turning buttons */
/* the index and search sheets */
.mx-filter { width: 100%; margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.mx-list { display: grid; gap: 4px; max-height: 56vh; overflow: auto; margin-bottom: 12px; }
.mx-row { display: grid; grid-template-columns: 2.4em 1fr auto; grid-template-areas: 'n nm pg' 'n sub pg'; align-items: center; gap: 0 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.mx-row:hover, .mx-row:focus-visible { border-color: var(--gold); outline: none; }
.mx-row b { grid-area: n; display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-size: calc(13px * var(--text-scale)); }
.mx-row .nm { grid-area: nm; font-weight: 600; }
.mx-row small { grid-area: sub; color: var(--muted); font-size: calc(12.5px * var(--text-scale)); }
.mx-row .pg { grid-area: pg; color: var(--muted); font-size: calc(13px * var(--text-scale)); font-variant-numeric: tabular-nums; }
.mx-hit { grid-template-columns: 1fr auto; grid-template-areas: 'nm pg' 'snip snip'; }
.mx-snip { grid-area: snip; margin-top: 4px; font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(17px * var(--text-scale)); line-height: 2; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mx-count { margin: 0 0 6px; }
.mx-verse-pre { font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(21px * var(--text-scale)); line-height: 2.1; margin: 6px 0 12px; max-height: 40vh; overflow: auto; }
.mx-verse-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.menu-row-sub { display: block; font-size: calc(12px * var(--text-scale)); color: var(--muted); font-weight: 400; }

/* a single page stretches to nearly the screen's width (about 2.5 mm from each edge), still a card with its shadow */
.mx-spread:not(.two) { --mx-w: calc(100vw - 20px); width: var(--mx-w); margin-left: calc((100% - var(--mx-w)) / 2); margin-right: calc((100% - var(--mx-w)) / 2); }
.mx-spread:not(.two) .mx-page.has-img { max-width: none; margin: 0; }
html, body { overflow-x: clip; }
.mx-nav .btn { white-space: nowrap; flex: 1 1 0; min-width: 0; justify-content: center; max-width: 220px; }

/* ---------- the mushaf as a reading screen: the page alone, floating bars over it ---------- */
body.mx-reading .bottom-nav, body.mx-reading .poc-strip { display: none; }
body.mx-reading #view { padding-top: 104px; padding-bottom: 84px; }
.mx-bar { position: fixed; inset-inline: 8px; z-index: 25; display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0, 0, 0, .14); transition: transform .25s ease, opacity .25s ease; }
.mx-bar-top { top: calc(46px + env(safe-area-inset-top)); }
.mx-bar-bottom { bottom: calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
.mx-bar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-weight: 600; font-size: calc(13.5px * var(--text-scale)); }
.mx-ib { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; }
.mx-ib:hover:not([disabled]) { background: var(--gold-soft); }
.mx-ib:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.mx-ib[disabled] { opacity: .35; cursor: default; }
.mx-ib[data-on] { color: var(--gold); }
.mx-ib[data-on] svg path { fill: currentColor; }
.mx-bar-bottom #mxScrub, .mx-bar-bottom #qyScrub { flex: 1; min-width: 0; accent-color: var(--green); }
.mx-bar-bottom .mx-where { min-width: 2.6em; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
/* the number to tap and type a page (or quarter) in: a button that looks like the number, a dotted line under it */
button.mx-where { border: 0; background: none; font: inherit; font-weight: 700; padding: 6px 4px; cursor: pointer; border-radius: 8px;
  text-decoration: underline dotted color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 4px; }
button.mx-where:hover, button.mx-where:focus-visible { color: var(--ink); background: color-mix(in srgb, currentColor 10%, transparent); outline: none; }
.mx-where-in { width: 3.6em; padding: 5px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-align: center; }
.mx-where-in::placeholder { color: var(--muted); opacity: .7; }
/* the bars hidden: a tap on the page */
body.mx-focus .mx-bar-top { transform: translateY(calc(-100% - 20px)); opacity: 0; pointer-events: none; }
body.mx-focus .mx-bar-bottom { transform: translateY(calc(100% + 20px)); opacity: 0; pointer-events: none; }
/* the settings, folded */
.mx-settings summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.mx-settings summary::-webkit-details-marker { display: none; }
.mx-settings summary::after { content: ''; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.mx-settings[open] summary::after { transform: rotate(-135deg); }
.mx-settings summary h3 { margin: 0; }
.mx-settings-body { display: grid; gap: 10px; margin-top: 10px; }

/* ---------- turning a page: a simple slide ---------- */
.mx-turn { position: fixed; z-index: 20; pointer-events: none; will-change: transform, opacity; }
.mx-turn.two { display: grid; grid-template-columns: 1fr 1fr; direction: rtl; }
.mx-turn .mx-page { margin: 0; max-width: none; }

/* the bookmarks overlay; eight icons in the top bar fit a narrow phone */
.mx-row.on { border-color: var(--gold); background: var(--gold-soft); }
@media (max-width: 420px) { .mx-ib { width: 33px; height: 36px; } .mx-bar { gap: 0; padding: 5px 6px; } }

/* the mushaf's thin identity bar: the app's header, slimmed: the crescent and name, the light/dark and language
   switches (the menu is in the mushaf's own bar; the streak is left out) */
body.mx-reading header.top { position: fixed; inset-inline: 0; top: 0; z-index: 26; height: calc(40px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0;
  transition: transform .25s ease, opacity .25s ease; }
body.mx-reading header.top .menu-btn, body.mx-reading header.top .streak-chip { display: none; }
body.mx-reading header.top .brand-mark svg { width: 20px; height: 20px; }
body.mx-reading header.top .brand-name { font-size: 16px; }
body.mx-reading header.top .icon-btn { width: 30px; height: 30px; min-width: 30px; padding: 0; font-size: 12px; }
body.mx-reading header.top .icon-btn svg { width: 16px; height: 16px; }
body.mx-reading header.top .top-actions { gap: 6px; }
body.mx-reading.mx-focus header.top { transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* the page fits the screen: as wide as the screen allows, and no taller than the space between the bars, so a page
   is read without scrolling; with the bars hidden it grows into their space */
body.mx-reading .mx-spread:not(.two) { --mx-w: min(calc(100vw - 20px), calc((100dvh - 190px) / 1.43)); }
body.mx-reading.mx-focus #view { padding-top: 10px; padding-bottom: 10px; }
body.mx-reading.mx-focus .mx-spread:not(.two) { --mx-w: min(calc(100vw - 20px), calc((100dvh - 24px) / 1.43)); }
body.mx-reading .mx-spread.two { --mx-w: min(1180px, 94vw, calc((100dvh - 200px) * 1.4)); }
body.mx-reading.mx-focus .mx-spread.two { --mx-w: min(1180px, 94vw, calc((100dvh - 24px) * 1.4)); }
body.mx-reading .mx-focus-hint { margin: 6px 0 0; }
.mx-tips { margin: 6px 0 0; font-size: calc(12.5px * var(--text-scale)); }
.mx-credit { margin: 0; font-size: calc(12px * var(--text-scale)); }
/* no space kept below for the app's tab bar (hidden on the mushaf): the page's own bottom bar floats over the view's padding */
body.mx-reading { padding-bottom: 0; }
body.mx-reading #view { padding-bottom: 74px; }
/* the page sits in the middle of the space it has (a phone is narrower than it is tall) */
body.mx-reading #view { box-sizing: border-box; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
body.mx-reading #view > .mx-spread { flex: none; }

/* the hints: behind the bottom bar, taking no room; they show when a tap hides the bars (how to bring them back) */
body.mx-reading .mx-focus-hint { position: fixed; inset-inline: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 24; margin: 0; padding: 8px 12px;
  text-align: center; font-size: calc(12.5px * var(--text-scale)); line-height: 1.6; color: var(--muted); border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: opacity .3s ease .1s, transform .3s ease .1s; pointer-events: none; }
/* shown for a few seconds on entering focus (.show), and while held down; long-pressing it selects nothing */
body.mx-reading.mx-focus .mx-focus-hint.show { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
body.mx-reading .mx-focus-hint { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
/* a phone turned sideways (a wide, short screen): the page fills the width and is read by scrolling down, as in
   the mushaf apps; the identity bar steps aside to leave the page more of the short screen */
@media (orientation: landscape) and (max-height: 600px) {
  body.mx-reading .mx-spread:not(.two), body.mx-reading.mx-focus .mx-spread:not(.two) { --mx-w: calc(100vw - 20px); }
  body.mx-reading #view { justify-content: flex-start; padding-top: 62px; }
  body.mx-reading.mx-focus #view { padding-top: 10px; }
  body.mx-reading header.top { display: none; }
  .mx-bar-top { top: calc(6px + env(safe-area-inset-top)); }
  .mx-bar { inset-inline: max(8px, env(safe-area-inset-left)); }
}

/* ---------- today's portion on the mushaf: a strip on the bottom bar, its pages on the scrubber, a count chip ---------- */
.mx-bar-bottom { overflow: hidden; }
.mx-wird-strip { position: absolute; inset-inline: 0; top: 0; height: 3px; background: color-mix(in srgb, var(--gold) 18%, transparent); }
.mx-wird-strip i { display: block; height: 100%; background: var(--gold); border-radius: 0 2px 2px 0; transition: width .4s ease; }
[dir="rtl"] .mx-wird-strip i, .mx-bar-bottom[dir="rtl"] .mx-wird-strip i { margin-inline-start: 0; }
.mx-bar-bottom.wird-done .mx-wird-strip i { background: var(--green); }
.mx-scrub-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.mx-scrub-wrap #mxScrub, .mx-scrub-wrap #qyScrub { position: relative; z-index: 1; width: 100%; background: transparent; }
.mx-wird-band { position: absolute; inset-inline: 9px; top: calc(50% + 6px); height: 3px; pointer-events: none; z-index: 2; }   /* today's pages, marked just under the track */
.mx-wird-band i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in srgb, var(--gold) 55%, transparent); }
.mx-wird { flex: none; display: inline-flex; align-items: baseline; gap: 1px; min-width: 44px; justify-content: center; padding: 4px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line)); background: var(--gold-soft); color: var(--ink); font: 700 calc(13px * var(--text-scale)) var(--font-ui); cursor: pointer; font-variant-numeric: tabular-nums; }
.mx-wird small { font-weight: 500; color: var(--muted); font-size: .85em; }
.mx-bar-bottom.wird-done .mx-wird { background: color-mix(in srgb, var(--green) 14%, var(--surface)); border-color: color-mix(in srgb, var(--green) 50%, var(--line)); color: var(--green); }
.mx-wird:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mx-wird-acts { display: grid; gap: 8px; margin: 12px 0; }
.mx-wird-acts .btn { width: 100%; }

/* the nickname's privacy note: apart from the length hint above it, and its two statements apart from each other */
.form-note.nick-note { margin-top: 6px; }
.nick-note p { margin: 0; }
.nick-note p + p { margin-top: 6px; }
/* the nickname's note: the first line shown, the rest folded under «المزيد» */
.nick-more { margin-top: 2px; }
.nick-more summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--green); font-weight: 600; list-style: none; }
.nick-more summary::-webkit-details-marker { display: none; }
.nick-more summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nick-more[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nick-more summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.nick-more p { margin-top: 6px; }
.country-more { margin-top: 6px; }
.country-more p { margin-bottom: 0; }

/* ---------- the country field: a search box with its list of matches under it ---------- */
.cc { position: relative; }
.cc label { display: block; }
.cc-input { background-image: none; }
.cc-list { position: absolute; inset-inline: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none; max-height: min(260px, 45vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); overscroll-behavior: contain; }
.cc-list[hidden] { display: none; }
.cc-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.cc-list li[aria-selected="true"] { background: var(--gold-soft); }
.cc-list li.cur { font-weight: 700; color: var(--green); }
.cc-list li.cur::after { content: " ✓"; }
.cc-list li.cc-none { cursor: default; color: var(--muted); }
@media (hover: hover) { .cc-list li[role=option]:hover { background: color-mix(in srgb, var(--gold-soft) 70%, transparent); } }

/* ---------- the mushaf turned up and down: the page holds still under the finger (no scroll, no pull to refresh) ---------- */
body.mx-vswipe .mx-spread { touch-action: pan-x pinch-zoom; }
html:has(body.mx-vswipe), body.mx-vswipe { overscroll-behavior-y: none; }

/* ---------- the counting options (auto count, goal, split): their own folding card under the counter ---------- */
.ts-opts .ts-set-body { gap: 14px; padding-top: 4px; }
.ts-opts .ts-auto-row { margin-top: 0; }
.card.ts-hist-card, .card.ts-set-card { padding: 0; margin-top: 12px; background: var(--surface); }
.ts-hist-card .ts-set-body { gap: 10px; }

/* ---- Nafahat local: the account on the server ---- */
/* the recovery code: large, spaced and in a fixed-width face, so each character reads clearly when written down */
.rc-code { margin: 16px 0 4px; padding: 14px 12px; text-align: center; font: 600 clamp(19px, 5.4vw, 24px)/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .08em; color: var(--ink); background: var(--gold-soft); border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); border-radius: 14px;
  user-select: all; -webkit-user-select: all; word-break: break-all; }
.rc-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.rc-input::placeholder { text-transform: none; letter-spacing: .04em; }
.restore-link { margin: 4px 0 0; text-align: center; }
.link-btn { background: none; border: 0; padding: 8px 4px; font: inherit; font-size: 14px; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--gold); }
.acct-server .acct-state { margin: 0 0 12px; font-size: 14px; }
.acct-server .acct-state:last-child { margin-bottom: 0; }

/* ---- Nafahat local: the quiz marked on the server ---- */
/* chosen while offline: held in the gold of "waiting", neither right nor wrong yet */
.opt.chosen { border-color: var(--gold); background: var(--gold-soft); }
.opt.chosen .letter { background: var(--gold); border-color: var(--gold); color: var(--on-green); }
.result.wait { background: var(--gold-soft); }
/* the server can't be reached: a small pill just under the header, clear of the toasts at the bottom */
.net-note { position: fixed; inset-inline: 0; top: 72px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; line-height: 1.4; text-align: center; z-index: 40; pointer-events: none;
  color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.net-note[hidden] { display: none; }

/* ---- Nafahat local: days by the server's clock ---- */
.poc-strip[hidden] { display: none; }   /* live mode: no preview tools */
.before-ramadan h2 { margin-top: 6px; }
.before-ramadan .cres-wrap { display: inline-block; margin-bottom: 4px; }
/* the du'a for reaching Ramadan, over the countdown's title: Fustat 700 at 22px, as the last ten nights' du'a */
.before-dua { margin: 2px 0 0; }
.before-dua span { display: block; font-family: var(--font-display); font-weight: 700; font-size: calc(22px * var(--text-scale)); line-height: 1.8; color: var(--gold); }
.before-dua small { display: block; font-size: 13px; color: var(--muted); }

/* ---- Nafahat local: the quiz board (knowledge only) ---- */
.card.kb h3 { margin: 0 0 10px; }
.kb-scope { margin: 0 0 12px; }
/* your score: the number large, your place beside it */
.kb-me { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.kb-pct { font-size: 34px; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.kb-me p { margin: 0; }
.kb-top { font-weight: 600; }
.kb-join { margin: 4px 0 12px; }
/* the bands: one row each, a thin bar of the count (one colour: they are amounts, not kinds), the number written out */
.kb-bands { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kb-band { padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.kb-band.me { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); background: var(--gold-soft); }
.kb-row { display: grid; grid-template-columns: 5.6em 1fr 3em; align-items: center; gap: 10px; }
.kb-label { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.kb-bar i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.kb-band.me .kb-bar i { background: var(--gold); }
.kb-count { text-align: end; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kb-here { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--gold); }
.kb-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.kb-names .kb-name { font: inherit; cursor: pointer; font-size: 12.5px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.kb-note { font-size: 12.5px; margin: 12px 0 0; }

/* the recovery code as a QR: always dark on white, so phone cameras read it in the dark theme too */
.rc-qr { display: flex; justify-content: center; margin: 12px 0 0; min-height: 180px; }
.rc-qr svg { width: 180px; height: 180px; border-radius: 10px; }
.rc-qr-note { font-size: 13px; text-align: center; margin: 8px 0 0; }

/* the readiness days before Ramadan */
.ready-card { margin-top: 14px; }
.ready-card .hero-eyebrow { color: var(--gold); font-weight: 600; font-size: 13px; }
.ready-theme { margin: 4px 0 0; font-size: 1.35rem; }
.ready-draft { font-size: 12.5px; margin: 6px 0 0; }
.ready-starts { text-align: center; max-width: 360px; margin: 14px auto 0; font-size: 14px; }
.ready-days { margin: 18px 0 0; text-align: center; }
.ready-days > span { display: block; font-size: 13px; margin-bottom: 8px; }
.ready-days > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ready-days .chip { min-width: 34px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.ready-days .chip.on { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.before-note { font-size: 13px; max-width: 340px; margin: 14px auto 0; text-align: center; }

/* other ways to sign in */
.logins { margin: 16px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.logins h3 { margin: 0; font-size: 1rem; }
.logins-note { font-size: 13px; margin: 4px 0 10px; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.login-row:last-child { border-bottom: 0; }
.login-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-row .muted { font-size: 13px; overflow-wrap: anywhere; }
.login-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn.sm { padding: 6px 14px; font-size: 14px; min-height: 0; }
.gis-slot { min-height: 40px; display: flex; justify-content: center; }
.gis-slot.muted { font-size: 13px; align-items: center; }
.apple-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid #000; background: #000; color: #fff; font: 600 15px/1 -apple-system, "SF Pro Text", system-ui, sans-serif; cursor: pointer; }
.apple-btn svg { width: 15px; height: 18px; margin-top: -2px; }
:root[data-theme="dark"] .apple-btn { background: #fff; color: #000; border-color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .apple-btn { background: #fff; color: #000; border-color: #fff; } }
.provider-btns { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0; }
.provider-btns > .btn, .provider-btns > .apple-btn { width: min(100%, 320px); }
.login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted, inherit); font-size: 13px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.rc-alt { margin-top: 6px; }
.about-version { text-align: center; font-size: 13px; margin: 6px 0 0; }

/* reported nicknames, and the links to the privacy policy and account deletion */
.kb-names .kb-name:hover { border-color: var(--gold); }
.report-list { display: grid; gap: 8px; }
.acct-flag { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: var(--bad-soft); color: var(--ink); font-size: 14px; line-height: 1.7; }
.legal-links { text-align: center; font-size: 13px; line-height: 2; margin: 10px 0 0; }
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* consent for the three habits: both choices look the same, so neither is pushed */
.hc-card p, .hc-sheet p { margin: 8px 0 0; line-height: 1.8; }
.hc-sheet h3 { margin: 0; font-size: calc(20px * var(--text-scale)); }
.hc-actions { display: grid; gap: 8px; margin-top: 14px; }

/* the fast through the day: the Today card, and the reminder bar above the bottom bar */
.fn-card { display: grid; gap: 8px; }
.fn-card h3 { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fn-card h3 small { font-size: calc(13px * var(--text-scale)); font-weight: 400; }
.fn-body { display: grid; gap: 8px; }
.fn-line { margin: 0; font-size: calc(17px * var(--text-scale)); font-weight: 600; color: var(--ink); }
.fn-suhoor, .fn-said { margin: 0; font-size: calc(14px * var(--text-scale)); line-height: 1.8; }
.fn-suhoor .muted { font-size: calc(12.5px * var(--text-scale)); }
.fn-quote { margin: 0; font-size: calc(15px * var(--text-scale)); line-height: 1.9; }
.fn-quote .muted { display: block; font-size: calc(12.5px * var(--text-scale)); }
.dua-times { display: grid; gap: 12px; }
.dua-times h3, .dua-times h4 { margin: 0; }
.dua-times h4 { font-size: calc(15px * var(--text-scale)); color: var(--gold); margin-top: 4px; }
.fn-body .aya, .dua-times .aya { margin: 0; }
.remind-card h4 { margin: 8px 0 0; font-size: calc(15.5px * var(--text-scale)); }
.fn-dua summary { cursor: pointer; padding: 6px 0; font-size: calc(14.5px * var(--text-scale)); color: var(--green); }
.fn-dua .ten-dua { margin-top: 6px; }
.fast-bar { position: fixed; inset-inline: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 39; max-width: 560px; margin: 0 auto; max-height: 60vh; overflow: auto;
  display: grid; gap: 10px; padding: 14px 16px; border-radius: 18px; color: var(--ink); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line)); box-shadow: 0 8px 26px rgb(0 0 0 / .22); }
.fast-bar[hidden] { display: none; }
.fast-bar .fb-text { display: grid; gap: 8px; }
.fn-card .ten-dua p, .dua-times .ten-dua p, .fast-bar .ten-dua p { margin: 0; }
.fast-bar .btn { justify-self: end; }
@media print { .fast-bar { display: none !important; } }

/* the side menu: the bottom bar's pages at the size of the other rows' icons, and the page that is open */
.menu-row .avatar svg { width: 22px; height: 22px; }
.menu-row[aria-current="page"] .menu-row-label { color: var(--gold); font-weight: 600; }

/* what it shows never widens the card */
.ts-history > * { min-width: 0; }
/* the dhikr history's filter: a month or a year, and a step back or forward */
.ts-span { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 4px 0 12px; }
.ts-span-nav { display: flex; align-items: center; gap: 6px; }
.ts-span-nav strong { min-width: 7.5em; text-align: center; font-size: calc(15px * var(--text-scale)); }
.ts-span-nav .icon-btn:disabled { opacity: .35; cursor: default; }
/* the khatma: the finished count beside the title, and Ramadan's reading after it */
.khatma-card .wird-head { flex-wrap: wrap; }
.kh-ram .ts-set-body > * { min-width: 0; }
.kh-goal .kh-ramleft { color: var(--gold); font-size: calc(13.5px * var(--text-scale)); }

/* the month names in calligraphy, on the calendars */
.khatt { display: block; --khatt-orn: var(--gold); }
.khatt .ko { fill: var(--khatt-orn, currentColor); opacity: .85; }
.khatt-text { font-family: var(--font-display); font-weight: 700; }
.khatt-head { position: relative; overflow: hidden; border-radius: 22px; padding: 14px 22px 10px; margin: 0 0 14px; color: #f3f1e6; background: radial-gradient(90% 120% at 82% 0, #2b3a72 0, transparent 62%), linear-gradient(165deg, #141b38, #0a0e20); box-shadow: var(--shadow); }
:root:not([data-theme="dark"]) .khatt-head { background: radial-gradient(90% 120% at 82% 0, #4f8a70 0, transparent 62%), linear-gradient(165deg, var(--hero-1), var(--hero-2)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .khatt-head { background: radial-gradient(90% 120% at 82% 0, #2b3a72 0, transparent 62%), linear-gradient(165deg, #141b38, #0a0e20); } }
.khatt-head .khatt { width: 100%; height: 118px; overflow: visible; }
.khatt-head p { margin: 2px 0 0; display: flex; justify-content: space-between; gap: 10px; font-size: calc(13.5px * var(--text-scale)); opacity: .82; }
.ln-nav .khatt { width: min(230px, 46vw); height: 78px; margin: 0 auto; color: var(--ink); overflow: visible; }
.hero .khatt { width: min(300px, 74%); height: 96px; margin: 4px 0 2px; margin-inline-end: auto; color: var(--hero-ink); overflow: visible; }

/* ---- every settings list in one style (the settings page, the mushaf's, the qiyam's, the counter's): rows with an icon
   and the label at the start, the choices across the row, the note under them, a hairline between rows */
.set-rows { display: grid; gap: 0; }
.set-rows > .field { display: grid; justify-items: stretch; gap: 8px; text-align: start; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.set-rows > .field:first-of-type { border-top: 0; padding-top: 6px; }
.set-rows > .field > .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; justify-content: stretch; box-sizing: border-box; max-width: none; }
.set-rows > .field > .seg button { min-width: 0; white-space: normal; line-height: 1.3; }
.set-rows > .field small { display: block; margin-top: 0; text-align: start; }
.set-rows > .field.install-row > .btn { justify-self: stretch; }
.set-rows > p { margin: 10px 0 0; }
.set-sec-title { margin: 2px 0 4px; font-family: var(--font-display); font-size: calc(19px * var(--text-scale)); }
.settings-ts + .settings-ts { margin-top: 12px; }
/* the reminders: rows like every settings list, a subheading for the du'a's, the calendar button across */
.set-sub-title { margin: 0 0 2px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--font-sub); font-size: calc(14px * var(--text-scale)); color: var(--gold); }
.set-sub-title + .field { border-top: 0; padding-top: 6px; }
.remind-rows { margin-top: 4px; }
.remind-card .btn.remind-ics, .remind-set .btn.remind-ics { justify-self: stretch; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; }
.remind-set { display: grid; gap: 8px; }
/* four choices or more (minutes, sizes): short words, one line each, a little smaller */
.set-rows .seg:has(> button:nth-child(4)) button { padding-inline: 2px; font-size: calc(13.5px * var(--text-scale)); white-space: nowrap; }

/* the tasbīḥ chips: soft pills with room to tap; the chosen one filled green, raised, with a check;
   «أضف ذكرًا» a dashed outline with a plus disc */
.tasbih-chips { gap: 8px; }
.tasbih-chips .chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line)); background: var(--surface); color: var(--ink-2, var(--ink));
  font-weight: 500; line-height: 1.3; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.tasbih-chips .chip:hover:not(.on):not(:disabled) { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); color: var(--green); background: color-mix(in srgb, var(--green-soft) 45%, var(--surface)); }
.tasbih-chips .chip:active:not(:disabled) { transform: scale(.97); }
.tasbih-chips .chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tasbih-chips .chip.on { background: var(--green); border-color: var(--green); color: var(--on-green, #fff); font-weight: 700;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--green) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .15); }
.tasbih-chips .chip.on[data-action="tasbih-pick"]::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.tasbih-chips .chip.add { border: 1.5px dashed color-mix(in srgb, var(--green) 55%, var(--line)); background: transparent; color: var(--green); font-weight: 600; box-shadow: none; }
.tasbih-chips .chip.add:hover:not(.on) { border-style: solid; }
.tasbih-chips .chip.add.on { border-style: solid; color: var(--on-green, #fff); }

/* focus mode and starting again: a matched pair of tonal pills, each icon in a small disc */
.tasbih-page .tasbih-actions { display: flex; flex-wrap: wrap; gap: 10px; width: min(460px, 100%); justify-self: center; margin-top: 2px; }
.tasbih-page .tasbih-actions > .btn { flex: 1 1 auto; white-space: nowrap; }
.tasbih-actions .ts-focus-btn, .tasbih-actions .ts-reset-btn { justify-content: center; gap: 10px; min-height: 48px; padding: 6px 16px; padding-inline-start: 6px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); background: color-mix(in srgb, var(--gold) 5%, var(--surface));
  color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.tasbih-actions .ts-focus-btn svg, .tasbih-actions .ts-reset-btn svg { flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 9px; border-radius: 50%; transition: background-color .15s, color .15s; }
.tasbih-actions .ts-focus-btn svg { background: var(--green-soft); color: var(--green); }
.tasbih-actions .ts-reset-btn svg { background: var(--gold-soft); color: var(--gold); }
.tasbih-actions .ts-focus-btn:hover { border-color: var(--green); box-shadow: 0 3px 12px color-mix(in srgb, var(--green) 18%, transparent); }
.tasbih-actions .ts-focus-btn:hover svg { background: var(--green); color: var(--on-green, #fff); }
.tasbih-actions .ts-reset-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); color: var(--bad); box-shadow: 0 3px 12px color-mix(in srgb, var(--bad) 14%, transparent); }
.tasbih-actions .ts-reset-btn:hover:not(:disabled) svg { background: var(--bad); color: #fff; }
.tasbih-actions .ts-focus-btn:active, .tasbih-actions .ts-reset-btn:active:not(:disabled) { transform: scale(.98); }
.tasbih-actions .ts-focus-btn:focus-visible, .tasbih-actions .ts-reset-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tasbih-actions .ts-reset-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.tasbih-actions .ts-reset-btn:disabled svg { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tasbih-chips .chip, .tasbih-actions .btn { transition: none; } .tasbih-chips .chip:active, .tasbih-actions .btn:active { transform: none; } }

/* the history's month / year bar: the choice as a tonal track with a raised tile (as in the settings),
   the period between its two arrows in one pill */
.ts-span { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 6px 0 14px; }
.ts-span .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.ts-span-nav { justify-content: space-between; }
@media (min-width: 560px) { .ts-span { grid-template-columns: minmax(200px, auto) 1fr; align-items: center; } }
.ts-span .seg { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.ts-span .seg button { min-height: 36px; min-width: 64px; padding: 6px 14px; border-radius: 10px; color: var(--ink-2); font: inherit; font-weight: 500;
  transition: background-color .15s, color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.ts-span .seg button:hover:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.ts-span .seg button[aria-pressed="true"] { border-radius: 10px; background: var(--surface); color: var(--green); font-weight: 700;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--green) 55%, transparent), 0 2px 8px color-mix(in srgb, var(--green) 16%, transparent), 0 1px 2px rgba(0, 0, 0, .08); }
.ts-span .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ts-span-nav { gap: 2px; padding: 4px; border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--gold) 5%, var(--surface)); }
.ts-span-nav strong { min-width: 8em; padding: 0 4px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.ts-span-nav .icon-btn { display: grid; place-items: center; width: 36px; height: 36px; min-width: 0; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface); color: var(--green); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); transition: background-color .15s, color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.ts-span-nav .icon-btn:hover:not(:disabled) { background: var(--green); color: var(--on-green, #fff); }
.ts-span-nav .icon-btn:active:not(:disabled) { transform: scale(.94); }
.ts-span-nav .icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ts-span-nav .icon-btn:disabled { opacity: 1; background: transparent; box-shadow: none; color: color-mix(in srgb, var(--muted) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .ts-span .seg button, .ts-span-nav .icon-btn { transition: none; } .ts-span-nav .icon-btn:active { transform: none; } }

/* the review's answers: a tonal track (as in the settings) with roomy pills; the chosen answer raised in its tone,
   with a small mark (✓ done, a clock for late or part, ✕ missed) so it never rests on colour alone */
.wird-scale { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.wird-scale button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 5px 12px;
  color: var(--ink-2); font-weight: 600; transition: background-color .15s, color .15s, box-shadow .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.wird-scale button:hover:not(.on) { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.wird-scale button:active { transform: scale(.96); }
.wird-scale button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.wird-scale button.on { font-weight: 700; }
.wird-scale button.on.opt-top { background: var(--green); color: var(--on-green); box-shadow: 0 2px 8px color-mix(in srgb, var(--green) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .15); }
.wird-scale button.on.opt-good { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--green) 50%, transparent), 0 1px 3px rgba(0, 0, 0, .08); }
.wird-scale button.on.opt-mid { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: color-mix(in srgb, var(--gold) 70%, var(--ink));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--gold) 60%, transparent), 0 1px 3px rgba(0, 0, 0, .08); }
.wird-scale button.on.opt-low { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--bad) 45%, transparent), 0 1px 3px rgba(0, 0, 0, .08); }
.wird-scale button.on::before { content: ""; flex: none; width: 13px; height: 13px; background: currentColor;
  -webkit-mask: var(--wq-mark) center / contain no-repeat; mask: var(--wq-mark) center / contain no-repeat; }
.wird-scale button.on.opt-top, .wird-scale button.on.opt-good {
  --wq-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.wird-scale button.on.opt-mid {
  --wq-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3Cpath d='M12 7.5V12l3 2' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.wird-scale button.on.opt-low {
  --wq-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* the mark takes the room each answer keeps for it (13px + 5px gap), so choosing one never widens the row */
.wird-q:not(.wide) .wird-scale button { padding-inline: 14px; }
.wird-q:not(.wide) .wird-scale button.on { padding-inline: 6px; gap: 4px; }
.wird-q:not(.wide) .wird-scale button.on::before { width: 12px; height: 12px; }
/* four answers across the row: no mark, each as wide as its words, so «At the mosque» keeps one line */
.wird-q.wide .wird-scale button { flex: 1 1 auto; min-width: 0; padding-inline: 6px; }
.wird-q.wide .wird-scale button.on::before { display: none; }
@media (prefers-reduced-motion: reduce) { .wird-scale button { transition: none; } .wird-scale button:active { transform: none; } }
/* «تغيير» in the review: a button dressed as the link it was, opening the brother/sister choice in place */
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-size: calc(12.5px * var(--text-scale)); font-weight: 600; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wird-gender-edit { animation: wgIn .18s ease-out; }
@keyframes wgIn { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .wird-gender-edit { animation: none; } }
/* a neutral answer (not fasting a voluntary day): a plain raised tile with a dash, no tone of praise or blame */
.wird-scale button.on.opt-none { background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent), 0 1px 3px rgba(0, 0, 0, .08);
  --wq-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* the review rows: the item's name a little firmer; four answers (a brother's prayers) share the line with the name
   when they fit, and drop under it, across the full width, only when they don't */
.wird-label { font-weight: 600; }
.wird-q.wide { flex-wrap: wrap; gap: 8px 12px; }
.wird-q.wide .wird-label { flex: 0 0 5.4em; }
/* the same weight chosen or not, and one width for every prayer's name, so all five rows fit or wrap together */
.wird-q.wide .wird-scale button.on { font-weight: 600; }
.wird-q.wide .wird-scale { flex: 1 1 auto; width: auto; max-width: 100%; }
.wird-q.wide .wird-scale button { flex: 1 1 auto; padding-inline: 8px; }
.wird-scale button { letter-spacing: .005em; }
:root[lang="ar"] .wird-q.wide .wird-label { flex-basis: 3.8em; }
/* brother or sister, asked in the prayer card (the first time, or after «تغيير»): a soft gold panel with a person icon,
   the question, and the two answers as the settings' tonal track with a raised tile */
.wird-ask { gap: 10px 12px; padding: 12px 14px; margin: 8px 0 6px; border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.wird-ask > span { display: inline-flex; align-items: center; gap: 10px; flex: 1 1 12em; font-weight: 600; line-height: 1.5; color: var(--ink); }
.wird-ask > span::before { content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%; background-color: var(--gold-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23b08a3e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c.8-3.8 3.6-6 7-6s6.2 2.2 7 6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 18px; }
.wird-ask .seg { flex: 1 1 11em; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.wird-ask .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  color: var(--ink-2); font: inherit; font-weight: 600; transition: background-color .15s, color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.wird-ask .seg button:hover:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.wird-ask .seg button[aria-pressed="true"] { border-radius: 10px; background: var(--surface); color: var(--green); font-weight: 700;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--green) 55%, transparent), 0 2px 8px color-mix(in srgb, var(--green) 16%, transparent), 0 1px 2px rgba(0, 0, 0, .08); }
.wird-ask .seg button[aria-pressed="true"]::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.wird-ask .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .wird-ask .seg button { transition: none; } }
/* counts on the leaderboard: the trophy alone, in a small gold disc (its name in the label and the tooltip) */
.on-board { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 50%; vertical-align: -5px; }
.on-board svg { width: 15px; height: 15px; }
/* a prayer row with the trophy: the name and the trophy on one line, and every name in that card a little wider, so the rows still line up */
.wird-q.wide .wird-label { white-space: nowrap; }
.wird-group:has(.wird-q.wide .on-board) .wird-q.wide .wird-label { flex-basis: 7em; }
:root[lang="ar"] .wird-group:has(.wird-q.wide .on-board) .wird-q.wide .wird-label { flex-basis: 5.4em; }
/* four answers keep their mark too: the chosen one trades its 8px + 8px padding for the 12px mark and its 4px gap,
   so choosing never widens the row, and all five rows still fit or wrap together */
.wird-q.wide .wird-scale button.on { padding-inline: 0; gap: 4px; }
.wird-q.wide .wird-scale button.on::before { display: block; width: 12px; height: 12px; }
/* «في المسجد», chosen: a mosque (dome, door, minaret) in place of the check */
.wird-q.wide .wird-scale button.on.opt-top[data-action="wird-mark"] { gap: 3px; }
.wird-q.wide .wird-scale button.on.opt-top[data-action="wird-mark"]::before { width: 13px; height: 13px;
  --wq-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 21h20M4 21V13a6 6 0 0 1 12 0v8M10 3.5v3'/%3E%3Cpath d='M8 21v-3a2 2 0 0 1 4 0v3M19.5 21V10M18 10h3M19.5 10V7.5'/%3E%3C/g%3E%3C/svg%3E"); }

/* ─── the review as a ledger ───
   One sheet for the day's deeds. Groups are sections split by a heavier rule; rows are ruled lines. Answers are named once,
   at the head of the columns, and each row holds only the boxes to tick. A ticked box fills with the answer's tone and sign:
   green ✓ (or the mosque) for the full mark, a green outline ✓ for good, gold clock for late or part, red ✕ for missed. */
.wird-sheet { padding: 6px 18px 12px; }
.wird-sheet .wird-group { padding: 14px 0 6px; }
.wird-sheet .wird-group + .wird-group { border-top: 2px solid color-mix(in srgb, var(--ink) 13%, transparent); margin-top: 6px; }
.wird-sheet .wird-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 2px; }
.wird-sheet .wird-head h3 { margin: 0 auto 0 0; font-family: var(--font-display); font-size: calc(20px * var(--text-scale)); font-weight: 700; letter-spacing: 0; }
[dir="rtl"] .wird-sheet .wird-head h3 { margin: 0 0 0 auto; }
.wird-got { flex: none; font-size: calc(13px * var(--text-scale)); color: var(--ink-2); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.wird-go { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: calc(13.5px * var(--text-scale)); font-weight: 600; color: var(--green); text-decoration: none; }
.wird-go svg { width: 17px; height: 17px; color: var(--gold); }
.wird-go:hover span { text-decoration: underline; text-underline-offset: 3px; }
.wird-go:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.wird-sheet .wird-gender { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 0 0; color: var(--muted); font-size: calc(13px * var(--text-scale)); }

/* the columns: the label, then one box per answer, the same widths in the head and every row under it */
.lg-cols, .lg-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--n), var(--lg-w)); column-gap: 2px; align-items: center;
  --lg-w: clamp(50px, 14vw, 76px); }
.lg-cols[style*="--n:4"], .lg-row[style*="--n:4"] { --lg-w: clamp(50px, 13.4vw, 72px); column-gap: 3px; }
.lg-cols { padding: 12px 0 4px; }
.lg-cols > span { text-align: center; font-size: calc(11.5px * var(--text-scale)); font-weight: 600; line-height: 1.25; color: var(--ink-2); }
.lg-row { min-height: 52px; border-top: 1px solid var(--line); }
.lg-cols + .lg-row { border-top-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.lg-row .wird-label { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; padding: 8px 0; font-weight: 500; font-size: calc(15.5px * var(--text-scale)); line-height: 1.35; }
.lg-row .dk-link { margin: 0; }
.wird-sheet .on-board { display: inline-grid; width: auto; height: auto; padding: 0; background: none; color: var(--gold); vertical-align: middle; }
.wird-sheet .on-board svg { width: 16px; height: 16px; }

/* a box: a 48px target around a 26px square */
.lg-mark { display: grid; place-items: center; height: 48px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lg-mark i { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); background: var(--surface); transition: border-color .15s, background-color .15s; }
.lg-mark:hover i { border-color: var(--green); }
.lg-mark:focus-visible { outline: none; }
.lg-mark:focus-visible i { outline: 2px solid var(--gold); outline-offset: 3px; }
.lg-mark.on i { border-color: transparent; color: var(--surface); animation: lgTick .18s ease-out; }
.lg-mark.on i::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--lg-sign) center / contain no-repeat; mask: var(--lg-sign) center / contain no-repeat; }
.lg-mark.on.opt-top i { background: var(--green); }
.lg-mark.on.opt-good i { background: var(--surface); border: 2px solid var(--green); color: var(--green); }
.lg-mark.on.opt-mid i { background: var(--gold); }
.lg-mark.on.opt-low i { background: var(--bad); }
.lg-mark.on.opt-top, .lg-mark.on.opt-good {
  --lg-sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.lg-mark.on.mq { --lg-sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 21h20M4 21V13a6 6 0 0 1 12 0v8M10 3.5v3'/%3E%3Cpath d='M8 21v-3a2 2 0 0 1 4 0v3M19.5 21V10M18 10h3M19.5 10V7.5'/%3E%3C/g%3E%3C/svg%3E"); }
.lg-mark.on.opt-mid {
  --lg-sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3Cpath d='M12 7.5V12l3 2' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.lg-mark.on.opt-low {
  --lg-sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
@keyframes lgTick { from { transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .lg-mark i { transition: none; } .lg-mark.on i { animation: none; } }

/* the khatma line closes the Qur'an section as one more ruled line: its two facts stacked, the way in at the end */
.wird-sheet .kh-line { margin: 0; padding: 12px 0 6px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.wird-sheet .kh-line.done { background: none; }
.wird-sheet .kh-line > span:first-of-type { display: grid; gap: 1px; }
.kh-line b { font-weight: 600; font-size: calc(14px * var(--text-scale)); }
.kh-line small { color: var(--muted); font-size: calc(12.5px * var(--text-scale)); }
.wird-sheet .wird-ask { margin: 10px 0 4px; }
/* the day's fast opens the sheet as its first section, not a card of its own */
.wird-sheet > .card { margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.wird-sheet .fast-card { padding: 14px 0 12px; }
.wird-sheet .fast-excuse, .wird-sheet .fast-undo { border-radius: 10px; padding: 9px 16px; box-shadow: none; }
/* the night's note: written on ruled lines, like the rest of the ledger */
.wird-note { --rule: calc(15px * var(--text-scale) * 1.9); line-height: 1.9; padding: 4px 12px 8px; border-radius: 10px;
  background-color: var(--surface); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--rule) - 1px), var(--line) calc(var(--rule) - 1px), var(--line) var(--rule));
  background-position: 0 4px; background-attachment: local; }
/* rows that still use labelled answers (the excuse for not fasting): the name on its own line, the answers across under it */
:root[lang] .wird-q.wide > .wird-label { flex: 0 0 100%; white-space: normal; }
:root[lang] .wird-q.wide > .wird-scale { flex: 1 1 100%; }

/* making up a missed fast: one plain green button to record a day (a ticked box, as in the ledger), and a quiet
   text button to take one back; no pill, no glow */
.qada-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 4px; }
.qada-add { flex: 1 1 12em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px;
  border: 0; border-radius: 10px; background: var(--green); color: var(--on-green); font: inherit; font-weight: 700; font-size: calc(15.5px * var(--text-scale));
  cursor: pointer; transition: background-color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.qada-add:hover:not(:disabled) { background: color-mix(in srgb, var(--green) 88%, var(--ink)); }
.qada-add:active:not(:disabled) { transform: translateY(1px); }
.qada-add:disabled { background: color-mix(in srgb, var(--ink) 10%, var(--surface)); color: var(--muted); cursor: default; }
.qada-undo { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 4px;
  border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; font-size: calc(14px * var(--text-scale)); cursor: pointer; }
.qada-undo:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.qada-undo:disabled { color: var(--muted); opacity: .55; cursor: default; }
.qada-add:focus-visible, .qada-undo:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .qada-add { transition: none; } .qada-add:active:not(:disabled) { transform: none; } }
/* turning the ledger's days: one strip as wide as the sheet, the day in the middle, a square arrow at each end
   divided off by a thin rule; an end with no day to turn to fades */
.wird-days { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: stretch; gap: 0; margin: 0 0 12px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.wird-days span { display: grid; place-items: center; min-height: 48px; padding: 4px 8px; text-align: center;
  font-size: calc(16px * var(--text-scale)); font-weight: 700; color: var(--ink); }
.wird-days .icon-btn { display: grid; place-items: center; width: 48px; height: auto; min-height: 48px; padding: 0; border: 0; border-radius: 0;
  background: none; color: var(--green); box-shadow: none; transition: background-color .15s; -webkit-tap-highlight-color: transparent; }
.wird-days .icon-btn:first-child { border-inline-end: 1px solid var(--line); }
.wird-days .icon-btn:last-child { border-inline-start: 1px solid var(--line); }
.wird-days .icon-btn:hover:not([disabled]) { background: color-mix(in srgb, var(--green) 9%, transparent); }
.wird-days .icon-btn:active:not([disabled]) { background: color-mix(in srgb, var(--green) 16%, transparent); }
.wird-days .icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.wird-days .icon-btn[disabled] { opacity: 1; color: color-mix(in srgb, var(--muted) 45%, transparent); cursor: default; }
@media (prefers-reduced-motion: reduce) { .wird-days .icon-btn { transition: none; } }
/* the fast's questions (did you fast? the excuse): a paper form in the ledger, the question on its line, the answers
   as equal boxes below it, each with a small square that fills with the answer's sign when chosen */
.wird-sheet .fast-card .wird-q { flex-wrap: wrap; gap: 10px; padding: 10px 0 4px; border-top: 0; }
.wird-sheet .fast-card .wird-q > .wird-label { flex: 0 0 100%; font-weight: 600; }
.wird-sheet .fast-card .wird-scale { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  padding: 0; border: 0; border-radius: 0; background: none; }
.wird-sheet .fast-card .wird-q.wide .wird-scale { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.wird-sheet .fast-card .wird-scale button { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 9px;
  min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); font-weight: 500; text-align: start; white-space: normal; line-height: 1.3; box-shadow: none; transform: none; }
.wird-sheet .fast-card .wird-scale button::before { content: ""; flex: none; display: block; width: 18px; height: 18px; box-sizing: border-box; border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); background: var(--surface); -webkit-mask: none; mask: none; }
.wird-sheet .fast-card .wird-scale button:hover:not(.on) { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); background: var(--surface); }
.wird-sheet .fast-card .wird-scale button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wird-sheet .fast-card .wird-scale button.on { padding-inline: 12px; font-weight: 700; color: var(--ink); background: var(--surface);
  border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.wird-sheet .fast-card .wird-scale button.on::before { border-color: transparent; background: var(--tone); width: 18px; height: 18px; }
.wird-sheet .fast-card .wird-scale button.on::after { content: ""; position: absolute; inset-inline-start: 15px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: var(--surface); -webkit-mask: var(--sign) center / contain no-repeat; mask: var(--sign) center / contain no-repeat; }
.wird-sheet .fast-card .wird-scale button.opt-top, .wird-sheet .fast-card .wird-scale button.opt-good { --tone: var(--green);
  --sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.wird-sheet .fast-card .wird-scale button.opt-none { --tone: var(--ink-2);
  --sign: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* the review's cards as one family with the ledger sheet: a 14px corner (the hero keeps its larger one), a crisp edge
   and a thin paper shadow in place of the soft blur, the sheet's side margin, and its title type */
.wird-sheet, .wird-card { border-radius: 14px; border-color: color-mix(in srgb, var(--ink) 11%, var(--line));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent), 0 2px 6px -2px color-mix(in srgb, var(--ink) 10%, transparent); margin-bottom: 14px; }
.wird-card { padding: 16px 18px; }
.wird-card > h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: calc(20px * var(--text-scale)); font-weight: 700; }
.wird-card .wird-sub { margin: 0 0 10px; }
.wird-month-card .aya { margin-top: 14px; }
.wird-private { margin: 14px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--line); font-size: calc(12.5px * var(--text-scale)); line-height: 1.75; }
.qada-card { gap: 10px; }
.qada-card .qada-line strong { font-size: calc(15.5px * var(--text-scale)); }
.qada-add { min-height: 40px; padding: 6px 16px; font-size: calc(15px * var(--text-scale)); }
.qada-add svg { width: 18px; height: 18px; }
.qada-undo { min-height: 40px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wird-sheet, :root:not([data-theme="light"]) .wird-card { box-shadow: none; } }
:root[data-theme="dark"] .wird-sheet, :root[data-theme="dark"] .wird-card { box-shadow: none; }
/* the month in the ledger: a day is a small square; one hue, deeper as more of it was done; a day not yet come is a
   blank dashed box; the day open in the review wears an ink ring (a gap, then the ring). The key under it names the
   five shades, then the marks (a sunnah day, a day fasted, a day missed with an excuse). */
.wird-month { gap: 5px; margin-top: 4px; }
.wd-cell { border-radius: 7px; border: 1px solid color-mix(in srgb, var(--ink) 12%, var(--line)); background: color-mix(in srgb, var(--ink) 3%, var(--surface));
  font-size: calc(12.5px * var(--text-scale)); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; color: var(--ink-2);
  transition: border-color .15s; -webkit-tap-highlight-color: transparent; }
.wd-cell.l1, .wd-cell.l2, .wd-cell.l3, .wd-cell.l4 { border-color: transparent; color: var(--ink); }
.wd-cell.l3, .wd-cell.l4 { color: var(--on-green, #fff); }
button.wd-cell:hover { border-color: var(--green); }
button.wd-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wd-cell.x { opacity: 1; background: none; border: 1px dashed color-mix(in srgb, var(--ink) 16%, transparent); color: color-mix(in srgb, var(--muted) 70%, transparent); font-weight: 500; }
.wd-cell.cur { outline: none; font-weight: 800; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.wd-cell.cur.fz { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
@media (prefers-reduced-motion: reduce) { .wd-cell { transition: none; } }
/* the key */
.wird-month-card .fy-keys { align-items: center; gap: 8px 18px; margin-top: 12px; color: var(--ink-2); }
.wd-scale { display: inline-flex; align-items: center; gap: 3px; }
.wd-scale > span { font-size: calc(12px * var(--text-scale)); color: var(--muted); }
.wd-scale > span:first-child { margin-inline-end: 4px; }
.wd-scale > span:last-child { margin-inline-start: 4px; }
.wd-scale i { width: 13px; height: 13px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 3%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ink) 12%, var(--line)); box-sizing: border-box; }
.wd-scale i.l1 { background: color-mix(in srgb, var(--green) 18%, var(--surface)); border-color: transparent; }
.wd-scale i.l2 { background: color-mix(in srgb, var(--green) 38%, var(--surface)); border-color: transparent; }
.wd-scale i.l3 { background: color-mix(in srgb, var(--green) 62%, var(--surface)); border-color: transparent; }
.wd-scale i.l4 { background: var(--green); border-color: transparent; }
.fy-key i.nf::after { content: ""; position: absolute; top: 2px; inset-inline-end: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.wd-cell.sn::after { bottom: 2px; width: 4px; height: 4px; margin-left: -2px; }
/* each day fills from the bottom up, like a loading bar standing on end: a quarter for each level, a full day solid.
   The part filled is a soft green the number reads on; a full day is the full green. */
.wd-cell, .wd-scale i { --wd-f: 0%; --wd-c: color-mix(in srgb, var(--green) 42%, var(--surface));
  background: linear-gradient(to top, var(--wd-c) var(--wd-f), color-mix(in srgb, var(--ink) 3%, var(--surface)) var(--wd-f)); }
.wd-cell.l1, .wd-scale i.l1 { --wd-f: 25%; }
.wd-cell.l2, .wd-scale i.l2 { --wd-f: 50%; }
.wd-cell.l3, .wd-scale i.l3 { --wd-f: 75%; }
.wd-cell.l4, .wd-scale i.l4 { --wd-f: 100%; --wd-c: var(--green); }
.wd-cell.l1, .wd-cell.l2, .wd-cell.l3 { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); color: var(--ink); }
.wd-scale i.l1, .wd-scale i.l2, .wd-scale i.l3 { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); }
.wd-cell.l4 { border-color: transparent; color: var(--on-green, #fff); }
.wd-cell.x { background: none; }
.wd-cell.l0, .wd-cell.l1, .wd-cell.l2, .wd-cell.l3, .wd-cell.l4, .wd-scale i.l0, .wd-scale i.l1, .wd-scale i.l2, .wd-scale i.l3, .wd-scale i.l4 {
  background: linear-gradient(to top, var(--wd-c) var(--wd-f), color-mix(in srgb, var(--ink) 3%, var(--surface)) var(--wd-f)); }
/* each tick shows: the fill a little firmer, and its top edge drawn as a 2px line, so even one answer (a few percent)
   reads as a rise. A sunnah fast day: no dot, its empty part a faint gold instead of grey (the key shows the same). */
.wd-cell, .wd-scale i { --wd-bg: color-mix(in srgb, var(--ink) 3%, var(--surface)); --wd-c: color-mix(in srgb, var(--green) 48%, var(--surface));
  --wd-edge: color-mix(in srgb, var(--green) 85%, var(--surface)); }
.wd-cell, .wd-scale i,
.wd-cell.l0, .wd-cell.l1, .wd-cell.l2, .wd-cell.l3, .wd-cell.l4, .wd-scale i.l0, .wd-scale i.l1, .wd-scale i.l2, .wd-scale i.l3, .wd-scale i.l4 {
  background: linear-gradient(to top, var(--wd-c) 0, var(--wd-c) calc(var(--wd-f) - 2px), var(--wd-edge) calc(var(--wd-f) - 2px), var(--wd-edge) var(--wd-f), var(--wd-bg) var(--wd-f)); }
.wd-cell.l4, .wd-scale i.l4 { --wd-edge: var(--green); }
.wd-cell.sn, .fy-key i.sn { --wd-bg: color-mix(in srgb, var(--gold) 20%, var(--surface)); }
.wd-cell.sn:not(.l1):not(.l2):not(.l3):not(.l4) { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.wd-cell.sn::after, .fy-key i.sn::after { display: none; }
.fy-key i.sn { background: var(--wd-bg); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.wd-cell.x.sn { background: color-mix(in srgb, var(--gold) 13%, transparent); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
/* the fill without its top edge line: the level is the soft green alone */
.wd-cell, .wd-scale i { --wd-edge: var(--wd-c); }
.wd-cell.l4, .wd-scale i.l4 { --wd-edge: var(--green); }
