/* =========================================================
   Makkah Finder — "Night sky over Mecca"
   Midnight background, gold Islamic geometry, glass panels.
   ========================================================= */
:root {
  --bg-0: #04080f;
  --bg-1: #08111d;
  --bg-2: #0d1a2a;
  --text: #f1f4f2;
  --muted: #a3b2bb;
  --faint: #6f8290;
  --line: rgba(227, 194, 122, .14);
  --line-soft: rgba(255, 255, 255, .07);
  --glass: rgba(16, 30, 46, .55);
  --glass-2: rgba(255, 255, 255, .06);
  --gold: #e3c27a;
  --gold-hi: #f6e2ab;
  --emerald: #33d6a4;
  --ok: #4be3a9;
  --warn-bg: rgba(227, 194, 122, .1);
  --warn-text: #f3dca0;
  --grad-gold: linear-gradient(135deg, #f8e6b4 0%, #e3c27a 45%, #b98a3e 100%);
  --grad-emerald: linear-gradient(135deg, #39e0ad 0%, #14917a 60%, #0b5a4c 100%);
  --glow-gold: 0 0 24px rgba(227, 194, 122, .35);
  --glow-emerald: 0 0 28px rgba(51, 214, 164, .35);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  --radius: 24px;
  --radius-sm: 14px;
  --tabbar-h: 66px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ar: "Noto Naskh Arabic", "Amiri", "Geeza Pro", "Traditional Arabic", "Arabic Typesetting", "Segoe UI", serif;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg-0); }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font: 17px/1.6 var(--font);
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
/* Fixed sky: glows + stars, then a faint geometric lattice. */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  background:
    radial-gradient(ellipse 70% 45% at 85% -5%, rgba(51, 214, 164, .16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 15%, rgba(31, 184, 201, .1), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(227, 194, 122, .12), transparent 70%),
    url("../img/stars.svg") 0 0 / 600px repeat,
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 60%, #03060b 100%);
}
body::after {
  background: url("../img/pattern.svg") center top / 80px repeat;
  opacity: .05;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; text-decoration-color: rgba(227, 194, 122, .4); }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font: 600 1.85rem/1.15 var(--font-display); letter-spacing: .005em; }
h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: .01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
::selection { background: rgba(227, 194, 122, .35); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: #1a1305; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.ar { font-family: var(--font-ar); direction: rtl; }

/* ===== Header ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(4, 8, 15, .72);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(227, 194, 122, .6), transparent); }
.topbar-in { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand:hover { color: var(--text); }
.brand span { font: 600 1.2rem var(--font-display); letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 420px) { .brand { gap: 7px; } .brand span { font-size: 1.05rem; } .brand-mark { width: 26px; height: 26px; } .topbar-in { gap: 8px; } }
.brand-mark { width: 30px; height: 30px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(227, 194, 122, .55)); }
.topnav { display: none; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line-soft); }
.topnav a { color: var(--muted); text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; transition: color .2s, background .2s; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="page"] { color: #1a1305; background: var(--grad-gold); box-shadow: var(--glow-gold); }
.loc-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 36vw;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px 8px 10px; font: 600 .92rem var(--font); cursor: pointer; min-height: 40px;
  transition: border-color .2s, box-shadow .2s;
}
.loc-btn svg { width: 18px; height: 18px; flex: none; color: var(--gold); }
.loc-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-btn:hover { border-color: var(--gold); box-shadow: var(--glow-gold); }

/* ===== Floating glass tab bar (phones) ===== */
.tabbar {
  position: fixed; left: 12px; right: 12px; z-index: 30;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: var(--tabbar-h); padding: 6px;
  background: rgba(10, 20, 33, .8);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); text-decoration: none; font-size: .72rem; font-weight: 650; letter-spacing: .02em; border-radius: 18px; transition: color .2s, background .2s; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--gold-hi); background: linear-gradient(180deg, rgba(227, 194, 122, .16), rgba(227, 194, 122, .04)); box-shadow: inset 0 0 0 1px rgba(227, 194, 122, .25); }
.tabbar a[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(227, 194, 122, .7)); }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .topbar-in { height: 70px; }
  h1 { font-size: 2.4rem; }
}

