/* Self-hosted. Generated by scripts/fetch_fonts.py — do not edit. */
@font-face{font-family:'Amiri';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/amiri-arabic-400-italic.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/amiri-latin-400-italic.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/amiri-arabic-400.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/amiri-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/amiri-arabic-700.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/amiri-latin-700.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Amiri Quran';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/amiri-quran-arabic-400.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/eb-garamond-latin-ext-400-italic.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/eb-garamond-latin-400-italic.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/eb-garamond-latin-ext-400.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/eb-garamond-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/eb-garamond-latin-ext-500.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/eb-garamond-latin-500.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
/* Qur'an Core Vocabulary — design system.
 *
 * Tokens, type and components from docs/REDESIGN_GUIDE.md §5–§7. Hand-written
 * and committed; scripts/build_pages.py concatenates app/fonts/fonts.css in
 * front of it to make app/site.css, so a page makes one stylesheet request.
 *
 * Two dyes, two jobs. Indigo means "here, or you can act": links, secondary
 * buttons, selection, the current tab, the highlighted word in an āyah.
 * Saffron is ornament, plus the one primary button on a screen — never text
 * on a light ground, because it does not reach 4.5:1 there and never will.
 *
 * scripts/checks.py asserts every text token against --paper and --surface in
 * both themes and fails the build below 4.5:1, so these values are not free
 * to drift.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  --paper:        #FFFFFF;
  --surface:      #F6F5F1;
  --ink:          #141829;
  --ink-2:        #2B2F40;
  --muted:        #575B6B;
  --line:         #DCD9D0;   /* hairlines ONLY — never text, never a control edge */
  --indigo:       #34418A;
  --saffron:      #E0A43A;
  --saffron-edge: #B07612;
  --saffron-hover:#E8B04A;
  --saffron-press:#CC9128;
  --ornament:     #C98A1B;   /* decoration only */
  --on-saffron:   #141829;
  --right:        #2F6B4F;
  --not-yet:      #8E3B2E;
  --disabled-bg:  #E2DFD6;
  --focus:        var(--indigo);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px; --s7: 72px;
  --r-chip: 4px; --r-ctl: 8px; --r-card: 12px;
  --lift: 0 1px 2px rgba(20,24,41,.08), 0 8px 24px rgba(20,24,41,.12);

  --serif: "EB Garamond", Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "Amiri Quran", "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
  --arabic-ui: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
}

/* The un-stamped document is what most people see: system setting, no choice
 * made. :not([data-theme="light"]) lets an explicit light choice beat a dark
 * OS. The stamped block below lets the toggle win in the other direction. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:#0E1124; --surface:#161A33;
    --ink:#ECEAF2; --ink-2:#C9CCE0; --muted:#A0A4BC; --line:#272C4D;
    --indigo:#A9B4F2;
    --saffron:#E0A43A; --saffron-edge:transparent;
    --saffron-hover:#E8B04A; --saffron-press:#CC9128;
    --ornament:#E0A43A; --on-saffron:#0E1124;
    --right:#7FC4A0; --not-yet:#E58A7A;
    --disabled-bg:#232845;
    --focus:#E0A43A;
  }
}
:root[data-theme="dark"] {
  --paper:#0E1124; --surface:#161A33;
  --ink:#ECEAF2; --ink-2:#C9CCE0; --muted:#A0A4BC; --line:#272C4D;
  --indigo:#A9B4F2;
  --saffron:#E0A43A; --saffron-edge:transparent;
  --saffron-hover:#E8B04A; --saffron-press:#CC9128;
  --ornament:#E0A43A; --on-saffron:#0E1124;
  --right:#7FC4A0; --not-yet:#E58A7A;
  --disabled-bg:#232845;
  --focus:#E0A43A;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* The artifact of a page that sets colour without setting its ground is a
 * light page on a dark host, so both are always set together. */
main, .wrap { color: var(--ink); }

/* The UA's [hidden]{display:none} loses to any class that sets display, so
 * `el.hidden = true` silently fails on anything this file styles as a grid or
 * a flex box — which is most of it, including every row the browse filter
 * hides. Not optional. */
[hidden] { display: none !important; }

/* The site bar is sticky and its height is not a constant — the nav wraps on
 * a phone — so header() measures it and publishes it as --bar-h. This is the
 * value before the script runs, and the value if it never does. Anything else
 * that sticks, and every anchor jump, works from it. */
:root { --bar-h: 56px; }
[id] { scroll-margin-top: calc(var(--bar-h) + 12px); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-chip);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: var(--s2); top: var(--s2); z-index: 60;
  background: var(--paper); color: var(--indigo);
  padding: var(--s2) var(--s3);
  border: 2px solid var(--indigo); border-radius: var(--r-ctl);
}

