/* Umrah Companion — marble, kiswa black and gold thread; Madinah screens shift to the green of the dome. */
:root {
  --marble: #F4F5F2;
  --surface: #FFFFFF;
  --surface-2: #ECEDE8;
  --ink: #1B1A17;
  --ink-2: #57544B;
  --ink-3: #8A867B;
  --line: #DDDDD5;
  --kiswa: #000000;
  --gold: #A9822F;
  --gold-ink: #7A5C17;
  --gold-soft: #F1E7CF;
  --dome: #2E6B55;
  --dome-soft: #DCEBE3;
  --alert: #A63D2A;
  --alert-soft: #F6E3DE;
  --ok: #2E6B55;
  --accent: var(--gold);
  --accent-ink: var(--gold-ink);
  --accent-soft: var(--gold-soft);
  --on-ink: #F4F5F2;
  --radius-l: 22px;
  --radius-m: 14px;
  --radius-s: 9px;
  --pad: 18px;
  --tabbar-h: 66px;
  --font-ui: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Reem Kufi", "Lexend", system-ui, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Geeza Pro", serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --marble: #000000;
    --surface: #15140F;
    --surface-2: #201E18;
    --ink: #EEECE5;
    --ink-2: #B9B5AA;
    --ink-3: #847F73;
    --line: #2C2A23;
    --gold: #D2AE5E;
    --gold-ink: #E2C27A;
    --gold-soft: #2B2412;
    --dome: #5FAE8C;
    --dome-soft: #11261D;
    --alert: #E2836F;
    --alert-soft: #2E1712;
    --ok: #5FAE8C;
    --on-ink: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --marble: #000000; --surface: #15140F; --surface-2: #201E18; --ink: #EEECE5; --ink-2: #B9B5AA; --ink-3: #847F73;
  --line: #2C2A23; --gold: #D2AE5E; --gold-ink: #E2C27A; --gold-soft: #2B2412; --dome: #5FAE8C; --dome-soft: #11261D;
  --alert: #E2836F; --alert-soft: #2E1712; --ok: #5FAE8C; --on-ink: #000000; color-scheme: dark;
}
body[data-city="md"] { --accent: var(--dome); --accent-ink: var(--dome); --accent-soft: var(--dome-soft); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--marble); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
:lang(ur), .ur { font-family: var(--font-ur); line-height: 2.15; }
html[lang="ur"] body { font-size: 15.5px; }
.ar { font-family: var(--font-ar); direction: rtl; text-align: right; font-size: 25px; line-height: 2; color: var(--ink); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: fixed; inset-inline-start: 8px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: 8px; z-index: 90; transform: translateY(-160%); }
.skip:focus { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; min-height: 58px;
  background: color-mix(in srgb, var(--marble) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title { flex: 1; min-width: 0; font-family: var(--font-head); font-weight: 600; font-size: 19px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline: 6px; }
html[lang="ur"] .topbar .title { font-family: var(--font-ur); font-size: 18px; font-weight: 600; line-height: 1.9; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  cursor: pointer; color: var(--ink); flex: none;
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn svg { width: 22px; height: 22px; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.langbtn { min-width: 42px; height: 34px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; cursor: pointer; font-size: 14px; font-weight: 500; }
.langbtn .ur { line-height: 1; font-size: 15px; }
.citychip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; font-weight: 500; border: 0; cursor: pointer; }
.citychip i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding-top: 6px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); padding-left: max(var(--pad), env(safe-area-inset-left, 0px)); padding-right: max(var(--pad), env(safe-area-inset-right, 0px)); outline: none; }
.main.enter { animation: pageIn .28s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .inner { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
.tab { height: var(--tabbar-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); cursor: pointer; font-size: 11.5px; font-weight: 500; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::after { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
html[lang="ur"] .tab { font-family: var(--font-ur); font-size: 12px; line-height: 1.6; gap: 0; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: .005em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 21px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { font-family: var(--font-ur); font-weight: 600; line-height: 1.9; }
html[lang="ur"] h1 { font-size: 26px; }
html[lang="ur"] h2 { font-size: 19px; }
html[lang="ur"] h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.lead { font-size: 17px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13.5px; }
.small { font-size: 13.5px; }
.gold { color: var(--accent-ink); }
.alert-t { color: var(--alert); }

.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-head a, .sec-head button.link { font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border-radius: var(--radius-l); padding: 18px; border: 1px solid var(--line); }
.panel + .panel { margin-top: 12px; }
.panel.tight { padding: 14px; }
.panel.ink { background: var(--kiswa); color: #F4F5F2; border-color: var(--kiswa); }
.panel.ink .muted, .panel.ink .faint { color: #B9B5AA; }
.rows { background: var(--surface); border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; background: none; width: 100%; border-left: 0; border-right: 0; border-bottom: 0; text-align: start; cursor: pointer; }
.row:first-child { border-top: 0; }
.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 500; line-height: 1.35; }
.row .s { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
html[lang="ur"] .row .t { line-height: 1.9; }
html[lang="ur"] .row .s { line-height: 1.9; }
.row .end { text-align: end; flex: none; }
.row .chev { color: var(--ink-3); flex: none; width: 18px; height: 18px; }
.row.static { cursor: default; }
.row.static:active { background: none; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--alert-soft); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
.notice svg { flex: none; width: 22px; height: 22px; color: var(--alert); margin-top: 1px; }
.notice.info { background: var(--accent-soft); }
.notice.info svg { color: var(--accent-ink); }
.notice b { font-weight: 600; }
.notice .close { margin-inline-start: auto; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 24px; border: 0; background: var(--ink); color: var(--on-ink); font-weight: 500; font-size: 15.5px; cursor: pointer; text-decoration: none; transition: transform .12s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.accent { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.accent, .btn.accent.on-dark { color: #000; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 19px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
html[lang="ur"] .btn { font-family: var(--font-ur); line-height: 1.7; padding-top: 2px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 150px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
html[lang="ur"] .chip { font-family: var(--font-ur); line-height: 1.6; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 10px; min-height: 38px; font-size: 14.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
html[lang="ur"] .seg button { font-family: var(--font-ur); line-height: 1.7; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea.input { min-height: 90px; resize: vertical; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); }
.search .input { padding-inline-start: 44px; border-radius: 24px; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.stepper + .stepper { border-top: 1px solid var(--line); }
.stepper .ctrl { display: flex; align-items: center; gap: 4px; }
.stepper .ctrl button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 20px; cursor: pointer; line-height: 1; }
.stepper .ctrl output { min-width: 40px; text-align: center; font-size: 20px; font-weight: 500; }

.check { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-child { border-top: 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink-3); display: grid; place-items: center; margin-top: 1px; transition: background .15s, border-color .15s; }
.check .box svg { width: 16px; height: 16px; color: #fff; opacity: 0; transform: scale(.6); transition: .15s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; transform: none; }
.check input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.check .t { font-weight: 500; line-height: 1.4; }
.check .s { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.check.todo input:checked ~ .grow .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.check .qty { flex: none; font-size: 13.5px; color: var(--accent-ink); font-weight: 500; padding-top: 2px; }
html[lang="ur"] .check .t, html[lang="ur"] .check .s { line-height: 1.95; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.warn { background: var(--alert-soft); color: var(--alert); }
.badge.good { background: var(--dome-soft); color: var(--dome); }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); }
html[lang="ur"] .badge { font-family: var(--font-ur); line-height: 1.5; height: 28px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: end; font-weight: 500; }

/* ---------- Home dial (signature) ---------- */
.hero { display: grid; justify-items: center; text-align: center; padding: 6px 0 2px; }
.dial { width: min(78vw, 300px); aspect-ratio: 1; position: relative; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .ring { fill: none; stroke: var(--line); }
.dial .ring.prog { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.3,.7,.2,1); }
.dial .tick { stroke: var(--ink-3); stroke-width: 1.4; }
.dial .tick.on { stroke: var(--accent); stroke-width: 2.2; }
.dial .kaaba { fill: var(--kiswa); }
:root[data-theme="dark"] .dial .kaaba { fill: #000; stroke: var(--gold); stroke-width: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dial .kaaba { stroke: var(--gold); stroke-width: 1; } }
.dial .band { fill: var(--gold); }
.dial .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial .big { font-family: var(--font-head); font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.dial .cap { font-size: 14px; color: var(--ink-2); margin-top: 6px; max-width: 150px; margin-inline: auto; }
html[lang="ur"] .dial .cap { font-family: var(--font-ur); line-height: 1.9; }
.hero .greet { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.hero h1 { margin-top: 2px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 108px; padding: 14px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); text-align: start; cursor: pointer; text-decoration: none; color: inherit; }
.tile svg { width: 28px; height: 28px; color: var(--accent-ink); }
.tile .t { font-weight: 500; line-height: 1.3; }
.tile .s { font-size: 13px; color: var(--ink-2); }
html[lang="ur"] .tile .t, html[lang="ur"] .tile .s { line-height: 1.9; }
.tile:active { background: var(--surface-2); }

.prayers { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; gap: 2px; }
.prayers div { padding: 8px 0; border-radius: 10px; }
.prayers .n { font-size: 12px; color: var(--ink-2); }
html[lang="ur"] .prayers .n { font-family: var(--font-ur); line-height: 1.8; }
.prayers .v { font-weight: 500; font-size: 15px; }
.prayers .next { background: var(--accent-soft); }
.prayers .next .v { color: var(--accent-ink); }

/* ---------- Steps / timeline ---------- */
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { position: relative; padding-inline-start: 50px; padding-bottom: 22px; }
.steps li::before { content: ""; position: absolute; inset-inline-start: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps .n { position: absolute; inset-inline-start: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--accent-ink); }
.steps li.done .n { background: var(--accent); color: #fff; }
.steps a { color: inherit; text-decoration: none; display: block; }
.steps .t { font-weight: 600; font-size: 17px; line-height: 1.3; padding-top: 5px; }
.steps .s { color: var(--ink-2); font-size: 14.5px; margin-top: 3px; }
html[lang="ur"] .steps .t { line-height: 1.9; padding-top: 0; }

.dua { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.dua:first-child { border-top: 0; padding-top: 4px; }
.dua .when { font-size: 13.5px; color: var(--accent-ink); font-weight: 500; margin-bottom: 4px; }
.dua .tr { font-style: italic; color: var(--ink-2); font-size: 14.5px; margin-top: 4px; }
.dua .mean { font-size: 14.5px; margin-top: 6px; }
.prose p, .prose li { font-size: 15.5px; }
.prose ul { padding-inline-start: 20px; margin: 6px 0 12px; }
.prose li { margin-bottom: 6px; }
.prose h3 { margin: 18px 0 6px; }
html[lang="ur"] .prose p, html[lang="ur"] .prose li { line-height: 2.1; }

/* ---------- Counters ---------- */
.counter { display: grid; justify-items: center; gap: 14px; text-align: center; }
.mataf { width: min(84vw, 320px); aspect-ratio: 1; }
.mataf svg { width: 100%; height: 100%; overflow: visible; }
.mataf .track { fill: none; stroke: var(--line); stroke-width: 20; }
.mataf .seg { fill: none; stroke: var(--surface-2); stroke-width: 20; }
.mataf .seg.on { stroke: var(--accent); }
.mataf .walker { fill: var(--ink); transition: none; }
.mataf .startline { stroke: var(--gold); stroke-width: 3; stroke-dasharray: 4 5; }
.mataf .stone { fill: var(--gold); }
.mataf .kaaba { fill: #000; }
.mataf .kband { fill: var(--gold); }
.countbig { font-family: var(--font-head); font-size: 56px; font-weight: 600; line-height: 1; }
.countbig small { font-size: 22px; color: var(--ink-3); }
.tapbtn { width: 100%; min-height: 72px; border-radius: 36px; font-size: 19px; }
.saitrack { width: 100%; max-width: 360px; height: 120px; }
.saitrack svg { width: 100%; height: 100%; }
.saitrack .lane { fill: var(--surface-2); }
.saitrack .green { fill: var(--dome); opacity: .28; }
.saitrack .hill { fill: var(--ink-2); }
.saitrack .dot { fill: var(--accent); transition: cx .9s cubic-bezier(.4,.1,.2,1); }
.saitrack text { font-size: 12px; fill: var(--ink-2); font-family: var(--font-ui); }
.lapdots { display: flex; gap: 6px; justify-content: center; }
.lapdots i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.lapdots i.on { background: var(--accent); border-color: var(--accent); }

.stepnav { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 10px 0; }
.stepnav .dots { display: flex; gap: 6px; }
.stepnav .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.stepnav .dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }

/* ---------- Places ---------- */
.radar { width: 100%; aspect-ratio: 1; max-width: 380px; margin: 0 auto; display: block; }
.radar .rr { fill: none; stroke: var(--line); }
.radar .rl { font-size: 10px; fill: var(--ink-3); font-family: var(--font-ui); }
.radar .core { fill: #000; }
body[data-city="md"] .radar .core { fill: var(--dome); }
.radar .pt { fill: var(--ink-2); opacity: .75; cursor: pointer; }
.radar .pt.est { fill: none; stroke: var(--ink-2); stroke-width: 1.4; }
.radar .pt.mine { fill: var(--accent); opacity: 1; }
.radar .pt.hl { fill: var(--accent); opacity: 1; }
.radar .compass { font-size: 11px; fill: var(--ink-2); font-weight: 600; font-family: var(--font-ui); }
.distbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin: 10px 0 4px; }
.distbar .r { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); opacity: .35; }
.distbar .p { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); transform: translateX(-50%); }
.distbar .a { position: absolute; top: -6px; width: 4px; height: 20px; border-radius: 2px; background: var(--alert); transform: translateX(-50%); }
.distscale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.metric { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric > div { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px; }
.metric .v { font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1.15; }
.metric .l { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin-top: 4px; }
html[lang="ur"] .metric .l { line-height: 1.9; }
.verdict { padding: 16px; border-radius: var(--radius-m); font-size: 15.5px; line-height: 1.5; }
.verdict.ok { background: var(--dome-soft); }
.verdict.bad { background: var(--alert-soft); }
.verdict.mid { background: var(--gold-soft); }
.verdict b { font-weight: 600; }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 61; max-height: 92dvh; overflow: auto; background: var(--marble); border-radius: 24px 24px 0 0; padding: 8px var(--pad) calc(env(safe-area-inset-bottom) + 24px); animation: up .3s cubic-bezier(.2,.8,.2,1); max-width: 620px; margin: 0 auto; }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet .shead { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.sheet .shead h2 { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 20px); background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 22px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--on-ink); border-end-end-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 6px; }
.msg .src { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
html[lang="ur"] .msg { line-height: 2.05; }
.composer { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); display: flex; gap: 8px; margin-top: 14px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; }
.composer input { flex: 1; border: 0; background: transparent; padding: 0 10px; min-height: 44px; font-size: 16px; }
.composer input:focus { outline: none; }
.composer .btn { min-height: 44px; padding: 0 16px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Where am I ---------- */
.arrowdial { width: 210px; height: 210px; margin: 0 auto; position: relative; }
.arrowdial svg { width: 100%; height: 100%; }
.arrowdial .face { fill: var(--surface); stroke: var(--line); }
.arrowdial .needle { transform-origin: 105px 105px; transition: transform .35s ease-out; }
.arrowdial .needle path { fill: var(--accent); }

/* ---------- Taxi card ---------- */
.taxicard { background: #fff; color: #000; border-radius: var(--radius-l); padding: 22px; text-align: center; border: 2px solid #000; }
.taxicard .arname { font-family: var(--font-ar); font-size: 34px; line-height: 1.7; direction: rtl; }
.taxicard .enname { font-size: 20px; font-weight: 600; margin-top: 4px; }

/* ---------- Onboarding ---------- */
.onb { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; gap: 18px; padding-top: 10px; }
.onb .art { display: grid; place-items: center; padding: 10px 0; }
.onb .art svg { width: 190px; height: 190px; }
.drawk path, .drawk rect, .drawk circle { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 2.2s cubic-bezier(.4,.1,.2,1) forwards; }
.drawk .d2 { animation-delay: .5s; } .drawk .d3 { animation-delay: .9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.langpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.langpick button { min-height: 76px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); font-size: 18px; cursor: pointer; }
.langpick button[aria-pressed="true"] { border: 2px solid var(--accent); }
.langpick .ur { font-size: 22px; }

.footnote { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-top: 10px; }
html[lang="ur"] .footnote { line-height: 2; }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.spacer { height: 12px; }
.center { text-align: center; }
.hstack { display: flex; align-items: center; gap: 10px; }
.hstack.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }

@media (min-width: 700px) {
  .main { padding-top: 16px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Ihram, step by step (animated figure) ---------- */
:root { --fig-skin: #E6D2BD; --fig-line: #A9896C; --fig-hair: #3A2E25; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fig-skin: #B39880; --fig-line: #E0CCB6; } }
:root[data-theme="dark"] { --fig-skin: #B39880; --fig-line: #E0CCB6; }
.ihplayer { padding: 14px; }
.ihstage { display: flex; justify-content: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ihf { width: 100%; max-width: 320px; height: auto; display: block; overflow: visible; }
.ihf .ihskin { fill: var(--fig-skin); stroke: var(--fig-line); stroke-width: 1.3; }
.ihf .ihskin .whair { fill: #2E241D; stroke: none; }
.ihf .hair, .ihf .beard { fill: var(--fig-hair); }
.ihf .ground { fill: var(--ink); opacity: .07; }
.ihf .cloth { fill: url(#ihTerry); stroke: #8E897C; stroke-width: 1.3; }
.ihf .fold { fill: none; stroke: #8E897C; stroke-width: 1.2; stroke-linecap: round; }
.ihf .kamz { fill: #C7D2DA; stroke: #7F8F9B; stroke-width: 1.2; }
.ihf .kseam { fill: none; stroke: rgba(0, 0, 0, .2); }
.ihf .cap { fill: #FBFBF8; stroke: #9A958A; }
.ihf .drops path { fill: #5AA9E6; animation: ihdrop 1.6s ease-in infinite; }
.ihf .nobg { fill: var(--alert-soft); stroke: var(--alert); stroke-width: 2; }
.ihf .noicon { fill: none; stroke: var(--alert); stroke-width: 2; stroke-linejoin: round; }
.ihf .nogap { stroke: var(--alert); stroke-width: 2; }
.ihf .noslash { stroke: var(--alert); stroke-width: 3; stroke-linecap: round; }
.ihf .meas path { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ihf .meas text, .ihf .instl { fill: var(--accent-ink); font: 600 9px var(--font-ui); }
.ihf .beltc { fill: var(--gold); }
.ihf .buckle { fill: #E3C676; stroke: #7A5C17; }
.ihf .pouch { fill: #8A6A23; }
.ihf .zip { stroke: #E3C676; stroke-width: 1.2; }
.ihf .sole { fill: #6B4F3A; }
.ihf .strap { fill: none; stroke: #6B4F3A; stroke-width: 3; stroke-linecap: round; }
.ihf .inset { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.ihf .bone { fill: var(--ok); }
.ihf .bone.pulse, .ihf .shl, .ihf .wfr, .ihf .whd { fill: none; stroke: var(--ok); stroke-width: 2.5; }
.ihf .pulse { animation: ihpulse 1.4s ease-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.ihf .bub { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.ihf .bubar { fill: var(--ink); font: 700 12px var(--font-ar); }
.ihf .bubtx { fill: var(--ink-2); font: 500 7.5px var(--font-ui); }
.ihf .arrow { stroke: var(--accent); stroke-width: 2.5; }
.ihf .arrowhead { fill: var(--accent); }
.ihf .kab .spin { transform-box: view-box; transform-origin: 36px 36px; animation: ihspin 6s linear infinite; }
.ihf .okb circle { fill: var(--ok); }
.ihf .okb path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ihf .wkam { fill: #E9C9D3; stroke: #A98190; stroke-width: 1.2; }
.ihf .dupatta { fill: #F4DCE4; stroke: #C59AAA; stroke-width: 1.1; }
.ihf .abaya { fill: #2F3A4C; stroke: #1E2633; stroke-width: 1.2; }
.ihf.f-wcol .abaya { animation: ihcol 4.5s ease-in-out infinite; }
.ihf .hijab { fill: #4C5E73; stroke: #33404F; stroke-width: 1.2; }
.ihf .capband { fill: none; stroke: #F2F0EA; stroke-width: 3; stroke-linecap: round; }
.ihf .visor { fill: #3A3F47; }
.ihf .veil { fill: #2F3A4C; opacity: .28; }
.ihf .shoec { fill: #5A4636; stroke: #3B2D22; }
/* pieces are hidden until the step's flag shows them; transitions animate the change */
.ihf .ih { opacity: 0; transition: opacity .55s ease, transform .8s cubic-bezier(.3, .7, .2, 1); transform-box: fill-box; transform-origin: 50% 50%; pointer-events: none; }
.ihf .kam, .ihf .wk { transform: translateY(18px); }
.ihf .izb { transform: scaleX(.3); }
.ihf .izr { transform: scaleX(.06); transform-origin: 0% 50%; }
.ihf .izl { transform: scaleX(.06); transform-origin: 100% 50%; }
.ihf .roll { transform: scaleY(.1); transform-origin: 50% 0%; }
.ihf .belt { transform: scaleX(.1); }
.ihf .rida, .ihf .wab, .ihf .whj { transform: translateY(-34px); }
.ihf .ridi, .ihf .wvs { transform: translateY(-8px); }
.ihf .shoe, .ihf .wsh { transform: translateY(10px); }
.ihf .inst, .ihf .kab, .ihf .nou, .ihf .wnq, .ihf .okb { transform: scale(.5); }
.ihf .talb { transform: scale(.4); transform-origin: 0% 100%; }
.ihf.f-kam .kam, .ihf.f-wk .wk, .ihf.f-drops .drops, .ihf.f-nou .nou, .ihf.f-izr .izr, .ihf.f-izl .izl, .ihf.f-meas .meas,
.ihf.f-roll .roll, .ihf.f-belt .belt, .ihf.f-rida .rida, .ihf.f-ridi .ridi, .ihf.f-okb .okb, .ihf.f-shoe .shoe,
.ihf.f-inst .inst, .ihf.f-talb .talb, .ihf.f-kab .kab, .ihf.f-wab .wab, .ihf.f-whj .whj, .ihf.f-wvs .wvs, .ihf.f-wnq .wnq, .ihf.f-wsh .wsh { opacity: 1; transform: none; }
.ihf.f-shl .shl, .ihf.f-wfr .wfr, .ihf.f-whd .whd { opacity: 1; }
.ihf.f-izb .izb { opacity: 1; transform: scaleX(.55); }
.ihf.f-izwide .izb { transform: none; }
@keyframes ihdrop { 0% { transform: translateY(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
@keyframes ihpulse { 0% { transform: scale(.85); stroke-opacity: 1; } 100% { transform: scale(1.3); stroke-opacity: .1; } }
@keyframes ihspin { to { transform: rotate(-360deg); } }
@keyframes ihcol { 0%, 100% { fill: #2F3A4C; } 33% { fill: #5E3B3F; } 66% { fill: #4B5543; } }
@media (prefers-reduced-motion: reduce) { .ihf .ih, .ihf .ih *, .ihf .pulse, .ihf .abaya { transition: none !important; animation: none !important; } }
.ihbar { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.ihbar .iconbtn:disabled { opacity: .35; cursor: default; }
.ihdots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.ihdots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 5px; background: var(--line); cursor: pointer; transition: width .3s, background .3s; }
.ihdots button[aria-current="step"] { width: 22px; background: var(--accent); }
.ihtext { margin-top: 10px; min-height: 170px; }
.ihcount { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.ihcols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .ihcols { grid-template-columns: 1fr; } }
.ihlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ihlist li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
ul.ihlist.panel { padding: 14px 16px; }
.ihmark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.ihmark.no { background: var(--alert-soft); color: var(--alert); }
.ihmark.yes { background: var(--dome-soft); color: var(--ok); }
.ihf .whairf { fill: #2E241D; }
.main li a, .footnote a { overflow-wrap: anywhere; }

/* ---------- Fares, converter ---------- */
.rows-gap { display: grid; gap: 12px; }
.farecols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.farecols > div { background: var(--surface-2); border-radius: var(--radius-m); padding: 10px 12px; }
.farecols .v { font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.2; }
.farecols .l { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
html[lang="ur"] .farecols .l { line-height: 1.9; }
.fare .rows .row.static { border-color: var(--line); }
.cvswap { flex: none; font-size: 20px; color: var(--accent); padding-bottom: 12px; }

/* ---------- Small map and family tracker ---------- */
.mm { position: relative; overflow: hidden; background: var(--surface-2); touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--radius-l); direction: ltr; }
.mm-pane, .mm-tiles, .mm-markers { position: absolute; inset: 0; }
.mm-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; -webkit-user-drag: none; }
.mm-tile.err { visibility: hidden; }
.mm-svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.mm-svg .mm-route { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.mm-svg .mm-route.dashed { stroke-dasharray: 8 8; }
.mm-svg circle.acc { fill: rgba(47, 111, 224, .12); stroke: rgba(47, 111, 224, .4); stroke-width: 1; }
.mm-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.mm-mark > * { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.mm-mark.person span { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.mm-mark.person.stale span { opacity: .55; }
.mm-mark.person.sos span { box-shadow: 0 0 0 5px rgba(166, 61, 42, .55); animation: sospulse 1s ease-in-out infinite; }
.mm-mark.me span { width: 16px; height: 16px; border-radius: 50%; background: #2F6FE0; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(47, 111, 224, .35), 0 1px 3px rgba(0, 0, 0, .4); }
.mm-mark.place svg { width: 24px; height: 24px; padding: 5px; background: #fff; color: #7A5C17; border-radius: 9px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.mm-ctrl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mm-ctrl button, .mapbtns .iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--surface); color: var(--ink); font-size: 20px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: pointer; }
.mm-attr { position: absolute; right: 0; bottom: 0; font-size: 11px; background: rgba(255, 255, 255, .88); color: #333; padding: 2px 7px; border-top-left-radius: 7px; }
.mm-attr a { color: #333; }
.mm-off { position: absolute; left: 10px; right: 10px; bottom: 28px; background: var(--surface); color: var(--ink); padding: 10px 12px; border-radius: 12px; font-size: 13.5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.fammapwrap { position: relative; }
.fammap { height: min(58vh, 460px); }
.mapbtns { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mapbtns .iconbtn { display: grid; place-items: center; }
.mapbtns .iconbtn svg { width: 20px; height: 20px; }
.famrow { align-items: center; }
.famrow.sos { background: var(--alert-soft); }
.famdot { flex: none; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; display: grid; place-items: center; }
.famdot.me { width: 20px; height: 20px; margin: 7px; background: #2F6FE0; box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(47, 111, 224, .4); }
.famarrow { flex: none; width: 30px; height: 30px; display: grid; place-items: center; color: var(--accent); transition: transform .3s; }
.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; border: 0; background: var(--line); cursor: pointer; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
html[dir="rtl"] .switch span { left: auto; right: 3px; }
html[dir="rtl"] .switch[aria-checked="true"] span { transform: translateX(-20px); }
.btn.sosbtn { background: var(--alert); border-color: var(--alert); color: #fff; }
.sosbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 80; display: block; background: var(--alert); color: #fff; font-weight: 600; text-align: center; text-decoration: none;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); box-shadow: 0 -2px 10px rgba(0, 0, 0, .2); }
@keyframes sospulse { 50% { transform: translate(-50%, -50%) scale(1.15); } }

/* ---------- Find mode ---------- */
.finder { text-align: center; padding-top: 8px; }
.fhead { display: flex; gap: 12px; align-items: center; text-align: start; }
.fname { font-weight: 700; font-size: 20px; line-height: 1.3; }
.fdial { position: relative; width: min(80vw, 330px); aspect-ratio: 1; max-width: 100%; margin: 14px auto 0; }
.fsvg { width: 100%; height: 100%; display: block; }
.fticks line { stroke: var(--ink-3); stroke-width: 2; }
.fnorth, .farrow, .fnear circle { transform-box: view-box; transform-origin: 150px 150px; }
.fnorth { transition: transform .2s linear; }
.fnorth text { fill: var(--alert); font: 700 17px var(--font-ui); }
.farrow { transition: transform .25s ease-out, opacity .3s; }
.farrow path { fill: var(--accent); }
.fdial.nocompass .farrow path { fill: var(--ink-3); }
.fdial.wait .farrow { opacity: .2; }
.fnear circle { fill: none; stroke: var(--ok); stroke-width: 3; opacity: 0; }
.fnear .core { fill: var(--ok); stroke: none; transition: r .5s; }
.fdial.near .farrow { opacity: 0; }
.fdial.near .fnear circle { animation: fping 1.8s ease-out infinite; }
.fdial.near .fnear .r2 { animation-delay: .6s; }
.fdial.near .fnear .r3 { animation-delay: 1.2s; }
.fdial.near .fnear .core { opacity: .85; animation: none; }
@keyframes fping { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1.1); opacity: 0; } }
.fdist { font-family: var(--font-head); font-size: 44px; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.fsay { font-size: 26px; font-weight: 700; line-height: 1.35; margin-top: 2px; }
html[lang="ur"] .fsay { line-height: 1.9; }
.ftrend { font-size: 15.5px; min-height: 24px; color: var(--ink-2); margin-top: 2px; }
.ftrend.good { color: var(--ok); }
.ftrend.bad { color: var(--alert); }
.fbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
#fcompass .notice { text-align: start; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .fdial.near .fnear circle { animation: none; opacity: .4; } }
ol.bgsteps { padding-inline-start: 22px; display: grid; gap: 14px; margin: 14px 0 10px; }
ol.bgsteps li { line-height: 1.5; }
.ringov { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: var(--alert); color: #fff; animation: ringflash .5s steps(2) 12; padding: max(16px, env(safe-area-inset-left, 0px)); }
.ringbox { text-align: center; max-width: 360px; }
.ringbig { font-size: 30px; font-weight: 800; line-height: 1.3; }
html[lang="ur"] .ringbig { line-height: 1.9; }
.ringbox p { font-size: 18px; margin: 12px 0 18px; }
.ringbox .btn { background: #fff; color: #000; border-color: #fff; }
@keyframes ringflash { 50% { background: #000; } }
