/* Dhikr: Taʿqībāt's styles (../wird/styles.css) in plum, plus search, categories, favourites and the day picker */
:root { --accent: #7c4f93; --accent-soft: #efe4f4; }
:root[data-theme="dark"] { --accent: #c39ad8; --accent-soft: #322539; }

.items .item { padding-left: 14px; }
.ar-mini { flex: 0 1 auto; max-width: 34%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2);
  font: 500 16px/1.4 "Scheherazade New", "Noto Naskh Arabic", serif; }

.search { display: block; margin: 0 0 14px; }
.search input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink);
  font: 16px "DM Sans", sans-serif; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Category tabs: one row that scrolls sideways on a phone */
.cats { display: flex; gap: 6px; margin: 0 -16px 4px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink);
  font: 600 16px "DM Sans", sans-serif; cursor: pointer; }
.cats button:hover { border-color: var(--accent); }
.cats button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--card); }
.cat-sub { margin: 0 0 8px 2px; color: var(--ink-2); font-size: 16px; }
#panel .slot:first-child { margin-top: 12px; }

.read-acts .fav { margin-left: auto; flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.read-acts .fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.read-acts .fav.on { color: var(--accent); border-color: var(--accent); }
.read-acts .fav.on svg { fill: currentColor; }
.read-acts .fav.print + .fav { margin-left: 8px; }
.read-acts .fav.print:hover { color: var(--accent); border-color: var(--accent); }

.parts { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 6px; }
.parts a { min-width: 40px; padding: 6px 8px; text-align: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 600; }
.parts a[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--card); }
.part-name { margin: 0 0 12px; color: var(--ink-2); font-weight: 600; }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.links .guidelink { margin: 0; }

/* Saved on this device */
.keep { margin-top: 26px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.keep h2 { margin: 0 0 4px; font: 600 18px/1.2 "Noto Serif", "Fraunces", Georgia, serif; }
.keep p { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; }
.keep p b { color: var(--ink); }

/* A verse of obligatory sajdah */
.lines .sajdah { margin: 8px 0 2px; padding: 9px 12px; border-radius: 12px; background: var(--accent-soft); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink); font-size: 16px; line-height: 1.45; }
.lines .sajdah b { color: var(--accent); }