/* ------------------------------------------------------------------ type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.18; letter-spacing: -.012em;
     text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.3; margin: var(--s6) 0 var(--s3); }
h3 { font-size: 18px; line-height: 1.35; margin: var(--s5) 0 var(--s2); }

p, li, dd { margin: 0 0 var(--s3); }

.prose, .lede, .note, .ayah .en {
  font-family: var(--serif);
  font-size: 18px; line-height: 1.6;
  color: var(--ink-2);
}
@media (min-width: 720px) { .prose, .lede { font-size: 19px; line-height: 1.65; } }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 var(--s5); }
.note { color: var(--muted); font-size: 16px; margin: var(--s6) 0 0; }

/* a line carrying Arabic needs more leading than one that does not: the
   ḥarakāt sit above and the tails below, and a heading is the tightest line
   on the page before any of that is added */
.has-ar, p:has(> bdi) { line-height: 1.75; }
h1:has(bdi), h2:has(bdi) { line-height: 1.5; }

a { color: var(--indigo); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }

.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--indigo);
  margin: 0 0 var(--s2);
}

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Arabic. Never squeezed to a Latin grid: the ḥarakāt need the room. */
.ar, [lang="ar"] { font-family: var(--arabic); }
bdi[lang="ar"] { font-family: var(--arabic-ui); font-size: 1.3em; }

/* ---------------------------------------------------------------- layout */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s7);
}
@media (min-width: 720px) { .wrap { padding: var(--s6) var(--s6) var(--s7); } }

/* ---------------------------------------------------------------- chrome */
.sitebar {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
@media (min-width: 720px) { .sitebar { padding: var(--s3) var(--s6); } }

.sitebar nav { display: flex; gap: var(--s1); flex-wrap: wrap; margin-left: auto; }
.sitebar nav a {
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: var(--s2) var(--s3); border-radius: var(--r-ctl);
  white-space: nowrap;
}
.sitebar nav a:hover { color: var(--ink); }
.sitebar nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--indigo);
}

.sb-brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; }
.sb-mark { border-radius: 50%; display: block; }
.sb-name b {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink); line-height: 1.2;
}
.sb-name i {
  display: block; font-style: normal; font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}

.sitefoot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--s5) var(--s4) var(--s6);
  margin-top: var(--s7);
}
@media (min-width: 720px) { .sitefoot { padding: var(--s5) var(--s6) var(--s6); } }
.sitefoot .sf-links {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  margin: 0 0 var(--s4); max-width: 1200px; margin-inline: auto;
}
.sitefoot a { color: var(--muted); font-size: 14px; text-decoration: none; }
.sitefoot a:hover { color: var(--indigo); text-decoration: underline; }
.sitefoot .sf-note {
  color: var(--muted); font-size: 13px; line-height: 1.6;
  max-width: 70ch; margin: 0 auto;
}
.sf-meta {
  display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center;
  max-width: 1200px; margin: 0 auto var(--s4);
  font-size: 13px; color: var(--muted);
}

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  font-size: 13px; color: var(--muted); margin: 0 0 var(--s4);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--indigo); text-decoration: underline; }
.crumbs .cur { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  font: inherit; font-size: 15px; font-weight: 600;
  border-radius: var(--r-ctl); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
/* One per screen. If a screen seems to need two, one of them is secondary. */
.btn-primary {
  background: var(--saffron); color: var(--on-saffron);
  border-color: var(--saffron-edge);
}
.btn-primary:hover { background: var(--saffron-hover); }
.btn-primary:active { background: var(--saffron-press); }
.btn-secondary {
  background: transparent; color: var(--indigo);
  border: 1.5px solid var(--indigo);
}
.btn-secondary:hover { background: color-mix(in srgb, var(--indigo) 8%, transparent); }
.btn-tertiary {
  min-height: 0; padding: 0; background: none; border: none;
  color: var(--indigo); text-decoration: underline; text-underline-offset: 4px;
  font-weight: 500;
}
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--disabled-bg); color: var(--muted);
  border-color: transparent; cursor: default;
}

/* ------------------------------------------------------------ components */
.chip {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: 0 var(--s3); border-radius: var(--r-chip);
  font-size: 14px; background: transparent; color: var(--ink);
  border: 1px solid var(--muted); cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--indigo); color: var(--paper); border-color: var(--indigo);
}

.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line);
        margin: 0 0 var(--s5); }
.tabs [role="tab"] {
  background: none; border: none; padding: var(--s3) 0;
  font: inherit; font-size: 15px; color: var(--muted); cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] {
  color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--indigo);
}

