/* =========================================================================
   DIK-ZIKRS — public app stylesheet
   Tokens → base → layout → components → views → utilities
   ========================================================================= */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("../fonts/amiri-sub.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- Tokens ---------- */
:root {
  --brand: #10b981;
  --brand-strong: #059669;
  --brand-grad: linear-gradient(135deg, #10b981, #059669);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;

  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .875rem; --fs-base: 1rem;
  --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: 2.25rem; --fs-4xl: 2.75rem;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;

  --side-w: 264px;
  --top-h: 64px;
  --player-h: 88px;
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 20px;
  --maxw: 1320px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23d8ac52' stroke-width='1'%3E%3Crect x='14' y='14' width='28' height='28'/%3E%3Crect x='14' y='14' width='28' height='28' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 28h8.2M47.8 28H56M28 0v8.2M28 47.8V56'/%3E%3Cpath d='M0 0l8 8M56 0l-8 8M0 56l8-8M56 56l-8-8'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1714;
  --bg-elev: #111d19;
  --surface: #15231f;
  --surface-2: #1b2c27;
  --surface-3: #233731;
  --line: rgba(220, 240, 230, .08);
  --line-strong: rgba(220, 240, 230, .16);
  --text: #ecf2ee;
  --text-2: #a3b5ad;
  --text-3: #6f847b;
  --accent: #10b981;
  --accent-text: #34d399;
  --accent-soft: rgba(16, 185, 129, .14);
  --on-accent: #04241a;
  --gold: #d8ac52;
  --gold-soft: rgba(216, 172, 82, .14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 32px -8px rgba(0, 0, 0, .55);
  --shadow-3: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --hero-from: #0f3d30;
  --hero-to: #0a211b;
  --overlay: rgba(4, 10, 8, .6);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eaf0ed;
  --surface-3: #dfe7e3;
  --line: rgba(14, 40, 30, .09);
  --line-strong: rgba(14, 40, 30, .18);
  --text: #0e1c17;
  --text-2: #4b5f57;
  --text-3: #7a8c85;
  --accent: #059669;
  --accent-text: #047857;
  --accent-soft: rgba(5, 150, 105, .1);
  --on-accent: #ffffff;
  --gold: #a87a1f;
  --gold-soft: rgba(168, 122, 31, .12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .08);
  --shadow-1: 0 1px 2px rgba(14, 40, 30, .08);
  --shadow-2: 0 10px 28px -10px rgba(14, 40, 30, .22);
  --shadow-3: 0 24px 60px -16px rgba(14, 40, 30, .3);
  --hero-from: #0f4535;
  --hero-to: #0b2a21;
  --overlay: rgba(10, 20, 16, .45);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  min-height: 100dvh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
/* No zoom (pinch / double-tap) and fit every screen */
html, body { touch-action: manipulation; overscroll-behavior-x: none; max-width: 100%; }
img, video, svg, canvas { max-width: 100%; }
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; } /* iOS: no auto-zoom on focus */
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.ic { width: 22px; height: 22px; flex: none; fill: currentColor; }
.ic-on { display: none; }
.active > .ic-on, .liked > .ic-on, [aria-pressed="true"] > .ic-on { display: block; }
.active > .ic-off, .liked > .ic-off, [aria-pressed="true"] > .ic-off { display: none; }

/* Every word starts with a capital letter (interface text) */
body, button, select, .btn, .chip { text-transform: capitalize; }
input, textarea, kbd, .no-cap, .about-card p, .bio { text-transform: none; }
input::placeholder, textarea::placeholder { text-transform: capitalize; }
.ic-sm { width: 18px; height: 18px; }
.ic-xs { width: 15px; height: 15px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: var(--r-md); font-weight: 600; }
.skip-link:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; }

/* ---------- Brand (logo — unchanged identity) ---------- */
.brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 48px; height: 48px; flex: none;
  background: var(--brand-grad);
  border-radius: 1rem;
  display: grid; place-items: center;
  color: #fff;
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; color: var(--text); }
.brand-sm .brand-mark { width: 38px; height: 38px; border-radius: .8rem; }
.brand-sm .brand-mark svg { width: 22px; height: 22px; }
.brand-sm .brand-name { font-size: 1.375rem; }

/* ---------- Layout ---------- */
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-nav, .top-search { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.view {
  display: block; padding-top: 4px;
  min-height: calc(100dvh - var(--top-h));
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  outline: none;
}
body.has-player .view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 92px); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-elev); background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--text-3);
  transition: color .15s;
}
.tabbar a .ic { width: 25px; height: 25px; }
.tabbar a.active { font-weight: 600; }
.tabbar a.active { color: var(--text); }
.tabbar a.active .ic { color: var(--accent-text); }

