/* ---------- prayer times ---------- */
.pr-hero {
  display: flex; align-items: stretch; justify-content: space-between; gap: 12px; padding: 16px; margin-bottom: 10px;
  border-radius: 20px; color: var(--on-green); border: 1px solid var(--gold);
  background: radial-gradient(circle at 85% 20%, rgba(201, 169, 94, .25), transparent 55%), linear-gradient(135deg, var(--green), #155442);
}
.pr-next { display: flex; flex-direction: column; line-height: 1.3; }
.pr-next small { color: var(--gold-2); font-size: 12.5px; }
.pr-next b { font-family: "Amiri", serif; font-size: 34px; color: #f6e7bd; }
.pr-at { font-size: 18px; font-weight: 700; }
.pr-left { font-size: 13px; opacity: .85; margin-top: 2px; }
.pr-dates { display: flex; flex-direction: column; justify-content: center; text-align: left; font-size: 13px; line-height: 1.7; }
.pr-dates span { font-family: "Amiri", serif; font-size: 15px; color: #f6e7bd; }
.pr-dates small { opacity: .8; }
.pr-loc { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; background: var(--paper-2); }
.pr-loc svg { color: var(--accent); }
.pr-loc span { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.pr-loc small { color: var(--ink-3); font-size: 12px; }
.pr-loc em { font-style: normal; color: var(--accent); font-size: 13.5px; }
.pr-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.pr-row { display: grid; grid-template-columns: 1fr auto 44px; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pr-row:last-child { border-bottom: 0; }
.pr-row.next { background: var(--select); }
.pr-name { font-family: "Amiri", serif; font-size: 19px; font-weight: 700; }
.pr-time { font-size: 17px; font-weight: 700; color: var(--ink-2); }
.pr-row.next .pr-time { color: var(--accent); }
.pr-bell { width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--ink-3); }
.pr-bell.on { color: var(--accent); }
.pr-bell svg { width: 21px; height: 21px; }
.pr-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 6px; }
.pr-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 6px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--gold-soft); font-size: 14.5px; }
.pr-actions svg { color: var(--accent); width: 26px; height: 26px; flex: none; }

/* ---------- tasbih counter ---------- */
.tb-chips button { font-family: "Amiri", serif; font-size: 16px; }
.tb-text { font-family: "Amiri", serif; font-size: 26px; line-height: 1.7; color: var(--accent); text-align: center; margin: 10px 0 6px; min-height: 1.7em; }
.tb-del { font-family: "Naskh", serif; font-size: 13px; color: var(--ink-3); text-decoration: underline; vertical-align: middle; margin-inline-start: 6px; }
.tb-tap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: min(68vw, 250px); aspect-ratio: 1; margin: 6px auto 14px;
  border-radius: 50%; background: radial-gradient(circle at 50% 38%, var(--surface), var(--paper-2)); border: 1px solid var(--gold-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255, 255, 255, .5); touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.tb-tap:active { transform: scale(.97); background: var(--paper-2); }
.tb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.tb-ring circle { fill: none; stroke-width: 5; }
.tb-ring .bg { stroke: var(--paper-3); }
.tb-ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .2s; }
.tb-tap b { font-size: 64px; line-height: 1; color: var(--ink); font-weight: 700; }
.tb-tap small { margin-top: 8px; font-size: 13.5px; color: var(--ink-3); }
.tb-tools { display: flex; justify-content: center; gap: 8px; margin-bottom: 4px; }
.tb-tools button { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--gold-soft); background: var(--paper-2); color: var(--ink-2); font-size: 14px; }
.tb-tools button:disabled { opacity: .45; }
.tb-tools svg { width: 15px; height: 15px; transform: scaleX(-1); }
.tb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tb-row span { font-family: "Amiri", serif; font-size: 18px; }
.tb-row b { color: var(--accent); font-size: 17px; }
.tb-row.sum span { font-family: inherit; font-size: 15px; font-weight: 700; }
.pr-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.pr-toggle span { display: flex; flex-direction: column; font-weight: 700; }
.pr-toggle small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.pr-toggle input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--paper-3); position: relative; flex: none; transition: background .2s; }
.pr-toggle input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.pr-toggle input:checked { background: var(--green-2); }
.pr-toggle input:checked::after { transform: translateX(-20px); }
#pr-listen { margin-top: 12px; }

