/* The Quran's own font, from the Quran Foundation (Quran.com) servers, as their developer guide shows; it belongs to
   the King Fahd Glorious Quran Printing Complex, Madinah. Licence to be confirmed before a public launch. */
@font-face { font-family: 'UthmanicHafs'; font-display: swap;
  src: url('https://verses.quran.foundation/fonts/quran/hafs/uthmanic_hafs/UthmanicHafs1Ver18.woff2') format('woff2'),
       url('https://verses.quran.foundation/fonts/quran/hafs/uthmanic_hafs/UthmanicHafs1Ver18.ttf') format('truetype'); }
/* Cairo (Google Fonts, SIL Open Font License, css/fonts/OFL.txt), kept in the app (2026-10-21): one variable file per
   alphabet, every weight 200-1000, ~80 KB in all. Two names for the same files:
   - 'Cairo' as designed: the share image (js/share.js) is drawn with it.
   - 'Cairo UI' for the interface and reading text: grown 9% so its small letters stand as tall as Inter's (Cairo's
     x-height is 0.50, Inter's 0.55), which keeps every size and measured spacing as reviewed; and its very tall built-in
     line spacing (1.87 em, made for Arabic) reined in to Inter's (1.21 em), with capitals centred in that line, so text
     sits centred in buttons and pills. */
@font-face { font-family: 'Cairo'; font-weight: 200 1000; font-display: swap; src: url('fonts/cairo-latin-ext.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: 'Cairo'; font-weight: 200 1000; font-display: swap; src: url('fonts/cairo-latin.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: 'Cairo UI'; font-weight: 200 1000; font-display: swap; src: url('fonts/cairo-latin-ext.woff2') format('woff2');
  size-adjust: 109%; ascent-override: 89.5%; descent-override: 21.5%; line-gap-override: 0%;
  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: 'Cairo UI'; font-weight: 200 1000; font-display: swap; src: url('fonts/cairo-latin.woff2') format('woff2');
  size-adjust: 109%; ascent-override: 89.5%; descent-override: 21.5%; line-gap-override: 0%;
  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; }
:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-arabic: 'UthmanicHafs', 'Geeza Pro', serif; /* (founder, 2026-11-15) one Arabic script everywhere: the Quran's own */
  /* The Quran text itself: the King Fahd Complex's UthmanicHafs font, paired with the QPC Hafs wording in data/quran
     (as Quran.com does). Since 2026-11-15 it is also used for all other Arabic (hadith, quotes): Amiri and Cairo's Arabic are gone. */
  --font-quran: 'UthmanicHafs', 'Geeza Pro', serif;

  /* Type scale (2026-10-15): six sizes for every piece of text in the app, plus three for Arabic outside the Ayah.
     It replaced 15 sizes, many half a pixel apart. The Ayah itself (.arabic, .translation on the card) scales with
     the screen. 16px is also the smallest size that stops iPhones zooming into a search box when you type.
     xs: small capitals labels, counts, times. s: notes, sources, transliteration, small buttons. m: buttons, pills,
     menus. base: reading text (English Ayah, commentary, Hadith, lists). l: search boxes, headings. xl: window titles. */
  --fs-xs: 11px;
  --fs-s: 12px;
  --fs-m: 13px;
  --fs-base: 14px;
  --fs-l: 16px;
  --fs-xl: 19px;
  --fs-ar-s: 15px;
  --fs-ar-m: 20px;
  --fs-ar-l: 24px;

  --text: rgba(255, 255, 255, 0.97);
  --text-2: rgba(255, 255, 255, 0.8);
  --text-3: rgba(255, 255, 255, 0.62);
  --accent: #f2d493;
  --ink: #16182b;

  --glass: rgba(8, 44, 78, 0.38);
  --glass-strong: rgba(8, 44, 78, 0.56);
  --glass-border: rgba(255, 255, 255, 0.2);
  /* Every popup (prayer times, Find an Ayah, topics, word meanings, windows, the Quran-line label, reciter
     list, repeat panel) uses these four, so they always match each other on every sky. "Frosted glass", chosen
     2026-10-13: 0.78 keeps small grey text readable (5:1) even over the brightest sky. */
  --panel: rgba(16, 20, 36, 0.78);
  --panel-border: rgba(255, 255, 255, 0.14);
  --panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  --panel-blur: blur(28px) saturate(160%);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* strong ease-out for things appearing */
  --pop-in: 440ms;  /* how long a pop-up takes to open */
  --pop-out: 180ms; /* and to close: always quicker */
  --panel-solid: rgba(16, 20, 36, 0.96); /* for a pop-up inside something that already blurs (no frosting possible) */

  --radius-card: 28px;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Pills with gold text (topics, Ayah of the Day, +N, From the Sunnah) sit on this darker fill rather than a gold tint,
     so the gold reads on every sky: 3.3-3.6 before on the bright skies, 5.5+ now (4.5 is the standard; 2026-10-15). */
  --pill-fill: rgba(10, 12, 30, 0.25);
}