label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 var(--s1); }
input[type="text"], input[type="search"], select {
  width: 100%; min-height: 46px; padding: 0 var(--s3);
  font: inherit; color: var(--ink); background: var(--paper);
  /* --muted, not --line: a control edge has to reach 3:1 */
  border: 1.5px solid var(--muted); border-radius: var(--r-ctl);
}

/* A fraction in words, and a hairline. No rings, streaks or scores. */
.progress { font-size: 14px; color: var(--muted); margin: 0 0 var(--s2); }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--indigo); }

.card {
  background: var(--surface); border-radius: var(--r-card);
  padding: var(--s4); margin: 0 0 var(--s3);
}

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--indigo); border: 1px solid var(--indigo);
  border-radius: var(--r-chip); padding: 1px 6px; margin-inline-start: var(--s2);
}

/* ---- the āyah block, which appears on dozens of pages ------------------ */
.ayah {
  background: var(--surface);
  border-top: 1px solid var(--ornament);
  border-bottom: 1px solid var(--line);
  padding: var(--s4) var(--s4) var(--s3);
  margin: 0 0 var(--s4);
}
.ayah .ar {
  font-size: clamp(24px, 5.2vw, 30px); line-height: 2;
  direction: rtl; text-align: right; color: var(--ink);
  margin: 0 0 var(--s3);
}
.ayah .en { margin: 0 0 var(--s2); }
.ayah .ref {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--indigo);
  text-decoration: none;
}
.ayah .hl { color: var(--indigo); }

/* ---- bilingual rhythm: the hardest part, per §6 ------------------------ */
.tokens {
  display: flex; flex-wrap: wrap; direction: rtl;
  gap: 20px 16px;                         /* 20 between rows, 16 between words */
  margin: 0 0 var(--s4);
}
.token {
  display: flex; flex-direction: column; align-items: center;
  min-width: 64px; max-width: 120px;      /* long glosses wrap, never stretch */
  background: none; border: 1.5px solid transparent; border-radius: var(--r-ctl);
  padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.token .w {
  font-family: var(--arabic);
  font-size: 32px; line-height: 56px;     /* 1.75 — the ḥarakāt need the room */
  color: var(--ink);
}
.token .g {
  direction: ltr; margin-top: 8px;        /* fixed 8px, then the gloss */
  font-family: var(--sans); font-size: 13px; line-height: 16px;
  color: var(--muted); text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.token[aria-pressed="true"] { border-color: var(--indigo); background: var(--paper); }
.tokens.no-gloss { gap: 6px 8px; }
.tokens.no-gloss .g { display: none; }

/* ---- audio: a round 44px control, indigo fill, white glyph ------------- */
.spk {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--indigo); color: var(--paper);
  border: none; cursor: pointer; padding: 0;
}
.spk svg { width: 18px; height: 18px; fill: currentColor; }
.spk:hover { background: var(--ink); }
.spk[aria-pressed="true"] { background: var(--ink); }
.spk-sm { width: 34px; height: 34px; }
.spk-sm svg { width: 13px; height: 13px; }
/* the one message the site cannot avoid: recitation is streamed, so it is
   also the one thing that does not work offline */
.a-note {
  background: var(--surface); border: 1px solid var(--not-yet);
  border-radius: var(--r-ctl); padding: var(--s3) var(--s4);
  font-size: 14px; color: var(--ink); margin: var(--s3) 0;
}

/* ---- the āyah roundel: Arabic-Indic digits in an ornament ring --------- */
.rnd {
  float: right; margin: 0 0 var(--s2) var(--s3);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--ornament); color: var(--muted);
  font-family: var(--arabic-ui); font-size: 15px; line-height: 1;
}

/* ---- the action card that ends an item page --------------------------- */
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.acts .said { flex: 1 1 100%; font-size: 14px; color: var(--muted); margin: 0; }

/* an aside that is a remark, not a warning: tone, not a coloured bar */
.notice {
  background: var(--surface); border-left: 2px solid var(--ornament);
  padding: var(--s3) var(--s4); margin: var(--s4) 0;
}
.notice > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------- page-level pieces */
.hero { margin: 0 0 var(--s5); padding-bottom: var(--s4);
        border-bottom: 1px solid var(--line); }
/* §8: on a word or root page the meaning is the title, 30/38 — the Arabic
   above it is the display element, so the h1 steps down from 44 to 30 */