/* Bookmarks: the marked line, the Continue bar, and the button that stays at the bottom of the screen */
.lines li.marked { box-shadow: inset 4px 0 0 var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.resume { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px;
  background: var(--accent-soft); font-size: 16px; }
.resume span { font-weight: 600; margin-right: auto; }
.resume .tickall { margin: 0; }

/* Tap a line, then the button on it, to bookmark it; no zoom on a double tap anywhere (pinch zoom still works) */
html, body { touch-action: manipulation; }
.lines li { position: relative; }
.lines li.picked { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.bm-pill { position: absolute; z-index: 5; top: 6px; right: 6px; display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border: 0;
  border-radius: 999px; background: var(--accent); color: var(--card); font: 600 15px "DM Sans", sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.bm-pill svg { width: 15px; height: 15px; fill: currentColor; }
.bm-toast, .bm-ask, .bm-help { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 32px));
  border-radius: 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.bm-toast { bottom: max(16px, env(safe-area-inset-bottom)); padding: 11px 16px; font-size: 16px; font-weight: 600; text-align: center; }
.bm-ask { bottom: max(16px, env(safe-area-inset-bottom)); padding: 12px 14px; }
.bm-ask p { margin: 0 0 8px; font-size: 16px; }
.bm-ask span { display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.bm-ask .tickall { margin: 0; }
.bm-help { top: 84px; padding: 14px 16px 10px; }
.bm-help b { font: 600 17px "Noto Serif", Fraunces, Georgia, serif; }
.bm-help p { margin: 6px 0; color: var(--ink-2); font-size: 16px; }
.rd-bm { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); cursor: pointer; padding: 0; }
.rd-bm svg { width: 16px; height: 16px; fill: currentColor; }

/* A tab's groups (list within list): chips to jump to each */
.groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.groups a { padding: 5px 11px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; }
.groups a small { color: var(--ink-2); font-weight: 600; margin-left: 2px; }

/* Add to My Wird, under a text's title */
.in-wird { margin: 0 0 12px; font-size: 16px; color: var(--ink-2); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.acts .tickall { margin: 0; text-decoration: none; }
.acts .in-wird { margin: 0 4px 0 0; }

/* The library's first page: categories as large cards, a plain name with the term under it */
.catgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.catcard { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 84px; padding: 14px 40px 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.catcard:hover { border-color: var(--accent); }
.catcard b { font: 600 17px/1.25 "DM Sans", sans-serif; }
.catcard small { color: var(--ink-2); font-size: 14px; }
.catcard .n { position: absolute; top: 12px; right: 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); }   /* how many, quietly: not a badge to clear */
.cat-head h1 { margin-bottom: 0; }
.cat-head .term { margin: 2px 0 6px; color: var(--accent); font-weight: 600; }
details.keep summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.keep[open] summary { margin-bottom: 8px; }

/* Sources, folded at the foot of a text (sources.json): where it comes from, the books it is in, how ours compares; not printed */
.sources { margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sources > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--accent); }
.sources .sb { padding: 0 16px 12px; }
.sources h3 { margin: 14px 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.sources .sb > h3:first-child { margin-top: 2px; }
.sources p { margin: 0 0 8px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.sb-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sb-books li { display: grid; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.sb-t { font-size: 16px; color: var(--ink); }
.sb-t i { font-weight: 600; }
.sb-by, .sb-w { font-size: 15px; color: var(--ink-2); }
.sb-e { font-size: 13px; color: var(--ink-2); opacity: .85; }
.sb-more { margin: 4px 0 8px; }
.sb-unfound { margin: 4px 0 8px; padding-left: 20px; }
.sb-more summary { cursor: pointer; font-size: 15px; color: var(--accent); font-weight: 600; }
.sb-more p { margin-top: 6px; font-size: 15px; }
.sources .src-when { font-size: 14px; margin-top: 10px; }
@media print { .sources { display: none !important; } }
.to-sources { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
/* Back to top, at the foot of a text */
.to-top { margin: 18px 0 8px; text-align: center; }
@media print { .to-top { display: none !important; } }

/* The reader's head kept short, so About and the text come into view sooner: a smaller icon, title and buttons */
#view > .back { margin: 10px 0 2px; }
.read-head { gap: 10px; margin: 4px 0 2px; }
.read-head .ic.big { width: 36px; height: 36px; border-radius: 11px; }
.read-head .ic.big svg { width: 21px; height: 21px; }
.read-head h1 { font-size: 22px; line-height: 1.2; }
.read-acts .fav, .read-acts .fav.print { width: 44px; height: 44px; border-radius: 12px; }
.read-acts .fav svg, .read-acts .fav.print svg { width: 19px; height: 19px; }
.read-acts .fav.print + .fav { margin-left: 6px; }
.sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 2px 0 8px; }
.sub-row .meta { margin: 0; flex: 1 1 160px; }
.sub-row .acts { margin: 0; }
/* Curated lists: a numbered heading for each moment, Use as a checklist under the title */
.cl-part h2 { display: flex; align-items: center; gap: 10px; }
.cl-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 15px "DM Sans", sans-serif; }
.cl-use { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.cl-use .tickall { margin: 0; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 16px; font-size: 15px; text-decoration: none; }
.cl-use small { color: var(--ink-2); font-size: 14px; }
.items .cl-ar { display: block; font-size: 20px; margin: 4px 0 2px; }
.items small.cl-about { margin-top: 4px; }

/* The reader's top: Back, with Favourite and Print on the same line, so the title has the whole width under them */
.read-top { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; }
.read-top a.back { margin: 0 auto 0 0; }
.read-acts { display: flex; gap: 8px; }
.read-acts .fav { margin: 0 !important; }