/* adhan banner */
.adhan-bar {
  position: absolute; left: 10px; right: 10px; top: calc(var(--safe-top) + 10px); z-index: 55;
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px;
  background: linear-gradient(135deg, var(--green), #155442); color: var(--on-green); border: 1px solid var(--gold); box-shadow: var(--shadow); animation: drop .3s ease;
}
.ab-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: center; color: var(--gold-2); flex: none; }
.ab-body { flex: 1; display: flex; flex-direction: column; }
.ab-body b { font-family: "Amiri", serif; font-size: 18px; color: #f6e7bd; }
.ab-body small { opacity: .8; }
.adhan-bar button { color: var(--on-green); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }

/* qibla */
.qibla { text-align: center; }
.q-status { font-family: "Amiri", serif; font-size: 19px; color: var(--accent); margin: 6px 0 12px; min-height: 30px; }
.dial-wrap { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 0 auto 14px; }
.dial {
  position: absolute; inset: 0; border-radius: 50%; transition: transform .15s linear, box-shadow .3s;
  background: radial-gradient(circle, var(--surface) 58%, var(--paper-2) 59%, var(--paper-2) 70%, var(--surface) 71%);
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 8px var(--paper), inset 0 0 0 9px var(--gold-2);
}
.dial.aligned { box-shadow: inset 0 0 0 8px var(--paper), inset 0 0 0 9px var(--gold-2), 0 0 0 6px rgba(29, 90, 69, .35); }
.cd { position: absolute; font-family: "Amiri", serif; font-weight: 700; font-size: 18px; color: var(--ink-2); }
.cd.n { top: 4%; left: 50%; transform: translateX(-50%); color: #b4522d; }
.cd.s { bottom: 4%; left: 50%; transform: translateX(-50%); }
.cd.e { right: 5%; top: 50%; transform: translateY(-50%); }
.cd.w { left: 5%; top: 50%; transform: translateY(-50%); }
.q-arrow { position: absolute; inset: 0; }
.q-arrow::before { content: ""; position: absolute; left: 50%; top: 18%; bottom: 50%; width: 3px; transform: translateX(-50%); background: linear-gradient(var(--gold), var(--green-2)); border-radius: 2px; }
.kaaba { position: absolute; left: 50%; top: 9%; width: 30px; height: 30px; transform: translateX(-50%); background: #1b1b1b; border-radius: 3px;
  box-shadow: inset 0 7px 0 -3px #c9a95e, 0 0 0 2px var(--gold); }
.q-top { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 12px solid var(--accent); }
.q-deg { font-size: 16px; color: var(--ink-2); margin: 0 0 12px; }

/* adhkar */
.dh-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.dh-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.dh-bar i { display: block; height: 100%; width: 0; background: var(--green-2); border-radius: 3px; transition: width .3s; }
.dhikr { position: relative; padding: 14px 14px 46px; margin-bottom: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--gold-soft);
  cursor: pointer; transition: opacity .3s, background .3s; user-select: none; -webkit-user-select: none; }
.dhikr p { margin: 0; font-family: "Amiri", serif; font-size: 20px; line-height: 2; color: var(--ink); text-align: justify; }
.dhikr .dq { color: var(--accent); }
.dh-note { font-family: "Naskh", serif; font-size: 14.5px; color: var(--ink-3); }
.dh-note.hl { color: var(--accent); background: var(--select); border-radius: 5px; padding: 0 3px; }
.dh-count { position: absolute; left: 12px; bottom: 10px; min-width: 44px; height: 30px; padding: 0 10px; border-radius: 15px;
  background: var(--green); color: var(--on-green); border: 1px solid var(--gold); font-weight: 700; }
.dh-undo { position: absolute; right: 12px; bottom: 10px; height: 30px; padding: 0 12px; border-radius: 15px; display: inline-flex; align-items: center; gap: 5px;
  background: transparent; color: var(--ink-2); border: 1px solid var(--gold-soft); font: inherit; font-size: 14px; }
.dh-undo svg { width: 15px; height: 15px; transform: scaleX(-1); }
.dh-undo[hidden] { display: none; }
.dhikr:active { background: var(--paper-2); }
.dhikr.done p { opacity: .55; }
.dhikr.done .dh-count { background: var(--green-2); }

/* ---------- qibla (precise) ---------- */
.qb { text-align: center; }
.qb-status { font-family: "Amiri", serif; font-size: 20px; color: var(--accent); min-height: 32px; margin: 2px 0 8px; transition: color .3s; }
.qb-stage { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 6px auto 6px; }
.qb-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.qb-dial { will-change: transform; }
.dl-rim { fill: var(--paper-2); stroke: var(--gold); stroke-width: 2.5; }
.dl-face { fill: var(--surface); stroke: var(--gold-2); stroke-width: 1; }
.tk { stroke: var(--ink-3); stroke-width: 1; opacity: .55; }
.tk-major { stroke: var(--ink-2); stroke-width: 2; }
.tk-num { font-size: 10px; fill: var(--ink-3); text-anchor: middle; font-family: "Naskh", sans-serif; }
.cd2 { font-family: "Amiri", serif; font-weight: 700; font-size: 20px; fill: var(--ink-2); text-anchor: middle; }
.cd2.n { fill: #b4522d; }
.qb-line { stroke: url(#qb-beam); stroke-width: 3; stroke-linecap: round; }
.qb-hub { fill: var(--green); stroke: var(--gold); stroke-width: 2; }
.qb-kaaba { filter: drop-shadow(0 0 0 rgba(201, 169, 94, 0)); transition: filter .3s; }
.qb-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 16px solid var(--accent); }
.qb-stage::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(29, 90, 69, 0); transition: box-shadow .35s; pointer-events: none; }
.qb-stage.aligned::after { box-shadow: 0 0 0 7px rgba(29, 90, 69, .35), 0 0 34px 6px rgba(201, 169, 94, .45); }
.qb-stage.aligned .qb-kaaba { filter: drop-shadow(0 0 7px rgba(240, 210, 130, .95)); }
.qb-stage.aligned .qb-pointer { border-top-color: var(--green-2); }
.qb-turn { min-height: 34px; font-size: 17px; color: var(--ink-2); margin-bottom: 8px; }
.qb-turn b { color: var(--accent); font-size: 20px; }
.qb-turn .ok { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: var(--green-2); color: #fff; font-size: 20px; }
.qb-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; text-align: right; }
.qb-info div { padding: 10px 12px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--gold-soft); display: flex; flex-direction: column; line-height: 1.5; }
.qb-info small { font-size: 12px; color: var(--ink-3); }
.qb-info b { font-size: 18px; color: var(--accent); }
.qb-info span { font-size: 11.5px; color: var(--ink-3); }
.qb-info.calibrate div:last-child { border-color: var(--note); }
.qb-info.calibrate div:last-child b { color: var(--note); }
#qb-gps { margin-top: 4px; }
/* qibla: sun, spirit level, calibration, extra cards */
.qb-sun circle { fill: #f2b632; stroke: #fff6d8; stroke-width: 1.5; }
.qb-sun line { stroke: #f2b632; stroke-width: 2.2; stroke-linecap: round; }
.qb-level-ring { fill: none; stroke: var(--gold-soft); stroke-width: 1.2; stroke-dasharray: 3 3; }
.qb-bubble { fill: rgba(180, 82, 45, .55); transition: fill .2s; }
.qb-bubble.ok { fill: rgba(29, 90, 69, .55); }
.qb-calib { display: flex; align-items: center; gap: 10px; text-align: right; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: rgba(180, 82, 45, .1); color: var(--note); font-size: 14px; }
.qb-calib .eight { font-size: 26px; line-height: 1; animation: eight 1.6s ease-in-out infinite; display: inline-block; }
@keyframes eight { 0%, 100% { transform: translateX(-4px) rotate(-12deg); } 50% { transform: translateX(4px) rotate(12deg); } }
.qb-card { text-align: right; margin: 10px 0; padding: 12px 14px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--gold-soft); }
.qb-card h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; font-family: "Amiri", serif; font-size: 18px; color: var(--accent); }
.qb-card h3 svg { color: #e0a21b; width: 22px; height: 22px; }
.qb-card h3 small { font-family: "Naskh", serif; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.qb-card p { margin: 0; font-size: 15px; line-height: 1.9; color: var(--ink); }
.qb-card p b { color: var(--accent); }
.qb-card p small { color: var(--ink-3); font-size: 12.5px; }
/* location buttons: visible progress and errors */
.btn.busy { opacity: .85; pointer-events: none; }
.btn.done { color: var(--green-2); border-color: var(--green-2); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--gold-soft); border-top-color: var(--accent); display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qb-gps-msg { text-align: right; margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(180, 82, 45, .1); color: var(--note); font-size: 14px; line-height: 1.8; }
#qb-gps { margin-top: 8px; }