@media (min-width: 1024px) {
  :root { --gutter: 44px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 45;
    width: var(--side-w);
    padding: 26px 16px 20px;
    background: var(--bg-elev);
    border-right: 1px solid var(--line);
    overflow-y: auto; scrollbar-width: none;
  }
  body.has-player .sidebar { bottom: var(--player-h); }
  .sidebar .brand { padding: 0 8px 18px; }
  .topbar { margin-left: var(--side-w); padding: 0 var(--gutter); }
  .topbar .brand-sm { display: none; }
  .topbar-nav { display: flex; gap: 4px; }
  .top-search {
    display: flex; align-items: center; gap: 10px;
    width: min(440px, 44vw); height: 42px; padding: 0 14px;
    background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-full);
    color: var(--text-3); cursor: text; transition: border-color .15s, background .15s;
  }
  .top-search:focus-within { border-color: var(--accent); background: var(--surface); }
  .top-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: var(--fs-md); }
  .top-search input::placeholder { color: var(--text-3); }
  .top-search kbd { font: 600 11px var(--font); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--text-3); }
  .only-mobile { display: none !important; }
  .view { margin-left: var(--side-w); padding-bottom: 48px; min-height: calc(100vh - var(--top-h)); }
  body.has-player .view { padding-bottom: calc(var(--player-h) + 40px); }
  .tabbar { display: none; }
}
@media (max-width: 1023.98px) { .hide-mobile { display: none !important; } }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 14px; border-radius: var(--r-md);
  font-size: .9375rem; font-weight: 500; color: var(--text-2);
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--accent-soft); color: var(--text); }
.side-nav a.active .ic { color: var(--accent-text); }
.side-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-title { padding: 0 12px 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.side-count { margin-left: auto; font-style: normal; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding: 16px 14px 4px; }
.side-foot .ar { font-family: var(--font-ar); color: var(--gold); font-size: 1.6rem; line-height: 1.4; opacity: .85; }
.side-admin {
  margin-top: auto; display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-md); font-weight: 500; color: var(--text-2);
  transition: border-color .15s, color .15s;
}
.side-admin:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Buttons ---------- */
.icon-btn {
  position: relative;
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--r-full); color: var(--text-2);
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ic { width: 19px; height: 19px; }
.icon-btn[aria-pressed="true"] { color: var(--accent-text); }
.icon-btn[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn .badge { position: absolute; top: 0; right: -4px; min-width: 18px; padding: 1px 4px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--r-full);
  font-size: var(--fs-md); font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, transform .1s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
.btn-light { background: #fff; color: #0b1f18; }
.btn-light:hover { background: #e9f5ef; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { border: 1px solid var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--text-2); }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-round { width: 56px; height: 56px; padding: 0; border-radius: 50%; }
.btn-round .ic { width: 24px; height: 24px; }
.btn-link { color: var(--accent-text); font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 4px; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.like-btn.liked { color: var(--accent-text); }


/* ---------- Chips & segmented ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px var(--gutter); margin: 0 calc(-1 * var(--gutter)); scroll-padding: 0 var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 18px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip.active { background: var(--text); color: var(--bg); }
.chip small { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-full); }
.segmented button, .segmented a { height: 34px; padding: 0 14px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.segmented button.active, .segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
[data-theme="dark"] .segmented button.active, .segmented a.active { background: var(--surface-3); }

/* ---------- Section headings ---------- */
.section { margin-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.section-head p { font-size: var(--fs-md); color: var(--text-3); margin-top: 4px; }
@media (min-width: 1024px) { .section { margin-top: 68px; } .section-head h2 { font-size: 1.875rem; } .section-head { margin-bottom: 24px; } }

/* ---------- Shelves (horizontal scroll) ---------- */
.shelf {
  display: grid; grid-auto-flow: column; gap: 16px;
  grid-auto-columns: calc((100% - 16px) / 2.15);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 2px var(--gutter) 6px; margin: 0 calc(-1 * var(--gutter));
  scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; min-width: 0; }
@media (min-width: 640px) { .shelf { grid-auto-columns: calc((100% - 3 * 20px) / 3.6); gap: 20px; } }
@media (min-width: 1024px) { .shelf { grid-auto-columns: calc((100% - 4 * 26px) / 5); gap: 26px; } }
.shelf.shelf-round { grid-auto-columns: 128px; }
@media (min-width: 1024px) { .shelf.shelf-round { grid-auto-columns: calc((100% - 5 * 26px) / 6); } }

/* ---------- Cards ---------- */
.card { position: relative; display: block; cursor: pointer; }
.card-media { position: relative; }
.card-art {
  display: block; position: relative; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-1);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.card:hover .card-art img { transform: scale(1.04); }
.card-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease);
}
.card-play .ic { width: 20px; height: 20px; margin-left: 2px; }
.card:hover .card-play, .card:focus-within .card-play, .card.playing .card-play { opacity: 1; transform: none; }
@media (hover: none) { .card-play { opacity: 1; transform: none; width: 38px; height: 38px; } .card-play .ic { width: 17px; height: 17px; } }
.card-title { margin-top: 12px; font-size: .9375rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.playing .card-title { color: var(--accent-text); }

.card-round { text-align: center; }
.card-round .card-art { border-radius: 50%; }
.card-round .card-title { -webkit-line-clamp: 2; }

.card-collection { padding-top: 6px; }
.card-collection .card-art { overflow: visible; }
.card-collection .card-art img { border-radius: var(--r-lg); }
.card-collection .card-art .stack { position: absolute; left: 5px; right: 5px; top: -4px; height: 8px; border-radius: 8px 8px 0 0; background: var(--surface-3); z-index: -1; }

.grid-cards { display: grid; gap: 30px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 28px; } }
.grid-round { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
@media (min-width: 480px) { .grid-round { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) { .grid-round { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-round { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 28px; } }

/* ---------- Track list ---------- */
.tracks { display: flex; flex-direction: column; }
.track {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px;
  min-height: 72px; padding: 9px 10px; margin: 0 -10px; border-radius: var(--r-md);
  cursor: pointer; transition: background .12s;
  content-visibility: auto; contain-intrinsic-size: auto 72px;
}
.track:hover { background: var(--surface-2); }
.track:active { background: var(--surface-3); }
.track-art { position: relative; width: 54px; height: 54px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.track-art img { width: 100%; height: 100%; object-fit: cover; }
.track-art .eq { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); display: none; align-items: center; justify-content: center; gap: 2px; }
.track.playing .track-art .eq { display: flex; }
.track-main { min-width: 0; }
.track-title { font-size: .9375rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { margin-top: 3px; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub a:hover { color: var(--text); text-decoration: underline; }
.track.playing .track-title { color: var(--accent-text); }
.track-end { display: flex; align-items: center; gap: 2px; color: var(--text-3); }
.track-dur { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.track-plays, .track-cat, .track-num { display: none; }
.track .like-btn { display: none; }
.track .like-btn.liked { display: inline-grid; }
@media (min-width: 768px) {
  .track { grid-template-columns: 30px 54px minmax(0, 1.4fr) minmax(0, 1fr) auto; padding: 9px 14px; margin: 0 -14px; }
  .track-num { display: block; font-size: var(--fs-sm); color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
  .track:hover .track-num { visibility: hidden; position: relative; }
  .track:hover .track-num::after { content: ""; visibility: visible; position: absolute; inset: -4px 4px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.8v14.4a1 1 0 0 0 1.52.85l11.5-7.2a1 1 0 0 0 0-1.7L8.52 3.95A1 1 0 0 0 7 4.8z'/%3E%3C/svg%3E") center/16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.8v14.4a1 1 0 0 0 1.52.85l11.5-7.2a1 1 0 0 0 0-1.7L8.52 3.95A1 1 0 0 0 7 4.8z'/%3E%3C/svg%3E") center/16px no-repeat; color: var(--text); }
  .track.playing .track-num { color: var(--accent-text); }
  .track-cat { display: block; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .track .like-btn { display: inline-grid; opacity: 0; }
  .track:hover .like-btn, .track .like-btn.liked { opacity: 1; }
}
@media (min-width: 1100px) {
  .tracks.with-plays .track { grid-template-columns: 30px 54px minmax(0, 1.4fr) minmax(0, 1fr) 90px auto; }
  .tracks.with-plays .track-plays { display: block; font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
}
.tracks-head { display: none; }
@media (min-width: 768px) {
  .tracks-head {
    display: grid; grid-template-columns: 30px 54px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px;
    padding: 0 14px 12px; margin: 0 -14px 8px; border-bottom: 1px solid var(--line);
    font-size: var(--fs-xs); color: var(--text-3); font-weight: 500;
  }
  .tracks-head span:first-child { text-align: center; }
  .tracks-head .h-dur { text-align: right; padding-right: 50px; display: flex; justify-content: flex-end; }
}
@media (min-width: 1100px) { .tracks-head.with-plays { grid-template-columns: 30px 54px minmax(0, 1.4fr) minmax(0, 1fr) 90px auto; } .tracks-head .h-plays { text-align: right; } }
.tracks-head .h-plays { display: none; }
@media (min-width: 1100px) { .tracks-head.with-plays .h-plays { display: block; } }

/* Ranked list (home "Les plus écoutés") */
.ranked { display: grid; gap: 6px 40px; }
@media (min-width: 900px) { .ranked { grid-template-columns: 1fr 1fr; } }
.ranked .track { grid-template-columns: 28px 54px minmax(0, 1fr) auto; }
.ranked .track-num { display: block; font-size: var(--fs-lg); font-weight: 700; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.ranked .track:hover .track-num { visibility: visible; }
.ranked .track:hover .track-num::after { display: none; }
.ranked .track-cat { display: none; }

/* Equalizer bars (now playing indicator) */
.eq i { width: 3px; height: 14px; background: #fff; border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
body:not(.is-playing) .eq i { animation-play-state: paused; transform: scaleY(.4); }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- Banner / hero ---------- */
.pattern { background-image: var(--pattern); background-size: 56px 56px; }

.banner { position: relative; margin-top: 8px; }
.banner-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  border-radius: var(--r-xl);
}
.banner-track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; scroll-snap-align: start; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl);
  min-height: 400px;
  display: grid; align-items: end;
  padding: 26px 24px 28px;
  color: #fff;
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
}
.slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22;
  background: var(--pattern) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 70%);
  mask-image: linear-gradient(200deg, #000 10%, transparent 70%);
}
.slide-bg { position: absolute; inset: 0; z-index: -2; }
.slide-bg img { width: 100%; height: 100%; object-fit: cover; }
.slide-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 14, 11, .92) 8%, rgba(5, 14, 11, .45) 55%, rgba(5, 14, 11, .2)); }
.slide-art {
  position: absolute; top: 26px; right: 24px; width: 120px; aspect-ratio: 1;
  border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .6);
}
.slide-art img { width: 100%; height: 100%; object-fit: cover; }
.slide-ar {
  font-family: var(--font-ar); direction: rtl;
  font-size: 2.6rem; line-height: 1.25; color: var(--gold);
  position: absolute; top: 20px; left: 20px; right: 150px; text-align: left;
}
[data-theme="light"] .slide-ar { color: #e3bd6a; }
.slide-body { position: relative; max-width: 560px; }
.slide-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 500; color: rgba(255, 255, 255, .78); margin-bottom: 8px; }
.slide-kicker .ic { width: 16px; height: 16px; color: #e8c475; }
.slide-title { font-size: 2.25rem; font-weight: 750; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.slide-text { margin-top: 8px; font-size: var(--fs-md); color: rgba(255, 255, 255, .78); max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.banner-dots button { width: 7px; height: 7px; border-radius: 4px; background: var(--line-strong); transition: width .25s var(--ease), background .2s; }
.banner-dots button.active { width: 22px; background: var(--accent); }
.banner-nav { display: none; }

@media (min-width: 768px) {
  .slide { min-height: 360px; padding: 36px 40px; align-items: center; }
  .slide-art { top: 50%; right: 40px; width: 240px; transform: translateY(-50%); border-radius: var(--r-lg); }
  .slide-ar { position: static; font-size: 3rem; margin-bottom: 10px; text-align: left; direction: rtl; display: inline-block; }
  .slide-body { max-width: calc(100% - 300px); }
  .slide-title { font-size: var(--fs-4xl); }
  .slide-text { font-size: var(--fs-base); }
}
@media (min-width: 1024px) {
  .slide { min-height: 440px; padding: 56px 60px; }
  .slide-art { width: 280px; right: 52px; }
  .slide-title { font-size: 3.25rem; }
  .banner-nav { display: flex; position: absolute; right: 20px; bottom: 16px; gap: 8px; z-index: 2; }
  .banner-nav .icon-btn { background: rgba(0, 0, 0, .35); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .banner-nav .icon-btn:hover { background: rgba(0, 0, 0, .55); }
  .banner-dots { position: absolute; left: 52px; bottom: 20px; margin: 0; z-index: 2; }
  .banner-dots button { background: rgba(255, 255, 255, .3); }
  .banner-dots button.active { background: #fff; }
}

/* Greeting row */
.greet { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; margin-bottom: 22px; }
.greet h1 { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.greet p { color: var(--text-3); font-size: var(--fs-sm); margin-top: 2px; }
.greet .ar { font-family: var(--font-ar); color: var(--gold); font-size: 1.5rem; line-height: 1; }
@media (min-width: 1024px) { .greet { padding-top: 24px; margin-bottom: 28px; } .greet h1 { font-size: var(--fs-3xl); } }

/* Quick tiles (continue / shortcuts) */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 28px; } }
.quick-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  height: 64px; padding-right: 12px; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-2); font-size: var(--fs-sm); font-weight: 600; text-align: left;
  transition: background .15s;
}
.quick-tile:hover { background: var(--surface-3); }
.quick-tile .qt-art { width: 64px; height: 64px; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.quick-tile .qt-art img { width: 100%; height: 100%; object-fit: cover; }
.quick-tile .qt-art .ic { color: var(--accent-text); }
.quick-tile .qt-art.gold .ic { color: var(--gold); }
.quick-tile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* Resume card */
.resume {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  margin-top: 18px;
}
.resume img { width: 64px; height: 64px; border-radius: var(--r-md); object-fit: cover; }
.resume h3 { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume p { font-size: var(--fs-sm); color: var(--text-3); }
.resume .bar { height: 3px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.resume .bar span { display: block; height: 100%; background: var(--accent); }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.cat-tile {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 3; padding: 14px 16px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff; background: #0f3a2e;
  transition: transform .25s var(--ease), box-shadow .25s;
  box-shadow: var(--shadow-1);
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.cat-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s var(--ease); }
.cat-tile:hover .cat-bg { transform: scale(1.06); }
.cat-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 50% 38%, rgba(0,0,0,.05), rgba(0,0,0,.55)), linear-gradient(0deg, rgba(0,0,0,.55), transparent 45%); }
.cat-ar {
  position: absolute; left: 10px; right: 10px; top: 42%; transform: translateY(-50%);
  font-family: var(--font-ar); direction: rtl; text-align: center; line-height: 1.5;
  font-size: clamp(1.35rem, 5.4vw, 2rem); color: #f6e3ae;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55), 0 0 1px rgba(0,0,0,.4);
  text-wrap: balance;
}
.cat-tile strong { position: relative; font-size: var(--fs-md); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
@media (min-width: 640px) { .cat-ar { font-size: 1.9rem; } }
@media (min-width: 1024px) { .cat-tile { padding: 16px 20px; } .cat-ar { font-size: 2.2rem; } .cat-tile strong { font-size: var(--fs-base); } }

/* ---------- Page headers ---------- */
.page-banner {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  margin: 8px 0 0; border-radius: var(--r-xl);
  padding: 32px 24px 28px; min-height: 220px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
}
.page-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .2; background: var(--pattern) 0 0 / 56px 56px; -webkit-mask-image: linear-gradient(220deg, #000, transparent 75%); mask-image: linear-gradient(220deg, #000, transparent 75%); }
.page-banner h1 { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.08; }
.page-banner p { margin-top: 6px; color: rgba(255, 255, 255, .78); font-size: var(--fs-md); max-width: 60ch; }
.page-banner .ar { position: absolute; top: 18px; right: 22px; font-family: var(--font-ar); color: var(--gold); font-size: 2.2rem; line-height: 1.2; opacity: .95; }
[data-theme="light"] .page-banner .ar { color: #e3bd6a; }
.page-banner .stats { display: flex; gap: 18px; margin-top: 14px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .8); }
.page-banner .stats b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
@media (min-width: 1024px) {
  .page-banner { padding: 56px 60px 44px; min-height: 280px; }
  .page-banner h1 { font-size: 3.25rem; }
  .page-banner p { font-size: var(--fs-base); }
  .page-banner .ar { font-size: 3.2rem; top: 30px; right: 48px; }
}

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 20px; flex-wrap: wrap; }
.toolbar .count { font-size: var(--fs-sm); color: var(--text-3); }
.sort-select {
  height: 36px; padding: 0 34px 0 14px; border-radius: var(--r-full);
  border: 1px solid var(--line-strong); background: transparent; font-size: var(--fs-sm); font-weight: 500;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8c85' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.sort-select option { background: var(--surface); color: var(--text); }

/* Detail hero (reciter / collection / zikr) */
.detail {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 0 calc(-1 * var(--gutter));
  padding: 24px var(--gutter) 22px;
  color: #fff;
}
.detail-bg { position: absolute; inset: 0; z-index: -2; background: linear-gradient(170deg, var(--hero-from), var(--hero-to)); }
.detail-bg img { width: 100%; height: 100%; object-fit: cover; }
.detail-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(5, 14, 11, .55) 45%, rgba(5, 14, 11, .25) 100%); }
[data-theme="light"] .detail-bg::after { background: linear-gradient(0deg, rgba(8, 24, 19, .94) 0%, rgba(5, 14, 11, .55) 50%, rgba(5, 14, 11, .25) 100%); }
.detail-bg.patterned::before { content: ""; position: absolute; inset: 0; opacity: .16; background: var(--pattern) 0 0 / 56px 56px; }
.detail-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-top: 24px; }
.detail-art { width: 180px; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-3); background: var(--surface-2); flex: none; }
.detail-art.round { border-radius: 50%; width: 156px; border: 3px solid rgba(255, 255, 255, .9); }
.detail-art img { width: 100%; height: 100%; object-fit: cover; }
.detail-type { font-size: var(--fs-sm); font-weight: 500; color: rgba(255, 255, 255, .75); }
.detail h1 { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.08; text-wrap: balance; }
.detail-meta { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .8); }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-meta .ic { width: 15px; height: 15px; }
.detail-meta a:hover { color: #fff; text-decoration: underline; }
.detail-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.detail-actions .icon-btn { color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .25); }
.detail-actions .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.detail-actions .like-btn.liked { color: #34d399; border-color: #34d399; }
.detail-back { position: absolute; top: 12px; left: var(--gutter); z-index: 2; background: rgba(0, 0, 0, .3); color: #fff; }
.detail-back:hover { background: rgba(0, 0, 0, .5); color: #fff; }
@media (min-width: 768px) {
  .detail { padding: 40px var(--gutter) 30px; }
  .detail-inner { flex-direction: row; align-items: flex-end; text-align: left; gap: 28px; padding-top: 40px; }
  .detail-art { width: 220px; }
  .detail-art.round { width: 200px; }
  .detail h1 { font-size: 3rem; }
  .detail-meta { justify-content: flex-start; }
  .detail-actions { justify-content: flex-start; margin-top: 18px; }
  .detail-back { display: none; }
}
@media (min-width: 1024px) {
  .detail { margin: 0 calc(-1 * var(--gutter)); padding: 56px var(--gutter) 34px; }
  .detail-art { width: 232px; }
  .detail h1 { font-size: 4rem; }
}
.about { margin-top: 48px; display: grid; gap: 16px; }
.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.about-card h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 8px; }
.about-card p { color: var(--text-2); font-size: var(--fs-md); line-height: 1.65; max-width: 70ch; white-space: pre-line; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.facts div { background: var(--surface-2); border-radius: var(--r-md); padding: 12px; }
.facts b { display: block; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.facts small { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Search ---------- */
.search-box {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 5;
  padding: 8px 0 12px; background: var(--bg);
}
.search-field { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
.search-field:focus-within { border-color: var(--accent); background: var(--surface); }
.search-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: var(--fs-base); }
.search-field input::placeholder { color: var(--text-3); }
.search-field .ic { color: var(--text-3); }
@media (min-width: 1024px) { .search-box { display: none; } }
.search-group { margin-top: 24px; }
.search-group h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 10px; }
.recent-searches { display: flex; flex-wrap: wrap; gap: 8px; }
.result-top { display: grid; gap: 16px; }
@media (min-width: 900px) { .result-top { grid-template-columns: minmax(280px, 380px) 1fr; } }
.top-hit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: background .15s; position: relative; }
.top-hit:hover { background: var(--surface-2); }
.top-hit img { width: 96px; height: 96px; border-radius: var(--r-md); object-fit: cover; box-shadow: var(--shadow-2); }
.top-hit.round img { border-radius: 50%; }
.top-hit h4 { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.top-hit p { font-size: var(--fs-sm); color: var(--text-3); }
.top-hit .btn-round { position: absolute; right: 18px; bottom: 18px; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Library ---------- */
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.lib-head h1 { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -.03em; }
@media (min-width: 1024px) { .lib-head h1 { font-size: var(--fs-3xl); } }
.lib-actions { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); margin-bottom: 6px; }
.empty .empty-ic .ic { width: 28px; height: 28px; }
.empty h3 { font-size: var(--fs-lg); font-weight: 700; }
.empty p { color: var(--text-3); font-size: var(--fs-md); max-width: 40ch; }
.empty .btn { margin-top: 8px; }

/* ---------- Settings ---------- */
.settings { max-width: 760px; }
.set-group { margin-top: 34px; }
.set-group > h2 { font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); margin: 0 4px 8px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; min-height: 72px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .set-ic { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.set-row .set-ic .ic { width: 19px; height: 19px; }
.set-text { flex: 1; min-width: 0; }
.set-text strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.set-text small { display: block; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.4; margin-top: 1px; }
a.set-row, button.set-row { width: 100%; text-align: left; transition: background .12s; }
a.set-row:hover, button.set-row:hover { background: var(--surface-2); }
.set-row .chev { color: var(--text-3); }
.set-row.danger strong, .set-row.danger .set-ic { color: var(--danger); }
.set-row-stack { flex-wrap: wrap; }
@media (max-width: 560px) { .set-row-stack .segmented { width: 100%; } .set-row-stack .segmented button { flex: 1; justify-content: center; } }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.about-app { text-align: center; padding: 34px 0 10px; color: var(--text-3); font-size: var(--fs-sm); }
.about-app .brand { justify-content: center; margin-bottom: 10px; }

/* ---------- Tasbih ---------- */
.tasbih { max-width: 560px; margin: 0 auto; text-align: center; padding-top: 6px; }
.tasbih-phrases { justify-content: flex-start; }
@media (min-width: 600px) { .tasbih-phrases { justify-content: center; flex-wrap: wrap; } }
.tasbih-ar { font-family: var(--font-ar); direction: rtl; font-size: 2.6rem; line-height: 1.5; color: var(--gold); margin-top: 22px; min-height: 1.5em; }
.tasbih-tr { color: var(--text-2); font-size: var(--fs-md); }
.tasbih-dial {
  --p: 0;
  position: relative; width: min(300px, 76vw); aspect-ratio: 1; margin: 26px auto 18px;
  border-radius: 50%; display: grid; place-items: center; user-select: none; -webkit-user-select: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1turn), var(--surface-2) 0);
  touch-action: manipulation; cursor: pointer;
  transition: transform .08s;
}
.tasbih-dial:active { transform: scale(.985); }
.tasbih-dial::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tasbih-dial .pattern-ring { position: absolute; inset: 10px; border-radius: 50%; opacity: .1; }
.tasbih-count { position: relative; font-size: 4.6rem; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.tasbih-target { position: relative; display: block; margin-top: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.tasbih-dial.done { background: conic-gradient(var(--gold) 1turn, var(--gold) 0); }
.tasbih-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tasbih-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.tasbih-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 8px; }
.tasbih-stats b { display: block; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.tasbih-stats small { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Player bar ---------- */
.player {
  position: fixed; z-index: 55;
  left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  height: 68px; padding: 0 8px 0 10px;
  display: flex; align-items: center; gap: 6px;
  border-radius: var(--r-lg);
  background: var(--surface-2); background: color-mix(in srgb, var(--surface-2) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(20px);
  backdrop-filter: saturate(1.5) blur(20px);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.player-progress-mini { position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.player-progress-mini span { display: block; height: 100%; width: 0; background: var(--text); }
.player-track { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; height: 100%; }
.player-cover { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); flex: none; }
.player-meta { min-width: 0; display: flex; flex-direction: column; }
.player-title { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-center { display: flex; align-items: center; }
.player-controls { display: flex; align-items: center; gap: 2px; }
.play-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--text); transition: transform .1s; }
.play-btn .ic { width: 26px; height: 26px; }
.play-btn:active { transform: scale(.92); }
.player .like-btn { color: var(--text-2); }
.range { -webkit-appearance: none; appearance: none; height: 16px; background: transparent; cursor: pointer; --v: 0%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--text) var(--v), var(--surface-3) var(--v)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--text); margin-top: -4.5px; opacity: 0; transition: opacity .15s; }
.range::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); opacity: 0; }
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb, .range:focus-visible::-moz-range-thumb { opacity: 1; }
.range:hover::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) var(--v), var(--surface-3) var(--v)); }
.time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; }
.time:first-child { text-align: right; }

@media (min-width: 1024px) {
  .player {
    left: 0; right: 0; bottom: 0; height: var(--player-h);
    border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: var(--bg-elev); box-shadow: none;
    padding: 0 20px; gap: 16px;
    display: grid; grid-template-columns: minmax(200px, 1fr) minmax(360px, 640px) minmax(200px, 1fr);
  }
  .player-progress-mini { display: none; }
  .player-track { flex: none; gap: 14px; }
  .player-cover { width: 56px; height: 56px; }
  .player > .player-like { position: absolute; left: 0; display: none; }
  .player-center { flex-direction: column; justify-content: center; gap: 4px; }
  .player-controls { gap: 10px; }
  .play-btn { width: 38px; height: 38px; background: var(--text); color: var(--bg); }
  .play-btn .ic { width: 18px; height: 18px; }
  .play-btn:hover { transform: scale(1.06); }
  .player-timeline { display: flex; align-items: center; gap: 10px; width: 100%; }
  .player-timeline .range { flex: 1; }
  .player-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
  .range-vol { width: 96px; }
}
.player-wrap-like { display: contents; }

/* ---------- Sheets & overlays ---------- */
.backdrop { position: fixed; inset: 0; z-index: 110; background: var(--overlay); opacity: 0; transition: opacity .25s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 115;
  max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-elev); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 8px calc(12px + var(--safe-b));
  transform: translateY(100%); transition: transform .3s var(--ease);
  box-shadow: var(--shadow-3);
}
.sheet.show { transform: none; }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head img { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; }
.sheet-head h3 { font-size: var(--fs-base); font-weight: 700; line-height: 1.25; }
.sheet-head p { font-size: var(--fs-sm); color: var(--text-3); }
.sheet-title { font-size: var(--fs-lg); font-weight: 700; padding: 4px 12px 10px; }
.menu-item { display: flex; align-items: center; gap: 16px; width: 100%; height: 54px; padding: 0 12px; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: 500; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--text-2); }
.menu-item.active { color: var(--accent-text); }
.menu-item.active .ic { color: var(--accent-text); }
.menu-item .menu-right { margin-left: auto; color: var(--text-3); font-size: var(--fs-sm); }
@media (min-width: 768px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; border-radius: var(--r-xl); padding: 10px 8px 12px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .22s var(--ease), opacity .2s; max-height: 80vh; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
}

/* Now playing (full screen) */
.np {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 22px calc(var(--safe-b) + 18px);
  color: #fff; overflow: hidden; isolation: isolate;
  background: #0a1a15;
  transform: translateY(100%); transition: transform .38s var(--ease);
}
.np.show { transform: none; }
.np-bg { position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center; filter: blur(50px) saturate(1.3) brightness(.55); transform: scale(1.2); }
.np::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 14, 11, .25), rgba(5, 14, 11, .8)); }
.np-top { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.np-top .icon-btn { color: #fff; }
.np-top .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.np-from { text-align: center; font-size: var(--fs-xs); color: rgba(255, 255, 255, .7); line-height: 1.3; min-width: 0; }
.np-from b { display: block; font-size: var(--fs-sm); color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.np-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; width: 100%; max-width: 460px; margin: 0 auto; min-height: 0; }
.np-art { width: 100%; max-width: min(400px, 46dvh); aspect-ratio: 1; margin: 0 auto; border-radius: var(--r-xl); overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); background: rgba(255, 255, 255, .06); transition: transform .35s var(--ease); }
body:not(.is-playing) .np-art { transform: scale(.94); }
.np-art img { width: 100%; height: 100%; object-fit: cover; }
.np-info { display: flex; align-items: center; gap: 12px; }
.np-info > div { flex: 1; min-width: 0; }
.np-title { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: var(--fs-md); color: rgba(255, 255, 255, .72); }
.np-artist:hover { text-decoration: underline; color: #fff; }
.np-info .icon-btn { color: #fff; }
.np-info .like-btn.liked { color: #34d399; }
.np .range { width: 100%; }
.np .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fff var(--v), rgba(255, 255, 255, .22) var(--v)); }
.np .range::-moz-range-track { background: rgba(255, 255, 255, .22); }
.np .range::-moz-range-progress { background: #fff; }
.np .range::-webkit-slider-thumb { opacity: 1; background: #fff; }
.np .range::-moz-range-thumb { opacity: 1; background: #fff; }
.np-times { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; margin-top: 2px; }
.np-controls { display: flex; align-items: center; justify-content: space-between; }
.np-controls .icon-btn { color: #fff; width: 52px; height: 52px; }
.np-controls .icon-btn .ic { width: 30px; height: 30px; }
.np-controls .icon-btn.sm { width: 44px; height: 44px; color: rgba(255, 255, 255, .75); }
.np-controls .icon-btn.sm .ic { width: 22px; height: 22px; }
.np-controls .icon-btn[aria-pressed="true"] { color: #34d399; }
.np-controls .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.np-play { width: 72px; height: 72px; border-radius: 50%; background: #fff; color: #0a1a15; display: grid; place-items: center; transition: transform .12s; }
.np-play:active { transform: scale(.94); }
.np-play .ic { width: 30px; height: 30px; }
.np-extras { display: flex; justify-content: space-between; }
.np-extras button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: rgba(255, 255, 255, .75); min-width: 64px; padding: 6px; border-radius: var(--r-md); }
.np-extras button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.np-extras button.on { color: #34d399; }
.np-extras .ic { width: 21px; height: 21px; }
@media (min-width: 1024px) {
  .np { padding: 20px 40px 30px; }
  .np-body { max-width: 980px; flex-direction: row; align-items: center; gap: 60px; }
  .np-art { max-width: 440px; flex: none; width: 440px; }
  .np-panel { flex: 1; display: flex; flex-direction: column; gap: 22px; }
  .np-title { font-size: var(--fs-3xl); white-space: normal; }
}
.np-panel { display: flex; flex-direction: column; gap: 22px; }

/* Queue list inside sheet */
.queue-list .track { margin: 0; padding: 7px 10px; grid-template-columns: 44px minmax(0, 1fr) auto; }
.queue-list .track-art { width: 44px; height: 44px; }
.queue-list .track-num, .queue-list .track-cat { display: none !important; }
.queue-sub { font-size: var(--fs-sm); color: var(--text-3); padding: 12px 12px 4px; font-weight: 600; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 84px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
@media (min-width: 1024px) { .toasts { bottom: calc(var(--player-h) + 20px); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: var(--fs-md); font-weight: 500; box-shadow: var(--shadow-2); animation: toast-in .25s var(--ease); max-width: 100%; }
.toast .ic { width: 18px; height: 18px; }
.toast.error { background: #b91c1c; color: #fff; }
.toast button { margin-left: 6px; font-weight: 700; color: var(--accent); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Skeletons ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.site-foot { margin-top: 72px; padding: 30px 0 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-3); }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a:hover { color: var(--text); }

/* ---------- View transition ---------- */
.view-enter { animation: view-in .28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.top-hit > div { padding-right: 64px; }

/* ---------- Author (Elhadj Mouhamadou Moustapha NGOM) ---------- */
.author-slide { background: linear-gradient(160deg, #10342a, #071510); }
.slide-portrait { position: absolute; z-index: -2; top: 0; right: 0; bottom: 0; width: 72%; }
.slide-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; filter: grayscale(1) contrast(1.05);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%); mask-image: linear-gradient(90deg, transparent 0%, #000 42%); }
.slide-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 16, 12, .96) 18%, rgba(5, 16, 12, .35) 58%, transparent 80%); }
.author-slide::before { z-index: -3; }
.author-slide .slide-title { max-width: 14ch; }
@media (min-width: 768px) {
  .slide-portrait { width: 48%; }
  .slide-shade { background: linear-gradient(90deg, rgba(7, 21, 16, .9) 30%, transparent 70%); }
  .author-slide .slide-body { max-width: 52%; }
}
@media (min-width: 1024px) { .slide-portrait { width: 44%; right: 4%; } }


.has-lyrics { display: inline-flex; vertical-align: -2px; margin-left: 7px; color: var(--gold); }
.player-lyrics { color: var(--gold); }
@media (min-width: 1024px) { .player > .player-lyrics { display: none !important; } }
.detail-lyrics { height: 46px; }

/* ---------- Lyrics reader ---------- */
.reader { position: fixed; z-index: 104; inset: 0; display: flex; flex-direction: column; background: var(--bg-elev); transform: translateY(100%); transition: transform .32s var(--ease); }
.reader.show { transform: none; }
.reader-top { display: flex; align-items: center; gap: 4px; min-height: 62px; padding: env(safe-area-inset-top, 0px) 8px 0; border-bottom: 1px solid var(--line); }
.reader-title { flex: 1; min-width: 0; padding: 0 6px; }
.reader-title strong { display: block; font-size: var(--fs-md); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title small { display: block; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-page { font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.reader-body { position: relative; flex: 1; overflow: auto; overscroll-behavior: contain; padding: 12px; -webkit-overflow-scrolling: touch; background: var(--surface-2); touch-action: pan-x pan-y; }
.reader-pages { transition: none; will-change: auto; }
.reader-auto[aria-pressed="true"] { color: var(--accent-text); }
.reader-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: min-content; margin: 0 auto; }
.r-page { position: relative; background: #fff; border-radius: 3px; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); overflow: hidden; flex: none; }
.r-page canvas { display: block; width: 100%; height: 100%; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(16, 185, 129, .25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reader-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg-elev); }
.rb-cover { width: 46px; height: 46px; border-radius: var(--r-sm); object-fit: cover; }
.rb-meta { flex: 1; min-width: 0; }
.rb-meta strong { display: block; font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-meta small { display: block; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-play { width: 48px; height: 48px; background: var(--text); color: var(--bg); }
.rb-play .ic { width: 22px; height: 22px; }
.rb-progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--line); }
.rb-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
@media (min-width: 1024px) {
  .reader { inset: 0 0 0 auto; width: min(560px, 40vw); z-index: 58; border-left: 1px solid var(--line); box-shadow: var(--shadow-3); transform: translateX(100%); }
  body.has-player .reader { bottom: var(--player-h); }
  body.reader-open .view, body.reader-open .topbar { margin-right: min(560px, 40vw); }
  .reader-bar { display: none; }
}

/* ---------- Compact zikr rows in shelves (reciter photo + title) ---------- */
.picks {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, auto);
  grid-auto-columns: 88%; gap: 4px 18px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scroll-padding: 0 var(--gutter);
}
.picks::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .picks { grid-auto-columns: calc((100% - 18px) / 2); } }
@media (min-width: 1100px) { .picks { grid-auto-columns: calc((100% - 2 * 28px) / 3); column-gap: 28px; } }
.pick {
  scroll-snap-align: start; min-width: 0;
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 8px 4px 8px 8px; border-radius: var(--r-md); cursor: pointer; transition: background .12s;
}
.pick:hover { background: var(--surface-2); }
.pick:active { background: var(--surface-3); }
.pick-art { position: relative; width: 60px; height: 60px; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-1); }
.pick-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.pick-art .eq { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); display: none; align-items: center; justify-content: center; gap: 2px; }
.pick-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .38); color: #fff; opacity: 0; transition: opacity .15s; }
.pick-play .ic { width: 22px; height: 22px; }
.pick:hover .pick-play { opacity: 1; }
.pick.playing .pick-play { display: none; }
.pick.playing .eq { display: flex; }
.pick-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pick-title { font-size: .9375rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub:hover, .pick-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.pick.playing .pick-title { color: var(--accent-text); }
.pick-dur { font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .pick-dur { display: none; } }

/* Reciter photos: keep faces in frame, softer corners */
.track-art { border-radius: 12px; }
.track-art img, .player-cover, .np-art img, .slide-art img, .detail-art img, .resume img, .sheet-head img, .top-hit img, .rb-cover, .card-round .card-art img { object-position: 50% 22%; }

/* Collections: smaller tiles */
@media (min-width: 1024px) { .shelf:not(.shelf-round) { grid-auto-columns: calc((100% - 5 * 24px) / 6); gap: 24px; } }

/* ---- Collection banners (admin-chosen backgrounds) ---- */
.detail-bg.has-banner img { object-position: 70% 50%; }
.detail-bg.has-banner::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(5, 10, 14, .5) 50%, rgba(5, 10, 14, .1) 100%); }

/* ---- Install (PWA) ---- */
.install-card { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 10px 12px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.install-card img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-text strong { font-size: var(--fs-md); font-weight: 650; }
.install-text small { font-size: var(--fs-sm); color: var(--text-2); text-transform: none; }
.install-card .btn { flex: none; }
.install-help { padding: 8px 22px 22px; text-align: center; }
.install-help img { width: 72px; height: 72px; border-radius: 18px; margin: 4px auto 12px; box-shadow: var(--shadow-2); }
.install-help h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.install-help ol { list-style: none; text-align: left; display: grid; gap: 10px; margin-bottom: 20px; }
.install-help li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); text-transform: none; font-size: var(--fs-md); }
.install-help b { font-weight: 650; }
.ih-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ih-ic .ic { width: 20px; height: 20px; }
.tasbih-dial.press { transform: scale(.975); }
.install-text strong, .install-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install-help .btn { justify-content: center; }

/* ---- Small phones (≤ 360px) ---- */
.brand-name { white-space: nowrap; }
.tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar a { min-width: 0; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
@media (max-width: 360px) {
  .brand-sm .brand-name { font-size: 1.15rem; }
  .brand-sm .brand-mark { width: 34px; height: 34px; }
  .tabbar a { font-size: 10px; letter-spacing: -.01em; }
}

/* ---- Close the player ---- */
.player-close-m { color: var(--text-3); margin-left: 2px; }
.player-close { color: var(--text-3); }
.player-close:hover, .player-close-m:hover { color: var(--text); }
@media (min-width: 1024px) { .player-close-m { display: none !important; } }
@media (max-width: 1023.98px) { .player-close { display: none !important; } }

/* ---- Lyrics loading progress ---- */
.reader-load { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-2); font-size: var(--fs-sm); }
.reader-load .bar { width: 160px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.reader-load .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---- Hero banners (collection slide, zikr du jour): photo blended into the banner ---- */
.hero-slide { background: linear-gradient(160deg, #10342a, #071510); }
.hero-slide::before { z-index: -3; }
.hero-slide .slide-bg { z-index: -3; }
.hero-slide .slide-bg::after { display: none; }
.slide-portrait.color img { filter: saturate(.95) contrast(1.02); object-position: 50% 18%; }
.hero-slide.no-portrait .slide-shade { background: linear-gradient(0deg, rgba(5, 14, 11, .9) 12%, rgba(5, 14, 11, .3) 60%, rgba(5, 14, 11, .1)); }
.hero-slide .slide-ar { position: static; display: block; font-size: 2rem; line-height: 1.3; margin-bottom: 8px; text-align: left; }
.hero-slide .slide-title { max-width: 16ch; }
@media (min-width: 768px) {
  .hero-slide .slide-body { max-width: 52%; }
  .hero-slide.no-portrait .slide-shade { background: linear-gradient(90deg, rgba(5, 14, 11, .88) 25%, rgba(5, 14, 11, .2) 75%); }
  .hero-slide .slide-ar { font-size: 2.6rem; display: block; direction: rtl; text-align: right; width: max-content; max-width: 100%; }
}
.page-banner.has-bg::before { display: none; }
.pb-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-banner.has-bg::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,.1) 70%); }
.page-banner.has-bg .ar { color: #f6e3ae; text-shadow: 0 2px 16px rgba(0,0,0,.5); }

/* ---- Zikrs filters ---- */
.filter-btn { position: relative; gap: 8px; }
.filter-btn.on { color: var(--accent-text); }
.fbadge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; border-radius: 17px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 500; }
.fchip:not(:has(img)) { padding-left: 12px; }
.fchip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.fchip .ic:last-child { color: var(--text-3); }
.fchip:hover { border-color: var(--line-strong); }
.fclear { font-size: var(--fs-sm); font-weight: 600; color: var(--accent-text); padding: 0 6px; }

.sheet-filters { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet-filters .sheet-grip { margin: 8px auto 0; }
.filters { display: flex; flex-direction: column; min-height: 0; max-height: calc(86dvh - 16px); }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.filters-head h3 { font-size: var(--fs-lg); font-weight: 700; }
.filters-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 16px; }
.filters-body section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filters-body section:last-child { border-bottom: 0; }
.filters-body h4 { font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); margin-bottom: 10px; }
.fseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fseg label { position: relative; }
.fseg input, .fcat input, .fopt input { position: absolute; opacity: 0; pointer-events: none; }
.fseg span { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; font-size: var(--fs-sm); font-weight: 550; cursor: pointer; transition: background .15s, border-color .15s; }
.fseg input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.fseg input:focus-visible + span, .fcat input:focus-visible + .fcat-in, .fopt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fcats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fcat-in { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 74px; padding: 8px 10px; border-radius: var(--r-md); overflow: hidden; isolation: isolate; color: #fff; font-size: var(--fs-sm); font-weight: 650; background: #0f3a2e center / cover; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.fcat-in::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,.15)); }
.fcat-ar { position: absolute; top: 6px; right: 10px; left: 10px; font-family: var(--font-ar); direction: rtl; text-align: right; color: #f6e3ae; font-size: 1.05rem; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.fcat input:checked + .fcat-in { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fcat input:checked + .fcat-in::before { content: ""; position: absolute; left: 8px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.fsearch { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 8px; color: var(--text-3); }
.fsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; text-transform: none; }
.frecs { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.fopt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-md); font-weight: 500; }
.fopt[hidden] { display: none; }
.fopt:hover { background: var(--surface-2); }
.fopt img, .frec-all { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; object-position: 50% 22%; }
.frec-all { display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.fcheck { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); color: transparent; flex: none; }
.fopt:has(input:checked) { background: var(--accent-soft); }
.fopt:has(input:checked) .fcheck { background: var(--accent); border-color: var(--accent); color: #fff; }
.ftoggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 550; }
.ftoggle .switch { margin-left: auto; }
.filters-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg-elev); }
.filters-foot .btn-primary { justify-content: center; }
@media (min-width: 640px) { .fcats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fseg { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) {
  .sheet.sheet-filters { width: 560px; padding: 0; }
  .filters { max-height: 82vh; }
  .filters-foot { padding-bottom: 14px; }
}

/* ---- Reciters ---- */
.shelf.shelf-round { grid-auto-columns: 104px; }
@media (min-width: 1024px) { .shelf.shelf-round { grid-auto-columns: calc((100% - 7 * 22px) / 8); gap: 22px; } }
.card-round .card-title { font-size: var(--fs-sm); }
.rsearch { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-3); flex: 1; min-width: 200px; max-width: 360px; border: 1px solid transparent; transition: border-color .15s; }
.rsearch:focus-within { border-color: var(--line-strong); }
.rsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: var(--fs-md); text-transform: none; }
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
@media (min-width: 560px) { .rgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .rgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 20px; } }
@media (min-width: 1400px) { .rgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.rcard { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.rcard[hidden] { display: none; }
.rcard-av { width: 100%; max-width: 88px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--surface-3); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line); transition: box-shadow .2s, transform .2s; }
.rcard-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.rcard:hover .rcard-av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); transform: translateY(-2px); }
.rcard-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.avatars { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; }
.avatars::-webkit-scrollbar { display: none; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.avatar img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line-strong); transition: box-shadow .15s, transform .15s; }
.avatar:hover img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); transform: translateY(-2px); }
.avatar span { font-size: var(--fs-xs); font-weight: 550; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 1024px) { .avatars { grid-auto-columns: 96px; gap: 20px; } .avatar img { width: 84px; height: 84px; } }

