/* ---------- «وِردي»: khatma plan, memorisation, share card ---------- */

/* toolbar: six items, two-line labels allowed, a dot when something is waiting today */
.toolbar { grid-template-columns: repeat(6, 1fr); }
.toolbar button { position: relative; line-height: 1.25; text-align: center; }
.toolbar button span { display: block; max-width: 100%; }
.tb-badge { position: absolute; top: 3px; left: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: #e0a43a; border: 1.5px solid var(--green); }

.wd-lead { font-size: 16px; line-height: 1.9; color: var(--ink-2); margin: 4px 0 12px; }
.wd-seg { display: flex; width: 100%; margin-bottom: 10px; }
.wd-seg button { flex: 1; padding: 9px 6px; }
.wd-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.wd-choices > button { padding: 9px 14px; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--gold-soft); color: var(--ink-2); font-size: 14.5px; }
.wd-choices > button.on { background: var(--green); color: var(--on-green); border-color: var(--gold); }
.wd-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); }
.wd-custom .input { width: 110px; padding: 8px 10px; }
.wd-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.wd-time .input { width: 140px; text-align: center; }
.wd-time[hidden] { display: none; }
.wd-sum { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); color: var(--ink); font-size: 15.5px; line-height: 1.8; border: 1px solid var(--gold-soft); }

.wd-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--green); color: var(--on-green); border: 1px solid var(--gold); margin-bottom: 12px; }
.wd-ring-box { position: relative; width: 112px; height: 112px; flex: none; }
.wd-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.wd-ring circle { fill: none; stroke-width: 8; }
.wd-ring .bg { stroke: rgba(255, 255, 255, .14); }
.wd-ring .fg { stroke: var(--gold-2); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.wd-ring-box > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; }
.wd-ring-box b { font-size: 26px; color: var(--on-green); }
.wd-ring-box small { font-size: 11px; opacity: .85; text-align: center; padding: 0 12px; }
.wd-hero-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.5; }
.wd-hero-info small { color: var(--gold-2); font-size: 13px; }
.wd-hero-info b { font-family: "Amiri", serif; font-size: 21px; }
.wd-hero-info span { font-size: 13px; opacity: .9; }

.wd-card { padding: 14px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--gold-soft); margin-bottom: 12px; }
.wd-card.hot { border-color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold-soft); }
.wd-card.ok { background: var(--surface); }
.wd-card h3 { font-family: "Amiri", serif; font-size: 20px; color: var(--accent); margin: 0 0 6px; }
.wd-card p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.wd-card .btn.wide { margin-top: 8px; }
.wd-card .btn.ghost.wide { margin-top: 6px; }
.wd-prog { height: 8px; border-radius: 4px; background: var(--paper-3); overflow: hidden; margin: 4px 0 6px; }
.wd-prog i { display: block; height: 100%; background: var(--green-2); border-radius: 4px; transition: width .3s; }
.wd-left { font-size: 14px !important; color: var(--ink-2) !important; }
.wd-row { display: flex; flex-direction: column; gap: 8px; }
.wd-pos { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.wd-pos .input { width: 90px; text-align: center; padding: 8px; }
.wd-stop { color: var(--note) !important; margin-top: 18px !important; }
.btn:disabled { opacity: .45; }

/* the week's reading: one series (no legend), today emphasised, today's wird as a reference line */
.wd-week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 150px; padding: 0 2px 26px;
  border-bottom: 1px solid var(--line); margin-top: 4px; }
.wd-ref { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink-3); opacity: .55; pointer-events: none; }
.wd-ref em { position: absolute; left: 2px; top: -18px; font-style: normal; font-size: 11px; color: var(--ink-3); background: var(--paper); padding: 0 4px; }
.wd-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; padding: 0; }
.wd-col { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wd-col i { display: block; width: min(60%, 22px); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--green-2); opacity: .55; transition: height .3s; }
.wd-day.now .wd-col i, .wd-day.sel .wd-col i { opacity: 1; }
.wd-day.now .wd-col i { background: var(--gold); }
.wd-day small { position: absolute; bottom: -22px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.wd-day.now small { color: var(--ink); font-weight: 700; }
.wd-cap { margin: 30px 0 10px; font-size: 13px; color: var(--ink-2); text-align: center; min-height: 1.5em; }
.wd-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.wd-tiles div { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 4px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--gold-soft); line-height: 1.35; }
.wd-tiles b { font-size: 22px; color: var(--ink); }
.wd-tiles small { font-size: 11.5px; color: var(--ink-3); }