/* ===== Buttons & fields ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-2); color: var(--text);
  font: 650 1rem var(--font); letter-spacing: .01em; cursor: pointer; text-decoration: none;
  transition: transform .1s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--grad-gold); border-color: transparent; color: #1a1305; box-shadow: 0 8px 24px -8px rgba(227, 194, 122, .6); }
.btn.primary:hover { box-shadow: 0 10px 30px -6px rgba(227, 194, 122, .8); color: #1a1305; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-2); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; flex: none; transition: border-color .2s, box-shadow .2s; }
.icon-btn:hover { border-color: var(--gold); box-shadow: var(--glow-gold); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.field { display: block; margin: 0 0 14px; }
.field span { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 6px; color: var(--muted); }
select, input[type="search"] {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); font: 1rem var(--font);
}
select option { background: var(--bg-2); color: var(--text); }
select:focus, input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 194, 122, .2); }

/* ===== Glass cards ===== */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02) 40%), var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.page-head { padding: 28px 0 10px; }
.page-head h1, .prose h1 { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--gold); }
.page-head::after, .prose h1::after { content: ""; display: block; width: 200px; height: 20px; margin-top: 12px; background: url("../img/ornament.svg") left center / contain no-repeat; }
.page-head .lead { color: var(--muted); max-width: 60ch; margin: 0; }
.section { margin: 20px 0; }
.notice { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; margin: 6px 6px 10px; }

/* ===== Location prompt ===== */
.setup { text-align: center; padding: 34px 22px; }
.setup .big-icon { width: 70px; height: 70px; margin: 0 auto 14px; color: var(--gold); filter: drop-shadow(0 0 14px rgba(227, 194, 122, .5)); }
.setup h1, .setup h2 { font: 600 1.5rem var(--font-display); color: var(--gold-hi); }
.setup p { color: var(--muted); max-width: 40ch; margin-left: auto; margin-right: auto; }
.setup .btn { margin: 4px; }

/* ===== Home: arch hero with ring countdown ===== */
.home-grid { display: grid; gap: 18px; margin-top: 10px; }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1.05fr 1fr; align-items: start; } }

.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 34px 18px 26px;
  border-radius: 190px 190px var(--radius) var(--radius) / 130px 130px var(--radius) var(--radius);
  background:
    url("../img/pattern.svg") center / 64px repeat,
    linear-gradient(170deg, #0f3b3a 0%, #0a2230 55%, #07121f 100%);
  border: 1px solid rgba(227, 194, 122, .35);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .9), 0 0 50px -15px rgba(51, 214, 164, .35), inset 0 0 0 6px rgba(4, 8, 15, .35), inset 0 0 0 7px rgba(227, 194, 122, .18);
  isolation: isolate;
}
.hero::before { /* soften the lattice towards the edges */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 50% 58%, rgba(51, 214, 164, .2), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(8, 26, 36, .72) 25%, rgba(7, 18, 31, .9) 85%);
}
.bismillah { font-size: 1.45rem; line-height: 1.6; margin: 0 0 4px; color: var(--gold-hi); text-shadow: 0 0 18px rgba(227, 194, 122, .45); }
.hero-dates { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; font-size: .86rem; color: rgba(241, 244, 242, .82); margin-bottom: 4px; }
.hero-dates .hijri { color: var(--gold); font-weight: 600; }
.hero-dates .hijri::before { content: "✦"; margin-inline-end: 10px; color: rgba(227, 194, 122, .6); font-size: .7rem; vertical-align: 2px; }

