@font-face{font-family:'Naskh';src:url('../fonts/naskh-400-arabic.woff2') format('woff2');font-weight:400 700;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Cairo';src:url('../fonts/cairo-arabic.woff2') format('woff2');font-weight:200 1000;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Cairo';src:url('../fonts/cairo-latin.woff2') format('woff2');font-weight:200 1000;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  --bg1:#08121C; --bg2:#0C1A27; --bg3:#12283A;
  --card:rgba(19,41,58,.78); --card-solid:#1E394B; --hero1:#1C4257; --hero2:#12293A;
  --stroke:rgba(255,255,255,.12);
  --teal:#7FD8C7; --teal-dark:#4FA9A0; --gold:#E8C88A;
  --text:#FFFFFF; --muted:#A9C0CE;
  --nav-h:66px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
html{background:var(--bg1)}
body{
  font-family:'Cairo',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,var(--bg1) 0%,var(--bg2) 45%,var(--bg3) 100%);
  background-attachment:fixed;
  min-height:100vh; min-height:100dvh;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}
.bg-scene{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:url('../img/bg.jpg') center top/cover no-repeat;
  opacity:.22;
  -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.25) 70%,transparent);
  mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.25) 70%,transparent);
}
.app{position:relative; z-index:1; max-width:520px; margin:0 auto; padding:0 14px; padding-top:env(safe-area-inset-top)}

/* ---------- views ---------- */
.view{display:none; padding:14px 2px calc(var(--nav-h) + 74px + env(safe-area-inset-bottom))}
.view.active{display:block}
.viewhead{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:6px 2px 12px}
h1{font-size:20px; font-weight:700; margin:0}
.muted{color:var(--muted)}
.small{font-size:12px}
.center{text-align:center}
.note{margin:14px 4px 0; line-height:1.7}

/* ---------- cards ---------- */
.card{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:20px;
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
  margin-bottom:12px;
}