.reciter-hero { margin-top: 8px; min-height: 340px; }
.reciter-hero .detail-back { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(0,0,0,.3); color: #fff; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hero-tags span { font-size: var(--fs-xs); font-weight: 600; padding: 5px 10px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.btn-icon { width: 46px; padding: 0; justify-content: center; }
.top-pick { margin-top: 22px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.tp-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 650; color: var(--gold); margin: 0 0 6px 6px; }
.top-pick .picks { display: block; margin: 0; padding: 0; overflow: visible; }
.r-toolbar .chips { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .reciter-hero { min-height: 380px; } }

/* ---- Zikr du jour: the reciter framed in a mihrab arch, the category pattern behind ---- */
.day-sec { padding-inline: 10px; }
@media (min-width: 768px) { .day-sec { padding-inline: 28px; } }
@media (min-width: 1200px) { .day-sec { padding-inline: 56px; } }
.day-card {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9; max-height: 400px; width: 100%;
  border-radius: 0; color: #fff; /* square on phones */
  background: radial-gradient(120% 140% at 85% 30%, #1b6b4d 0%, #0d3b2b 45%, #061a13 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 40px -18px rgba(0,0,0,.6);
  display: flex; align-items: center;
}
.day-card::after { /* thin gold frame */
  content: ""; position: absolute; inset: 7px; border-radius: 0; pointer-events: none; z-index: -1;
  border: 1px solid rgba(232, 200, 125, .28);
}
.day-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; z-index: -4; opacity: .55; filter: saturate(.85); transition: transform 1s var(--ease); }
.day-card:hover .day-photo { transform: scale(1.03); }
.day-pattern { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; opacity: .22; mix-blend-mode: soft-light; }
/* The photo fades into the green: fully visible on the right, dissolved under the text */
.day-fade { position: absolute; inset: 0; z-index: -2; background:
  linear-gradient(90deg, rgba(6, 30, 22, .96) 0%, rgba(6, 30, 22, .82) 38%, rgba(6, 30, 22, .25) 75%, rgba(6, 30, 22, .1) 100%),
  linear-gradient(0deg, rgba(4, 20, 14, .75) 0%, transparent 45%); }
.day-body { position: relative; z-index: 1; width: 68%; padding: 0 0 0 22px; }
.day-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #f2d48c; }
.day-kicker .ic { width: 12px; height: 12px; }
.day-title { margin-top: 6px; font-size: 1.35rem; font-weight: 780; letter-spacing: -.025em; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }
.day-by { margin-top: 4px; font-size: var(--fs-sm); color: rgba(255, 255, 255, .78); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-by a:hover, .day-title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.day-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.day-play { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #f6dfa2, #d9b25e); color: #2a1d05; box-shadow: 0 8px 20px -6px rgba(217, 178, 94, .7); transition: transform .15s; }
.day-play .ic { width: 15px; height: 15px; margin-left: 2px; }
.day-play:hover { transform: scale(1.07); }
.day-play:active { transform: scale(.95); }
.day-cat { padding: 3px 9px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
@media (min-width: 768px) {
  .day-card { aspect-ratio: 21 / 8; border-radius: 22px; }
  .day-card::after { inset: 10px; border-radius: 15px; }
  .day-body { width: 55%; padding-left: 52px; }
  .day-photo { left: auto; width: 62%; object-position: 50% 12%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
  .day-kicker { font-size: var(--fs-sm); }
  .day-title { font-size: 2.4rem; margin-top: 10px; }
  .day-by { font-size: var(--fs-md); margin-top: 8px; }
  .day-foot { margin-top: 22px; gap: 14px; }
  .day-play { width: 46px; height: 46px; }
  .day-play .ic { width: 18px; height: 18px; }
  .day-cat { font-size: var(--fs-sm); padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) { .day-photo, .day-play { transition: none; } }

/* "Avec paroles": 6 on phones and tablets, 9 on computers */
@media (max-width: 1099.98px) { .picks-cap > :nth-child(n+7) { display: none; } }

/* Zikr du jour: same buttons as the top banners */
.day-by { display: flex; align-items: center; gap: 8px; }
.day-by .day-cat { max-width: none; }
.day-actions { margin-top: 16px; flex-wrap: wrap; gap: 10px; }
.day-card .like-btn.liked { color: #ff6b81; }
@media (max-width: 767.98px) {
  .day-card { aspect-ratio: auto; min-height: 0; }
  .day-body { width: 100%; padding: 20px 18px 18px; }
  .day-title { font-size: 1.2rem; margin-top: 6px; }
  .day-by { font-size: 13px; margin-top: 3px; }
  /* Phones: round icon buttons only — white play, glass for the rest */
  .day-actions { flex-wrap: nowrap; gap: 8px; margin-top: 14px; }
  .day-actions .btn { width: 36px; height: 36px; padding: 0; justify-content: center; flex: none; }
  .day-actions .btn .lbl { display: none; }
  .day-actions .btn .ic { width: 15px; height: 15px; }
  .day-actions .day-listen { width: 40px; height: 40px; }
  .day-actions .day-listen .ic { width: 16px; height: 16px; margin-left: 2px; }
}

/* ---- Install in settings ---- */
.install-set { display: grid; grid-template-columns: 64px 1fr; gap: 14px 16px; align-items: center; padding: 18px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); border: 1px solid var(--line); }
.install-set img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-1); }
.is-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.is-text strong { font-size: var(--fs-md); font-weight: 700; }
.is-text small { font-size: var(--fs-sm); color: var(--text-2); text-transform: none; line-height: 1.45; }
.is-actions { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.is-actions .btn { justify-content: center; height: 48px; }
.is-os { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.is-os button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); }
.is-os button:hover { color: var(--text); background: var(--surface-3); }
.is-done { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 650; font-size: var(--fs-sm); }
@media (min-width: 640px) { .install-set { grid-template-columns: 64px 1fr auto; } .is-actions, .is-done { grid-column: auto; } .is-actions { min-width: 250px; } }
.ih-sub { font-size: var(--fs-sm); color: var(--text-2); margin: -8px auto 14px; max-width: 34ch; text-transform: none; }
.ih-tabs { margin-bottom: 14px; }
.install-help li em { font-style: normal; font-weight: 700; color: var(--accent-text); margin-right: 6px; }
.ih-note { font-size: var(--fs-xs); color: var(--text-3); margin: -8px 0 14px; text-transform: none; }
.rec-banner .slide-actions { margin-top: 16px; }
.rb-faces { display: flex; margin-bottom: 18px; }
.rb-faces img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 3px solid #0d3528; margin-right: -14px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
@media (min-width: 768px) {
  .rb-faces { position: absolute; right: 40px; bottom: 36px; margin: 0; }
  .rb-faces img { width: 84px; height: 84px; margin-right: -22px; border-width: 4px; }
  .rb-faces img:last-child { margin-right: 0; }
}
.nocap { text-transform: none; }
.r-toolbar { flex-direction: column; align-items: stretch; }
.r-toolbar .segmented { align-self: flex-start; }
@media (min-width: 900px) { .r-toolbar { flex-direction: row; align-items: center; } .r-toolbar .segmented { align-self: auto; } }
@media (max-width: 767.98px) { .reciter-hero { padding-top: 64px; } .reciter-hero .slide-title { font-size: 2rem; } }
@media (min-width: 900px) { .rcard-av { max-width: 104px; } }

/* Long titles: the text is cut, the lyrics icon always stays visible */
.track-title, .pick-title { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.track-title .tt, .pick-title .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-title .has-lyrics, .pick-title .has-lyrics { flex: none; margin-left: 6px; vertical-align: 0; }

/* Filter dialog: live counts, empty choices dimmed, one scroll only on phones */
.fcount { font-style: normal; margin-left: auto; padding-left: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fopt .fcount { margin-left: auto; }
.fopt .fcount + .fcheck { margin-left: 10px; }
.fcat-in .fcount { position: absolute; right: 8px; bottom: 7px; color: rgba(255,255,255,.8); }
.fcat.is-empty .fcat-in, .fopt.is-empty { opacity: .4; }
.fcat.is-empty:has(input:checked) .fcat-in, .fopt.is-empty:has(input:checked) { opacity: 1; }
@media (max-width: 767.98px) { .frecs { max-height: none; overflow: visible; } }

/* ======================= Collections ======================= */
/* Stacked reciter photos */
.faces { display: inline-flex; align-items: center; }
.faces img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 2px solid rgba(8, 28, 21, .9); margin-left: -8px; }
.faces img:first-child { margin-left: 0; }
.faces b { margin-left: 6px; font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.85); }

/* Hero (list page: newest collection; detail page: the collection) */
.coll-hero { position: relative; overflow: hidden; isolation: isolate; margin-top: 8px; border-radius: var(--r-xl); color: #fff; min-height: 300px; display: flex; align-items: flex-end; background: #0b241c; }
.coll-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.coll-hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 16, 12, .95) 0%, rgba(5, 16, 12, .55) 45%, rgba(5, 16, 12, .1) 80%), linear-gradient(90deg, rgba(5, 16, 12, .55), transparent 70%); }
.coll-hero-body { position: relative; padding: 26px 22px 24px; width: 100%; }
.coll-hero-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 8px; max-width: 18ch; text-wrap: balance; }
.coll-hero-by { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: var(--fs-sm); color: rgba(255,255,255,.85); font-weight: 550; }
.coll-dur { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 11px; background: rgba(255,255,255,.14); font-size: 12px; }
.coll-hero .slide-actions { margin-top: 18px; }
.coll-hero .detail-back { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(0,0,0,.3); color: #fff; }
.coll-detail { min-height: 340px; }
@media (max-width: 767.98px) { .coll-detail .coll-hero-body { padding-top: 70px; } }
@media (min-width: 768px) {
  .coll-hero { min-height: 360px; }
  .coll-hero-body { padding: 44px 48px; }
  .coll-hero-title { font-size: 3.2rem; }
  .coll-detail { min-height: 380px; }
}

/* Toolbar */
.coll-tools { flex-wrap: wrap; gap: 12px; }
.coll-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.coll-tabs .segmented a { display: inline-flex; align-items: center; gap: 6px; }
.coll-tabs .segmented em { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--accent); color: #fff; }

/* Cards: the collection's background, its name, its reciters */
.coll-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .coll-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.ccard { position: relative; border-radius: var(--r-lg); overflow: hidden; isolation: isolate; aspect-ratio: 16 / 9; background: #0b241c; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s; }
.ccard[hidden] { display: none; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.ccard-link { position: absolute; inset: 0; display: flex; align-items: flex-end; color: #fff; }
.ccard-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s var(--ease); }
.ccard:hover .ccard-bg { transform: scale(1.05); }
.ccard-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 16, 12, .9) 0%, rgba(5, 16, 12, .35) 50%, rgba(5, 16, 12, 0) 80%); }
.ccard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 70px 14px 16px; min-width: 0; }
.ccard-body strong { font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-play { position: absolute; right: 14px; bottom: 14px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0b1f18; box-shadow: 0 8px 20px rgba(0,0,0,.35); transition: transform .15s; }
.ccard-play .ic { width: 18px; height: 18px; margin-left: 2px; }
.ccard-play:hover { transform: scale(1.07); }
.ccard-save { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .15s, transform .15s; }
.ccard-save .ic { width: 17px; height: 17px; }
.ccard-save:hover { background: rgba(0,0,0,.45); }
.ccard-save.on, .coll-save.on { color: #ff6b81; }
@media (hover: hover) and (min-width: 768px) {
  .ccard-save { opacity: 0; } .ccard:hover .ccard-save, .ccard-save.on, .ccard-save:focus-visible { opacity: 1; }
}
.shelf.shelf-wide { grid-auto-columns: 82%; }
@media (min-width: 640px) { .shelf.shelf-wide { grid-auto-columns: calc((100% - 18px) / 2); } }
@media (min-width: 1100px) { .shelf.shelf-wide { grid-auto-columns: calc((100% - 2 * 22px) / 3); gap: 22px; } }

/* Reciters of a collection */
.coll-recs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 18px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter); }
.coll-recs::-webkit-scrollbar { display: none; }
.coll-rec { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; }
.coll-rec img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; }
.coll-rec:hover { border-color: var(--line-strong); }