/* Each sky tints the glass with a deeper, cooler shade of its own colour (chosen 2026-10-11): warm gold
   mixed into the glass is what used to turn the card muddy brown on Asr and Fajr. --dock-bg is the
   player bar, the same family, nearly solid. */
/* Daytime skies (Fajr, Dhuhr, Asr): glass 0.68 and brighter secondary text, so the card stays readable against
   the bright sky behind it (2026-10-14, quality audit, founder chose option 3 "Comfortable": small grey text
   measured 4.8-5.4, English 5.6-6.4, against 4.5 needed; it was 2.8 and 3.6). Maghrib and Isha already passed. */
/* Readability by day and at Maghrib (2026-10-15, measured at the brightest point behind the text): Maghrib's glass
   as dense as the other bright skies, the quietest grey a step brighter. */
body[data-phase='fajr'] { --glass: rgba(44, 40, 98, 0.68); --text-2: rgba(255, 255, 255, 0.88); --text-3: rgba(255, 255, 255, 0.86); --glass-strong: rgba(44, 40, 98, 0.8); --dock-bg: rgba(38, 34, 84, 0.94); }
body[data-phase='dhuhr'] { --glass: rgba(8, 44, 84, 0.68); --text-2: rgba(255, 255, 255, 0.88); --text-3: rgba(255, 255, 255, 0.86); --glass-strong: rgba(8, 44, 84, 0.8); --dock-bg: rgba(10, 38, 72, 0.94); }
body[data-phase='asr'] { --glass: rgba(18, 46, 82, 0.68); --text-2: rgba(255, 255, 255, 0.88); --text-3: rgba(255, 255, 255, 0.86); --glass-strong: rgba(18, 46, 82, 0.8); --dock-bg: rgba(18, 40, 72, 0.94); }
body[data-phase='maghrib'] { --glass: rgba(42, 18, 62, 0.68); --glass-strong: rgba(42, 18, 62, 0.8); --text-3: rgba(255, 255, 255, 0.78); --dock-bg: rgba(34, 14, 50, 0.95); }
body[data-phase='isha'] { --glass: rgba(150, 175, 255, 0.08); --glass-strong: rgba(150, 175, 255, 0.2); --glass-border: rgba(190, 205, 255, 0.16); --dock-bg: rgba(10, 16, 40, 0.96); }

[hidden] { display: none !important; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background: #0d2f4d;
}

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ---------- Shared glass pieces ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-2);
  font-size: var(--fs-m);
  letter-spacing: 0.01em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 1.2s ease, color 0.2s, border-color 0.2s;
}

button.pill { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { button.pill:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.34); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--glass-strong); color: var(--text); } }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.topbar-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.topbar-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* Sources (2026-10-14, founder's pick of 4): a plain icon at the far right of the top bar, off the card, since it
   covers the whole app. No circle or border; same 36px height as the pills beside it. */
.top-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; transition: color 0.15s, background 0.15s, scale 0.12s ease-out; }
.top-icon svg { width: 16px; height: 16px; } /* an open book (founder, 2026-10-14); 16px like the pills beside it */
.top-icon:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.08); }
@media (hover: hover) and (pointer: fine) { .top-icon:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); } }
.top-icon:active { scale: 0.94; }

.prayer { position: relative; }
.prayer-pill { color: var(--text-2); }
.prayer-name { font-weight: 600; color: var(--text); }
.prayer-countdown { font-variant-numeric: tabular-nums; }