/* ---------- top bar ---------- */
.topbar{display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 2px 10px}
.loc{display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); min-width:0}
.loc span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ico{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.loc .ico{width:16px;height:16px;color:var(--teal)}
.linkbtn{
  font-family:inherit; font-size:12.5px; color:var(--teal); background:rgba(127,216,199,.10);
  border:1px solid rgba(127,216,199,.28); border-radius:999px; padding:7px 12px; flex:none;
}
.linkbtn:active{background:rgba(127,216,199,.2)}
.tb-actions{display:flex; gap:6px; flex:none}
.ghostbtn{color:var(--muted); background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.14)}
.dates{margin:0 4px 12px}
.locinfo{margin:-6px 4px 10px; line-height:1.6}
.locinfo.warn{color:#E8A87C}
#hijriText{font-size:14px; color:var(--gold); font-weight:600}
#gregText{margin-top:2px}

/* ---------- hero ---------- */
.hero{
  background:linear-gradient(160deg,var(--hero1),var(--hero2));
  padding:20px 18px 18px; text-align:center;
  border-color:rgba(255,255,255,.16);
}
.hero-label{font-size:12px; color:var(--muted); letter-spacing:.02em}
.hero-name{font-size:24px; font-weight:700; color:var(--gold); margin-top:6px}
.hero-time{font-size:46px; font-weight:700; line-height:1.15; margin-top:2px; font-variant-numeric:tabular-nums}
.hero-cd{font-size:13px; color:var(--teal); margin-top:4px}

/* ---------- prayer list ---------- */
.list{padding:6px 4px}
.prow{display:flex; align-items:center; justify-content:space-between; padding:13px 14px; border-radius:14px}
.prow + .prow{position:relative}
.prow + .prow::before{content:""; position:absolute; inset-inline:14px; top:0; height:1px; background:rgba(255,255,255,.07)}
.prow.next{background:rgba(127,216,199,.12)}
.prow.next .pname{color:var(--teal); font-weight:600}
.pname{font-size:15px}
.ptime{font-size:16px; font-variant-numeric:tabular-nums; color:#EAF4F8}
.prow.next .ptime{color:var(--teal)}

/* ---------- rows ---------- */
.row{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; gap:12px}
.rowbtn{width:100%; font-family:inherit; color:inherit; text-align:start; border:1px solid var(--stroke); background:var(--card)}
.row-l{display:flex; flex-direction:column; gap:2px; font-size:14.5px}
.row-r{display:flex; align-items:center; gap:4px; color:var(--teal); font-size:13.5px}
.chev{width:16px;height:16px; transform:rotate(180deg)}

/* switch */
.switch{position:relative; display:inline-flex; flex:none}
.switch input{position:absolute; opacity:0; width:100%; height:100%; margin:0}
.switch .track{width:46px;height:27px;border-radius:999px;background:rgba(255,255,255,.16);display:block;transition:background .18s}
.switch .knob{width:21px;height:21px;border-radius:50%;background:#fff;display:block;margin:3px;transition:transform .18s;transform:translateX(0)}
.switch input:checked + .track{background:var(--teal-dark)}
.switch input:checked + .track .knob{transform:translateX(-19px)}

/* ---------- segmented ---------- */
.segmented{display:flex; gap:6px; background:rgba(255,255,255,.06); border-radius:14px; padding:4px; margin-bottom:12px}
.seg{flex:1; font-family:inherit; font-size:13.5px; color:var(--muted); background:transparent; border:0; padding:9px 4px; border-radius:11px}
.seg.sel{background:rgba(127,216,199,.18); color:var(--teal); font-weight:600}

/* ---------- progress ---------- */
.progress{height:6px; border-radius:999px; background:rgba(255,255,255,.10); overflow:hidden; margin:0 2px 14px}
.progress .bar{height:100%; width:0; background:linear-gradient(90deg,var(--teal-dark),var(--teal)); transition:width .25s}

/* ---------- adhkar ---------- */
.dcard{padding:16px 16px 12px}
.dcard.done{opacity:.55}
.dtext{font-family:'Naskh',serif; font-size:19px; line-height:1.95; text-align:center; white-space:pre-wrap; word-break:break-word}
.dtakh{font-size:11.5px; line-height:1.75; color:var(--muted); margin-top:10px; padding-top:9px; border-top:1px solid rgba(255,255,255,.08)}
.dfoot{display:flex; align-items:center; justify-content:center; margin-top:12px}
.dcount{
  font-family:inherit; font-size:13px; font-variant-numeric:tabular-nums;
  color:var(--teal); background:rgba(127,216,199,.12); border:1px solid rgba(127,216,199,.30);
  border-radius:999px; padding:7px 16px;
}
.dcard.done .dcount{color:var(--muted); background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.14)}

/* ---------- tasbih ---------- */
.tasbih-card{padding:18px 16px; text-align:center}
.dhikr-name{font-family:'Naskh',serif; font-size:22px; color:var(--gold); margin-bottom:6px}
.counter{position:relative; width:230px; height:230px; margin:8px auto 4px; background:none; border:0; padding:0; display:block}
.ring{width:100%;height:100%; transform:rotate(-90deg)}
.ring-bg{fill:none; stroke:rgba(255,255,255,.10); stroke-width:10}
.ring-fg{fill:none; stroke:var(--teal); stroke-width:10; stroke-linecap:round; stroke-dasharray:552.9; stroke-dashoffset:552.9; transition:stroke-dashoffset .18s}
.count{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:58px; font-weight:700; font-variant-numeric:tabular-nums;
}
.counter:active{transform:scale(.985)}
.target-row,.dhikr-row{display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:12px}
.chip{
  font-family:inherit; font-size:13px; color:var(--muted);
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
  border-radius:999px; padding:8px 14px;
}
.chip.sel{color:var(--teal); background:rgba(127,216,199,.16); border-color:rgba(127,216,199,.5); font-weight:600}
.pill{
  font-family:inherit; font-size:14px; color:#08202A; font-weight:600;
  background:var(--teal); border:0; border-radius:999px; padding:12px 22px; margin-top:16px; width:100%;
}
.pill.ghost{background:rgba(255,255,255,.07); color:var(--muted); border:1px solid rgba(255,255,255,.12)}

/* ---------- qibla ---------- */
.compass-card{padding:18px 16px; text-align:center}
.compass{position:relative; width:100%; max-width:320px; margin:0 auto; aspect-ratio:1/1}
.dial{width:100%;height:100%; display:block}
.dial-ring{fill:rgba(255,255,255,.03); stroke:rgba(255,255,255,.14); stroke-width:1.5}
.dial text{fill:var(--muted); font-family:'Cairo',sans-serif; font-size:15px; text-anchor:middle; font-weight:600}
.rose-n{fill:var(--teal) !important}
.tick{stroke:rgba(255,255,255,.22); stroke-width:1.4}
.tick.major{stroke:rgba(255,255,255,.45); stroke-width:2}
.needle-body{fill:var(--teal)}
.needle-hub{fill:#0C1A27; stroke:var(--teal); stroke-width:3}
#needle{transform-origin:150px 150px; transition:transform .12s linear}
#dialRose{transform-origin:150px 150px; transition:transform .12s linear}
.qibla-readout{text-align:center; margin:10px 0 2px}
.qibla-readout .deg{font-size:30px; font-weight:700; color:var(--gold); font-variant-numeric:tabular-nums; line-height:1.2}

/* ---------- radio ---------- */
.search{
  width:100%; font-family:inherit; font-size:14px; color:var(--text);
  background:rgba(19,41,58,.85); border:1px solid var(--stroke); border-radius:14px;
  padding:12px 14px; margin-bottom:10px; outline:none;
}
.search::placeholder{color:rgba(169,192,206,.7)}
.chips-scroll{overflow-x:auto; overflow-y:hidden; margin:0 -14px 10px; padding:0 14px; -webkit-overflow-scrolling:touch; scrollbar-width:none}
.chips-scroll::-webkit-scrollbar{display:none}
.chips{display:flex; gap:8px; width:max-content; padding:2px 0 4px}
.rrow{display:flex; align-items:center; gap:10px; padding:13px 15px; border-radius:16px; background:var(--card); border:1px solid var(--stroke); margin-bottom:8px}
.rrow.playing{border-color:rgba(127,216,199,.5); background:rgba(127,216,199,.10)}
.rrow.dead{opacity:.45}
.rname{flex:1; font-size:14px; min-width:0}
.rsub{font-size:11px; color:var(--muted); margin-top:2px}
.rplay{width:38px;height:38px;flex:none;border-radius:50%;background:rgba(127,216,199,.16);border:0;display:grid;place-items:center;color:var(--teal)}
.rrow.playing .rplay{background:var(--teal); color:#08202A}
.rplay .ico{width:18px;height:18px}
.badge{font-size:10.5px; color:#E8A87C; border:1px solid rgba(232,168,124,.35); border-radius:999px; padding:2px 7px; margin-inline-start:6px; white-space:nowrap}

/* ---------- now playing ---------- */
.nowplaying{
  position:fixed; z-index:20; left:10px; right:10px; bottom:calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
  max-width:500px; margin:0 auto;
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:rgba(11,26,39,.96); border:1px solid rgba(127,216,199,.25);
  border-radius:16px; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
}
.np-info{flex:1; min-width:0}
.np-name{font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.np-btn{width:38px;height:38px;flex:none;border-radius:50%;border:0;background:rgba(127,216,199,.16);color:var(--teal);display:grid;place-items:center}
.np-btn .ico{width:18px;height:18px}

/* ---------- tabbar ---------- */
.tabbar{
  position:fixed; z-index:30; left:0; right:0; bottom:0;
  height:calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  display:flex; background:rgba(11,26,39,.97);
  border-top:1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
}
.tab{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  background:none; border:0; font-family:inherit; font-size:10.5px; color:var(--muted);
  padding:0; min-width:0;
}
.tab .ico{width:23px;height:23px}
.tab.sel{color:var(--teal)}
.tab.sel .ico{stroke-width:1.9}

/* ---------- sheet ---------- */
.sheet-backdrop{position:fixed; inset:0; z-index:40; background:rgba(4,9,14,.66); display:flex; align-items:flex-end; justify-content:center}
.sheet{
  width:100%; max-width:520px; background:#0E1E2B; border-top-left-radius:22px; border-top-right-radius:22px;
  border-top:1px solid rgba(255,255,255,.10); padding:18px 16px calc(18px + env(safe-area-inset-bottom));
}
.sheet-title{font-size:15px; font-weight:600; margin-bottom:10px; color:var(--gold)}
.mrow{display:flex; align-items:center; justify-content:space-between; padding:14px 12px; border-radius:12px; font-family:inherit; font-size:14px; color:var(--text); background:none; border:0; width:100%; text-align:start}
.mrow.sel{background:rgba(127,216,199,.12); color:var(--teal)}
.mrow .ico{width:18px;height:18px; color:var(--teal)}

.city-list{max-height:54vh; overflow:auto; margin-bottom:6px}
.crow{display:flex; align-items:center; justify-content:space-between; width:100%; padding:13px 12px; border:0; border-radius:12px; background:none; color:var(--text); font-family:inherit; font-size:14px; text-align:start}
.crow.sel{background:rgba(127,216,199,.12); color:var(--teal)}
.crow + .crow{border-top:1px solid rgba(255,255,255,.06)}

[hidden]{display:none !important}