.hero-item h1 { font-size: clamp(26px, 5.4vw, 30px); line-height: 1.27; }
.hero .ar {
  /* §6 says 1.5 for the Arabic hero. Measured, that clips: Amiri Quran sets
     رَبّ with a shadda stacked over a fatḥa, and the ink runs well past a 1.5
     line box at this size — upwards, into the breadcrumb. The rule the guide
     actually cares about is that the ḥarakāt get their room, so the leading
     gives way, not the marks, and the padding carries what is left. */
  /* §6 assigns Amiri Quran to āyāt and tokens, and Amiri to "Arabic in UI and
     prose, root letters" — a hero headword and a root are the second kind.
     Both faces place ḥarakāt at a fixed height above the baseline, so on a
     two-short-letter word like رَبّ the marks sit most of an em clear of the
     letters at 96px. That is the font being right about Qur'anic typography,
     not a layout fault; do not "fix" it by nudging the marks. */
  font-family: var(--arabic-ui);
  font-size: clamp(56px, 16vw, 96px); line-height: 1.7;
  padding: .22em 0 .06em;
  direction: rtl; text-align: right; color: var(--ink); margin: 0 0 var(--s2);
}
/* the Arabic sits right, its play button left of it on the same line. After
   `.hero .ar` so its margin wins — both selectors weigh the same. */
.wh { display: flex; align-items: center; gap: var(--s4); }
.wh .ar { margin: 0 0 0 auto; }
.hero h1 { margin: 0 0 var(--s2); }
/* root letters are three separate letters, not a word: 72px with ornament
   dots between them, so nobody reads ر ب ب as a spelling of rabb */
.hero-root .ar { font-size: clamp(44px, 13vw, 72px); }
.hero-root .dot { color: var(--ornament); }
.k { font-size: 13px; color: var(--muted); }
/* a run of bare Arabic forms, set to breathe rather than packed as prose */
.tokens-plain { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
                font-size: 22px; }
.hero .tr {
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--muted); margin: 0;
}

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s3) var(--s5); margin: 0 0 var(--s6); padding: 0;
}
.facts div { margin: 0; }
.facts dt {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 var(--s1);
}
.facts dd { margin: 0; font-size: 16px; color: var(--ink); }

.fam { width: 100%; border-collapse: collapse; font-size: 15px; }
.fam th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: 0 var(--s3) var(--s2) 0;
}
.fam td {
  padding: var(--s3) var(--s3) var(--s3) 0;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.fam .ar { font-size: 22px; direction: rtl; white-space: nowrap; }
.fam .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
/* a wide table scrolls in its own box, never the page */
.tblwrap { overflow-x: auto; }

.idx { columns: 2; column-gap: var(--s5); padding: 0; margin: 0 0 var(--s5);
       list-style: none; }
@media (min-width: 720px) { .idx { columns: 3; } }
.idx li { break-inside: avoid; margin: 0 0 var(--s2); font-size: 15px; }
.idx .ar { font-size: 19px; direction: rtl; }
.idx .g { color: var(--muted); font-size: 14px; }

/* ---- browse: search, chips, and a dense bilingual list ----------------- */
.tools { margin: 0 0 var(--s4); }
.tools .fld { max-width: 420px; margin: 0 0 var(--s3); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s3);
         padding: 0; list-style: none; }
.chips li { margin: 0; }
.count { font-size: 14px; color: var(--muted); margin: 0; }

/* Arabic right, English left, on one row. A grid rather than flex so the
   Arabic column keeps its width down the page and the eye can run it. */
.wl { list-style: none; padding: 0; margin: 0; }
.wl li {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; gap: var(--s3);
  padding: var(--s3) 0; margin: 0; border-bottom: 1px solid var(--line);
}
.wl a { text-decoration: none; }
.wl a:hover .m { text-decoration: underline; }
.wl .m { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink); }
.wl .s { display: block; font-size: 13px; color: var(--muted); }
.wl .ar { font-size: 24px; direction: rtl; white-space: nowrap; color: var(--ink); }
.wl .k { font-size: 12px; color: var(--muted); }
.band {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--indigo);
  margin: var(--s5) 0 var(--s2);
}
.empty { font-family: var(--serif); font-size: 18px; color: var(--muted);
         padding: var(--s5) 0; }

.pager { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s6) 0 0; }
.pn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border: 1.5px solid var(--indigo); border-radius: var(--r-ctl);
  color: var(--indigo); text-decoration: none; font-size: 14px; font-weight: 600;
}
.pn:hover { background: color-mix(in srgb, var(--indigo) 8%, transparent); }

/* ----------------------------------------------------------- theme switch */
.theme-switch { display: inline-flex; gap: var(--s1); align-items: center; }
.theme-switch button {
  min-height: 36px; padding: 0 var(--s3);
  font: inherit; font-size: 13px; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: var(--r-chip);
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] {
  color: var(--ink); border-color: var(--muted); font-weight: 600;
}