/* Idea, not yet decided: a ring that fills in as the next prayer approaches. */
.prayer-ring { display: inline-flex; flex: none; }
.ring-track { stroke: rgba(255, 255, 255, 0.28); }
.ring-fill {
  stroke: var(--accent);
  stroke-dasharray: 50.27;
  stroke-dashoffset: 50.27;
  transition: stroke-dashoffset 1s linear;
}
.prayer-pill.is-now .ring-fill { animation: ring-pulse 1.6s ease-in-out infinite; }
.prayer-pill.is-now { animation: pill-pulse 1.6s ease-in-out infinite; }

@keyframes ring-pulse {
  0%, 100% { stroke: var(--accent); }
  50% { stroke: #fff; }
}
@keyframes pill-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 212, 147, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(242, 212, 147, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .prayer-pill.is-now, .prayer-pill.is-now .ring-fill { animation: none; }
}

.times-today { margin: -4px 8px 2px; font-size: var(--fs-m); color: var(--text); }
.times-hijri { margin: 0 8px 10px; font-size: var(--fs-m); color: var(--text-2); }

.streak { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.streak svg { flex: none; }
.icon-pill svg { flex: none; }

.times-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 344px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: var(--panel-blur);
  backdrop-filter: var(--panel-blur);
}

.times-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 6px 8px; }
.times-place { margin: 0; min-width: 0; font-size: var(--fs-l); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.times-change { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--glass-border); border-radius: 999px; background: transparent; color: var(--text-2); font: 500 var(--fs-s) var(--font-ui); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .times-change:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.4); } }
.times-settings { display: grid; gap: 8px; margin: 10px 4px 2px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.times-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-s); color: var(--text-3); }
.times-row select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='white' stroke-opacity='0.7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; max-width: 190px; min-height: 30px; padding: 0 34px 0 10px; border-radius: 8px; border: 1px solid var(--glass-border); background-color: rgba(255, 255, 255, 0.06); color: var(--text); font: 500 var(--fs-s) var(--font-ui); }
.times-row select option { color: #16182b; }
.times-row-stack { display: grid; justify-content: stretch; gap: 6px; }
.times-row-stack select { max-width: none; width: 100%; }
.times-seg { display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.times-seg button { min-height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 500 var(--fs-s) var(--font-ui); cursor: pointer; }
.times-seg button[aria-pressed='true'] { background: rgba(255, 255, 255, 0.94); color: var(--ink); }
.times-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.times-list li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: var(--fs-base);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.times-list li.is-next { background: rgba(255, 255, 255, 0.1); color: var(--text); font-weight: 600; }
.times-note { margin: 8px 8px 0; font-size: var(--fs-s); line-height: 1.45; color: var(--text-3); }

/* ---------- Browse toolbar ---------- */

.toolbar {
  max-width: 900px;
  width: 100%;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.tb-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tb-btn { min-height: 34px; padding: 0 14px; font-size: var(--fs-m); font-weight: 500; color: var(--text-2); }
.tb-btn svg { flex: none; }
.tb-btn.is-gold { border-color: rgba(242, 212, 147, 0.55); color: var(--accent); background: rgba(242, 212, 147, 0.1); }
.tb-btn.is-quiet { opacity: 0.45; cursor: default; }
@media (hover: hover) and (pointer: fine) { .tb-btn.is-quiet:hover { color: var(--text-2); border-color: var(--glass-border); } }
.tb-btn.is-on, .tb-btn[aria-pressed='true'] { background: rgba(255, 255, 255, 0.94); color: var(--ink); border-color: transparent; }
/* The general pill hover turns text white; keep the selected (white) and gold pills readable when hovered. */
@media (hover: hover) and (pointer: fine) { .tb-btn.is-on:hover, .tb-btn[aria-pressed='true']:hover { color: var(--ink); border-color: transparent; } }
@media (hover: hover) and (pointer: fine) { .tb-btn.is-gold:hover { color: var(--accent); border-color: rgba(242, 212, 147, 0.8); } }
.tb-count { font-size: var(--fs-xs); font-weight: 400; opacity: 0.6; font-variant-numeric: tabular-nums; }

.popwrap { position: relative; }
.pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: var(--panel-blur);
  backdrop-filter: var(--panel-blur);
}
.theme-pop { display: grid; gap: 2px; padding: 6px; }
.theme-pop button {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-m);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.theme-pop button[aria-checked='true'] { background: rgba(255, 255, 255, 0.1); color: var(--text); }
@media (hover: hover) and (pointer: fine) { .theme-pop button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); } }
.theme-pop .count { opacity: 0.6; font-variant-numeric: tabular-nums; }

