/* SafarSalah styles */
:root {
  --paper: #F6F8F7; --surface: #FFFFFF; --sunk: #EDF2F1;
  --ink: #16202B; --muted: #566674; --line: #D6DFE2;
  --lapis: #1F3A5F; --lapis-soft: #E3EAF3;
  --tile: #1E8C8C; --tile-ink: #136a6a; --tile-soft: #DDF0EE;
  --saffron: #E0A526; --saffron-ink: #7d5500; --saffron-soft: #FBF0D6;
  --focus: #1E8C8C;
  --f-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-read: "Literata", Georgia, "Times New Roman", serif;
  --f-ar: "Amiri", "Traditional Arabic", serif;
  --r-s: 6px; --r-m: 12px; --r-l: 20px;
  --wrap: 1200px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0E1620; --surface: #142130; --sunk: #0B121A;
  --ink: #E6EDF2; --muted: #98A9B7; --line: #26394A;
  --lapis: #8DB2E2; --lapis-soft: #1A2B40;
  --tile: #46BDB6; --tile-ink: #6fd6cf; --tile-soft: #12302F;
  --saffron: #F0BA45; --saffron-ink: #F6CD72; --saffron-soft: #33280f;
  --focus: #6fd6cf;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--f-ui); }
img, svg { max-width: 100%; }
a { color: var(--lapis); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-300%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { transform: none; }
h1, h2, h3 { font-family: var(--f-read); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h4 { font-weight: 700; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; color: var(--tile); }
.brand b { color: var(--tile); font-weight: 800; }
.site-nav { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: var(--r-s); font-weight: 600; font-size: .95rem; }
.site-nav a:hover { background: var(--sunk); }
.site-nav a[aria-current="page"] { color: var(--tile-ink); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--sunk); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-btn { display: none; }
@media (max-width: 820px) {
  .nav-btn { display: inline-grid; margin-inline-start: auto; }
  .site-nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none; }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { padding: 12px; }
}

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 20px; font: 700 .95rem var(--f-ui); cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--lapis); border-color: var(--lapis); color: #fff; padding: 15px 28px; font-size: 1.02rem; }
:root[data-theme="dark"] .btn-primary { color: #0E1620; }
.btn-primary:hover { filter: brightness(1.1); border-color: var(--lapis); }
.btn-primary[data-busy="1"] { opacity: .75; cursor: progress; }
.btn-primary[data-busy="1"]::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-quiet { border-color: transparent; background: transparent; }

.field { display: grid; gap: 6px; margin-bottom: 16px; position: relative; }
.field > label, .field-label { font-weight: 700; font-size: .92rem; }
.hint { color: var(--muted); font-size: .86rem; margin: 0; }
input[type="text"], input[type="search"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%; font: 500 1rem var(--f-ui); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; min-height: 48px;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 60%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tile); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile) 25%, transparent); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 40px; }
[dir="rtl"] select { background-position: 14px 50%, 20px 50%; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tile); flex: none; }
.check span small { display: block; color: var(--muted); font-size: .85rem; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; }
.with-btn .icon-btn { width: 48px; height: 48px; border-radius: var(--r-s); flex: none; }
.status { font-size: .86rem; margin: 0; min-height: 1.2em; color: var(--muted); }
.status[data-kind="ok"] { color: var(--tile-ink); }
.status[data-kind="warn"] { color: var(--saffron-ink); }
.status[data-kind="busy"]::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
.error { color: #b3261e; font-weight: 600; margin: 12px 0 0; min-height: 1.2em; }
:root[data-theme="dark"] .error { color: #ffb4ab; }

.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; list-style: none; margin: 4px 0 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 12px 32px -12px rgba(15, 30, 45, .35); max-height: 320px; overflow: auto; }
.suggest li { padding: 10px 12px; border-radius: var(--r-s); cursor: pointer; display: grid; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--sunk); }
.opt-name { font-weight: 700; }
.opt-sub { font-size: .84rem; color: var(--muted); }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); flex-wrap: wrap; }
.seg label, .seg button { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span, .seg button { display: block; padding: 8px 16px; border-radius: 999px; font: 600 .9rem var(--f-ui); color: var(--muted); background: none; border: 0; cursor: pointer; }
.seg input:checked + span, .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 .86rem var(--f-ui); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--tile); background: var(--tile-soft); color: var(--tile-ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- hero ---------- */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.9rem); max-width: 22ch; margin: 0 0 18px; font-weight: 500; letter-spacing: -0.025em; }
.hero .lede { font-size: 1.15rem; max-width: 58ch; color: var(--muted); margin: 0; }
.hero-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: .92rem; }
.hero-meta span { display: inline-flex; gap: 8px; align-items: center; }
.hero-meta svg { width: 18px; height: 18px; color: var(--tile); }

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 40px; }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 8px 28px 28px; }
.step { border: 0; padding: 22px 0 8px; margin: 0; border-bottom: 1px solid var(--line); }
.step:last-of-type { border-bottom: 0; }
.step legend { display: flex; align-items: center; gap: 12px; font: 600 1.25rem var(--f-read); padding: 0; margin-bottom: 14px; float: left; width: 100%; }
.step legend + * { clear: both; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); font: 700 .85rem var(--f-ui); flex: none; }
.is-muted { opacity: .45; pointer-events: none; }
.more { border-top: 1px solid var(--line); padding: 14px 0 6px; margin-top: 4px; }
.more summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); line-height: 1; }
.more[open] summary::after { content: "–"; }
.more-body { padding-top: 8px; }
.submit-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.submit-row .hint { flex: 1; min-width: 180px; }
.calc-map { position: sticky; top: 84px; }
#map { height: min(640px, 72vh); border-radius: var(--r-l); border: 1px solid var(--line); background: var(--sunk); z-index: 1; }
.map-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 4px 0; font-size: .84rem; color: var(--muted); }
.map-legend span { display: inline-flex; gap: 8px; align-items: center; }
.lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.lg-area { background: color-mix(in srgb, var(--tile) 20%, transparent); border: 2px solid var(--tile); border-radius: 3px; }
.lg-exit { background: var(--saffron); border: 2px solid var(--ink); }
.lg-th { background: var(--paper); border: 3px solid var(--saffron); }
.lg-route { width: 22px; height: 4px; border-radius: 2px; background: var(--lapis); }
.leaflet-container { font-family: var(--f-ui); }
.map-dim .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6); }
#map:not(.map-dim) .leaflet-tile-pane { filter: saturate(.55) contrast(.95); }
@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; }
  .calc-map { position: static; }
  #map { height: 340px; }
  .calc-form { padding: 4px 18px 22px; }
}

