/* Nur · calm mint — tokens follow the Nur design system in Figma */
@font-face { font-family: 'Jakarta'; src: url('../fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Amiri'; src: url('../fonts/amiri-arabic-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Amiri'; src: url('../fonts/amiri-arabic-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --primary: #0C8A4C;
  --primary-strong: #066B3A;
  --primary-soft: #E4F5EB;
  --mint-a: #6BE09A;
  --mint-b: #33BF73;
  --text: #0E2A1F;
  --muted: #6E857A;
  --line: #E2ECE7;
  --bg: #F5FBF7;
  --card: #FFFFFF;
  --warm: #FFF4DF;
  --warm-ink: #B56B0D;
  --night: #0A3321;
  --night-2: #0F4A30;
  --on-primary: #FFFFFF;
  --shadow: 0 10px 30px rgba(6, 60, 34, 0.08);
  --radius: 20px;
  --font: 'Jakarta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --arabic: 'Amiri', 'Noto Naskh Arabic', serif;
  --tabbar: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3FD08A; --primary-strong: #6BE09A; --primary-soft: #123D2A;
    --mint-a: #1F8E57; --mint-b: #0F6B3E;
    --text: #E6F4EC; --muted: #93AEA1; --line: #1E3A2D; --bg: #08170F; --card: #0F2219;
    --warm: #2A2210; --warm-ink: #F2B65A; --night: #04110A; --night-2: #0B2A1C;
    --on-primary: #04110A; --shadow: 0 10px 30px rgba(0,0,0,0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.ar { font-family: var(--arabic); direction: rtl; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
#app { min-height: 100%; }
.screen { padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 24px); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.screen[hidden] { display: none; }
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.date-line { font-size: 13px; color: var(--muted); font-weight: 500; }
h1 { font-size: 24px; line-height: 1.2; margin: 2px 0 0; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 18px; margin: 0; font-weight: 800; }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; background: var(--card); display: grid; place-items: center; box-shadow: var(--shadow); flex: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: none; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .grow { flex: 1; min-width: 0; }
.link { color: var(--primary); font-weight: 700; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; white-space: nowrap; }
.chip.muted { background: var(--bg); color: var(--muted); }
.chip.warm { background: var(--warm); color: var(--warm-ink); }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.divider { height: 1px; background: var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 700; font-size: 15px; background: var(--primary); color: var(--on-primary); width: 100%; }
.btn.secondary { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost { background: transparent; color: var(--primary); min-height: 44px; }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .5; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.input { width: 100%; min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 12px 14px; font-size: 15px; }
.input:focus { outline: none; border-color: var(--primary); }
textarea.input { resize: none; min-height: 70px; }

/* ---------- next prayer hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; color: #06331D; background: linear-gradient(140deg, var(--mint-a), var(--mint-b)); box-shadow: 0 16px 36px rgba(12,138,76,.25); }
@media (prefers-color-scheme: dark) { .hero { color: #E9FFF2; } }
.hero .eyebrow { color: inherit; opacity: .8; }
.hero .time { font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 6px 0 10px; }
.hero .count { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.55); font-weight: 700; font-size: 13px; }
@media (prefers-color-scheme: dark) { .hero .count { background: rgba(0,0,0,.25); } }
.hero .mosque { position: absolute; right: -6px; top: 16px; width: 150px; opacity: .55; pointer-events: none; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 18px; }
.timeline::before { content: ''; position: absolute; left: 10%; right: 10%; top: 6px; height: 2px; background: currentColor; opacity: .25; }
.timeline .tp { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; position: relative; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.85); }
.timeline .tp.done .dot { background: currentColor; opacity: .6; }
.timeline .tp.next .dot { width: 16px; height: 16px; margin-top: -2px; background: #06331D; box-shadow: 0 0 0 4px rgba(255,255,255,.7); }
@media (prefers-color-scheme: dark) { .timeline .tp.next .dot { background: #E9FFF2; box-shadow: 0 0 0 4px rgba(0,0,0,.3); } }

/* journey ring */
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.habits { display: flex; flex-wrap: wrap; gap: 8px; }
.habit { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 13px; color: var(--muted); }
.habit .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; }
.habit.on { background: var(--primary-soft); color: var(--primary); }
.habit.on .tick { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.warm-card { background: var(--warm); }
.warm-card .eyebrow { color: var(--warm-ink); }
.night-card { background: linear-gradient(160deg, var(--night-2), var(--night)); color: #E9FFF2; }
.night-card .eyebrow { color: #8BE6AE; }
.night-card .muted { color: #A9C8B8; }
.night-card .btn.secondary { background: rgba(255,255,255,.08); color: #E9FFF2; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

.hadith { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 17px; line-height: 1.5; margin: 0; }
.source { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- salah ---------- */
.daynav { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.daynav button { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; color: var(--muted); }
.daynav .mid { text-align: center; }
.prayer-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.prayer-row .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-size: 18px; flex: none; }
.prayer-row .name { font-weight: 700; }
.prayer-row .arn { font-family: var(--arabic); font-size: 15px; color: var(--muted); }
.prayer-row .t { font-weight: 800; font-size: 18px; }
.prayer-row.next { background: linear-gradient(140deg, var(--mint-a), var(--mint-b)); color: #06331D; }
.prayer-row.next .arn, .prayer-row.next .muted { color: #0b4d2c; }
.prayer-row.next .ic { background: rgba(255,255,255,.5); }
.check { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 15px; color: transparent; }
.check.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.check[disabled] { opacity: .35; }
.prayer-row.next .check { border-color: rgba(6,51,29,.35); }

.compass { width: 150px; height: 150px; border-radius: 50%; margin: 4px auto; position: relative; background: radial-gradient(circle, var(--card) 58%, var(--primary-soft) 59%); box-shadow: inset 0 0 0 1.5px var(--line); }
.compass .n { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 12px; color: var(--muted); }
.compass .needle { position: absolute; inset: 0; }
.compass .needle i { position: absolute; left: 50%; top: 34px; width: 4px; height: 41px; margin-left: -2px; border-radius: 4px; background: var(--primary); }
.compass .needle b { position: absolute; left: 50%; top: 18px; width: 20px; height: 20px; margin-left: -10px; border-radius: 4px; background: var(--text); box-shadow: inset 0 5px 0 #C9A227; }
.compass .hub { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--primary); }

/* ---------- journal ---------- */
.bless { display: flex; gap: 12px; align-items: flex-start; }
.bless .n { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; margin-top: 10px; }
.sense { display: grid; place-items: center; padding: 24px 0 8px; }
.pulse { width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #8BE6AE 0 18%, rgba(139,230,174,.35) 19% 40%, rgba(139,230,174,.15) 41% 70%, transparent 71%); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.mood-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-chips button { padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: #E9FFF2; font-weight: 600; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.mood-chips button.on { background: #8BE6AE; color: #04301B; box-shadow: none; }
.entry { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry ol { margin: 0; padding-left: 18px; color: var(--text); font-size: 14px; }

/* ---------- quran ---------- */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); font-weight: 600; }
.bars .b i { display: block; width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--primary-soft); min-height: 4px; }
.bars .b.today i { background: var(--primary); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stepper button { width: 56px; height: 56px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); font-size: 26px; font-weight: 700; }
.stepper .val { font-size: 44px; font-weight: 800; line-height: 1; }
.progress { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 10px; }

/* ---------- rizq ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > * { min-width: 0; }
.result { padding: 18px; border-radius: 18px; background: var(--primary-soft); color: var(--primary-strong); }
.result .big { font-size: 32px; font-weight: 800; color: var(--text); }
.seg { display: flex; background: var(--bg); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 11px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar nav { max-width: 520px; margin: 0 auto; height: var(--tabbar); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--primary); }

/* ---------- sheets / onboarding ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; }
.sheet[hidden] { display: none; }
.sheet .screen { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }
.onb-hero { display: grid; place-items: center; padding: 30px 0 10px; }
.logo { width: 88px; height: 88px; border-radius: 28px; background: linear-gradient(140deg, var(--mint-a), var(--mint-b)); display: grid; place-items: center; box-shadow: 0 16px 36px rgba(12,138,76,.3); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); }
.dots i.on { width: 22px; background: var(--primary); }
.city-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.option { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; }
.option.on { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