.jump-pop { width: min(660px, calc(100vw - 32px)); display: grid; gap: 10px; background: var(--panel); }
.pop-search {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 400 var(--fs-l) var(--font-ui);
  outline: none;
}
.pop-search:focus { border-color: rgba(242, 212, 147, 0.6); }
.jump-body { max-height: min(460px, 62vh); overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.jump-label { margin: 6px 2px 8px; font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.jump-hits { display: grid; gap: 2px; margin-bottom: 8px; }
.jump-hit { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 500 var(--fs-base) var(--font-ui); text-align: left; cursor: pointer; }
.jump-hit:focus-visible, .jump-hit.is-first { background: rgba(255, 255, 255, 0.07); }
@media (hover: hover) and (pointer: fine) { .jump-hit:hover { background: rgba(255, 255, 255, 0.07); } }
.jump-hit .ref { color: var(--accent); font-variant-numeric: tabular-nums; }
.jump-hit .go { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); }
.jump-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.jump-tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'no ar' 'name name' 'count count'; gap: 1px 8px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.jump-tile:focus-visible { border-color: rgba(242, 212, 147, 0.55); background: rgba(255, 255, 255, 0.07); }
@media (hover: hover) and (pointer: fine) { .jump-tile:hover { border-color: rgba(242, 212, 147, 0.55); background: rgba(255, 255, 255, 0.07); } }
.jump-tile.is-here { border-color: rgba(242, 212, 147, 0.6); }
.jump-tile .no { grid-area: no; font-size: var(--fs-xs); color: var(--accent); font-variant-numeric: tabular-nums; }
.jump-tile .ar { grid-area: ar; justify-self: end; font-family: var(--font-arabic); font-size: var(--fs-ar-s); color: var(--text-3); line-height: 1.2; }
.jump-tile .name { grid-area: name; font-size: var(--fs-m); font-weight: 500; }
.jump-tile .count { grid-area: count; font-size: var(--fs-xs); color: var(--text-3); }
.jump-head { display: flex; align-items: center; gap: 10px; }
.jump-back { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); background: transparent; color: var(--text); font-size: var(--fs-l); cursor: pointer; }
.jump-title { flex: 1; min-width: 0; font-size: var(--fs-m); color: var(--text-3); }
.jump-title strong { color: var(--text); font-weight: 600; font-size: var(--fs-base); }
.jump-start { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.94); color: var(--ink); font: 600 var(--fs-m) var(--font-ui); cursor: pointer; }
.jump-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.jump-num { height: 40px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); color: var(--text); font: 500 var(--fs-base) var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; }
.jump-num:focus-visible { background: rgba(255, 255, 255, 0.94); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .jump-num:hover { background: rgba(255, 255, 255, 0.94); color: var(--ink); } }
.jump-num.is-here { border-color: rgba(242, 212, 147, 0.7); color: var(--accent); }
.jump-none { margin: 8px 4px; font-size: var(--fs-m); color: var(--text-3); }
/* On narrow screens the window spans the screen (16px each side) instead of hanging off its button. */
@media (max-width: 720px) {
  .jump-pop { position: fixed; top: 112px; left: 16px; right: 16px; width: auto; }
  .times-pop { position: fixed; top: 104px; left: 16px; right: 16px; width: auto; }
  .jump-title span { display: none; }
}

/* ---------- Stage ---------- */

.stage {
  /* align-items was "center", vertically centering the card in whatever space is left between the
     toolbar and the bottom - on a short mobile screen that's barely noticeable, but on a tall
     desktop window it leaves a big empty gap above the card (reported 2026-09-22). Top-aligning
     instead keeps the card a constant, comfortable distance below the filters no matter how tall
     the window is; any leftover space just settles below the footer instead. */
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 0;
}

/* Holds the live card plus two lightweight "peek" previews of the neighbouring verses, so a swipe
   on a phone reveals a sliver of the next/previous card rather than just cutting straight to it
   (js/app.js drives it by setting transforms on #cardStack's children while dragging). The live
   card sits in normal flow and gives the stack its height; the peeks are absolutely positioned to
   match that same box exactly, then pushed fully off to the side by default. */
