/* Dark mode: neutral warm greys (like Claude's dark mode), no green tint */
:root {
  --bg: #262624;
  --surface: #30302E;
  --border: #45443F;
  --primary: #2476C6;
  --primary-deep: #1E5C97;
  --gold: #C9A24B;
  --text: #F5F4EE;
  --muted: #A8A69D;
  --on-primary: #FFFFFF;
  --on-gold: #2E2606;
}
:root[data-theme="light"] {
  --bg: #F6F3EA;
  --surface: #FFFFFF;
  --border: #E4DECF;
  --primary: #1E6FB8;
  --primary-deep: #15507F;
  --gold: #866310;
  --text: #14201A;
  --muted: #5E6E64;
  --on-primary: #FFFFFF;
  --on-gold: #FFFFFF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* ARABIC WRITING (rule given by Ilyasse, 21 Nov 2026). The calligraphic font (Amiri, the one of the
   Quran text) is ONLY for: the Quran, the words of the Prophet and of his companions (hadith, dhikr),
   the large titles, and the Arabic that is being taught (letters, words, examples). Everything else
   in Arabic (menus, descriptions, lists, buttons, labels, small headings) is in the NORMAL writing:
   the font of the page, i.e. the Arabic font of the device, like the menu. So: do not add
   font-family "Amiri" to a rule unless it is one of those four cases. */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* The logo (drawn in app.js, LOGO): gold, sized by its height. In the header it is small, so
   the thin inner line is dropped, the arch is thicker and the words are larger. */
.brand-mark { display: block; color: var(--gold); line-height: 0; }
.logo { display: block; height: 100%; width: auto; overflow: visible; }
.app-header .brand-mark { height: 52px; margin: -2px 0; }
.app-header .logo .logo-thin, .app-footer .logo .logo-thin { display: none; }
.app-header .logo .logo-arch, .app-footer .logo .logo-arch { stroke-width: 11px; }
.app-header .logo .logo-words, .app-footer .logo .logo-words { font-size: 84px; }

.controls { display: flex; align-items: center; gap: 10px; }
/* Language switch: three choices in one box, with a thumb that slides to the chosen one */
.lang-seg {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px;
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 11px;
}
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3);
  border-radius: 8px; background: var(--primary); opacity: 0;
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .28s cubic-bezier(.3, .8, .3, 1), opacity .15s;
}
.lang-seg[data-on] .seg-thumb { opacity: 1; }
.lang-seg button {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted);
  padding: 7px 4px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: color .2s;
}
.lang-seg button:hover { color: var(--text); }
.lang-seg button.active { color: var(--on-primary); }
@media (prefers-reduced-motion: reduce) { .seg-thumb, .lang-seg button { transition: none; } }
.icon-btn {
  border: 0.5px solid var(--border); background: var(--surface); color: var(--gold);
  width: 38px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px;
}

.tabs {
  display: flex; gap: 8px; padding: 14px 16px 6px; overflow-x: auto;
}
.tabs button {
  flex: 0 0 auto; border: 0.5px solid var(--border); background: var(--surface);
  color: var(--muted); padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.tabs button.active {
  background: var(--primary-deep); color: #F2EFE6; border-color: var(--primary);
}

.list { padding: 10px 16px 8px; max-width: 1280px; margin: 0 auto; }
.list.reading { max-width: 640px; }

.card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 16px; padding: 18px; margin-bottom: 14px;
  transition: opacity .2s, border-color .2s;
}
.card.done { border-color: var(--primary); opacity: .62; }
.card .ar {
  font-family: "Amiri", serif; font-size: 22px; line-height: 2.1;
  text-align: right; direction: rtl; color: var(--text); margin: 0 0 12px;
}
.card .tr { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0 0 14px; }
.card .tr.soon { font-style: italic; opacity: .8; }
.card .translit { font-size: 13px; line-height: 1.6; color: var(--muted); font-style: italic; margin: 0 0 14px; }
.draft-note {
  font-size: 12px; color: var(--gold); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 9px 12px; margin: 2px 0 14px; text-align: center;
}

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 0.5px solid var(--border); padding-top: 14px;
}
.src {
  font-size: 12px; font-weight: 500; color: var(--on-gold);
  background: var(--gold); padding: 4px 11px; border-radius: 999px;
}
.count-wrap { display: flex; align-items: center; gap: 10px; }
.repeat { font-size: 13px; color: var(--muted); }
.counter {
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--primary); color: var(--on-primary);
  font-size: 17px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s;
}
.counter:active { transform: scale(0.9); }
.counter.done { background: var(--primary-deep); color: #F2EFE6; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.modal-wrap {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-wrap.hidden { display: none; }
.modal {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 18px; padding: 22px; width: 100%; max-width: 360px;
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.fr-options { display: flex; flex-direction: column; gap: 10px; }
.fr-options button {
  display: flex; flex-direction: column; gap: 3px; text-align: center;
  border: 0.5px solid var(--border); background: var(--bg); color: var(--text);
  padding: 13px; border-radius: 12px; font-size: 16px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.fr-options button small { color: var(--muted); font-size: 12px; font-weight: 400; }
.fr-options button:active { border-color: var(--primary); }

.home-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 6px 0 24px; margin: 0; width: 100%;
}
@media (min-width: 720px)  { .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
/* Side panels — large screens only: goals on the left, selected duas on the right */
.today, .featured { display: none; }
@media (min-width: 1100px) {
  .home-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today, .featured {
    display: block; margin-top: 6px;
    background: var(--surface); border: 0.5px solid var(--border); border-radius: 16px; padding: 16px;
  }
}
@media (min-width: 1400px) { .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.featured .today-title { margin-bottom: 12px; }
.feat { border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; background: var(--bg); }
.feat:last-child { margin-bottom: 0; }
.feat-head {
  margin: 0; padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; text-align: right;
  border-bottom: 0.5px solid var(--border); font-weight: 500;
}
.feat-title { font-family: "Amiri", serif; font-size: 17px; color: var(--gold); }
.feat-sub { font-size: 11px; color: var(--muted); }
.feat-sub:empty { display: none; }
.feat-ar { margin: 0; padding: 10px 12px 8px; font-family: "Amiri", serif; font-size: 17px; line-height: 1.95; text-align: right; color: var(--text); }
.feat-tr { margin: 0; padding: 0 12px 8px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.feat-src { display: inline-block; margin: 0 12px 10px; font-size: 11px; color: var(--muted); border: 0.5px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.today-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.today-date { margin: 2px 0 14px; font-size: 12px; color: var(--muted); }
.today-row {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; padding: 10px 20px 10px 12px; cursor: pointer; overflow: hidden;
  background: var(--bg); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px;
  font-family: inherit; text-align: right; transition: border-color .15s;
}
.today-row::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 7px; background: var(--bc); }
.today-row:hover, .today-row:focus-visible { border-color: var(--bc); outline: none; }
.tr-text { display: flex; flex-direction: column; gap: 1px; order: 2; }
.tr-ar { font-family: "Amiri", serif; font-size: 17px; line-height: 1.3; }
.tr-sub { font-size: 11px; color: var(--muted); }
.tr-sub:empty { display: none; }
.tr-prog {
  order: 1; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--bc) 26%, transparent);
}
/* Daily challenges: done (check mark), or greyed out while it is not their time */
.today-rows { margin-bottom: 12px; }
.today-row.done, .today-row.locked { cursor: default; }
.today-row.done:hover, .today-row.locked:hover { border-color: var(--border); }
.today-row.done .tr-prog { display: inline-flex; align-items: center; gap: 4px; }
.today-row.done .tr-prog svg { width: 13px; height: 13px; }
.today-row.locked::before { background: var(--border); }
.today-row.locked .tr-text { opacity: .5; }
.today-row.locked .tr-prog { font-size: 11px; color: var(--muted); background: transparent; border: 0.5px solid var(--border); }
.block {
  position: relative; cursor: pointer; text-align: right;
  border: 1.5px solid var(--border); border-radius: 16px;
  padding: 11px 22px 11px 12px; min-height: 0; color: var(--text);
  display: flex; flex-direction: column; justify-content: space-between; gap: 5px;
  background-color: var(--surface); font-family: inherit; overflow: hidden;
  transition: border-color .15s, transform .08s;
}
.block::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 9px; background: var(--bc);
}
.block:hover, .block:focus-visible, .block:active { border-color: var(--bc); outline: none; }
.block .b-ar { font-family: "Amiri", serif; font-size: 20px; line-height: 1.3; }
.block .b-en { font-size: 12px; color: var(--muted); }
.block .b-en:empty { display: none; }
.block .b-foot { display: flex; align-items: center; gap: 8px; }
.block .b-count {
  font-size: 12px; color: var(--text); padding: 3px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--bc) 26%, transparent);
}
.block .b-draft {
  font-size: 10px; color: var(--muted); border: 0.5px solid var(--border);
  padding: 3px 9px; border-radius: 999px; letter-spacing: .05em; text-transform: uppercase;
}
.block:active { transform: scale(0.98); }

.cat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0 6px; max-width: 640px; margin: 0 auto;
}
.back-btn {
  border: 0.5px solid var(--border); background: var(--surface); color: var(--text);
  width: 42px; height: 38px; border-radius: 10px; font-size: 19px; cursor: pointer;
}
.cat-title { font-size: 15px; font-weight: 600; color: var(--gold); }
/* Section heading inside a block: the two lines centred one above the other, then a long
   horizontal line in the block's color, strong in the middle and fading toward both ends */
.sec-head {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 26px 0 14px; padding: 0 12px 12px; font-weight: 500; text-align: center;
}
.sec-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cat, var(--primary)) 50%, transparent);
}
.sec-head .sec-ar { font-family: "Amiri", serif; font-size: 18px; color: var(--text); }
.sec-head .sec-en { font-size: 12px; color: var(--muted); }