/* ---- Filter bars (phones first) ---- */
.fbar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 20; margin: 18px calc(-1 * var(--gutter)) 0; padding: 10px 0; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.fbar-row { display: flex; align-items: center; gap: 8px; padding-left: var(--gutter); }
.fbar-row .chips { flex: 1; min-width: 0; margin: 0; padding-left: 0; }
.fbar-btn { flex: none; position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.fbar-btn .ic { width: 17px; height: 17px; }
.fbar-btn.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.fbar-btn .fbadge { position: absolute; top: -5px; right: -5px; }
.fbar .fchips { margin: 10px 0 0; padding: 0 var(--gutter); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.fbar .fchips::-webkit-scrollbar { display: none; }
.fbar .fchip, .fbar .fclear { flex: none; white-space: nowrap; }
.list-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.btn-icon-sq { width: 44px; padding: 0; justify-content: center; }
@media (max-width: 767.98px) { .fbar-btn .lbl { display: none; } .fbar-btn { width: 40px; padding: 0; justify-content: center; } }
@media (min-width: 1024px) { .fbar { margin-left: 0; margin-right: 0; padding-left: 0; } .fbar-row { padding-left: 0; } .fbar .fchips { padding: 0; } .fbar-row .chips { padding-right: 0; } }
/* Other pages' filter rows: comfortable on phones */
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button { flex: none; white-space: nowrap; }
.coll-tools .rsearch, .toolbar .rsearch { flex: 1 1 100%; max-width: none; }
@media (min-width: 768px) { .coll-tools .rsearch, .toolbar .rsearch { flex: 1 1 280px; max-width: 360px; } }
.search-types { margin-bottom: 18px; }
.search-types .chip em { font-style: normal; font-size: 11px; font-weight: 700; opacity: .7; margin-left: 2px; }

/* Reciter page: categories wrap on several lines, all visible, each with its count */
.r-toolbar .chips.r-cats { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 8px; width: 100%; }
.r-cats .chip { height: 36px; padding: 0 12px 0 14px; max-width: 100%; }
.r-cats .chip b { font-weight: 600; font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.r-cats .chip.active b { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
@media (max-width: 600px) { .r-cats .chip { height: 34px; font-size: 13px; padding: 0 10px 0 12px; } }

/* ---------- Fit the screen: never wider than the phone ---------- */
html, body { overflow-x: clip; width: 100%; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
.view, main, .app { max-width: 100vw; overflow-x: clip; }
.about { grid-template-columns: minmax(0, 1fr); }
.about-card, .about-card p, .about-card h3 { min-width: 0; max-width: 100%; }
p, h1, h2, h3, h4, .bio, .about-card p, .t, .tt, .r-name, .ccard h3 { overflow-wrap: anywhere; }
.grid, .rgrid, .cgrid, .shelf, .tracks, .toolbar, .fbar, .list-head, .hero, .r-hero, .coll-hero { min-width: 0; max-width: 100%; }
.toolbar > *, .fbar-row > *, .list-head > * { min-width: 0; }

/* Reciter page: one calm filter line instead of many buttons */
.r-fbar { margin: 30px 0 14px; }
.r-fbar-row { display: flex; align-items: center; gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.r-count { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sort { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.r-sort:hover { color: var(--text); background: var(--surface-2); }
.r-fbar .fchips { margin: 14px 0 0; }

/* ---------- Dark mode: main buttons are white with black text (no green buttons) ---------- */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .card-play,
[data-theme="dark"] .skip-link { background: #fff; color: #000; }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #e9ecea; color: #000; }
[data-theme="dark"] .btn-primary:disabled { background: rgba(255,255,255,.35); color: rgba(0,0,0,.6); }
[data-theme="dark"] .btn-primary .ic { color: #000; }
/* Selected choices and active filter button */
[data-theme="dark"] .fseg input:checked + span { background: #fff; border-color: #fff; color: #000; }
[data-theme="dark"] .fbar-btn.on { background: #fff; border-color: #fff; color: #000; }
[data-theme="dark"] .fcat input:checked + .fcat-in { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
[data-theme="dark"] .fcat input:checked + .fcat-in::before { background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.55); }
[data-theme="dark"] .fopt:has(input:checked) .fcheck { background: #fff; border-color: #fff; color: #000; }
/* Small count badges */
[data-theme="dark"] .fbadge,
[data-theme="dark"] .icon-btn .badge,
[data-theme="dark"] .coll-tabs .segmented em { background: #fff; color: #000; }
[data-theme="dark"] .fbar-btn.on .fbadge { background: #000; color: #fff; }