.card-stack {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* By id, not ".card-stack > .card": the peek cards also carry the ".card" class (for the same
   glass styling), so a class-based rule here would match them too, and being two classes it would
   beat ".card-peek"'s one-class "position: absolute" - which is exactly the bug that broke the
   carousel (peeks fell into normal document flow instead of overlaying the live card, stacking up
   as extra vertical space - the "huge gap"). Targeting the id only touches the real card. */
#card { position: relative; z-index: 2; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { justify-content: flex-start; }
}


/* Phones: keep the four toolbar pills on one row (drop the icons and the "Theme:" word). */
@media (max-width: 480px) {
  .tb-btn { padding: 0 12px; gap: 6px; }
  .tb-btn > svg:first-child { display: none; }
}
/* A long topic name ("Heart & Supplication") is trimmed with "..." so the top bar never wraps to a second row. */
#themeMenuLabel { display: inline-block; max-width: 8.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- One-row header (option 3, chosen 2026-10-13) ----------
   The two old rows are merged into one quiet line: the browse buttons (the "Daily Ayat" name was dropped 2026-10-13 so it all fits on one line), then your day
   (next prayer, streak). No pill outlines, so the Ayah stays the star. Location lives in the prayer
   times window - its only job is setting prayer times. */
.head { display: flex; align-items: center; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; flex-wrap: wrap; }
.head .topbar, .head .toolbar { display: contents; }
.head .tb-left { order: 2; }
.head #savedBtn, .head .saved-wrap { order: 3; }
.head .topbar-left { order: 5; margin-left: auto; }
.head .topbar-right { order: 6; flex-wrap: nowrap; }
.head .pill, .head .prayer-pill { border-color: transparent; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding-left: 12px; padding-right: 12px; }
@media (hover: hover) and (pointer: fine) { .head .pill:hover { background: rgba(255, 255, 255, 0.08); } }
.head .tb-btn.is-on, .head .tb-btn[aria-pressed='true'] { background: rgba(255, 255, 255, 0.94); }
@media (max-width: 720px) {
  .head .topbar-left { margin-left: 0; }
}
/* The sky picker only exists on localhost (development). Icon only, so the local header matches what
   visitors see; hover it for the current sky. */
.head #themeLabel { display: none; }

/* ---------- Top bar motion (chosen 2026-10-14, option 4 of 4: sliding highlight + living icons) ----------
   Hover is a soft light only (no white outline): one light glides between the buttons (js/navfx.js), so the
   buttons' own hover fill is off. The streak is a label, not a button, so it does not react at all. Items
   that open something carry an arrow that points right and turns down while open (like Finder); items that
   act at once (Today's Ayah, Saved) have none. Each icon acts out what it does when the pointer arrives. */
.head { position: relative; z-index: 10; } /* above the card (z-index 2), so the menus that drop from the bar are never hidden behind it */
.head .pill, .head .popwrap { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .head button.pill:hover { border-color: transparent; background: transparent; } }
@media (hover: hover) and (pointer: fine) { .head .streak:hover { background: transparent; } }
.nav-glow { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); pointer-events: none; opacity: 0;
  transition: translate 0.35s var(--ease-out), width 0.35s var(--ease-out), height 0.35s var(--ease-out), opacity 0.2s ease; }