/* ---------- results ---------- */
.result { padding: 24px 20px 48px; }
.verdict { --v: var(--tile); --v-soft: var(--tile-soft); position: relative; border-radius: var(--r-l); padding: 34px 36px; background: var(--v-soft); border: 1px solid color-mix(in srgb, var(--v) 35%, transparent); overflow: hidden; }
.verdict[data-verdict="mixed"] { --v: var(--saffron); --v-soft: var(--saffron-soft); }
.verdict[data-verdict="full"] { --v: var(--lapis); --v-soft: var(--lapis-soft); }
.verdict::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 8px; background: var(--v); }
.verdict-school { margin: 0 0 6px; font-weight: 700; color: var(--muted); font-size: .92rem; }
.verdict h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin: 0 0 10px; font-weight: 500; letter-spacing: -0.02em; }
.verdict p { margin: 0; max-width: 64ch; font-size: 1.08rem; }
.route-note { color: var(--muted); font-size: .9rem; margin-top: 10px !important; }
.verdict-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.verdict-actions .btn { background: var(--surface); }

.ruler { margin: 34px 0 10px; padding: 0 4px; }
.ruler-track { position: relative; height: 14px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); margin: 64px 0 10px; }
.ruler-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: linear-gradient(90deg, var(--lapis), color-mix(in srgb, var(--lapis) 70%, var(--tile))); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.ruler-tick { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-inline-start: -1px; background: var(--muted); opacity: .45; cursor: help; }
.ruler-tick::after { content: ""; position: absolute; inset: -8px -8px; }
.ruler-mark, .ruler-pin { position: absolute; top: 0; bottom: 0; }
.ruler-mark::before { content: ""; position: absolute; top: -12px; bottom: -12px; inset-inline-start: -2px; width: 4px; border-radius: 2px; background: var(--saffron); }
.ruler-half::before { background: repeating-linear-gradient(var(--saffron) 0 4px, transparent 4px 7px); }
.ruler-mark span, .ruler-pin span { position: absolute; white-space: nowrap; font-size: .82rem; font-weight: 700; transform: translateX(-50%); }
.ruler-mark span { top: 26px; color: var(--saffron-ink); }
.ruler-half span { top: 26px; font-weight: 600; }
.ruler-pin::before { content: ""; position: absolute; top: -34px; inset-inline-start: -9px; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--lapis); border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ruler-pin span { top: -62px; color: var(--ink); background: var(--surface); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.is-right > span { transform: translateX(calc(-100% + 12px)); }
.is-left > span { transform: translateX(-12px); }
.ruler-ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: 36px; }
.ruler-key { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

.phases { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: ph; }
.phase { position: relative; padding-inline-end: 18px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; }
.phase::before { content: ""; position: absolute; top: 9px; inset-inline-start: 22px; inset-inline-end: 0; height: 2px; background: var(--line); }
.phase:last-child::before { display: none; }
.phase-dot { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--muted); background: var(--surface); position: relative; z-index: 1; }
.phase[data-st="qasr"] .phase-dot { border-color: var(--tile); background: var(--tile); }
.phase[data-st="full"] .phase-dot { border-color: var(--lapis); }
.phase h4 { margin: 0 0 4px; font-size: 1rem; }
.phase p { margin: 0; color: var(--muted); font-size: .88rem; }
.phase-tag { justify-self: start; font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--lapis-soft); color: var(--lapis); }
.phase[data-st="qasr"] .phase-tag { background: var(--tile-soft); color: var(--tile-ink); }
.phase[data-st="na"] .phase-tag { background: var(--sunk); color: var(--muted); }
@media (max-width: 760px) {
  .phases { grid-template-columns: 1fr; gap: 18px; }
  .phase { grid-template-columns: 20px 1fr; grid-template-rows: auto auto; padding: 0; column-gap: 14px; }
  .phase::before { top: 22px; bottom: -18px; inset-inline-start: 9px; inset-inline-end: auto; width: 2px; height: auto; }
  .phase-tag { grid-column: 2; }
}