.ring-wrap { position: relative; width: min(80vw, 300px); aspect-ratio: 1; margin: 8px auto 0; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: rgba(4, 8, 15, .4); stroke: rgba(255, 255, 255, .08); stroke-width: 6; }
.ring-ticks { fill: none; stroke: rgba(227, 194, 122, .4); stroke-width: 5; }
.ring-bar {
  fill: none; stroke: url(#ringGrad); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  filter: drop-shadow(0 0 6px rgba(51, 214, 164, .8));
  transition: stroke-dashoffset 1s linear;
}
.ring-center { position: absolute; inset: 14%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.next-label { text-transform: uppercase; letter-spacing: .28em; font-size: .66rem; font-weight: 700; color: var(--gold); margin: 0 0 2px; }
.next-name { font: 600 2rem/1.1 var(--font-display); margin: 0; }
.next-ar { font-size: 1.3rem; line-height: 1.4; color: var(--gold-hi); margin: 0; opacity: .9; }
.countdown {
  direction: ltr; unicode-bidi: isolate;
  font-size: 2.5rem; font-weight: 250; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.05;
  margin: 4px 0 2px; color: #fff; text-shadow: 0 0 22px rgba(51, 214, 164, .6);
}
.next-at { margin: 0; color: var(--muted); font-size: .88rem; }
@media (min-width: 400px) { .countdown { font-size: 2.8rem; } .next-name { font-size: 2.2rem; } }

/* ===== Home: prayer list ===== */
.times-card { padding: 10px; }
.times-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px; }
.times-head h2 { margin: 0; font: 600 1.2rem var(--font-display); color: var(--gold-hi); }
.prayer-list { list-style: none; margin: 0; padding: 0; }
.prayer {
  position: relative;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border-radius: 18px; min-height: 64px;
  border: 1px solid transparent; transition: background .3s, border-color .3s;
}
.prayer + .prayer { margin-top: 4px; }
.prayer + .prayer::before { content: ""; position: absolute; inset-inline: 68px 12px; top: -3px; height: 1px; background: var(--line-soft); }
.p-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(227, 194, 122, .08); color: var(--gold); border: 1px solid rgba(227, 194, 122, .2); }
.p-icon svg { width: 22px; height: 22px; }
.p-name { font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.p-name small { display: block; font-weight: 500; font-size: .8rem; color: var(--faint); margin-top: 2px; }
.p-name .ar { font-size: 1rem; color: var(--gold); font-weight: 500; margin-inline-start: 8px; opacity: .85; }
.p-time { font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: end; letter-spacing: .01em; direction: ltr; unicode-bidi: isolate; justify-self: end; }
.prayer.is-sunrise .p-name, .prayer.is-sunrise .p-time { color: var(--muted); font-weight: 500; font-size: 1rem; }
.prayer.is-sunrise .p-icon { background: transparent; border-style: dashed; }
.prayer.is-past .p-time, .prayer.is-past .p-name { opacity: .45; }
.prayer.is-past .p-icon { opacity: .5; }
.prayer.is-next {
  background: linear-gradient(100deg, rgba(51, 214, 164, .18), rgba(227, 194, 122, .08));
  border-color: rgba(51, 214, 164, .45);
  box-shadow: 0 0 30px -8px rgba(51, 214, 164, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.prayer.is-next::before, .prayer.is-next + .prayer::before { display: none; }
.prayer.is-next .p-icon { background: var(--grad-emerald); color: #fff; border-color: transparent; box-shadow: var(--glow-emerald); }
.prayer.is-next .p-time { color: var(--ok); text-shadow: 0 0 14px rgba(75, 227, 169, .5); }
.tag { display: inline-block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; padding: 3px 8px; border-radius: 99px; margin-inline-start: 8px; vertical-align: 2px; }
.tag.next { background: var(--emerald); color: #03231a; box-shadow: var(--glow-emerald); }
.tag.now { background: var(--grad-gold); color: #1a1305; }
.method-line { padding: 10px 12px 8px; margin: 6px 0 0; font-size: .84rem; color: var(--faint); border-top: 1px solid var(--line-soft); }

/* ===== Quick links ===== */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 22px 0; }
.quick a {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), var(--glass);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.quick a::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; background: url("../img/pattern.svg") center / 55px; opacity: .14; border-radius: 50%; }
.quick a:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow), var(--glow-gold); color: var(--text); }
.quick svg { width: 32px; height: 32px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(227, 194, 122, .45)); }
.quick strong { font: 600 1.1rem var(--font-display); }
.quick span { font-size: .85rem; color: var(--muted); line-height: 1.4; }

/* ===== Qibla ===== */
.qibla-grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .qibla-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.compass-card { text-align: center; overflow: hidden; }
.compass-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, rgba(51, 214, 164, .14), transparent 55%); pointer-events: none; border-radius: inherit; }
.compass { position: relative; width: min(78vw, 330px); aspect-ratio: 1; margin: 16px auto 22px; }
.compass::before { /* slowly turning halo */
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(227, 194, 122, 0), rgba(227, 194, 122, .7), rgba(51, 214, 164, .5), rgba(227, 194, 122, 0) 50%, rgba(227, 194, 122, .7) 75%, rgba(227, 194, 122, 0));
  -webkit-mask: radial-gradient(circle, transparent 68.5%, #000 69.5%, #000 70.5%, transparent 71.5%);
  mask: radial-gradient(circle, transparent 68.5%, #000 69.5%, #000 70.5%, transparent 71.5%);
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.compass .dial { position: relative; width: 100%; height: 100%; transition: transform .25s ease-out; will-change: transform; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); }
.compass .pointer { position: absolute; left: 50%; top: -10px; width: 0; height: 0; transform: translateX(-50%); border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 20px solid var(--gold); z-index: 2; filter: drop-shadow(0 0 8px rgba(227, 194, 122, .9)); }
.dial-face { fill: url(#dialGrad); stroke: url(#rimGrad); stroke-width: 3; }
.dial-inner { fill: none; stroke: rgba(227, 194, 122, .2); stroke-width: 1; }
.dial-star { fill: none; stroke: rgba(227, 194, 122, .16); stroke-width: 1; }
.dial-tick { stroke: rgba(163, 178, 187, .55); stroke-width: 1; }
.dial-tick.major { stroke: var(--gold); stroke-width: 2; }
.dial-label { fill: var(--text); font: 700 13px var(--font); }
.dial-label.n { fill: #ff6b5b; }
.qibla-line { stroke: url(#arrowGrad); stroke-width: 5; stroke-linecap: round; }
.qibla-kaaba { fill: #0b0b0b; stroke: var(--gold); stroke-width: 1.6; }
.qibla-band { fill: var(--gold); }
.qibla-glow { fill: url(#kaabaGlow); }
.dial-center { fill: var(--gold); stroke: #0b1726; stroke-width: 3; }
.compass.aligned .dial { filter: drop-shadow(0 0 24px rgba(51, 214, 164, .85)); }
.compass.aligned .dial-face { stroke: var(--emerald); stroke-width: 5; }
.compass.aligned .pointer { border-top-color: var(--emerald); filter: drop-shadow(0 0 10px rgba(51, 214, 164, 1)); }
.big-deg { direction: ltr; unicode-bidi: isolate; font-size: 3.2rem; font-weight: 250; margin: 0; font-variant-numeric: tabular-nums; line-height: 1.05; text-shadow: 0 0 24px rgba(227, 194, 122, .45); position: relative; }
.big-dir { font: 600 1.3rem var(--font-display); color: var(--gold-hi); margin: 4px 0 2px; position: relative; }
.compass-card .muted, .compass-card .btn { position: relative; }
.compass-status { min-height: 1.5em; font-weight: 650; margin: 16px 0 0; position: relative; }
.compass-status.good { color: var(--ok); text-shadow: 0 0 14px rgba(75, 227, 169, .6); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; text-align: start; position: relative; }
.fact { background: rgba(0, 0, 0, .25); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.fact b { display: block; font-size: 1.12rem; color: var(--gold-hi); }
.fact span { font-size: .8rem; color: var(--muted); }
.card h2 { font: 600 1.3rem var(--font-display); color: var(--gold-hi); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 8px; }
.steps li { counter-increment: s; position: relative; padding-block: 0 16px; padding-inline: 50px 0; }
.steps li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 0; width: 26px; height: 26px; border-radius: 6px; transform: rotate(45deg); background: rgba(227, 194, 122, .1); border: 1px solid rgba(227, 194, 122, .5); }
.steps li::after { content: counter(s); position: absolute; inset-inline-start: 0; top: -2px; width: 34px; height: 30px; display: grid; place-items: center; color: var(--gold-hi); font-weight: 800; font-size: .9rem; }

/* ===== Timetable ===== */
.month-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0; }
.month-bar h2 { margin: 0; font: 600 1.3rem var(--font-display); text-align: center; color: var(--gold-hi); }
.month-bar h2 small { display: block; font: 500 .78rem var(--font); color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.month-bar .icon-btn { font-size: 1.4rem; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.tt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .84rem; min-width: 330px; }
.tt th, .tt td { padding: 10px 3px; text-align: center; white-space: nowrap; }
.tt thead th { white-space: normal; line-height: 1.2; }
.tt td { direction: ltr; unicode-bidi: isolate; }
.tt thead th { background: #141d24; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); border-bottom: 1px solid var(--line); }
.tt th:first-child, .tt td:first-child { text-align: start; padding-inline-start: 10px; position: sticky; inset-inline-start: 0; background: #0b1624; }
.tt tbody tr { border-top: 1px solid var(--line-soft); }
.tt .d { font-weight: 700; }
.tt .d small { display: block; font-weight: 500; font-size: .7rem; color: var(--faint); }
.tt .sun { color: var(--faint); }
.tt tr.fri > * { background: rgba(227, 194, 122, .07); }
.tt tr.fri > :first-child { background: #17201f; }
.tt tr.today > * { background: rgba(51, 214, 164, .16); font-weight: 700; color: #fff; }
.tt tr.today > :first-child { background: #0f3330; box-shadow: inset 3px 0 0 var(--emerald); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
@media (min-width: 640px) { .tt { font-size: 1rem; } .tt th, .tt td { padding: 11px 10px; } .tt thead th { font-size: .74rem; } }

/* ===== Articles ===== */
.articles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin: 18px 0 26px; }
.article-card {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), var(--glass);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow), var(--glow-gold); color: var(--text); }
.article-card .num { position: relative; flex: none; width: 42px; height: 42px; display: grid; place-items: center; font: 700 1.05rem var(--font-display); color: var(--gold-hi); }
.article-card .num::before, .article-card .num::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(227, 194, 122, .55); border-radius: 5px; }
.article-card .num::before { transform: rotate(45deg); background: rgba(227, 194, 122, .08); }
.article-card h2 { font: 600 1.15rem var(--font-display); margin: 0 0 4px; color: var(--text); }
.article-card p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.5; }

.prose { max-width: 700px; margin: 0 auto; padding: 18px 0 34px; }
.prose h1 { margin-top: .4em; }
.prose h1::after { margin-top: 14px; }
.prose h2 { margin-top: 1.8em; font: 600 1.4rem var(--font-display); color: var(--gold-hi); }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--gold); }
.prose ol, .prose ul { padding-inline-start: 1.3em; }
.prose strong { color: #fff; }
.prose .crumb { font-size: .9rem; margin: 0; }
.prose .summary { font-size: 1.12rem; color: var(--muted); }
.box {
  background: linear-gradient(120deg, rgba(51, 214, 164, .1), rgba(255, 255, 255, .02));
  border: 1px solid rgba(51, 214, 164, .3); border-inline-start: 3px solid var(--emerald);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 1.3em 0;
}
.box p:last-child { margin: 0; }
.dua {
  position: relative; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(227, 194, 122, .14), transparent 70%), rgba(0, 0, 0, .25);
  border: 1px solid rgba(227, 194, 122, .35); border-radius: var(--radius); padding: 22px 18px 18px; margin: 1.2em 0;
  box-shadow: inset 0 0 0 4px rgba(4, 8, 15, .4), inset 0 0 0 5px rgba(227, 194, 122, .12);
}
.dua .ar { font-size: 1.6rem; line-height: 2; display: block; margin-bottom: 8px; color: var(--gold-hi); text-shadow: 0 0 16px rgba(227, 194, 122, .3); }
.dua strong { display: block; color: var(--text); }
.dua em { display: block; color: var(--muted); font-size: .95rem; margin-top: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: start; vertical-align: top; }
.prose th { color: var(--gold); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.prose td .ar { color: var(--gold); margin-inline-start: 4px; }
.next-read { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 2.2em; padding-top: 1.2em; border-top: 1px solid var(--line); }

/* ===== Dialog sheets ===== */
.sheet {
  border: 1px solid var(--line); padding: 0; width: 100%; max-width: 520px; max-height: 90vh;
  background: linear-gradient(170deg, #112132, #08111d);
  color: var(--text); border-radius: 28px 28px 0 0;
  margin: auto auto 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.sheet::backdrop { background: rgba(2, 5, 10, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in .25s ease-out; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 28px; } }
.sheet-in { padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet-in::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); margin: -6px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font: 600 1.35rem var(--font-display); color: var(--gold-hi); }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .88rem; margin: 18px 0 12px; }
.or::before { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(270deg, transparent, var(--line)); }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.status { min-height: 1.2em; margin: 10px 0 4px; font-size: .95rem; color: var(--muted); }
.results { list-style: none; margin: 0; padding: 0; }
.result { display: block; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 12px 8px; color: var(--text); font: inherit; cursor: pointer; border-radius: 10px; transition: background .15s; }
.result:hover, .result:focus-visible { background: rgba(227, 194, 122, .08); }
.result strong { display: block; }
.result span { font-size: .86rem; color: var(--muted); }
.small-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin: 18px 0 4px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ===== Language & cities ===== */
.i18n-wait body { opacity: 0; }
body { transition: opacity .15s ease; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 10px; min-height: 40px; font: 700 .78rem var(--font); letter-spacing: .04em; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.lang-btn svg { width: 18px; height: 18px; color: var(--gold); }
.lang-btn:hover { border-color: var(--gold); box-shadow: var(--glow-gold); }
@media (max-width: 420px) { .lang-btn span { display: none; } .lang-btn { padding: 0 10px; } }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.lang-opt {
  min-height: 48px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; text-align: center;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--line-soft); font: 600 1rem var(--font);
  transition: border-color .15s, background .15s;
}
.lang-opt:hover { border-color: var(--gold); }
.lang-opt.is-current { background: var(--grad-gold); color: #1a1305; border-color: transparent; }
.lang-notice { margin-top: 1em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--line); font: 600 .92rem var(--font); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.chip:hover, .chip:focus-visible { border-color: var(--gold); color: var(--gold-hi); box-shadow: var(--glow-gold); }
.region-head { margin: 12px 0 2px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.cities-card h2 { margin-bottom: 8px; }
[dir="rtl"] .flip { transform: scaleX(-1); }
[dir="rtl"] .page-head::after, [dir="rtl"] .prose h1::after { background-position: right center; transform: scaleX(-1); }

/* ===== FAQ, breadcrumbs, city pages ===== */
.cities-card, .faq, .city-info { margin: 18px 0; }
.faq details { border-top: 1px solid var(--line-soft); padding: 4px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 12px 0; font-weight: 650; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 12px; }
.crumb { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: var(--gold); }
.city-info h2 { margin-top: 1.2em; }
.city-info h2:first-child { margin-top: 0; }

/* ===== Footer ===== */
.footer { margin-top: 36px; padding: 26px 0; font-size: .9rem; text-align: center; }
.footer::before { content: ""; display: block; width: 200px; height: 20px; margin: 0 auto 16px; background: url("../img/ornament.svg") center / contain no-repeat; opacity: .8; }
.footer p { margin: 0 0 6px; }
.footer .muted { color: var(--faint); }

/* ===== Motion ===== */
@media (prefers-reduced-motion: no-preference) {
  .page-head, .hero, .card, .quick a, .article-card, .prose > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .times-card { animation-delay: .08s; }
  .quick a:nth-child(2), .article-card:nth-child(2) { animation-delay: .06s; }
  .quick a:nth-child(3), .article-card:nth-child(3) { animation-delay: .12s; }
  .article-card:nth-child(n+4) { animation-delay: .18s; }
  .prayer.is-next .p-icon { animation: pulse 2.6s ease-in-out infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(51, 214, 164, .5); } 50% { box-shadow: 0 0 0 8px rgba(51, 214, 164, 0); } }

/* ===== Print (monthly timetable) ===== */
@media print {
  :root { --text: #000; --muted: #333; --faint: #555; --line: #bbb; --line-soft: #ddd; --gold: #000; --gold-hi: #000; }
  html, body { background: #fff !important; color: #000; }
  body { padding: 0; font-size: 11pt; }
  body::before, body::after, .page-head::after, .footer::before { display: none !important; }
  .topbar, .tabbar, .footer, .actions, .month-bar .icon-btn, .no-print, .skip { display: none !important; }
  .page-head h1 { -webkit-text-fill-color: #000; color: #000; background: none; }
  .table-wrap { box-shadow: none; border: 1px solid #999; overflow: visible; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .tt { min-width: 0; font-size: 10pt; }
  .tt th, .tt td { padding: 3px 6px; color: #000 !important; background: #fff !important; position: static !important; box-shadow: none !important; }
  .tt tr.today > *, .tt tr.fri > * { background: #eee !important; }
  * { animation: none !important; }
}

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