.wd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.wd-stats div { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 16px; background: var(--green); color: var(--on-green); border: 1px solid var(--gold); }
.wd-stats b { font-size: 24px; color: var(--gold-2); line-height: 1.3; white-space: nowrap; }
.wd-stats b.sm { font-size: 17px; line-height: 1.85; }
.wd-stats small { font-size: 12.5px; opacity: .9; }
.wd-surahs { display: flex; flex-direction: column; }
.wd-surah { display: grid; grid-template-columns: 6.5em 1fr auto; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); text-align: right; }
.wd-sn { font-family: "Amiri", serif; font-size: 17px; font-weight: 700; color: var(--ink); }
.wd-bar { height: 7px; border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.wd-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.wd-surah small { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

/* ---------- memorisation on the page ---------- */
.w.hid { color: transparent !important; background: var(--memo-mask, rgba(169, 133, 58, .16)); border-radius: 6px; box-shadow: inset 0 -2px 0 rgba(169, 133, 58, .28); }
.w.hid.sel { background: var(--select); }
.w.hid.playing { background: var(--play); }
.memoing .w:not(.hid) { transition: color .25s; }
.memoing .slide { padding-bottom: calc(var(--safe-bottom) + var(--memo-h, 170px)); }
.memoing.listening .slide { padding-bottom: calc(var(--safe-bottom) + var(--memo-h, 170px) + 60px); }
.memoing .player { bottom: calc(var(--safe-bottom) + var(--memo-h, 170px) - 6px); }
#app.memoing:not(.chrome-hidden) .player { bottom: calc(var(--safe-bottom) + var(--memo-h, 170px) + 58px); }
.memo-bar {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); z-index: 12;
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--gold-2); box-shadow: var(--shadow); animation: up .24s ease;
}
#app:not(.chrome-hidden) .memo-bar { bottom: calc(var(--safe-bottom) + 74px); }
.mb-top { display: flex; align-items: center; gap: 8px; }
.mb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.mb-info b { font-family: "Amiri", serif; font-size: 17px; color: var(--accent); }
.mb-info small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-x { width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.mb-x svg { width: 20px; height: 20px; }
.mb-sim { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 12px; text-align: right;
  background: rgba(224, 164, 58, .14); border: 1px solid rgba(224, 164, 58, .45); color: var(--ink); font-size: 13.5px; line-height: 1.5; }
.mb-sim[hidden] { display: none; }
.mb-sim svg { width: 20px; height: 20px; flex: none; color: #c4841c; }
.mb-sim span { flex: 1; min-width: 0; }
.mb-sim b { color: #b06d0c; }
.mb-sim em { font-style: normal; font-weight: 700; color: var(--accent); font-size: 13px; }
.mb-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mb-tools button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 12px; background: var(--paper-2); font-size: 12.5px; color: var(--ink-2); }
.mb-tools button svg { width: 21px; height: 21px; color: var(--accent); }
.mb-tools button.on { background: var(--green); color: var(--on-green); }
.mb-tools button.on svg { color: var(--gold-2); }
.mb-tools button:active { background: var(--paper-3); }
.mb-main { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border-radius: 14px;
  background: var(--green); color: var(--on-green); border: 1px solid var(--gold); font-size: 15.5px; font-weight: 700; }
.mb-main svg { width: 20px; height: 20px; color: var(--gold-2); }
.mb-rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mb-rate button { padding: 12px 8px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--gold-soft); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.mb-rate button.on { background: var(--green); color: var(--on-green); border-color: var(--gold); }

/* ---------- «واصل من حيث توقفت» ---------- */
.resume { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 84px); z-index: 14; padding: 10px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--gold-2); box-shadow: var(--shadow); animation: up .26s ease; }
.chrome-hidden .resume { bottom: calc(var(--safe-bottom) + 12px); }
.rs-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; }
.rs-head b { font-family: "Amiri", serif; font-size: 17px; color: var(--accent); }
.rs-head button { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.rs-head button svg { width: 18px; height: 18px; }
.rs-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 12px; text-align: right; }
.rs-row + .rs-row { border-top: 1px solid var(--line); }
.rs-row:active { background: var(--paper-2); }
.rs-row > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.rs-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.rs-row b { font-size: 15px; color: var(--ink); }
.rs-row small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row .rs-go { width: 18px; height: 18px; color: var(--gold-2); }

