/* SeeQuran tools: Qibla, Zakat, 99 Names, Tasbeeh (loaded only on pages that use them). */
.sq-tool { box-sizing: border-box; line-height: normal; }
.sq-tool *, .sq-tool *::before, .sq-tool *::after { box-sizing: border-box; }
.sq-tool p { margin: 0; }
.sq-tool [hidden] { display: none !important; }
.sq-tool button { font: inherit; cursor: pointer; }
.sq-tool :focus-visible { outline: 2px solid var(--sq-gold); outline-offset: 2px; }
.sq-btn-teal, .sq-btn-outline { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.sq-btn-teal { border: 0; background: var(--sq-teal); color: #fff; }
.sq-btn-teal:hover { background: var(--sq-teal-light); }
.sq-btn-outline { border: 1px solid var(--sq-line-2); background: #fff; color: var(--sq-teal); }
.sq-btn-outline:hover { border-color: var(--sq-gold); background: var(--sq-cream); }
.sq-tool-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.sq-tool-table caption { caption-side: top; text-align: left; padding: 0 0 12px; font-family: var(--sq-serif); font-size: 26px; font-weight: 700; color: var(--sq-teal); }
.sq-tool-table th, .sq-tool-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--sq-line); }
.sq-tool-table thead th { font-size: 13px; color: var(--sq-muted); font-weight: 600; }
.sq-tool-table tbody th { font-weight: 600; color: var(--sq-teal); }

/* ---------- Qibla ---------- */
.sq-qibla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 40px; align-items: center; padding: 32px; border-radius: 28px; background: #fff; border: 1px solid var(--sq-line); box-shadow: var(--sq-card-shadow); }
.sq-qibla-dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.sq-qibla-dial { position: relative; width: min(320px, 78vw); aspect-ratio: 1; }
.sq-qibla-rose { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--sq-cream) 0 58%, var(--sq-sand) 58% 100%); border: 2px solid var(--sq-line-2); transform: rotate(var(--sq-heading, 0deg)); transition: transform .25s ease-out; }
.sq-qibla-rose > span { position: absolute; font-weight: 800; font-size: 15px; color: var(--sq-muted); }
.sq-qibla-n { top: 8px; left: 50%; transform: translateX(-50%); color: #B23A26 !important; }
.sq-qibla-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.sq-qibla-e { right: 10px; top: 50%; transform: translateY(-50%); }
.sq-qibla-w { left: 10px; top: 50%; transform: translateY(-50%); }
.sq-qibla-arrow { position: absolute; left: 50%; top: 50%; width: 6px; height: 34%; margin-left: -3px; transform-origin: 50% 0; transform: rotate(calc(var(--sq-qibla, 0deg) + 180deg)); border-radius: 3px; background: linear-gradient(to top, var(--sq-gold-dark), var(--sq-gold)); }
.sq-qibla-kaaba { position: absolute; left: 50%; bottom: -14px; width: 30px; height: 30px; margin-left: -15px; border-radius: 6px; background: #111; box-shadow: inset 0 7px 0 -3px var(--sq-gold); transform: rotate(calc(-1 * (var(--sq-qibla, 0deg) + 180deg + var(--sq-heading, 0deg)))); }
.sq-qibla-top { position: absolute; top: -10px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top: 12px solid var(--sq-teal); border-bottom: 0; }
.sq-qibla:not(.has-compass) .sq-qibla-top { display: none; }
.sq-qibla.is-facing .sq-qibla-rose { border-color: #2E8B57; box-shadow: 0 0 0 6px rgba(46, 139, 87, .18); }
.sq-qibla-status { min-height: 1.4em; font-weight: 700; color: var(--sq-teal); text-align: center; }
.sq-qibla.is-facing .sq-qibla-status { color: #2E8B57; }
.sq-qibla-info { display: flex; flex-direction: column; gap: 12px; }
.sq-qibla-for { font-size: 16px; color: var(--sq-muted); }
.sq-qibla-for strong { color: var(--sq-teal); }
.sq-qibla-angle { display: flex; align-items: baseline; gap: 12px; font-family: var(--sq-serif); color: var(--sq-teal); }
.sq-qibla-deg { font-size: clamp(54px, 8vw, 76px); font-weight: 700; line-height: 1; }
.sq-qibla-point { font-family: var(--sq-sans); font-size: 20px; font-weight: 800; color: var(--sq-gold-dark); }
.sq-qibla-sub { font-size: 14.5px; color: var(--sq-muted); }
.sq-qibla-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sq-qibla-city { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--sq-muted); }
.sq-qibla-city select { max-width: 280px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--sq-line-2); background: #fff; font: inherit; font-size: 15px; color: var(--sq-ink); }
.sq-qibla-table-wrap { grid-column: 1 / -1; overflow-x: auto; }

/* ---------- Zakat ---------- */
.sq-zakat { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
.sq-zakat-fields { display: flex; flex-direction: column; gap: 18px; }
.sq-zakat-group { margin: 0; padding: 20px 22px; border: 1px solid var(--sq-line); border-radius: 20px; background: #fff; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sq-zakat-group legend { padding: 0 6px; font-family: var(--sq-serif); font-size: 22px; font-weight: 700; color: var(--sq-teal); }
.sq-zakat-help { font-size: 14px; color: var(--sq-muted); }
.sq-zakat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px 16px; }
.sq-zakat label > span:first-child { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--sq-ink); line-height: 1.4; }
.sq-zakat input[type="number"], .sq-zakat select { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sq-line-2); background: var(--sq-cream); font: inherit; font-size: 16px; color: var(--sq-ink); }
.sq-zakat input[type="number"]:focus, .sq-zakat select:focus { outline: 2px solid var(--sq-gold); outline-offset: 1px; background: #fff; }
.sq-zakat-unit { display: flex; gap: 8px; }
.sq-zakat-unit select { width: auto; flex: none; }
.sq-zakat-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 12px; align-items: center; }
.sq-zakat-line > span:first-child { margin: 0 !important; }
.sq-zakat-radio { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.sq-zakat-radio input { margin-top: 4px; accent-color: var(--sq-teal); width: 18px; height: 18px; flex: none; }
.sq-zakat-result { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 24px; background: var(--sq-teal) url(../images/girih-10.svg) repeat; color: #fff; }
.admin-bar .sq-zakat-result { top: 52px; }
.sq-zakat-title { margin: 0; font-family: var(--sq-serif); font-size: 28px; color: var(--sq-gold-light); }
.sq-zakat-result dl { margin: 0; display: grid; gap: 8px; }
.sq-zakat-result dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.sq-zakat-result dt { color: var(--sq-mist); }
.sq-zakat-result dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sq-z-due { font-family: var(--sq-serif); font-size: clamp(44px, 6vw, 60px); font-weight: 700; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sq-zakat.is-due .sq-z-due { color: var(--sq-gold-light); }
.sq-z-note { font-size: 14.5px; line-height: 1.55; color: var(--sq-mist-light); }
.sq-z-reset { align-self: flex-start; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.sq-z-reset:hover { background: rgba(255, 255, 255, .1); }

/* ---------- 99 Names ---------- */
.sq-names { display: flex; flex-direction: column; gap: 22px; }
.sq-names-filter input { width: 100%; max-width: 560px; min-height: 50px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--sq-line-2); background: #fff; font: inherit; font-size: 16px; }
.sq-names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; margin: 0; padding: 0 !important; list-style: none; }
.sq-name { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--sq-line); text-align: center; }
.sq-name-n { position: absolute; top: 12px; left: 14px; font-size: 12px; font-weight: 700; color: var(--sq-gold-dark); }
.sq-name-ar { font-size: 34px; line-height: 1.6; color: var(--sq-teal); }
.sq-name-tr { font-weight: 800; font-size: 15px; color: var(--sq-ink); }
.sq-name-en { font-size: 14px; color: var(--sq-muted); }
.sq-name-ur { font-family: var(--sq-urdu); font-size: 15px; line-height: 2.1; color: var(--sq-gold-dark); }
.sq-names-empty { color: var(--sq-muted); }

/* ---------- Tasbeeh ---------- */
.sq-tasbeeh { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 32px 24px; border-radius: 28px; background: #fff; border: 1px solid var(--sq-line); box-shadow: var(--sq-card-shadow); }
.sq-tb-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sq-tb-presets button { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--sq-line-2); background: var(--sq-cream); color: var(--sq-teal); font-size: 14px; font-weight: 700; }
.sq-tb-presets button[aria-checked="true"] { background: var(--sq-teal); border-color: var(--sq-teal); color: #fff; }
.sq-tb-main { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.sq-tb-ar { font-size: clamp(32px, 5vw, 44px); line-height: 1.7; color: var(--sq-teal); }
.sq-tb-meaning { font-size: 15px; color: var(--sq-muted); min-height: 1.3em; }
.sq-tb-tap { position: relative; width: min(260px, 70vw); aspect-ratio: 1; margin: 8px 0; border: 0; border-radius: 50%; background: radial-gradient(circle at 50% 35%, var(--sq-teal-light), var(--sq-teal-deep)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 24px 48px -20px rgba(6, 42, 43, .7); touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; transition: transform .08s ease; }
.sq-tb-tap:active { transform: scale(.97); }
.sq-tb-ring { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); }
.sq-tb-ring circle { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 5; }
.sq-tb-ring .sq-tb-progress { stroke: var(--sq-gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .15s ease; }
.sq-tb-count { position: relative; font-family: var(--sq-serif); font-size: clamp(64px, 12vw, 86px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sq-tb-target { position: relative; font-size: 16px; font-weight: 700; color: var(--sq-gold-light); }
.sq-tasbeeh.is-done .sq-tb-tap { box-shadow: 0 0 0 10px rgba(201, 165, 90, .35), 0 24px 48px -20px rgba(6, 42, 43, .7); }
.sq-tb-hint { font-size: 13px; color: var(--sq-muted); }
.sq-tb-stats { display: flex; gap: 24px; font-size: 15px; color: var(--sq-muted); }
.sq-tb-stats strong { color: var(--sq-teal); font-size: 18px; margin-left: 4px; }
.sq-tb-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 16px; }
.sq-tb-vibrate { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sq-muted); }
.sq-tb-vibrate input { accent-color: var(--sq-teal); width: 18px; height: 18px; }
.sq-tb-app { font-size: 15px; color: var(--sq-muted); text-align: center; }
.sq-tb-app a { font-weight: 700; color: var(--sq-gold-dark); }

@media (max-width: 820px) {
	.sq-qibla { grid-template-columns: 1fr; padding: 24px 18px; }
	.sq-qibla-info { align-items: center; text-align: center; }
	.sq-qibla-city { align-items: center; }
	.sq-zakat { grid-template-columns: 1fr; }
	.sq-zakat-result { position: static; }
}
@media (max-width: 520px) {
	.sq-zakat-line { grid-template-columns: 1fr; gap: 6px; }
	.sq-zakat-group { padding: 16px; }
	.sq-tasbeeh { padding: 24px 14px; }
}