.nav-glow.is-on { opacity: 1; }
.nav-chev { flex: none; opacity: 0.7; transition: rotate 0.3s var(--ease-out); }
[aria-expanded='true'] > .nav-chev { rotate: 90deg; }
.head .tb-btn > svg:first-child { transform-origin: center; }
@media (hover: hover) and (pointer: fine) {
  @media (hover: hover) and (pointer: fine) { #todayBtn:hover > svg:first-child { animation: nav-flip 0.5s var(--ease-out); } }
  @media (hover: hover) and (pointer: fine) { #jumpBtn:hover > svg:first-child { animation: nav-swing 0.6s var(--ease-out); } }
  @media (hover: hover) and (pointer: fine) { #themeMenuBtn:hover > svg:first-child path { stroke-dasharray: 16; animation: nav-draw 0.5s var(--ease-out); } }
  @media (hover: hover) and (pointer: fine) { #savedBtn:hover > svg:first-child { animation: nav-spin 0.6s var(--ease-out); } }
}
@keyframes nav-flip { 0% { transform: perspective(40px) rotateX(0); } 50% { transform: perspective(40px) rotateX(-70deg); } 100% { transform: perspective(40px) rotateX(0); } }
@keyframes nav-swing { 0% { transform: rotate(0) scale(1); } 35% { transform: rotate(-18deg) scale(1.15); } 70% { transform: rotate(8deg) scale(1.05); } 100% { transform: rotate(0) scale(1); } }
@keyframes nav-draw { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
@keyframes nav-spin { from { transform: rotate(0) scale(1); } 50% { transform: rotate(36deg) scale(1.2); } to { transform: rotate(72deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .nav-glow, .nav-chev { transition: none; }
  .head .tb-btn > svg, .head .tb-btn > svg path { animation: none !important; }
}

/* Saved drop-down (js/toolbar.js) */
.saved-pop { width: min(380px, calc(100vw - 32px)); padding: 10px; }
.saved-wrap .saved-pop { left: auto; right: 0; transform-origin: top right; }
.saved-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 4px; }
.saved-head .jump-label { margin: 0; }
.saved-all { padding: 5px 11px; border: 1px solid var(--panel-border); border-radius: 999px; background: transparent; color: var(--text); font: 500 var(--fs-s) var(--font-ui); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .saved-all:hover { background: rgba(255, 255, 255, 0.08); } }
.saved-list { display: grid; gap: 2px; max-height: min(60vh, 420px); overflow-y: auto; scrollbar-width: thin; }
.saved-item { display: grid; gap: 3px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.saved-item:focus-visible { background: rgba(255, 255, 255, 0.07); }
@media (hover: hover) and (pointer: fine) { .saved-item:hover { background: rgba(255, 255, 255, 0.07); } }
.saved-text { font: 400 var(--fs-m)/1.45 var(--font-ui); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saved-empty { margin: 6px 4px; font-size: var(--fs-m); line-height: 1.5; color: var(--text-3); }
@media (max-width: 720px) { .saved-wrap .saved-pop { position: fixed; top: 112px; left: 16px; right: 16px; width: auto; } }

/* ---------- The Nurayah logo (2026-10-15, founder: option 2 + the opening moment of 4) ----------
   The mark sits at the start of the top row. Its weight is the name at the bottom (the flames above are thin), so
   the name, not the whole image, is lined up with the middle of the 36px row: the name's centre is 72.7% of the
   way down the image (icons/brand/nurayah-mark-on-dark.svg), and the flame tips rise above the row. */
.head .brand { order: 1; display: block; flex: none; width: 27px; height: 36px; margin-right: 4px; border-radius: 8px; }
.head .brand-logo { --h: 44px; display: block; width: auto; height: var(--h); margin-top: calc(18px - 0.727 * var(--h)); }
.head .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* The opening moment: the full logo on the sky as the app opens, then it fades as the Ayah arrives. Once per visit
   (js/app.js openingMoment; an inline script in index.html hides it before the first paint on a reload). It never
   takes taps. Reduced motion: a plain fade. */
.brand-splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; background: rgba(8, 10, 24, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: opacity 0.7s ease; }
.brand-splash-logo { width: min(46vw, 210px); height: auto; transition: opacity 0.6s ease, scale 0.9s var(--ease-out), filter 0.6s ease; }
.brand-splash.is-entering .brand-splash-logo { opacity: 0; scale: 1.04; filter: blur(6px); transition: none; }
.brand-splash.is-gone { opacity: 0; }
.brand-splash.is-gone .brand-splash-logo { scale: 0.96; filter: blur(4px); }
.no-splash .brand-splash { display: none; }
@media (prefers-reduced-motion: reduce) { .brand-splash-logo { scale: none !important; filter: none !important; } }

/* Phones: the type scale (2026-10-15) made the top-row buttons a pixel or two wider, enough to push the row from two
   lines to three at 390px. A little less side padding keeps it at two, as before. (The phone design will redo this.) */
@media (max-width: 480px) {
  .head .pill, .head .prayer-pill { padding-left: 10px; padding-right: 10px; }
}