.result-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; margin: 8px 0 24px; }
@media (max-width: 860px) { .result-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px 24px; }
.panel h3 { margin: 0 0 12px; font-size: 1.25rem; }
.rakat { width: 100%; border-collapse: collapse; font-size: 1rem; }
.rakat th, .rakat td { text-align: start; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.rakat thead th { font-size: .82rem; color: var(--muted); font-weight: 700; }
.rakat td { font-variant-numeric: tabular-nums; font-weight: 600; }
.rakat td:last-child { font-size: 1.15rem; }
.rakat tr.is-short td:last-child { color: var(--tile-ink); }
.rakat tr.is-short td:nth-child(2) { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.reasons { margin: 0; padding-inline-start: 20px; }
.reasons li { margin-bottom: 10px; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); overflow: hidden; }
.rules > div { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.rules > div:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.rules h4 { margin: 0 0 6px; font-size: .95rem; }
.rules p, .rules ul { margin: 0; color: var(--muted); font-size: .95rem; }
.rules ul { padding-inline-start: 18px; }
.rules .wide { grid-column: 1 / -1; border-inline-end: 0 !important; border-bottom: 0; }
@media (max-width: 700px) { .rules { grid-template-columns: 1fr; } .rules > div { border-inline-end: 0 !important; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; min-width: 620px; }
.compare th, .compare td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: .82rem; color: var(--muted); background: var(--sunk); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tr[aria-current="true"] { background: var(--tile-soft); }
.compare td[data-st="qasr"] { color: var(--tile-ink); font-weight: 700; }
.compare td[data-st="full"] { color: var(--muted); }
.cmp-group { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }
.linklike { background: none; border: 0; padding: 0; font: 700 .95rem var(--f-ui); color: var(--ink); cursor: pointer; text-align: start; }
.linklike:hover { color: var(--tile-ink); text-decoration: underline; }
.section-h { font-size: 1.6rem; margin: 40px 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 18px; max-width: 64ch; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 80; }

/* ---------- home sections ---------- */
.band { padding: 56px 0; border-top: 1px solid var(--line); }
.band h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 10px; font-weight: 500; }
.how { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.how li { border-top: 3px solid var(--ink); padding-top: 16px; }
.how .n { font: 600 2.2rem var(--f-read); color: var(--tile); display: block; line-height: 1; margin-bottom: 10px; }
.how h3 { font-family: var(--f-ui); font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.how p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; gap: 20px; } }
.recent { margin: 0 0 12px; }
.recent h2 { font-family: var(--f-ui); font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.recent ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.recent-item { text-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-m); padding: 10px 14px; cursor: pointer; color: var(--ink); font: 600 .92rem var(--f-ui); display: grid; }
.recent-item small { color: var(--muted); font-weight: 500; }
.recent-item:hover { border-color: var(--tile); }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; margin-top: 24px; }
.post-card { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 1px solid var(--line); }
.post-card:first-child { grid-column: span 2; grid-row: span 2; border-top: 3px solid var(--tile); }
.post-card:first-child h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.post-card h3 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p { margin: 0; color: var(--muted); }
.post-meta { font-size: .84rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.tag { font-size: .78rem; font-weight: 700; color: var(--tile-ink); background: var(--tile-soft); padding: 3px 10px; border-radius: 999px; }
.tag[data-g="Shia"] { color: var(--lapis); background: var(--lapis-soft); }
@media (max-width: 860px) { .posts { grid-template-columns: 1fr 1fr; } .post-card:first-child { grid-column: 1 / -1; grid-row: auto; } }
@media (max-width: 560px) { .posts { grid-template-columns: 1fr; } }

.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font: 600 1.1rem var(--f-read); padding-block: 16px; padding-inline: 0 32px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: 4px; top: 12px; font: 400 1.6rem var(--f-ui); color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 70ch; }

/* ---------- article ---------- */
.article-head { padding: 48px 0 24px; max-width: 820px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.article-head h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); margin: 0 0 16px; font-weight: 500; letter-spacing: -0.02em; }
.article-head .dek { font: 400 1.2rem/1.6 var(--f-read); color: var(--muted); margin: 0 0 18px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 280px; gap: 56px; padding-bottom: 56px; }
.aside-inner { position: sticky; top: 90px; display: grid; gap: 20px; }
.aside-cta { background: var(--lapis); color: #fff; border-radius: var(--r-m); padding: 22px; }
:root[data-theme="dark"] .aside-cta { background: var(--lapis-soft); color: var(--ink); }
.aside-cta h2 { font-size: 1.2rem; margin: 0 0 8px; font-weight: 600; }
.aside-cta p { margin: 0 0 14px; font-size: .92rem; opacity: .85; }
.aside-cta .btn { background: #fff; color: var(--lapis); border: 0; }
:root[data-theme="dark"] .aside-cta .btn { background: var(--lapis); color: #0E1620; }
.toc { font-size: .9rem; }
.toc h2 { font: 700 .9rem var(--f-ui); margin: 0 0 8px; }
.toc ol { margin: 0; padding-inline-start: 18px; color: var(--muted); }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } .aside-inner { position: static; } }

.prose { font: 400 1.125rem/1.78 var(--f-read); max-width: 68ch; }
.prose h2 { font-size: 1.7rem; margin: 2.2em 0 .6em; font-weight: 600; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.6em 0; padding-block: 4px; padding-inline: 22px 0; border-inline-start: 3px solid var(--tile); color: var(--ink); }
.prose .ar { font: 400 1.6rem/2 var(--f-ar); direction: rtl; text-align: right; margin: 0 0 .4em; }
.prose table { width: 100%; border-collapse: collapse; font: 400 .95rem/1.5 var(--f-ui); margin: 1.4em 0; }
.prose .table-wrap { margin: 1.4em 0; }
.prose .table-wrap table { margin: 0; min-width: 520px; }
.prose th, .prose td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--sunk); font-size: .85rem; }
.prose .note { font: 400 .95rem/1.6 var(--f-ui); background: var(--saffron-soft); border-radius: var(--r-m); padding: 16px 18px; margin: 1.6em 0; }
.prose .note strong { color: var(--saffron-ink); }
.sources { font: 400 .9rem/1.6 var(--f-ui); color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.4em; padding-top: 1em; }
.related { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.related h2 { font-size: 1.5rem; margin: 0; font-weight: 500; }
.page-narrow { max-width: 760px; padding-bottom: 64px; }

/* ---------- compare page ---------- */
.matrix { min-width: 900px; }
.matrix th[scope="row"] { min-width: 180px; }
.matrix td { font-size: .92rem; }

/* ---------- ads ---------- */
.ad-slot { margin: 28px auto; text-align: center; min-height: 90px; max-width: 970px; }
.ad-slot[hidden] { display: none; }
.ad-slot[data-preview="true"] { border: 2px dashed var(--line); border-radius: var(--r-m); display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.ad-slot[data-preview="true"]::before { content: "Ad slot: " attr(data-slot); }
.ad-label { font-size: .72rem; color: var(--muted); }

/* ---------- footer, consent ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--sunk); padding: 44px 0 28px; font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font: 700 .92rem var(--f-ui); color: var(--ink); margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-base { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-inline-start: auto; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; box-shadow: 0 18px 50px -16px rgba(0,0,0,.35); font-size: .92rem; }
.consent p { margin: 0 0 12px; }
@media (max-width: 520px) { .consent { left: 8px; right: 8px; bottom: 8px; padding: 14px; font-size: .86rem; } .consent .btn { padding: 8px 14px; } }
.consent .btns { display: flex; gap: 8px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .site-header, .site-footer, .calc, .hero, .band, .ad-slot, .verdict-actions, .consent, .recent, #compareSection { display: none !important; }
  .result { padding: 0; }
  body { background: #fff; color: #000; }
}

/* ---------- language switcher ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin-inline: 6px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch svg { width: 16px; height: 16px; color: var(--muted); margin-inline: 4px; }
.site-nav .lang-switch a { padding: 4px 9px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.site-nav .lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.lang-switch a[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Noto Naskh Arabic", sans-serif; }
.lang-switch a[lang="ur"] { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; font-size: .8rem; line-height: 1.9; padding-block: 0; }
.lang-switch a[lang="en"] { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
@media (max-width: 820px) { .lang-switch { align-self: flex-start; margin: 8px 12px; } }

/* ---------- RTL ---------- */
[dir="rtl"] .calc-map, [dir="rtl"] #map, [dir="rtl"] .leaflet-container { direction: ltr; }
[dir="rtl"] .ruler-mark span, [dir="rtl"] .ruler-pin span { transform: translateX(50%); }
[dir="rtl"] .is-right > span { transform: translateX(calc(100% - 12px)); }
[dir="rtl"] .is-left > span { transform: translateX(12px); }
[dir="rtl"] .ruler-fill { background: linear-gradient(270deg, var(--lapis), color-mix(in srgb, var(--lapis) 70%, var(--tile))); }
[dir="rtl"] .ruler-pin::before { border-radius: 50% 50% 0 50%; transform: rotate(45deg); }
[dir="rtl"] .rakat td, [dir="rtl"] input[type="number"], [dir="rtl"] input[type="datetime-local"] { direction: ltr; text-align: end; }
[dir="rtl"] .brand { direction: ltr; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .hero h1, [dir="rtl"] .verdict h2, [dir="rtl"] .article-head h1 { letter-spacing: 0; }

/* Arabic: IBM Plex Sans Arabic for interface, Amiri for headings and reading */
:lang(ar) {
  --f-ui: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
  --f-read: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;
}
:lang(ar) body { font-size: 1.04rem; line-height: 1.75; }
:lang(ar) .prose { font-size: 1.3rem; line-height: 1.95; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { font-weight: 700; line-height: 1.35; }
:lang(ar) .hero h1, :lang(ar) .verdict h2, :lang(ar) .article-head h1 { font-weight: 700; }

/* Urdu: Nastaliq throughout, with the extra line height the script needs */
:lang(ur) {
  --f-ui: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
  --f-read: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
}
:lang(ur) body { font-size: .98rem; line-height: 2.1; }
:lang(ur) h1, :lang(ur) h2, :lang(ur) h3, :lang(ur) h4 { line-height: 1.9; font-weight: 600; }
:lang(ur) .hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); line-height: 1.8; }
:lang(ur) .verdict h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.8; }
:lang(ur) .article-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.8; }
:lang(ur) .prose { font-size: 1.12rem; line-height: 2.35; }
:lang(ur) .prose h2 { font-size: 1.45rem; }
:lang(ur) .btn, :lang(ur) .chip, :lang(ur) .seg span, :lang(ur) .seg button, :lang(ur) .phase-tag, :lang(ur) .tag { line-height: 1.9; padding-block: 4px; }
:lang(ur) .btn-primary { padding-block: 10px; }
:lang(ur) input, :lang(ur) select { line-height: 1.9; padding-block: 6px; }
:lang(ur) .step legend { font-size: 1.15rem; }
:lang(ur) .how .n, :lang(ur) .step-n { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
:lang(ur) .suggest li, :lang(ur) .recent-item { line-height: 1.9; }
:lang(ur) .ruler-mark span, :lang(ur) .ruler-pin span { font-family: "Noto Naskh Arabic", serif; }
:lang(ur) .rakat td, :lang(ar) .rakat td { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.brand, .brand span, [dir="rtl"] .ruler-mark span b { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
[data-theme="light"] .brand b { color: #146b6b; }