/* the day's wird at the foot of the page */
.page-foot { position: relative; }
.pf-wird { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px; border-radius: 10px; font-family: "Naskh", sans-serif; font-size: 11.5px; color: var(--gold); border: 1px solid var(--gold-soft); background: var(--paper); }
.pf-wird[hidden] { display: none; }
.pf-wird i { display: inline-block; width: 34px; height: 4px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.pf-wird i b { display: block; height: 100%; background: var(--gold); }
.pf-wird.done { color: var(--green-2); border-color: rgba(29, 90, 69, .3); }

/* ---------- «التسميع» ---------- */
.w.m-err { color: transparent !important; background: rgba(196, 60, 40, .22) !important; box-shadow: inset 0 0 0 2px rgba(196, 60, 40, .75) !important; animation: m-shake .4s ease; }
.w.m-unsure:not(.hid) { color: #c4841c !important; }
@keyframes m-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.mb-rate.three { grid-template-columns: 1fr auto 1fr; }
.mb-rate .mb-mic, .mb-mic { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 14px;
  background: #8a2f1e; color: #fff; border: 1px solid #b0503a; font-size: 15px; font-weight: 700; }
.mb-mic svg { width: 20px; height: 20px; color: #fff; }
.mb-rate button svg { width: 18px; height: 18px; vertical-align: -4px; margin-inline-end: 4px; color: var(--gold-2); }
.mb-tools.three { grid-template-columns: repeat(3, 1fr); }
.mb-tools.four { grid-template-columns: repeat(4, 1fr); }
.mb-status span { flex: 1; }
.mb-resume { flex: none; padding: 8px 16px; border-radius: 12px; background: var(--green); color: var(--on-green); border: 1px solid var(--gold); font-weight: 700; font-size: 14.5px; }
.mb-heard { font-size: 12px !important; color: var(--ink-2) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-heard:empty { display: none; }
.mb-status { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: var(--paper-2); line-height: 1.45; }
.mb-status > svg { width: 22px; height: 22px; flex: none; }
.mb-status span { display: flex; flex-direction: column; min-width: 0; }
.mb-status b { font-size: 14.5px; color: var(--ink); }
.mb-status small { font-size: 12.5px; color: var(--ink-3); }
.mb-status.err { background: rgba(196, 60, 40, .12); border: 1px solid rgba(196, 60, 40, .4); }
.mb-status.err > svg, .mb-status.err b { color: #b03a26; }
.mb-status.ok { background: rgba(29, 90, 69, .12); border: 1px solid rgba(29, 90, 69, .35); }
.mb-status.ok > svg, .mb-status.ok b { color: var(--green-2); }
.mb-wave { display: inline-flex; align-items: center; gap: 3px; height: 22px; flex: none; }
.mb-wave b { width: 4px; height: 8px; border-radius: 2px; background: #b03a26; animation: m-wave 1s ease-in-out infinite; }
.mb-wave b:nth-child(2) { animation-delay: .15s; }
.mb-wave b:nth-child(3) { animation-delay: .3s; }
@keyframes m-wave { 0%, 100% { height: 6px; } 50% { height: 20px; } }

/* ---------- share card ---------- */
.sh-preview { display: flex; align-items: center; justify-content: center; min-height: 160px; margin: 4px 0 6px; }
.sh-preview img { display: block; width: 100%; max-width: 360px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .16); }
.sh-preview.tall img { width: auto; max-width: 100%; max-height: 52vh; max-height: 52dvh; }
.sh-preview img:not([src]) { display: none; }
.sh-ayahs { display: flex; align-items: center; justify-content: space-between; }
.sh-ayahs .label { margin: 0 !important; }
.sh-step { display: flex; align-items: center; gap: 10px; }
.sh-step button { width: 38px; height: 38px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--gold-soft); font-size: 20px; color: var(--accent); }
.sh-step button:disabled { opacity: .35; }
.sh-step span { min-width: 7.5em; text-align: center; font-size: 14.5px; color: var(--ink); }
.sh-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sh-more button { padding: 11px; border-radius: 12px; background: var(--paper-2); color: var(--accent); font-size: 14.5px; border: 1px solid var(--gold-soft); }