/* Inside a block: everything takes that block's sheet color (--cat) */
.cat-title { color: var(--cat, var(--gold)); }
.back-btn:hover { border-color: var(--cat, var(--primary)); }
.counter { background: var(--cat, var(--primary)); color: var(--on-cat, var(--on-primary)); }
.counter.done { background: color-mix(in srgb, var(--cat, var(--primary)) 45%, #000); color: #F2EFE6; }
.card.done { border-color: var(--cat, var(--primary)); }
.src { background: color-mix(in srgb, var(--cat, var(--gold)) 24%, transparent); color: var(--text); }
.name-n, .name-tl { color: var(--cat, var(--primary)); }
:root[data-theme="light"] .cat-title,
:root[data-theme="light"] .name-n,
:root[data-theme="light"] .name-tl { color: color-mix(in srgb, var(--cat, var(--primary)) 62%, #000); }

.names-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 6px 0 24px; }
.name-card {
  position: relative; background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 22px 12px 14px; text-align: center;
}
.name-n { position: absolute; top: 8px; inset-inline-start: 10px; font-size: 11px; color: var(--cat, var(--gold)); }
.name-ar { font-family: "Amiri", serif; font-size: 26px; line-height: 1.6; color: var(--text); }
.name-tl { font-size: 13px; font-weight: 500; color: var(--cat, var(--primary)); margin-top: 2px; }
.name-en { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 3px; }

/* ---------- Site shell: menu, guest badge, home page, welcome screen ---------- */
a.brand { text-decoration: none; }
.site-nav {
  display: none; flex: 1; align-items: center; gap: 2px; margin-inline-start: 14px; min-width: 0;
  overflow-x: auto; scrollbar-width: none;          /* all the blocks are in the menu: it scrolls sideways if needed */
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav.scrolls { padding-inline-end: 30px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.site-nav a, .site-nav .nav-off {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap;
}
/* Menu links: no box. Under the link, a dot appears in the middle and stretches into a line
   when the pointer is on it; the line stays under the page you are on. */
.site-nav a { position: relative; transition: color .15s; }
.site-nav a::after {
  content: ""; position: absolute; bottom: 1px; left: calc(50% - 2px); right: calc(50% - 2px);
  height: 3px; border-radius: 3px; background: var(--nc, var(--primary)); opacity: 0;
  /* leaving: the line shrinks back to the dot, then the dot fades */
  transition: left .25s ease-in, right .25s ease-in, opacity .1s linear .2s;
}
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.active { color: var(--text); outline: none; }
.site-nav a:hover::after, .site-nav a:focus-visible::after, .site-nav a.active::after { left: 10px; right: 10px; opacity: 1;
  transition: left .32s cubic-bezier(.3, .8, .3, 1), right .32s cubic-bezier(.3, .8, .3, 1), opacity .1s linear;
}
@media (prefers-reduced-motion: reduce) { .site-nav a::after { transition: none !important; } }
.site-nav .nav-off { opacity: .45; cursor: default; }      /* a block that is not built yet */
@media (min-width: 720px) { .site-nav { display: flex; } }

/* Account button (person icon, or initials once signed in) and its menu */
.acct-wrap { position: relative; }
.acct {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 0.5px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: .02em; cursor: pointer;
}
.acct:hover, .acct[aria-expanded="true"] { border-color: var(--primary); }
.acct.in { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 30;
  width: 228px; max-width: calc(100vw - 24px); padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
  /* Closed: invisible, slightly smaller and higher. It grows out of the account button. */
  transform-origin: top right; opacity: 0; transform: translateY(-10px) scale(.9);
  visibility: hidden; pointer-events: none;
  transition: opacity .16s ease-in, transform .16s ease-in, visibility 0s linear .16s;
}
.acct-menu.open {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .2s ease-out, transform .3s cubic-bezier(.2, 1.25, .35, 1), visibility 0s;
}
.acct-menu [hidden] { display: none; }
/* Its lines come in one after the other */
.acct-menu.open > * { animation: menu-line .3s cubic-bezier(.2, .9, .3, 1) backwards; }
.acct-menu.open > :nth-child(2) { animation-delay: .04s; }
.acct-menu.open > :nth-child(3) { animation-delay: .08s; }
.acct-menu.open > :nth-child(4) { animation-delay: .12s; }
.acct-menu.open > :nth-child(5) { animation-delay: .16s; }
@keyframes menu-line { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.acct { transition: transform .12s, border-color .15s; }
.acct:active { transform: scale(.92); }
@media (prefers-reduced-motion: reduce) {
  .acct-menu, .acct-menu.open { transition: none; }
  .acct-menu.open > * { animation: none; }
  .acct { transition: none; }
}
.am-user { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; border-bottom: 0.5px solid var(--border); }
.am-avatar {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 600;
}
.am-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-signin {
  width: 100%; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-primary);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.am-signin:hover { background: var(--primary-deep); }
.am-box { padding: 6px; background: var(--bg); border: 0.5px solid var(--border); border-radius: 12px; }
.am-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text); font-family: inherit; font-size: 13px; text-align: start;
  text-decoration: none; cursor: pointer;
}
.am-item:hover { background: var(--bg); }
.am-item svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--muted); }
.acct-menu .lang-seg button { padding: 5px 2px; font-size: 12px; }
.am-out, .am-out svg { color: #E0655F; }
:root[data-theme="light"] .am-out, :root[data-theme="light"] .am-out svg { color: #A3261F; }

.soon-tag {
  font-size: 10px; font-weight: 500; letter-spacing: .04em; color: var(--muted);
  border: 0.5px solid var(--border); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}

/* Top of the home page: the logo and the tagline breathe, with the same space above and below
   as the verse on top of the Quran and Athkar pages (.q-motto). Less on a phone. */
/* less space below than above: the prayer band follows closely */
.hero { position: relative; text-align: center; padding: clamp(38px, 5.6vw, 80px) 0 clamp(18px, 2.4vw, 32px); }
/* Short phrases (Arabic, French, English) that appear and fade at random places on both sides
   of the logo. Placed by app.js (heroSpawnWord); never over the logo; clicks go through. */
.hero-words { position: absolute; inset: 0; pointer-events: none; }
.hero-title, .hero-tag { position: relative; }
.hw {
  position: absolute; left: 0; top: 0; opacity: 0;
  /* one writing style for all: the font of the Quran text (Amiri); French and English in its italic */
  font-family: "Amiri", serif; font-style: italic; font-weight: 400; font-size: var(--fs, 16px);
  line-height: 1.25; text-align: center; text-wrap: balance;
  /* each phrase has its own colour (--c, set by app.js): made a little lighter on the dark theme
     and darker on the light theme, so that every colour stays readable */
  color: color-mix(in srgb, var(--c, var(--gold)) 84%, white);
}
:root[data-theme="light"] .hw { color: color-mix(in srgb, var(--c, var(--gold)) 74%, black); }
.hw-ar { font-style: normal; line-height: 1.75; }          /* room for the vowels above and below */
/* large ones are the brightest, small ones the faintest: it gives depth */
.hw-l { --o: 1; } .hw-m { --o: .88; } .hw-s { --o: .74; }
.hw.on { animation: hero-word 5.2s ease-in-out both; }      /* same length as HERO_WORD_LIFE in app.js */
@keyframes hero-word {
  0%   { opacity: 0; transform: translateY(12px) scale(.94); filter: blur(5px); }
  16%  { opacity: var(--o); transform: none; filter: blur(0); }
  78%  { opacity: var(--o); transform: translateY(-5px); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-14px); filter: blur(4px); }
}
/* "Reduce motion" on the device: the phrases only fade in and out, nothing moves */
@keyframes hero-word-still { 0%, 100% { opacity: 0; } 16%, 78% { opacity: var(--o); } }
@media (prefers-reduced-motion: reduce) { .hw.on { animation-name: hero-word-still; } }
/* The site name, in Arabic, in the logo font; no letter-spacing (it breaks the joins) */
/* The logo, large, on the home page */
.hero-title { margin: 0 auto; height: 212px; width: max-content; color: var(--gold); line-height: 0; }
@media (max-width: 640px) { .hero-title { height: 186px; } }   /* phone: leaves room for the phrases on both sides */
.hero-tag { margin: 16px 0 0; font-size: 15px; color: var(--muted); }

.home-grid.modules { gap: 12px; }
@media (min-width: 720px)  { .home-grid.modules { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .home-grid.modules { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.block.module { min-height: 118px; padding: 14px 24px 14px 14px; text-decoration: none; justify-content: flex-start; }
.block.module .b-ar { font-size: 23px; }
.block.module .m-desc { margin-top: auto; padding-top: 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.block.module.off { cursor: default; opacity: .5; }
.block.module.off:hover, .block.module.off:active { border-color: var(--border); transform: none; }
.block.module.off::before { opacity: .45; }
.block.module .soon-tag { position: absolute; bottom: 12px; left: 12px; }
.block.module.off .m-desc { padding-left: 62px; }

a.back-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.page-head { max-width: none; padding-top: 6px; }

.w-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 600; }
.w-tagline { text-align: center; margin: 6px 0 18px; }
.w-label { margin: 0 0 8px; font-size: 12px; }
.w-langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.w-langs button {
  border: 0.5px solid var(--border); background: var(--bg); color: var(--text);
  padding: 10px 6px; border-radius: 10px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.w-langs button.active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.w-provider {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 500; font-family: inherit; margin-bottom: 8px;
}
/* The sign-in window is kept compact */
#welcome .modal { max-width: 300px; padding: 18px; border-radius: 16px; }
#welcome .w-brand { font-size: 17px; }
#welcome .w-brand .brand-mark { height: 96px; }
#welcome .w-tagline { margin: 4px 0 14px; font-size: 12.5px; }
#welcome .w-langs { margin-bottom: 12px; }
#welcome .w-langs button { padding: 7px 4px; font-size: 12.5px; }
#welcome .w-provider { padding: 9px; border-radius: 10px; font-size: 13.5px; margin-bottom: 6px; }
#welcome .w-guest { margin-top: 6px; font-size: 12px; }
#welcome .w-note { margin-top: 6px; font-size: 11px; }

/* "Continue as guest": small, under the two sign-in buttons, underlined */
.w-guest {
  display: block; margin: 8px auto 0; padding: 6px 8px; border: 0; background: none; color: var(--muted);
  font-family: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.w-guest:hover { color: var(--text); }
.w-provider { border: 0.5px solid var(--border); background: var(--bg); color: var(--text); }
.w-provider:disabled { opacity: .55; cursor: not-allowed; }
.w-provider[hidden] { display: none; }
.modal .w-note { margin: 10px 0 0; font-size: 12px; text-align: center; }

/* ---------- Quran: surah list and reading page ---------- */
.q-search {
  display: block; width: 100%; max-width: 520px; margin: 4px 0 14px; padding: 11px 14px;
  border-radius: 12px; border: 0.5px solid var(--border); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: 15px;
}
.q-search:focus { outline: none; border-color: var(--cat, var(--primary)); }
.surah-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 560px)  { .surah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .surah-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .surah-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.surah-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .15s;
}
.surah-row[hidden] { display: none; }
.surah-row:hover, .surah-row:focus-visible { border-color: var(--cat, var(--primary)); outline: none; }
.s-num {
  flex: 0 0 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--cat, var(--primary)) 24%, transparent);
}
.s-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.s-en { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-meta { font-size: 11px; color: var(--muted); }
.s-ar { font-family: "Amiri", serif; font-size: 19px; white-space: nowrap; }

.surah-head {
  text-align: center; padding: 18px 12px 14px; margin: 6px 0 14px;
  border: 0.5px solid var(--border); border-radius: 16px; background: var(--surface);
}
.sh-ar { margin: 0; font-family: "Amiri", serif; font-size: 30px; font-weight: 400; line-height: 1.6; color: var(--cat, var(--gold)); }
.sh-en { margin: 2px 0 0; font-size: 14px; color: var(--text); }
.sh-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.basmala { text-align: center; font-family: "Amiri", serif; font-size: 23px; line-height: 2; margin: 8px 0 12px; color: var(--text); }
.ayah { padding: 14px 4px; border-bottom: 0.5px solid var(--border); }
.ay-ar { margin: 0; font-family: "Amiri", serif; font-size: 23px; line-height: 2.1; text-align: right; color: var(--text); }
.ay-n { color: var(--cat, var(--gold)); }
.mushaf {
  margin: 4px 0 0; padding: 6px 4px 18px; font-family: "Amiri", serif; font-size: 24px; line-height: 2.2;
  text-align: justify; text-align-last: center; color: var(--text); border-bottom: 0.5px solid var(--border);
}
.ay-tr { margin: 6px 0 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.ay-k { color: var(--cat, var(--gold)); font-weight: 600; font-size: 13px; }
.q-nav { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.q-nav a {
  flex: 0 1 48%; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); font-size: 14px;
}
.q-nav a small { color: var(--muted); font-size: 12px; }
.q-nav .q-next { text-align: right; align-items: flex-end; }
.q-nav a:hover { border-color: var(--cat, var(--primary)); }
.q-credit { margin: 18px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.q-credit a { color: inherit; }
:root[data-theme="light"] .sh-ar,
:root[data-theme="light"] .ay-n,
:root[data-theme="light"] .ay-k { color: color-mix(in srgb, var(--cat, var(--gold)) 62%, #000); }

/* Readability: on the dark theme, colored titles are lightened so every sheet color stays legible */
:root:not([data-theme="light"]) .cat-title,
:root:not([data-theme="light"]) .name-n,
:root:not([data-theme="light"]) .name-tl,
:root:not([data-theme="light"]) .sh-ar,
:root:not([data-theme="light"]) .ay-n,
:root:not([data-theme="light"]) .ay-k { color: color-mix(in srgb, var(--cat, var(--gold)) 68%, #fff); }

/* ---------- Sources and credits page ---------- */
.about { padding: 4px 2px 20px; }
.about h2 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.about ul { list-style: none; margin: 0; padding: 0; border: 0.5px solid var(--border); border-radius: 12px; background: var(--surface); }
.about li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 0.5px solid var(--border); }
.about li:last-child { border-bottom: 0; }
.ab-k { font-size: 12px; color: var(--muted); }
.ab-v { font-size: 14px; line-height: 1.5; color: var(--text); }
.about a { color: var(--primary); }
:root:not([data-theme="light"]) .about a { color: color-mix(in srgb, var(--primary) 60%, #fff); }
.about p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ---------- Mushaf page turner (Arabic reading) ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 8px; }
.pg-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
a.pg-btn:hover, a.pg-btn:focus-visible { border-color: var(--cat, var(--primary)); outline: none; }
.pg-btn.off { opacity: .3; }
.pg-num {
  min-width: 40px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid currentColor;
  font-family: "Amiri", serif; font-size: 17px; display: inline-flex; align-items: center; justify-content: center;
}

/* Light theme: on the cream page the buttons need a white face, a visible edge and a soft shadow
   to read as buttons (on the dark theme the lighter surface already does that). */
:root[data-theme="light"] .pg-btn,
:root[data-theme="light"] .q-nav a {
  background: #FFFFFF; border-color: #D9CEB3;
  box-shadow: 0 1px 2px rgba(70, 52, 12, .08), 0 4px 14px rgba(70, 52, 12, .07);
}
:root[data-theme="light"] a.pg-btn { color: var(--gold); }
:root[data-theme="light"] a.pg-btn:hover, :root[data-theme="light"] a.pg-btn:focus-visible,
:root[data-theme="light"] .q-nav a:hover {
  border-color: var(--gold);
  box-shadow: 0 1px 2px rgba(70, 52, 12, .10), 0 6px 18px rgba(70, 52, 12, .12);
}
:root[data-theme="light"] .pg-btn.off { background: transparent; box-shadow: none; }
:root[data-theme="light"] .pg-num { background: #FFFFFF; }
:root[data-theme="light"] .q-nav a { transition: border-color .15s, box-shadow .15s; }

/* ---------- Surah list: phrase on top, then one line with the search and the filters ---------- */
/* The verse on top of the Quran and Athkar pages. It breathes: a clear space above it (under
   the header) and below it (before the search bar / the blocks). Less on a phone. */
.q-motto { --qm-top: clamp(38px, 5.6vw, 80px); --qm-bottom: clamp(32px, 4.8vw, 68px);
  text-align: center; padding: var(--qm-top) 0 var(--qm-bottom); }
.q-motto-ar { font-size: clamp(38px, 5.2vw, 62px); line-height: 1.6; }
.q-motto-ref { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.q-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.q-tools .q-search { flex: 1 1 280px; width: auto; max-width: none; height: 44px; margin: 0; padding: 0 14px; }
.q-filters { display: contents; }
.q-chips { display: inline-flex; height: 44px; border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.q-chip {
  border: 0; background: transparent; color: var(--muted); padding: 0 14px;
  font-family: inherit; font-size: 13px; cursor: pointer;
}
.q-chip.on { background: var(--cat, var(--primary)); color: var(--on-cat, #fff); }
.q-select {
  height: 44px; border-radius: 12px; border: 0.5px solid var(--border); background: var(--surface);
  color: var(--text); padding: 0 10px; font-family: inherit; font-size: 13px;
}
.q-select:focus { outline: none; border-color: var(--cat, var(--primary)); }
.ayah { scroll-margin-top: 122px; }

/* ---------- Favorite surahs: star beside each surah, star in the reading header, filter chip ---------- */
.surah-row { padding: 0; gap: 0; }
.surah-row:focus-within { border-color: var(--cat, var(--primary)); }
.s-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 2px;
  color: inherit; text-decoration: none; outline: none;
}
.s-fav {
  flex: none; width: 34px; align-self: stretch; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); opacity: .5; display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .15s, color .15s;
}
.s-fav:hover, .s-fav:focus-visible { opacity: 1; outline: none; }
.s-fav.on { opacity: 1; color: var(--cat, var(--gold)); }
:root[data-theme="light"] .s-fav.on { color: color-mix(in srgb, var(--cat, var(--gold)) 62%, #000); }
.surah-head { position: relative; }
.sh-fav { position: absolute; top: 8px; left: 8px; width: 38px; height: 38px; align-self: auto; border-radius: 50%; }
.q-favchip {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 0.5px solid var(--border); background: var(--surface);
  color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.q-favchip.on { color: var(--on-cat, #fff); background: var(--cat, var(--primary)); border-color: transparent; }
.s-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-link { gap: 10px; }

/* ---------- Reading bookmark: "save this place" and "resume" ---------- */
.mark-bar {
  position: sticky; top: 63px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 0; margin: -6px 0 6px; background: var(--bg);
}
.mk-btn {
  height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-family: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  transition: border-color .15s, color .15s;
}
.mk-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-btn svg { flex: none; }
.mk-btn:hover, .mk-btn:focus-visible { border-color: var(--cat, var(--primary)); color: var(--text); outline: none; }
.mk-btn.on, .mk-resume { color: var(--text); }
.mk-btn.on svg, .mk-resume svg { color: var(--cat, var(--gold)); }
:root[data-theme="light"] .mk-btn { background: #FFFFFF; border-color: #D9CEB3; }
:root[data-theme="light"] .mk-btn.on svg,
:root[data-theme="light"] .mk-resume svg { color: color-mix(in srgb, var(--cat, var(--gold)) 62%, #000); }
.q-resume { margin-top: 12px; }

/* ---------- Notes on verses ---------- */
.read-wrap { position: relative; }
.ay-n[data-note], .ay-k[data-note] { cursor: pointer; border-radius: 6px; }
/* No outline when hovering a verse number; a plain ring only when reached with the keyboard */
.ay-n[data-note], .ay-k[data-note] { outline: none; }
.ay-n[data-note]:focus-visible, .ay-k[data-note]:focus-visible { outline: 1.5px solid currentColor; outline-offset: 2px; }
.ay-n.has-note::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); margin-inline-start: 3px; vertical-align: super;
}
.ay-note, .note-card {
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; text-align: start; transition: border-color .15s;
}
.ay-note:hover, .note-card:hover, .ay-note:focus-visible, .note-card:focus-visible { border-color: var(--primary); outline: none; }
.note-text { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-ref { display: block; font-size: 11px; font-weight: 500; color: var(--primary); margin-bottom: 3px; }
:root:not([data-theme="light"]) .note-ref { color: color-mix(in srgb, var(--primary) 60%, #fff); }
.ay-note { margin: 10px 0 0; }
.notes-below { margin-top: 10px; display: grid; gap: 8px; }
.notes-below:empty { display: none; }
.notes-side { display: none; }
:root[data-theme="light"] .ay-note, :root[data-theme="light"] .note-card { background: #FFFFFF; border-color: #D9CEB3; }
@media (min-width: 1100px) {
  .notes-side { display: block; position: absolute; top: 0; width: min(280px, calc((100vw - 640px) / 2 - 12px)); }
  .notes-r { left: calc(100% + 16px); }
  .notes-l { right: calc(100% + 16px); }
  .note-card { position: absolute; left: 0; right: 0; }
  .ay-note, .notes-below { display: none; }
}

.note-modal { max-width: 360px; padding: 16px 18px; border-radius: 16px; }
.note-modal h2 { margin: 0; font-size: 15px; }
.modal .note-where { margin: 1px 0 10px; font-size: 12px; }
.note-modal textarea {
  display: block; width: 100%; min-height: 92px; resize: vertical; padding: 8px 10px; border-radius: 10px;
  border: 0.5px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.55;
}
.note-modal textarea:focus { outline: none; border-color: var(--primary); }
.modal .note-local { margin: 6px 0 10px; font-size: 11px; }
.note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note-btn {
  height: 32px; padding: 0 14px; border-radius: 9px; border: 0.5px solid var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer;
}
.note-btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.note-btn.danger { margin-inline-start: auto; color: #E0655F; }
:root[data-theme="light"] .note-btn.danger { color: #A3261F; }

/* ---------- Arabic reading: the page number is the bookmark button ---------- */
.mark-bar[hidden] { display: none; }
.mark-bar.plain { position: static; padding: 4px 0 8px; margin: 0; }
button.pg-num { background: transparent; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
button.pg-num:hover, button.pg-num:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); outline: none; }
:root .pg-num.on { background: var(--cat, var(--gold)); color: var(--on-cat, #10161A); border-color: transparent; }
:root[data-theme="light"] .pg-num.on { background: var(--gold); color: #FFFFFF; }

/* Keeps the page from jumping while the phrase on top of the Athkar page loads */
.q-motto:empty { box-sizing: content-box; min-height: calc(clamp(38px, 5.2vw, 62px) * 1.6 + 22px); }

/* ---------- Dhikr card footer: source | counter in the middle | favorite and share ---------- */
.card-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.cf-src { justify-self: start; min-width: 0; }
.cf-actions { justify-self: end; display: flex; align-items: center; gap: 2px; }
.count-wrap { position: relative; display: block; }
.count-wrap .repeat { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; }
.counter { width: 38px; height: 38px; font-size: 15px; }
.card-act {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.card-act:hover, .card-act:focus-visible {
  color: var(--text); background: color-mix(in srgb, var(--cat, var(--primary)) 16%, transparent); outline: none;
}
.card-act.on { color: var(--cat, var(--gold)); }
:root[data-theme="light"] .card-act.on { color: color-mix(in srgb, var(--cat, var(--gold)) 62%, #000); }
.card-act.ok { color: #3CC283; }
:root[data-theme="light"] .card-act.ok { color: #1B7A4B; }

/* ---------- "Allahumma barik": shown when a whole block of adhkar is finished ---------- */
.done-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.done-overlay.show { opacity: 1; pointer-events: auto; cursor: pointer; }
.done-box {
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 22px;
  padding: 26px 36px 22px; text-align: center; min-width: 220px;
}
.done-ring circle, .done-ring path { fill: none; stroke: var(--dc, var(--primary)); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.done-ring circle { stroke-dasharray: 214; stroke-dashoffset: 214; transform: rotate(-90deg); transform-origin: 40px 40px; }
.done-ring path { stroke-dasharray: 46; stroke-dashoffset: 46; }
.done-ar { margin: 8px 0 2px; font-family: "Amiri", serif; font-size: 34px; line-height: 1.6; color: var(--dc, var(--gold)); opacity: 0; }
:root[data-theme="light"] .done-ar { color: color-mix(in srgb, var(--dc, var(--gold)) 62%, #000); }
.done-sub { margin: 0; font-size: 13px; color: var(--muted); opacity: 0; }
.done-overlay.show .done-box { animation: done-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.done-overlay.show .done-ring circle { animation: done-draw .6s .1s ease-out forwards; }
.done-overlay.show .done-ring path { animation: done-draw .35s .65s ease-out forwards; }
.done-overlay.show .done-ar { animation: done-rise .5s .8s ease-out forwards; }
.done-overlay.show .done-sub { animation: done-rise .5s 1s ease-out forwards; }
@keyframes done-draw { to { stroke-dashoffset: 0; } }
@keyframes done-pop { from { transform: scale(.82); } to { transform: scale(1); } }
@keyframes done-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* People who asked their device for less motion get the final state at once */
@media (prefers-reduced-motion: reduce) {
  .done-overlay.show .done-box, .done-overlay.show .done-ring circle, .done-overlay.show .done-ring path,
  .done-overlay.show .done-ar, .done-overlay.show .done-sub { animation: none; }
  .done-ring circle, .done-ring path { stroke-dashoffset: 0; }
  .done-ar, .done-sub { opacity: 1; }
}


/* ---------- Left panel: reminders card and tasbih counter, styled like the right panel ---------- */
.today .today-date { margin-bottom: 12px; }
.tcard { text-align: start; }
.tcard-body { padding: 10px 12px 12px; }
/* Card title: Arabic on the right, its translation on the same line, on the left */
.tcard .feat-head {
  direction: rtl; flex-direction: row; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 2px 10px; text-align: right;
}
.tcard .feat-sub { direction: ltr; unicode-bidi: isolate; }
.tb-intro { font-size: 15px; line-height: 1.9; padding-bottom: 2px; color: var(--muted); }
.tb-phrase { margin: 0; padding: 0 12px 8px; font-family: "Amiri", serif; font-size: 19px; line-height: 1.9; text-align: center; color: var(--gold); }
.tb-ring {
  position: relative; display: block; width: 118px; height: 118px; margin: 6px auto 4px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: transform .08s;
}
.tb-ring:active { transform: scale(.96); }
.tb-ring:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tb-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.tb-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.tb-fg { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .25s ease-out; }
.tb-n {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
}
.tb-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px 0; }
.tb-foot .feat-src { margin-bottom: 0; }

/* ---------- Round counters: number and goal in the middle, pulse on a goal, look at 100 ---------- */
.tb-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.tb-center .tb-n { position: static; display: block; font-size: 28px; line-height: 1.1; }
.tb-goal { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-fg { transition: stroke-dashoffset .25s ease-out, stroke .25s; }
.tb-ring.hit { animation: ring-hit .45s ease-out; }
@keyframes ring-hit { 0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1); } }
.tb-ring.final svg { filter: drop-shadow(0 0 8px rgba(199, 125, 255, .6)); }
.tb-ring.final .tb-n { color: #D9A8FF; }
:root[data-theme="light"] .tb-ring.final .tb-n { color: #7C2BD0; }
@media (prefers-reduced-motion: reduce) { .tb-ring.hit { animation: none; } }
/* The sign ﷺ is missing from the interface font: fall back to the Arabic font for it */


/* ---------- Prayer times: the small block in the header and its menu ---------- */
.pray-wrap { position: relative; }
.pray {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 0.5px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, opacity .2s;
}
.pray svg { flex: 0 0 auto; color: var(--gold); }
.pray .pr-name { color: var(--muted); }
.pray .pr-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.pray:hover, .pray[aria-expanded="true"] { border-color: var(--primary); }
.pray.off { opacity: .5; }                       /* greyed out until the position is allowed */
.pray.off:hover, .pray.off[aria-expanded="true"] { opacity: .9; }
@keyframes pray-busy { to { opacity: .9; } }
.pray.busy { animation: pray-busy .7s ease-in-out infinite alternate; }
@media (max-width: 480px) { .pray { padding: 0 9px; } .pray .pr-name { display: none; } }

.pray-menu { width: 268px; }
.pray-menu.settled > * { animation: none; }
/* Top of the menu, in three groups: title + clock on one line; the two dates under each other;
   then the next prayer in a box of its own. */
.pt-head { display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 0; }
.pt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pt-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pt-dates { display: flex; flex-direction: column; gap: 2px; }
.pt-date { font-size: 12px; color: var(--muted); }
.pt-date::first-letter { text-transform: uppercase; }        /* "mardi 17 novembre" -> "Mardi…" */
.pt-hijri { font-size: 12px; color: var(--gold); }        /* the Hijri (lunar) date */
.pt-next {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px;
  border-radius: 12px; background: color-mix(in srgb, var(--primary) 16%, transparent);
  border: 0.5px solid color-mix(in srgb, var(--primary) 45%, transparent);
}
.pt-next-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt-next-l small { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pt-next-l b { font-size: 14px; font-weight: 600; color: var(--text); }
[dir="rtl"] .pt-next-l small { letter-spacing: 0; }      /* spacing would break the joins of Arabic letters */
.pt-next-w { font-size: 12px; color: var(--text); white-space: nowrap; }
.pt-list { display: flex; flex-direction: column; gap: 1px; padding: 4px; background: var(--bg); border: 0.5px solid var(--border); border-radius: 12px; }
.pt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--text); }
.pt-row .pt-t { font-weight: 500; font-variant-numeric: tabular-nums; }
.pt-row.minor { color: var(--muted); }
.pt-row.next { background: color-mix(in srgb, var(--primary) 24%, transparent); font-weight: 600; }
.pt-note { margin: 0; padding: 2px 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.pt-note.warn { color: var(--text); }
.pt-actions { display: flex; gap: 6px; }
.pt-btn {
  flex: 1; padding: 6px 8px; border: 0.5px solid var(--border); border-radius: 9px; background: transparent;
  color: var(--text); font-family: inherit; font-size: 12px; cursor: pointer;
}
.pt-btn:hover { border-color: var(--primary); }
.pt-btn.main { padding: 8px 10px; border: 0; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 600; }
.pt-btn.main:hover { background: var(--primary-deep); }

/* ---------- Prayer times: a band on the home page, above the blocks ---------- */
.pray-band {
  margin: 0 0 16px; padding: 11px 14px; background: var(--surface);
  border: 0.5px solid var(--border); border-radius: 16px;
}
.pb-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.pb-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.pb-title svg { color: var(--gold); }
/* Top line once the times are shown, in three parts: [title + dates] [clock] [next prayer].
   The two side columns have the same width (1fr), so the clock sits exactly in the middle. */
.pb-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px 16px; }
.pb-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pb-dates { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.pb-date { font-size: 12px; color: var(--muted); }
.pb-date::first-letter { text-transform: uppercase; }        /* "mardi 17 novembre" -> "Mardi…" */
.pb-hijri { font-size: 12px; color: var(--gold); }       /* the Hijri (lunar) date */
/* the time it is now */
.pb-clock {
  padding: 3px 15px; border-radius: 999px; background: var(--bg); border: 0.5px solid var(--border);
  font-size: 19px; font-weight: 600; letter-spacing: .02em; color: var(--text); font-variant-numeric: tabular-nums;
  min-width: 120px; text-align: center;        /* fixed width: the band does not move when the seconds change */
}
.pt-clock {
  padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 0.5px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
}
/* the next prayer, at the far end: a small label, then its name and time, then the time left */
.pb-next { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; text-align: end; }
.pb-next small { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .pb-next small { letter-spacing: 0; }             /* spacing would break the joins of Arabic letters */
.pb-next > span { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 2px 10px; }
.pb-next b { font-size: 14px; font-weight: 600; color: var(--text); }
.pb-next i { font-style: normal; font-size: 12px; color: var(--muted); }
.pb-times { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.pb-time {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 6px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
}
.pb-n { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pb-t { font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pb-time.minor .pb-t { font-weight: 500; color: var(--muted); }
.pb-time.next { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--bg)); }
.pb-time.next .pb-n { color: var(--text); }
/* Greyed out until the position is allowed; the button itself stays clear */
.pray-band.off .pb-title, .pray-band.off .pb-why { opacity: .5; }
.pray-band.off .pb-why.warn { opacity: .85; }
.pb-why { flex: 1 1 280px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.pb-allow {
  padding: 8px 14px; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-primary);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pb-allow:hover { background: var(--primary-deep); }
@media (max-width: 640px) {
  .pb-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* phone: the three parts go under each other, the clock still centred */
  .pb-head { grid-template-columns: minmax(0, 1fr); }
  .pb-clock { justify-self: center; }
  .pb-next { align-items: center; text-align: center; }
  .pb-next > span { justify-content: center; }
  .pb-info { align-items: center; text-align: center; }
  .pb-dates { justify-content: center; }
}

/* ==================== Motion ====================
   Everything here is decoration: with "reduce motion" switched on in the device settings,
   all of it is turned off (see the end of this section). */

/* 1. Arriving on a page: the page fades in, its blocks / cards / rows rise one after the other.
      "--k" is the place in the queue; from the 13th item on, everything comes together. */
@keyframes page-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.list.enter { animation: page-in .45s ease-out; }
.list.enter > *, .list.enter :is(.home-grid, .surah-grid, .names-grid) > * { --k: 12; }
.list.enter > :nth-child(1), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(1) { --k: 0; }
.list.enter > :nth-child(2), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(2) { --k: 1; }
.list.enter > :nth-child(3), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(3) { --k: 2; }
.list.enter > :nth-child(4), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(4) { --k: 3; }
.list.enter > :nth-child(5), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(5) { --k: 4; }
.list.enter > :nth-child(6), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(6) { --k: 5; }
.list.enter > :nth-child(7), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(7) { --k: 6; }
.list.enter > :nth-child(8), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(8) { --k: 7; }
.list.enter > :nth-child(9), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(9) { --k: 8; }
.list.enter > :nth-child(10), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(10) { --k: 9; }
.list.enter > :nth-child(11), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(11) { --k: 10; }
.list.enter > :nth-child(12), .list.enter :is(.home-grid, .surah-grid, .names-grid) > :nth-child(12) { --k: 11; }
.list.enter > .card, .list.enter > .sec-head, .list.enter > .pray-band,
.list.enter :is(.home-grid, .surah-grid, .names-grid) > * {
  animation: rise .75s cubic-bezier(.22, .61, .36, 1) backwards;      /* slow and soft */
  animation-delay: calc(var(--k) * 55ms);
}

/* 2. Blocks lift a little under the pointer */
.block { transition: border-color .15s, transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s; }
a.block:hover, button.block:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }
:root[data-theme="light"] a.block:hover, :root[data-theme="light"] button.block:hover { box-shadow: 0 10px 22px rgba(70, 52, 12, .14); }
a.block:active, button.block:active { transform: scale(.98); box-shadow: none; }
.today-row { transition: border-color .15s, transform .18s cubic-bezier(.2, .8, .3, 1); }
button.today-row:hover { transform: translateY(-2px); }

/* 3. Counter: a small bounce at each tap; the card glows once when its dhikr is finished */
@keyframes tap { 0% { transform: scale(.82); } 55% { transform: scale(1.1); } 100% { transform: scale(1); } }
.counter.tap { animation: tap .3s ease-out; }
@keyframes card-done {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cat, var(--primary)) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.card { transition: border-color .3s; }
.card.just-done { animation: card-done .7s ease-out; }

/* 4. Quran reading: the page slides in from the side we are turning toward */
/*    in two steps: the page being read slides away and fades (.26s, same as TURN_OUT_MS in
      app.js), then the new one glides in slowly */
@keyframes turn-out { to { opacity: 0; transform: translateX(var(--tx, 0)); } }
@keyframes turn-in { from { opacity: 0; transform: translateX(var(--tx, 0)); } }
.read-wrap.turn-out { animation: turn-out .26s ease-in forwards; }
.read-wrap.to-left { --tx: -32px; }
.read-wrap.to-right { --tx: 32px; }
.read-wrap.turn { animation: turn-in .7s cubic-bezier(.22, .61, .36, 1) backwards; }
.read-wrap.from-left { --tx: -40px; }
.read-wrap.from-right { --tx: 40px; }
body { overflow-x: clip; }          /* the sliding page must not create a sideways scroll */

/* 5. Quran list: it fades back in when a filter changes */
/*    the surahs that remain arrive one after the other (their place "--k" is set in
      refilter()); while typing in the search box, a plain soft fade instead */
.surah-grid.flash > * { animation: rise .7s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: calc(var(--k, 0) * 50ms); }
@keyframes soft-in { from { opacity: .35; } }
.surah-grid.flash-soft { animation: soft-in .4s ease-out; }

/* 6. Stars and the page bookmark: a small pop when switched on or off */
@keyframes pop { 0% { transform: scale(.65); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pop { animation: pop .38s ease-out; }

/* 7. Dark / light switch: for half a second every color glides to its new value, and the
      moon / sun turns into place */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease,
              fill .45s ease, stroke .45s ease, box-shadow .45s ease !important;
}
.tt-glyph { display: inline-block; }
@keyframes glyph-in { from { opacity: 0; transform: rotate(-120deg) scale(.4); } }
.tt-glyph.spin { animation: glyph-in .5s cubic-bezier(.2, 1.3, .4, 1); }

/* 8. Language change: the blocks / cards / rows arrive again (rule 1), without the page fade */
.list.enter.relang { animation: none; }

/* 9. Library. A shelf comes in when it is scrolled into view (.wait -> .in, see libAnimateIn in app.js):
      its name rises, its plank is drawn from the side where reading starts, then its books drop on it
      one after the other ("--b" = place of the book, "--s" = place of the shelf among those arriving together).
      Under the pointer a book is pulled a little out of the shelf. The window of a book rises, its
      cover turns to face the reader, its buttons come one after the other. */
.lib-sec.wait { opacity: 0; }
.lib-sec.in { --d: calc(var(--s, 0) * 90ms); }
.lib-sec.in .lib-sec-head, .lib-sec.in .lib-sec-desc { animation: rise .6s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: var(--d); }
@keyframes shelf-draw { from { clip-path: inset(-40px 100% -24px 0); } to { clip-path: inset(-40px 0 -24px 0); } }
@keyframes shelf-draw-rtl { from { clip-path: inset(-40px 0 -24px 100%); } to { clip-path: inset(-40px 0 -24px 0); } }
.lib-sec.in .lib-shelf { animation: shelf-draw .75s cubic-bezier(.3, .7, .3, 1) backwards; animation-delay: var(--d); }
.lib-secs[dir="rtl"] .lib-sec.in .lib-shelf { animation-name: shelf-draw-rtl; }
@keyframes book-in {
  0%   { opacity: 0; transform: translateY(-24px) rotate(-7deg); }
  55%  { opacity: 1; transform: translateY(0) rotate(2deg); }
  78%  { transform: rotate(-1deg); }
  100% { transform: none; }
}
.lib-cover { transform-origin: 50% 100%; }
.lib-sec.in .lib-cover { animation: book-in .6s cubic-bezier(.3, .9, .4, 1) backwards; animation-delay: calc(var(--d) + 220ms + var(--b, 0) * 110ms); }
.lib-sec.in .lib-cap { animation: page-in .5s ease-out backwards; animation-delay: calc(var(--d) + 420ms + var(--b, 0) * 110ms); }
.lib-book:hover .lib-cover, .lib-book:focus-visible .lib-cover { transform: translateY(-6px) rotate(-2.5deg); }
.lib-book:active .lib-cover { transform: translateY(-2px) scale(.97); }
@keyframes book-window { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes cover-turn { from { opacity: 0; transform: perspective(700px) rotateY(60deg); } }
@keyframes cover-turn-latin { from { opacity: 0; transform: perspective(700px) rotateY(-60deg); } }
@keyframes book-out { to { opacity: 0; } }
#bookModal { animation: page-in .22s ease-out; }
#bookModal .lib-modal { animation: book-window .36s cubic-bezier(.2, .9, .3, 1.12) backwards; }
#bookModal .lib-cover { transform-origin: 100% 50%; animation: cover-turn .65s .1s cubic-bezier(.2, .8, .3, 1) backwards; }
#bookModal .lib-cover.latin { transform-origin: 0 50%; animation-name: cover-turn-latin; }
#bookModal .lib-modal-text { animation: page-in .5s .12s ease-out backwards; }
#bookModal .lib-go { animation: rise .45s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: calc(180ms + var(--i, 0) * 70ms); }
#bookModal .lib-modal-note { animation: page-in .5s .4s ease-out backwards; }
#bookModal.closing { animation: book-out .17s ease-in forwards; }

/* 10. Learning pages: the ways to learn, the rows of lessons, the letters, the examples and the
       rules of tajwid rise one after the other when the page arrives ("--k" = place in the queue).
       A row of lesson pushes its arrow forward under the pointer. The "your e-mail is ready" panel rises. */
.list.enter :is(.ln-plan, .ln-rows > li, .ln-item, .ln-letter, .tj-rule) {
  animation: rise .7s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: calc(var(--k, 0) * 55ms);
}
.list.enter .ln-letter { animation-delay: calc(var(--k, 0) * 26ms); }
.ln-sent:not([hidden]) { animation: rise .5s cubic-bezier(.22, .61, .36, 1); }
.ln-row .ln-chev { transition: transform .18s ease; }
.ln-row:hover .ln-chev, .ln-row:focus-visible .ln-chev { transform: translateX(4px); }
[dir="rtl"] .ln-row .ln-chev { transform: scaleX(-1); }
[dir="rtl"] .ln-row:hover .ln-chev, [dir="rtl"] .ln-row:focus-visible .ln-chev { transform: scaleX(-1) translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .ln-sent:not([hidden]) { animation: none; }
  .ln-row .ln-chev, .ln-btn, .ln-row { transition: none; }
  .lib-sec.wait { opacity: 1; }
  .lib-sec.in *, #bookModal, #bookModal * { animation: none !important; }
  .tt-glyph.spin, .pray.busy { animation: none !important; }
  html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: none !important; }
  .list.enter, .list.enter *, .read-wrap.turn, .read-wrap.turn-out, .counter.tap, .card.just-done, .surah-grid.flash > *, .surah-grid.flash-soft, .pop { animation: none !important; }
  .block, .today-row, .card { transition: none; }
  a.block:hover, button.block:hover, button.today-row:hover { transform: none; }
}

/* ---------- Library: the verse, the search bar with its filters, then one shelf per section ----------
   A section is not a block as on the other pages: no box and no coloured band. It is a shelf: its name,
   a line of small book covers standing on a thin gold plank, and under each cover its label.
   The only colours are those of the covers (--bk, one deep cloth colour per section) and the gold of the site. */
/* the notice: more books come version after version */
.lib-more { margin: 0; padding: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.lib-more[dir="rtl"] { font-size: 13.5px; }
.lib-secs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px 44px; align-items: start; margin-top: 24px; padding-bottom: 20px; }
@media (min-width: 720px)  { .lib-secs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1160px) { .lib-secs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lib-secs.one { grid-template-columns: minmax(0, 1fr); }             /* one section chosen: its shelf takes the whole width */
.lib-sec { --cw: 84px; --ch: 119px; min-width: 0; }
.lib-sec[hidden] { display: none; }
.lib-sec-head { display: flex; align-items: baseline; gap: 9px; }
.lib-sec-name { min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--text); }
.lib-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lib-sec-ar { margin: 0 0 0 auto; font-family: "Amiri", serif; font-size: 23px; font-weight: 400; line-height: 1.4; color: var(--gold); flex: none; white-space: nowrap; }
.lib-secs[dir="rtl"] .lib-sec-ar { order: -1; }       /* Arabic site: the name first (right), the count at the other end */
.lib-sec-desc { margin: 1px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.lib-secs[dir="rtl"] .lib-sec-desc { font-size: 13.5px; }
/* the shelf: the books stand side by side; each one carries its piece of plank, and an empty
   piece (::after) carries the plank to the end of the line */
.lib-shelf { display: flex; flex-wrap: wrap; margin-top: 2px; }
.lib-stand, .lib-shelf::after {
  height: calc(var(--ch) + 15px);
  border-bottom: 3px solid color-mix(in srgb, var(--gold) 42%, var(--border));
  box-shadow: 0 9px 10px -9px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] .lib-stand, :root[data-theme="light"] .lib-shelf::after { box-shadow: 0 9px 10px -9px rgba(60, 45, 10, .28); }
.lib-shelf::after { content: ""; flex: 1000 1 0; min-width: 0; }
.lib-sec.empty .lib-shelf::after { height: 30px; }
.lib-book {
  flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lib-book[hidden] { display: none; }
.lib-book:focus-visible { outline: none; }
.lib-stand { display: flex; align-items: flex-end; padding: 0 7px; }
.lib-cap { display: flex; flex-direction: column; gap: 2px; width: calc(var(--cw) + 14px); padding: 8px 7px 0; }
.lib-cap b {
  font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.lib-cap small { font-size: 11px; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-secs[dir="rtl"] .lib-cap b { font-size: 13px; line-height: 1.5; }
.lib-secs[dir="rtl"] .lib-cap small { font-size: 12px; }
/* a cover: cloth of the colour of its section, the spine on the right (an Arabic book opens from the
   right; on the left for a book with no Arabic title), a thin gold frame, the title in gold letters.
   Every measure is in em of the cover, itself set from its width (--cw): the same cover is drawn
   small on a shelf and larger in the window of the book. */
.lib-cover {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: var(--cw); height: var(--ch); font-size: calc(var(--cw) * .155);
  padding: 1.25em 1.2em 1.5em .75em; border-radius: 3px 6px 6px 3px;
  background:
    linear-gradient(to left, rgba(0, 0, 0, .30) 0 .46em, rgba(255, 255, 255, .13) .46em calc(.46em + 1px), transparent calc(.46em + 1px)),
    linear-gradient(155deg, color-mix(in srgb, var(--bk) 86%, white) 0%, var(--bk) 52%, color-mix(in srgb, var(--bk) 78%, black) 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .34);
  color: #EAD9A8; transition: transform .16s ease, box-shadow .16s ease;
}
.lib-cover.latin {
  padding: 1.25em .75em 1.5em 1.2em; border-radius: 6px 3px 3px 6px;
  background:
    linear-gradient(to right, rgba(0, 0, 0, .30) 0 .46em, rgba(255, 255, 255, .13) .46em calc(.46em + 1px), transparent calc(.46em + 1px)),
    linear-gradient(155deg, color-mix(in srgb, var(--bk) 86%, white) 0%, var(--bk) 52%, color-mix(in srgb, var(--bk) 78%, black) 100%);
}
.lib-cover::before {                       /* the frame */
  content: ""; position: absolute; inset: .4em .92em .4em .4em; border: 1px solid rgba(234, 217, 168, .6); border-radius: 2px;
  box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 2.5px rgba(234, 217, 168, .22); pointer-events: none;
}
.lib-cover.latin::before { inset: .4em .4em .4em .92em; }
.lib-cover::after {                        /* a small diamond above the title */
  content: ""; position: absolute; top: .9em; left: calc(50% - .4em); width: .28em; height: .28em;
  background: currentColor; opacity: .75; transform: rotate(45deg);
}
.lib-cover.latin::after { left: calc(50% + .12em); }
.lib-cover-t {
  font-family: "Amiri", serif; font-size: 1em; font-weight: 700; line-height: 1.5; text-align: center; text-wrap: balance;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.lib-cover.long .lib-cover-t { font-size: .84em; line-height: 1.55; }
.lib-cover.latin .lib-cover-t { font-size: .78em; font-weight: 400; font-style: italic; line-height: 1.35; -webkit-line-clamp: 5; }
.lib-cover-l {
  position: absolute; bottom: 1.5em; left: 0; right: .52em; text-align: center; direction: ltr;
  font-family: "Inter", system-ui, sans-serif; font-size: .46em; font-weight: 600; letter-spacing: .1em; opacity: .8;
}
.lib-cover.latin .lib-cover-l { left: .52em; right: 0; }
.lib-book:hover .lib-cover, .lib-book:focus-visible .lib-cover { box-shadow: 0 10px 16px rgba(0, 0, 0, .42); }
.lib-book:focus-visible .lib-cover { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 640px) {
  .lib-sec { --cw: 78px; --ch: 110px; }
  .lib-stand { padding: 0 6px; }
  .lib-cap { width: calc(var(--cw) + 12px); padding: 7px 6px 0; }
  .lib-sec-ar { font-size: 21px; }
}
/* the window of a book */
.lib-modal { position: relative; max-width: 460px; padding: 20px; --cw: 104px; --ch: 148px; }
.lib-x {
  position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.lib-x:hover, .lib-x:focus-visible { background: var(--bg); color: var(--text); outline: none; }
.lib-modal-top { display: flex; align-items: flex-start; gap: 16px; padding-inline-end: 24px; }
.lib-modal-text { min-width: 0; padding-top: 4px; }
.modal .lib-modal-sec { margin: 0 0 5px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--gold); }
.lib-modal[dir="rtl"] .lib-modal-sec { font-size: 12.5px; letter-spacing: 0; }
.lib-modal h2 { margin: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.lib-modal[dir="rtl"] h2 { font-family: "Amiri", serif; font-size: 23px; line-height: 1.5; }
.modal .lib-modal-ar { margin: 5px 0 0; font-family: "Amiri", serif; font-size: 19px; line-height: 1.5; color: var(--text); }
.lib-modal:not([dir="rtl"]) .lib-modal-ar { text-align: left; }
.modal .lib-modal-a { margin: 7px 0 0; font-size: 13px; line-height: 1.45; }
.lib-modal[dir="rtl"] .lib-modal-a { font-size: 14px; }
.lib-eds { display: grid; gap: 8px; margin-top: 18px; }
.lib-go {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  background: var(--bg); border: 0.5px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.lib-go:hover, .lib-go:focus-visible { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--bg)); outline: none; }
.lib-go > svg:first-child { flex: none; color: var(--gold); }
.lib-go .lib-out { flex: none; color: var(--muted); }
.lib-modal[dir="rtl"] .lib-out { transform: scaleX(-1); }
.lib-go-t { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lib-go-t b { font-size: 14px; font-weight: 600; }
.lib-go-t small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.modal .lib-modal-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.45; text-align: center; }
@media (max-width: 480px) {
  .lib-modal { padding: 16px; --cw: 88px; --ch: 126px; }
  .lib-modal-top { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .lib-cover, .lib-go { transition: none; }
  .lib-book:hover .lib-cover, .lib-book:focus-visible .lib-cover, .lib-book:active .lib-cover { transform: none; }
}

/* ---------- Learning pages: "Learn Arabic" and "Hifdh" ----------
   Home of a page: the verse, the four ways to learn (cards), then the lessons as a numbered list.
   A lesson: text, examples in small tiles, the table of letters. The form: plain fields, gold button.
   Colours: the neutral surfaces of the site and its gold, nothing else. */
:root { --on-gold: #1F1B10; }
:root[data-theme="light"] { --on-gold: #FFFFFF; }
.ln-sec + .ln-sec { margin-top: 36px; }
.ln-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 28px 0 12px; }
.ln-sec > .ln-head:first-child { margin-top: 0; }
.ln-h { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }
.ln-sec[dir="rtl"] .ln-h { font-family: "Amiri", serif; font-size: 26px; font-weight: 400; line-height: 1.4; color: var(--gold); }
.ln-h-s { font-size: 12.5px; color: var(--muted); }
.ln-sec[dir="rtl"] .ln-h-s { font-size: 13.5px; }
.ln-h-ar { margin-left: auto; font-family: "Amiri", serif; font-size: 23px; line-height: 1.4; color: var(--gold); white-space: nowrap; }
/* the four ways to learn */
.ln-plans { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 560px)  { .ln-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .ln-plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ln-plan { display: flex; flex-direction: column; gap: 5px; padding: 16px; border-radius: 16px; background: var(--surface); border: 0.5px solid var(--border); }
.ln-plan.free { border: 1px solid color-mix(in srgb, var(--gold) 65%, var(--border)); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.ln-plan-n { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.ln-plan-p { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.ln-plan.free .ln-plan-p { font-size: 21px; color: var(--gold); }
.ln-plan-p.priced { font-size: 21px; color: var(--text); }
.ln-plan-p.priced small { font-size: 13px; font-weight: 500; color: var(--muted); }          /* a real price, written in data/learning.json */
.ln-plan-t { flex: 1; margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.ln-plan-s { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.ln-plan-s.trial { font-size: 12.5px; font-weight: 600; color: var(--gold); }       /* "first session free" */
.ln-plan .ln-btn { margin-top: 10px; }
.ln-sec[dir="rtl"] .ln-plan-n { font-size: 16px; }
.ln-sec[dir="rtl"] .ln-plan-t, .ln-sec[dir="rtl"] .ln-plan-s, .ln-sec[dir="rtl"] .ln-meet { font-size: 14px; }
.ln-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 11px;
  border: 0.5px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
  text-align: center; text-decoration: none; cursor: pointer; transition: border-color .15s, filter .15s, transform .12s;
}
.ln-btn:hover, .ln-btn:focus-visible { border-color: var(--gold); outline: none; }
.ln-btn:active { transform: scale(.98); }
.ln-btn.gold { background: var(--gold); border-color: transparent; color: var(--on-gold); }
.ln-btn.gold:hover, .ln-btn.gold:focus-visible { filter: brightness(1.08); }
.ln-btn.gold:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ln-btn.big { width: 100%; min-height: 48px; margin-top: 24px; font-size: 15px; }
.ln-meet { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
/* "More about the lessons with a teacher": closed by default, opens under the cards */
.ln-info { margin: 14px 0 0; border-radius: 14px; background: var(--surface); border: 0.5px solid var(--border); }
.ln-info summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px;
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; border-radius: 14px;
}
.ln-info summary::-webkit-details-marker { display: none; }
.ln-info summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ln-info summary .ln-chev { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.ln-info[open] summary .ln-chev { transform: rotate(-90deg); }
.ln-info dl { display: grid; gap: 14px 28px; margin: 0; padding: 4px 16px 18px; }
@media (min-width: 820px) { .ln-info dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ln-info dt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ln-info dd { margin: 3px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.ln-sec[dir="rtl"] .ln-info summary, .ln-sec[dir="rtl"] .ln-info dt { font-size: 14.5px; }
.ln-sec[dir="rtl"] .ln-info dd { font-size: 14.5px; line-height: 1.8; }
@media (prefers-reduced-motion: reduce) { .ln-info summary .ln-chev { transition: none; } }
/* the lessons: a numbered list, two columns on a large screen */
.ln-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 44px; }
@media (min-width: 900px) { .ln-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ln-rows > li { border-bottom: 0.5px solid var(--border); }
.ln-row { display: flex; align-items: center; gap: 13px; padding: 12px 6px; border-radius: 10px; color: var(--text); text-decoration: none; transition: background-color .15s; }
.ln-row:hover, .ln-row:focus-visible { background: color-mix(in srgb, var(--gold) 8%, transparent); outline: none; }
.ln-n {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border)); color: var(--gold); font-size: 13px; font-weight: 600;
}
.ln-t { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.4; }
.ln-sec[dir="rtl"] .ln-t { font-size: 16px; line-height: 1.5; }
.ln-ar { flex: none; font-size: 15px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.ln-chev { flex: none; color: var(--muted); }
@media (max-width: 520px) { .ln-ar { display: none; } }
/* a lesson */
.ln-lesson, .ln-form, .ln-sent { padding: 4px 2px 30px; }
.ln-title { margin: 12px 0 0; font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--text); }
[dir="rtl"] > .ln-title { font-family: "Amiri", serif; font-size: 32px; font-weight: 400; line-height: 1.5; color: var(--gold); }
.ln-title-ar { margin: 2px 0 0; font-family: "Amiri", serif; font-size: 24px; line-height: 1.5; color: var(--gold); text-align: left; }
.ln-p { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: var(--text); }
[dir="rtl"] > .ln-p, [dir="rtl"] > .tj-rule .ln-p { font-size: 16px; line-height: 1.9; }
.ln-arx { font-family: "Amiri", serif; font-size: 1.32em; line-height: 1; unicode-bidi: isolate; }   /* Arabic quoted inside French or English */
.ln-tip {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; border-inline-start: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); font-size: 14px; line-height: 1.65; color: var(--text);
}
[dir="rtl"] > .ln-tip { font-size: 15px; line-height: 1.85; }
.ln-ex { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; margin-top: 14px; }
.ln-item, .ln-letter {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border-radius: 12px;
  background: var(--surface); border: 0.5px solid var(--border); text-align: center; min-width: 0;
}
.ln-item-ar { font-family: "Amiri", serif; font-size: 27px; line-height: 1.75; color: var(--text); }
.ln-item-tr, .ln-l-tr { font-size: 12.5px; font-style: italic; color: var(--gold); }
.ln-item-m, .ln-l-s { font-size: 12px; line-height: 1.4; color: var(--muted); }
[dir="rtl"] > .ln-ex .ln-item-m { font-size: 13px; }
.ln-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 14px; }
.ln-l { font-family: "Amiri", serif; font-size: 44px; line-height: 1.45; color: var(--gold); }
.ln-l-n { font-family: "Amiri", serif; font-size: 17px; line-height: 1.4; color: var(--text); }
.ln-forms-w { margin-top: 14px; border: 0.5px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ln-forms { width: 100%; border-collapse: collapse; text-align: center; }
.ln-forms th { padding: 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 0.5px solid var(--border); }
.ln-forms td { padding: 2px 6px; font-family: "Amiri", serif; font-size: 28px; line-height: 1.85; color: var(--text); border-bottom: 0.5px solid var(--border); }
.ln-forms tr:last-child td { border-bottom: 0; }
.ln-forms td:first-child { color: var(--gold); }
.ln-steps { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; }
.ln-step {
  display: flex; flex-direction: column; gap: 2px; max-width: 48%; padding: 10px 14px; border-radius: 12px;
  border: 0.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.4;
  text-decoration: none; transition: border-color .15s;
}
.ln-step:hover, .ln-step:focus-visible { border-color: var(--gold); outline: none; }
.ln-step small { font-size: 11.5px; color: var(--muted); }
.ln-step.next { text-align: end; }
[dir="rtl"] > .ln-steps .ln-step span { font-size: 15px; }
/* a rule of tajwid */
.tj-rule { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--surface); border: 0.5px solid var(--border); }
.tj-name { display: flex; flex-direction: column; gap: 1px; margin: 0; }
.tj-name span { font-family: "Amiri", serif; font-size: 25px; font-weight: 400; line-height: 1.5; color: var(--gold); }
.ln-lesson:not([dir="rtl"]) .tj-name span { text-align: left; }
.tj-name small { font-size: 13.5px; font-weight: 600; color: var(--text); }
.tj-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ln-lesson:not([dir="rtl"]) .tj-letters { justify-content: flex-end; }
.tj-letters span {
  display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px 3px; border-radius: 9px;
  background: var(--bg); border: 0.5px solid var(--border); font-family: "Amiri", serif; font-size: 20px; line-height: 1; color: var(--text);
}
.tj-rule .ln-p { margin-top: 10px; font-size: 14.5px; }
.tj-ex { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.tj-x { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px; border-radius: 12px; background: var(--bg); border: 0.5px solid var(--border); text-align: center; min-width: 0; }
/* the words of an example are in the plain text color, like the black ink of the mushaf: only
   the letters of the rule are colored (":root" so that it wins over the gold of ".sh-ar") */
:root .tj-ex .tj-x .sh-ar { font-size: 25px; line-height: 2; color: var(--text); }
.tj-x small { font-size: 11.5px; color: var(--muted); }
/* The colors of the tajwid mushaf (key of the Dar al-Ma'rifah edition), a little brighter on the
   dark theme so that they can be read. Each color is written twice: "::highlight(tj-...)" paints
   the letters of an example without cutting its text (tajwidPaint in app.js), the class of the
   same name is for the dots of the key and for browsers without that tool. KEEP THE TWO IN STEP. */
.tj-madd6 { color: #EC5C86; }    ::highlight(tj-madd6) { color: #EC5C86; }
.tj-madd4 { color: #FF5A4A; }    ::highlight(tj-madd4) { color: #FF5A4A; }
.tj-madd246 { color: #FF9B3D; }  ::highlight(tj-madd246) { color: #FF9B3D; }
.tj-madd2 { color: #D6B25E; }    ::highlight(tj-madd2) { color: #D6B25E; }
.tj-ghunna { color: #4FC66F; }   ::highlight(tj-ghunna) { color: #4FC66F; }
.tj-silent { color: #8E8C84; }   ::highlight(tj-silent) { color: #8E8C84; }
.tj-tafkhim { color: #7391FF; }  ::highlight(tj-tafkhim) { color: #7391FF; }
.tj-qalqala { color: #5FC9F5; }  ::highlight(tj-qalqala) { color: #5FC9F5; }
:root[data-theme="light"] .tj-madd6 { color: #8B0A1F; }    :root[data-theme="light"] ::highlight(tj-madd6) { color: #8B0A1F; }
:root[data-theme="light"] .tj-madd4 { color: #D81E1E; }    :root[data-theme="light"] ::highlight(tj-madd4) { color: #D81E1E; }
:root[data-theme="light"] .tj-madd246 { color: #E26A00; }  :root[data-theme="light"] ::highlight(tj-madd246) { color: #E26A00; }
:root[data-theme="light"] .tj-madd2 { color: #A9780B; }    :root[data-theme="light"] ::highlight(tj-madd2) { color: #A9780B; }
:root[data-theme="light"] .tj-ghunna { color: #18883A; }   :root[data-theme="light"] ::highlight(tj-ghunna) { color: #18883A; }
:root[data-theme="light"] .tj-silent { color: #8E8E8E; }   :root[data-theme="light"] ::highlight(tj-silent) { color: #8E8E8E; }
:root[data-theme="light"] .tj-tafkhim { color: #1B3FA0; }  :root[data-theme="light"] ::highlight(tj-tafkhim) { color: #1B3FA0; }
:root[data-theme="light"] .tj-qalqala { color: #0E8FCB; }  :root[data-theme="light"] ::highlight(tj-qalqala) { color: #0E8FCB; }
/* the key: a dot of the color and what it means */
.tj-keys { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tj-key {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--bg); border: 0.5px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text);
}
.ln-sec > .tj-keys { justify-content: center; }          /* the full key on the Hifdh page: centered (asked by Ilyasse) */
.ln-sec > .tj-keys .tj-key { background: var(--surface); }
[dir="rtl"] .tj-key { padding: 4px 8px 4px 10px; font-size: 13.5px; }
.tj-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.tj-note { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
[dir="rtl"] > .tj-note { font-size: 14.5px; }
/* the form */
.ln-f { display: block; min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.ln-lab { display: block; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.ln-f input[type="text"], .ln-f input[type="email"], .ln-f textarea {
  display: block; width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 0.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
.ln-f textarea { height: auto; padding: 10px 13px; line-height: 1.5; resize: vertical; }
.ln-f input:focus, .ln-f textarea:focus { outline: none; border-color: var(--gold); }
.ln-two { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.ln-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-opt { position: relative; cursor: pointer; }
.ln-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ln-opt > span {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; border-radius: 11px; border: 0.5px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.4; transition: border-color .15s, background-color .15s;
}
.ln-opt small { font-size: 11.5px; color: var(--muted); }
.ln-opt input:checked + span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: color-mix(in srgb, var(--gold) 13%, var(--surface)); }
.ln-opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.ln-err { display: block; margin-top: 5px; font-size: 12px; color: #E0655F; }
.ln-err[hidden] { display: none; }
:root[data-theme="light"] .ln-err { color: #A3261F; }
.ln-f.bad input[type="text"], .ln-f.bad input[type="email"] { border-color: #E0655F; }
.ln-small { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.ln-mail { color: var(--gold); font-weight: 600; white-space: nowrap; }
.ln-msg {
  margin: 14px 0 0; padding: 14px; border-radius: 12px; background: var(--surface); border: 0.5px solid var(--border);
  font: inherit; font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; text-align: start;
}
.ln-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
[dir="rtl"] > .ln-f .ln-lab, [dir="rtl"] > .ln-two .ln-lab, [dir="rtl"] > .ln-small, .ln-form[dir="rtl"] .ln-opt > span { font-size: 14px; }

/* ---------- Sunnah, Sira, Aqida, Fiqh, Tafsir: a section = a STATION of the learning train ----------
   On top the board of the station (the small line of the route with the train standing here, the
   name, the introduction). Under it, like a manual: the contents with a search field on one side,
   the chapter being read on the other. Phone: the contents, then one chapter at a time. */
.stn-board, .stn-body { max-width: 1010px; margin-inline: auto; }
.stn-board {
  --rail: color-mix(in srgb, var(--muted) 42%, transparent);
  position: relative; margin-top: 6px; margin-bottom: 18px; padding: 24px 20px 20px; overflow: hidden; text-align: center;
  border-radius: 18px; background: var(--surface); border: 0.5px solid var(--border);
}
.stn-board::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--bc); }
.stn-line { display: flex; align-items: center; justify-content: center; margin: 2px 0 14px; padding: 0; list-style: none; }
.stn-line li { display: flex; align-items: center; }
.stn-line li + li::before {
  content: ""; width: clamp(26px, 8vw, 84px); height: 8px; border-block: 1.5px solid var(--rail);
  background: repeating-linear-gradient(90deg, var(--rail) 0 1.5px, transparent 1.5px 9px);
}
.stn-line li.past + li::before { --rail: color-mix(in srgb, var(--gold) 80%, transparent); }      /* the track already travelled */
.stn-line a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s;
}
.stn-line li.past a { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.stn-line li.cur a { width: 48px; height: 48px; background: var(--c); color: var(--on); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 26%, transparent); }
.stn-line a:hover, .stn-line a:focus-visible { transform: translateY(-2px); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
.stn-kicker { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.stn-kicker i { margin: 0 8px; font-style: normal; opacity: .6; }
.stn-board[dir="rtl"] .stn-kicker { font-size: 13px; letter-spacing: 0; }
/* the name and its Arabic name on ONE line, each on its own side: the name at the start, the Arabic at the
   other end, like the sign of a station in two languages (asked by Ilyasse, 21 Nov 2026) */
.stn-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; max-width: 68ch; margin: 6px auto 0; }
.stn-board[dir="rtl"] .stn-names { justify-content: center; }
.stn-name { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.25; color: var(--text); }
.stn-board[dir="rtl"] .stn-name { font-family: "Amiri", serif; font-size: 42px; font-weight: 400; line-height: 1.45; color: var(--gold); }
.stn-name-ar { margin-left: auto; font-family: "Amiri", serif; font-size: 28px; line-height: 1.5; color: var(--gold); }
.stn-intro { margin: 12px auto 0; max-width: 68ch; font-size: 15px; line-height: 1.7; color: var(--muted); }
.stn-board[dir="rtl"] .stn-intro { font-size: 16px; line-height: 1.9; }
/* on the page of a chapter the board is one small row: the name on one side, the line on the other */
.stn-board.small { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 16px 18px 12px; text-align: start; }
.stn-board.small .stn-line { order: 2; margin: 0; }
.stn-board.small .stn-line li + li::before { width: clamp(14px, 4vw, 44px); }
.stn-board.small .stn-line a { width: 28px; height: 28px; font-size: 12px; }
.stn-board.small .stn-line li.cur a { width: 38px; height: 38px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 26%, transparent); }
.stn-board.small .stn-line .path-train { width: 18px; height: 18px; }
.stn-board.small .stn-names { justify-content: flex-start; margin: 2px 0 0; }
.stn-board.small .stn-name { font-size: 20px; }
.stn-board.small[dir="rtl"] .stn-name { font-size: 28px; }
.stn-board.small .stn-name-ar { display: none; }      /* the small board has the line of the train on that side */

.stn-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.stn-toc { padding: 12px; border-radius: 16px; background: var(--surface); border: 0.5px solid var(--border); }
.stn-search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 11px;
  border: 0.5px solid var(--border); background: var(--bg); color: var(--muted); cursor: text;
}
.stn-search:focus-within { border-color: var(--gold); }
.stn-search svg { flex: none; }
.stn-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; outline: none; -webkit-appearance: none; appearance: none; }
.stn-search input::placeholder { color: var(--muted); opacity: .9; }
.stn-toc[dir="rtl"] .stn-search input { font-size: 15px; }
.stn-part[hidden] { display: none; }
.stn-part h2 { margin: 16px 8px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stn-toc[dir="rtl"] .stn-part h2 { font-size: 13.5px; letter-spacing: 0; color: var(--gold); }
.stn-part ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.stn-part li[hidden] { display: none; }
.stn-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 11px; color: var(--text); text-decoration: none; transition: background-color .15s; }
.stn-n {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: color-mix(in srgb, var(--bc) 24%, transparent); font-size: 12px; font-weight: 600; color: var(--text);
}
.stn-rt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.stn-rt b { font-size: 14px; font-weight: 600; line-height: 1.4; }
.stn-rt small { font-size: 12px; line-height: 1.45; color: var(--muted); }
.stn-toc[dir="rtl"] .stn-rt b { font-size: 15.5px; line-height: 1.5; }
.stn-toc[dir="rtl"] .stn-rt small { font-size: 13px; line-height: 1.6; }
.stn-wip { flex: none; display: inline-block; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; border: 1.5px solid var(--gold); }
.stn-row:hover, .stn-row:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); outline: none; }
.stn-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.stn-body.chap .stn-row.cur { background: color-mix(in srgb, var(--bc) 16%, transparent); }
.stn-body.chap .stn-row.cur .stn-n { background: var(--bc); color: var(--on); }
.stn-none, .stn-legend { margin: 12px 8px 4px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.stn-none[hidden] { display: none; }
.stn-legend { display: flex; align-items: center; gap: 7px; }
.stn-legend .stn-wip { margin: 0; }
.stn-toc[dir="rtl"] :is(.stn-none, .stn-legend) { font-size: 13px; }

.stn-read { min-width: 0; max-width: 70ch; padding: 2px 2px 0; }
.stn-read.in { animation: stn-in .45s cubic-bezier(.22, .61, .36, 1); }
@keyframes stn-in { from { opacity: 0; transform: translateY(6px); } }
.stn-crumb { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; font-size: 12.5px; color: var(--muted); }
.stn-back { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; color: var(--text); font-weight: 600; text-decoration: none; }
.stn-back .ln-chev { transform: scaleX(-1); }
.stn-read[dir="rtl"] .stn-back .ln-chev { transform: none; }
.stn-back:hover, .stn-back:focus-visible { color: var(--gold); outline: none; }
.stn-read[dir="rtl"] .stn-crumb { font-size: 13.5px; }
/* the title of the chapter and its Arabic title on ONE line, each on its own side (the Arabic goes under, still
   on its side, only when the line is too short) */
.stn-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; margin-top: 10px; }
.stn-title .ln-title { margin: 0; }
.stn-read[dir="rtl"] .ln-title { font-family: "Amiri", serif; font-size: 32px; font-weight: 400; line-height: 1.5; color: var(--gold); }
.stn-title-ar { margin-left: auto; font-family: "Amiri", serif; font-size: 25px; line-height: 1.4; color: var(--gold); }
/* previous / next: two plain buttons (a line of border, an arrow); the hover only tints them with the color of the station */
.stn-steps { display: flex; align-items: stretch; gap: 12px; margin-top: 34px; padding-top: 18px; border-top: 0.5px solid var(--border); }
.stn-step {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 48%; padding: 9px 14px; border-radius: 12px;
  border: 0.5px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.stn-step.next { margin-inline-start: auto; }
.stn-step.prev { flex-direction: row-reverse; }
.stn-step-t { display: grid; gap: 1px; min-width: 0; }
.stn-step small { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.stn-step b { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.stn-read[dir="rtl"] .stn-step small { font-size: 12.5px; }
.stn-read[dir="rtl"] .stn-step b { font-size: 15.5px; line-height: 1.5; }
.stn-step:hover, .stn-step:focus-visible { border-color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent); outline: none; }
.stn-step:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the arrows follow the reading direction */
.stn-step.prev .ln-chev, .stn-read[dir="rtl"] .stn-step.next .ln-chev { transform: scaleX(-1); }
.stn-read[dir="rtl"] .stn-step.prev .ln-chev { transform: none; }
/* phone: the contents OR one chapter */
@media (max-width: 899px) {
  .stn-body.home .stn-read, .stn-body.chap .stn-toc { display: none; }
  .stn-read { margin-inline: auto; }
}
/* large screen: contents and chapter side by side; the contents stay in view while reading */
@media (min-width: 900px) {
  .stn-body { grid-template-columns: 320px minmax(0, 1fr); gap: 30px; align-items: start; }
  .stn-toc { position: sticky; top: 78px; max-height: calc(100vh - 94px); overflow-y: auto; }
  .stn-back { display: none; }
  .stn-crumb { justify-content: flex-start; }
  .stn-body.home .stn-row.cur { background: color-mix(in srgb, var(--bc) 16%, transparent); }
  .stn-body.home .stn-row.cur .stn-n { background: var(--bc); color: var(--on); }
}
.list.enter .stn-board { animation: rise .6s cubic-bezier(.22, .61, .36, 1) backwards; }
.list.enter .stn-toc { animation: rise .6s cubic-bezier(.22, .61, .36, 1) .12s backwards; }
.list.enter .stn-line .path-train { animation: train-in .8s cubic-bezier(.2, .8, .3, 1) .45s backwards; }
.list.enter .stn-board[dir="rtl"] .stn-line .path-train { animation-name: train-in-rtl; }
@media (prefers-reduced-motion: reduce) {
  .stn-read.in { animation: none; }
  .stn-step { transition: none; }
  .stn-line a, .stn-row { transition: none; }
  .stn-line a:hover, .stn-line a:focus-visible { transform: none; }
}
.st-lead { margin: 14px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--muted); }
[dir="rtl"] > .st-lead { font-size: 16.5px; line-height: 1.85; }
.st-soon {
  margin: 22px 0 0; padding: 18px 20px; border-radius: 14px; border: 0.5px dashed color-mix(in srgb, var(--gold) 45%, var(--border));
  background: color-mix(in srgb, var(--gold) 6%, transparent); font-size: 14.5px; line-height: 1.65; color: var(--text); text-align: center;
}
[dir="rtl"] > .st-soon { font-size: 15.5px; line-height: 1.85; }
.st-h { margin: 28px 0 0; font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--text); }
[dir="rtl"] > .st-h { font-family: "Amiri", serif; font-size: 25px; font-weight: 400; line-height: 1.5; color: var(--gold); }
.st-quote {
  margin: 18px 0 0; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 0.5px solid var(--border);
  border-inline-start: 3px solid var(--gold);
}
.st-quote:empty { display: none; }                          /* a verse that is still loading */
.st-quote .sh-ar { margin: 0; font-size: 25px; line-height: 2; text-align: right; }
.st-quote .st-tr { margin: 10px 0 0; font-size: 14.5px; line-height: 1.7; color: var(--text); }
.st-quote footer { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
[dir="rtl"] > .st-quote footer { font-size: 13.5px; }
@media (max-width: 520px) { .st-quote .sh-ar { font-size: 22px; } }

/* ---------- Home: the learning train ----------
   The sections a learner follows, in order, drawn as a railway line: one station per section
   (a numbered disc in the color of the section), the train standing at the station of the visitor.
   Large screen: the whole line. Narrow screen: the line scrolls sideways, station by station. */
.path {
  --rail: color-mix(in srgb, var(--muted) 42%, transparent);
  margin: 0 0 16px; padding: 22px 16px 18px; border-radius: 16px;
  border: 0.5px solid var(--border); background: var(--surface);
}
.home-grid + .path { margin-top: 30px; }          /* the train comes after the blocks of the sections */
.path-head { max-width: 68ch; margin: 0 auto; text-align: center; }
.path-head h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--text); }
.path-head p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.path[dir="rtl"] .path-head h2 { font-family: "Amiri", serif; font-size: 30px; font-weight: 400; line-height: 1.5; color: var(--gold); }
.path[dir="rtl"] .path-head p { font-size: 15.5px; line-height: 1.85; }

.path-line {
  display: flex; margin: 10px -16px 0; padding: 34px 16px 6px; list-style: none;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.path-line::-webkit-scrollbar { display: none; }
.path-stop { position: relative; flex: 0 0 148px; scroll-snap-align: center; }
/* the track: two rails and their sleepers, before and after each station */
.path-stop::before, .path-stop::after {
  content: ""; position: absolute; top: 22px; height: 8px; width: 50%;
  border-block: 1.5px solid var(--rail);
  background: repeating-linear-gradient(90deg, var(--rail) 0 1.5px, transparent 1.5px 9px);
}
.path-stop::before { inset-inline-start: 0; }
.path-stop::after { inset-inline-end: 0; }
.path-stop:first-child::before, .path-stop:last-child::after { display: none; }
/* the part of the line already travelled */
.path-stop.past, .path-stop.cur { --done: color-mix(in srgb, var(--gold) 80%, transparent); }
.path-stop.past::before, .path-stop.past::after, .path-stop.cur::before { --rail: var(--done); }

.path-stop a {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; height: 100%;
  padding: 0 8px 6px; border-radius: 12px; text-align: center; text-decoration: none; color: var(--text);
}
.path-dot {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 4px 0 10px; border-radius: 50%;
  border: 2px solid var(--bc); background: var(--surface); font-size: 15px; font-weight: 600; color: var(--text);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s;
}
.path-stop.past .path-dot { background: color-mix(in srgb, var(--bc) 24%, var(--surface)); }
.path-stop.cur .path-dot {
  width: 52px; height: 52px; margin: 0 0 6px; background: var(--bc); color: var(--on);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--bc) 26%, transparent);
}
.path-train { display: block; }
.path-name { font-size: 15px; font-weight: 600; line-height: 1.35; transition: color .15s; }
.path-why { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.path[dir="rtl"] .path-name { font-size: 16px; line-height: 1.45; }
.path[dir="rtl"] .path-why { font-size: 13.5px; line-height: 1.6; }
.path-flag {
  position: absolute; top: -29px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; color: var(--on-gold); background: var(--gold);
}
.path-flag::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px;
  border: 4px solid transparent; border-top-color: var(--gold); border-bottom: 0;
}
.path[dir="rtl"] .path-flag { font-size: 12px; }
.path-stop a:hover .path-dot, .path-stop a:focus-visible .path-dot { transform: translateY(-3px); box-shadow: 0 0 0 5px color-mix(in srgb, var(--bc) 30%, transparent); }
.path-stop a:hover .path-name, .path-stop a:focus-visible .path-name { color: var(--gold); }
.path-stop a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.path-go { margin: 14px 0 0; text-align: center; }
.path-go .ln-btn { min-height: 46px; padding: 0 22px; gap: 6px; font-size: 15px; }
.path-go .ln-chev { color: inherit; }
.path[dir="rtl"] .path-go .ln-btn { font-size: 16px; }
.path[dir="rtl"] .path-go .ln-chev { transform: scaleX(-1); }
.path-daily { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.path[dir="rtl"] .path-daily { font-size: 13.5px; }

@media (min-width: 1040px) {
  .path { padding: 26px 22px 22px; }
  .path-line { margin-inline: 0; padding-inline: 0; overflow: visible; }
  .path-stop { flex: 1 1 0; min-width: 0; }
}
/* arrival: the stations come one after the other, then the train pulls in */
.list.enter .path { animation: rise .6s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: .1s; }
.list.enter .path-stop a { animation: rise .5s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: calc(.2s + var(--k, 0) * 70ms); }
.list.enter .path-train { animation: train-in .8s cubic-bezier(.2, .8, .3, 1) .75s backwards; }
.list.enter .path[dir="rtl"] .path-train { animation-name: train-in-rtl; }
@keyframes train-in { from { opacity: 0; transform: translateX(-26px); } }
@keyframes train-in-rtl { from { opacity: 0; transform: translateX(26px); } }
@media (prefers-reduced-motion: reduce) {
  .path-dot, .path-name { transition: none; }
  .path-stop a:hover .path-dot, .path-stop a:focus-visible .path-dot { transform: none; }
}

/* Under a section of the route: its place on the line, the station before and the next one */
.path-nav { margin-top: 34px; padding-top: 16px; border-top: 0.5px solid var(--border); }
.path-nav-t { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.path-nav-t .path-train { flex: none; width: 18px; height: 18px; color: var(--gold); }
.path-nav-t a { color: var(--text); text-decoration: none; font-weight: 600; }
.path-nav-t a:hover, .path-nav-t a:focus-visible { color: var(--gold); outline: none; }
.path-nav-t span { margin-inline-start: auto; white-space: nowrap; }
.path-nav[dir="rtl"] .path-nav-t { font-size: 13.5px; }
.path-nav[dir="rtl"] .path-nav-t a { font-size: 18px; font-weight: 400; }
.path-nav .ln-steps { margin-top: 12px; }

/* ---------- Home: "Did you know?" (between the train and the review block) ----------
   Several small cards (3 on a phone, 4 on a tablet, 6 on a large screen): the section the
   information comes from (pill with the color of the section) and the information, a link to that
   section. Every minute each card fades away and comes back with another one, slowly. */
.info { margin: 30px 0 0; }
.info[hidden] { display: none; }
.info-t { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); text-align: center; }
.info[dir="rtl"] .info-t { font-family: "Amiri", serif; font-size: 24px; font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.info-card { height: 118px; transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, .61, .36, 1); }
.info[dir="rtl"] .info-card { height: 128px; }
.info-card.out { opacity: 0; transform: translateY(10px); }
.info-card:nth-child(n+4) { display: none; }
@media (min-width: 620px) {
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-card:nth-child(4) { display: block; }
}
@media (min-width: 1000px) {
  .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .info-card:nth-child(n+5) { display: block; }
}
.info-grid .info-card[hidden] { display: none; }
.info-a {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; height: 100%; padding: 12px 14px; overflow: hidden;
  border-radius: 14px; border: 0.5px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .2s, transform .2s cubic-bezier(.2, .8, .3, 1);
}
.info-sec {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-size: 12px; line-height: 1.5;
  border: 0.5px solid color-mix(in srgb, var(--c) 50%, var(--border)); background: color-mix(in srgb, var(--c) 12%, transparent);
}
.info-x {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; text-align: start;
}
.info[dir="rtl"] .info-x { font-size: 14.5px; line-height: 1.6; }
.info-a:hover, .info-a:focus-visible { border-color: color-mix(in srgb, var(--c) 70%, var(--border)); transform: translateY(-2px); outline: none; }
.info-a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.list.enter .info-t { animation: rise .6s cubic-bezier(.22, .61, .36, 1) .2s backwards; }
@media (prefers-reduced-motion: reduce) {
  .info-card, .info-a { transition: none; }
  .info-card.out, .info-a:hover, .info-a:focus-visible { transform: none; }
}

/* ---------- Home: "Your opinion" (last block of the home page) and the visitors' reviews ----------
   Small on purpose: one centered line, a question and five stars. Choosing a star opens one row
   (comment, first name, send). Under it, just before the footer, the reviews that were read. */
.support {
  width: fit-content; max-width: min(100%, 660px); margin: 30px auto 4px; padding: 8px 18px;
  border-radius: 16px; background: var(--surface); border: 0.5px solid var(--border);
}
.support h2 { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--text); }
.support p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.support[dir="rtl"] h2 { font-size: 15.5px; }
.support[dir="rtl"] p { font-size: 13.5px; line-height: 1.7; }
.rv-form[hidden], .rv-sent[hidden], .rv-open[hidden] { display: none; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 14px; }
.rv-stars { display: inline-flex; }
.rv-star { position: relative; display: grid; place-items: center; width: 34px; height: 36px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.rv-star input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rv-star svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: transform .15s cubic-bezier(.2, .8, .3, 1), fill .15s, color .15s; }
.rv-star.on { color: var(--gold); }
.rv-star.on svg { fill: currentColor; }
.rv-star:hover svg { transform: scale(1.16); }
.rv-star:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: -2px; }
.rv-open { width: 624px; max-width: 100%; padding: 6px 0 8px; }
.rv-open:not([hidden]) { animation: rise .35s cubic-bezier(.22, .61, .36, 1); }
.rv-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.rv-form textarea, .rv-form input[type="text"] {
  display: block; min-width: 0; height: 40px; padding: 8px 12px; border-radius: 10px; border: 0.5px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px; line-height: 1.6;
}
.rv-form textarea { flex: 1 1 240px; resize: none; overflow-y: auto; }
.rv-form input[type="text"] { flex: 0 1 160px; }
.rv-form textarea:focus, .rv-form input[type="text"]:focus { outline: none; border-color: var(--gold); }
.rv-form ::placeholder { color: var(--muted); opacity: .85; }
.support[dir="rtl"] .rv-form :is(textarea, input[type="text"]) { font-size: 15px; }
.support .ln-btn { flex: none; min-height: 40px; padding: 0 18px; font-size: 14px; }
.support[dir="rtl"] .rv-row .ln-btn { font-size: 15px; }
.support .rv-err { color: #E0655F; }
:root[data-theme="light"] .support .rv-err { color: #A3261F; }
/* once given: the review in one line (a check mark and "thank you" right after sending) */
.rv-sent { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; min-height: 36px; }
.rv-sent h2 { display: flex; align-items: center; gap: 8px; }
.rv-ok { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.rv-ok svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; }
.rv-link {
  appearance: none; -webkit-appearance: none; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--muted);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent); text-underline-offset: 3px; cursor: pointer;
}
.rv-link:hover, .rv-link:focus-visible { color: var(--gold); outline: none; }
.support[dir="rtl"] .rv-link { font-size: 13.5px; }
.rv-sent.just { animation: rise .4s cubic-bezier(.22, .61, .36, 1); }
.rv-sent.just .rv-ok svg { animation: rv-draw .5s ease-out .2s backwards; }
@keyframes rv-draw { from { stroke-dashoffset: 24; } }
.list.enter .support { animation: rise .7s cubic-bezier(.22, .61, .36, 1) .5s backwards; }
@media (max-width: 560px) { .rv-form input[type="text"] { flex: 1 1 120px; } }

/* The reviews: SQUARE cards in one row (2 on a phone ... 6 on a large screen). With more reviews
   than that the row slides (by itself every second, see startReviews in app.js; or by hand). */
.reviews { margin: 26px 0 4px; }
.reviews > h2 { margin: 0 0 12px; font-size: 14.5px; font-weight: 600; color: var(--text); text-align: center; }
.reviews[dir="rtl"] > h2 { font-family: "Amiri", serif; font-size: 21px; font-weight: 400; line-height: 1.4; color: var(--gold); }
.rv-list {
  --per: 2; --gap: 12px; --lines: 4;
  display: flex; gap: var(--gap); padding: 2px 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px;
}
.rv-list::-webkit-scrollbar { display: none; }
.rv-list:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (min-width: 560px) { .rv-list { --per: 3; } }
@media (min-width: 800px) { .rv-list { --per: 4; --lines: 5; } }
@media (min-width: 1040px) { .rv-list { --per: 5; } }
@media (min-width: 1240px) { .rv-list { --per: 6; --lines: 6; } }
.rv-card {
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); aspect-ratio: 1; min-width: 0; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 14px; overflow: hidden;
  border-radius: 16px; background: var(--surface); border: 0.5px solid var(--border);
}
/* fewer reviews than the row can hold: they sit in the middle */
.rv-card:first-child { margin-inline-start: auto; }
.rv-card:last-child { margin-inline-end: auto; }
.rv-given { display: inline-flex; flex: none; gap: 1px; color: var(--border); }
.rv-given i { display: block; width: 15px; height: 15px; }
.rv-given svg { display: block; width: 15px; height: 15px; fill: currentColor; }
.rv-given i.on { color: var(--gold); }
.rv-card blockquote {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines); line-clamp: var(--lines); overflow: hidden;
  margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; text-align: start;
}
.rv-card figcaption { flex: none; margin-top: auto; font-size: 12px; color: var(--muted); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-card figcaption::before { content: "| "; }
/* the visitor's own review, until Ilyasse accepted it */
.rv-wait { flex: none; margin-top: auto; font-size: 11px; line-height: 1.4; color: var(--gold); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-wait + figcaption { margin-top: -5px; }
.list.enter .rv-card { animation: rise .6s cubic-bezier(.22, .61, .36, 1) backwards; animation-delay: calc(.55s + var(--k, 0) * 60ms); }
@media (prefers-reduced-motion: reduce) { .rv-star svg { transition: none; } .rv-star:hover svg { transform: none; } .rv-sent.just, .rv-sent.just .rv-ok svg, .rv-open:not([hidden]) { animation: none; } }

/* ---------- Footer (every page) ----------
   A band a little lighter than the page, opened by a thin gold line with the logo's diamond.
   Left: the logo, the motto and three promises. Right: the pages (a dot in each page's color)
   and the links about the site. Last line: the name and the three languages.
   The links use the font of the menu in every language (Amiri made them look bold in Arabic). */
.app-footer {
  --ft-line: color-mix(in srgb, var(--gold) 55%, transparent);
  --ft-soft: color-mix(in srgb, var(--text) 60%, var(--muted));      /* softer than the page text: nothing in the footer looks bold */
  margin-top: 56px; color: var(--muted); font-size: 13px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, var(--bg)), var(--bg) 92%);
}
.ft-orn {
  position: relative; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ft-line) 18%, var(--ft-line) calc(50% - 16px), transparent calc(50% - 16px),
              transparent calc(50% + 16px), var(--ft-line) calc(50% + 16px), var(--ft-line) 82%, transparent);
}
.ft-orn i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); border: 1px solid var(--gold); }
.ft-orn i::after { content: ""; position: absolute; inset: 2px; background: var(--gold); }

.ft { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 22px; max-width: 1120px; margin: 0 auto; padding: 40px 20px 30px; }
.ft-brand { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ft-brand .brand-mark { height: 88px; transition: opacity .15s; }
.ft-brand .brand-mark:hover { opacity: .85; }
.ft-tag { margin: 14px 0 0; max-width: 34ch; font-size: 15px; line-height: 1.5; color: var(--ft-soft); }
.ft[dir="rtl"] .ft-tag { font-size: 16px; line-height: 1.7; color: var(--gold); }
.ft-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.ft-pills li {
  padding: 4px 12px; border-radius: 999px; white-space: nowrap; font-size: 12px; line-height: 1.5; color: var(--ft-soft);
  border: 0.5px solid color-mix(in srgb, var(--gold) 42%, var(--border)); background: color-mix(in srgb, var(--gold) 9%, transparent);
}

.ft-col h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.ft-col h2::after { content: ""; flex: 1; min-width: 20px; height: 0.5px; background: var(--border); }
.ft[dir="rtl"] .ft-col h2 { font-size: 13.5px; letter-spacing: 0; }
.ft-col ul { display: grid; justify-items: start; gap: 1px; margin: 0; padding: 0; list-style: none; }
/* more than six pages: two columns, read down the first one and then down the second */
.ft-col ul.ft-two { grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 5), auto); grid-auto-columns: minmax(0, max-content); column-gap: 30px; }
.ft-col.ft-wide { grid-column: 1 / -1; }                    /* phone: this list takes the whole width */
.ft-col a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 34px; padding: 3px 0; border-radius: 6px;
  font-size: 14px; line-height: 1.4; color: var(--ft-soft); text-decoration: none; transition: color .15s, transform .2s, background-color .15s, border-color .15s;
}
.ft-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gold)); transition: transform .2s; }
.ft-col a:hover, .ft-col a:focus-visible { color: var(--gold); }
.ft-col a:not(.ft-give):hover { transform: translateX(3px); }
.ft[dir="rtl"] .ft-col a:not(.ft-give):hover { transform: translateX(-3px); }
.ft-col a:hover .ft-dot { transform: scale(1.45); }
.ft-col a:focus-visible, .ft-langs button:focus-visible, .ft-brand .brand-mark:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ft-col a.ft-give {
  gap: 8px; margin-top: 10px; min-height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 65%, transparent); font-size: 13.5px; font-weight: 500; color: var(--gold);
}
.ft-col a.ft-give:hover, .ft-col a.ft-give:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.ft-col a.ft-give:active { transform: scale(.98); }
.ft-heart { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }

.ft-end {
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 1120px; margin: 0 auto; padding: 16px 20px 26px;
  border-top: 0.5px solid var(--border); font-size: 12.5px;
}
.ft-name { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.ft-name bdi { font-family: "Amiri", serif; font-size: 19px; line-height: 1.2; color: var(--gold); }
.ft-name span { padding-inline-start: 10px; border-inline-start: 0.5px solid var(--border); letter-spacing: .04em; }
.ft-langs { display: flex; align-items: center; gap: 2px; }
.ft-langs button {
  appearance: none; -webkit-appearance: none; min-height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: color .15s, background-color .15s;
}
.ft-langs button[lang="ar"] { font-size: 13.5px; }
.ft-langs button:hover { color: var(--text); background: var(--surface); }
.ft-langs button[aria-current] { color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); cursor: default; }

@media (min-width: 760px) {
  .ft { grid-template-columns: minmax(0, 1fr) max-content max-content; column-gap: clamp(44px, 7vw, 104px); padding: 50px 24px 40px; }
  .ft-brand { grid-column: auto; align-items: flex-start; text-align: start; }
  .ft-pills { justify-content: flex-start; }
  .ft-col.ft-wide { grid-column: auto; }
  .ft-end { flex-direction: row; justify-content: space-between; padding: 14px 24px 24px; }
}
/* Language change: the parts of the footer arrive again, one after the other (like the blocks of the page) */
.app-footer.relang :is(.ft-brand, .ft-col, .ft-end) { animation: rise .7s cubic-bezier(.22, .61, .36, 1) backwards; }
.app-footer.relang .ft-col { animation-delay: 80ms; }
.app-footer.relang .ft-col + .ft-col { animation-delay: 160ms; }
.app-footer.relang .ft-end { animation-delay: 240ms; }
.app-footer.relang .ft-orn i { animation: glyph-in .6s cubic-bezier(.2, 1.3, .4, 1) backwards; }
@media (prefers-reduced-motion: reduce) {
  .app-footer.relang * { animation: none !important; }
  .ft-col a, .ft-dot, .ft-langs button, .ft-brand .brand-mark { transition: none; }
  .ft-col a:not(.ft-give):hover, .ft-col a:hover .ft-dot { transform: none; }
}
