:root {
  --navy: #0B2440; --navy-2: #123459; --deep: #072D4D; --gold: #E0A526; --gold-soft: #FFF3D6;
  --bg: #F4F6FA; --card: #FFFFFF; --ink: #111827; --muted: #5B6676; --line: #E2E7EF;
  --faith: #6A2C91; --mind: #1F5FA8; --body: #C0392B; --family: #2E7D32; --emotional: #D98E04; --money: #D99A1E; --social: #2E7D32;
  --green: #2E7D32; --green-soft: #E6F4EA; --red: #B42318; --red-soft: #FDECEA; --blue-soft: #E8F0FB;
  --r: 16px; --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Montserrat', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.signed-out { padding-bottom: 0; }
a { color: var(--mind); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-family: var(--display); }
h1 { font-size: 26px; font-weight: 800; } h2 { font-size: 20px; font-weight: 800; } h3 { font-size: 16.5px; font-weight: 700; font-family: var(--font); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }

/* top bar */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.top .logo img { height: 30px; border-radius: 6px; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.top .who .pill { background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 999px; }
.top nav.desk { display: none; gap: 4px; margin-left: 18px; }
.top nav.desk a { color: #D6E2F2; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; }
.top nav.desk a.on { background: rgba(255,255,255,.12); color: #fff; }
@media (min-width: 900px) { .top nav.desk { display: flex; } .tabbar { display: none !important; } body { padding-bottom: 0; } }

/* bottom tab bar (phones) */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tabbar a.on { color: var(--navy); }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a.on .ic { background-color: var(--gold); }

/* icons (white PNGs from the deck, used as masks) */
.ic { display: inline-block; width: 20px; height: 20px; background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; flex: none; }
.ic-faith { --i: url(../img/i-faith.png); } .ic-mind { --i: url(../img/i-mind.png); } .ic-body { --i: url(../img/i-body.png); }
.ic-family { --i: url(../img/i-home.png); } .ic-emotional { --i: url(../img/i-heart.png); } .ic-money { --i: url(../img/i-money.png); }
.ic-social { --i: url(../img/i-social.png); } .ic-star { --i: url(../img/i-star.png); } .ic-medal { --i: url(../img/i-medal.png); }
.ic-check { --i: url(../img/i-check.png); } .ic-tent { --i: url(../img/i-tent.png); } .ic-clock { --i: url(../img/i-clock.png); }
.ic-book { --i: url(../img/i-book.png); } .ic-hands { --i: url(../img/i-hands.png); } .ic-home { --i: url(../img/i-home.png); }
.badge-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.badge-ic .ic { width: 22px; height: 22px; }

/* pieces */
.page-head { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 22px 0 26px; }
.page-head p { color: #C7D5E8; margin-top: 4px; }
.section { padding: 18px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 15px; text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1300; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.small { padding: 6px 11px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn:disabled { opacity: .5; cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--navy); }
.tag.gold { background: var(--gold-soft); color: #7A5200; } .tag.green { background: var(--green-soft); color: var(--green); } .tag.red { background: var(--red-soft); color: var(--red); } .tag.gray { background: #EEF0F3; color: var(--muted); }
.banner { padding: 11px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--navy); font-size: 14.5px; }
.banner.gold { background: var(--gold-soft); color: #6B4700; } .banner.green { background: var(--green-soft); color: var(--green); } .banner.red { background: var(--red-soft); color: var(--red); }
label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.t { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
textarea.t { min-height: 80px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 13px; font-weight: 600; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kpi b { display: block; font-family: var(--display); font-size: 26px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.ok b { color: var(--green); } .kpi.low b { color: var(--red); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 12px; overflow: hidden; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #F0F3F8; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 99; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); }

/* rank */
.rank-card { background: linear-gradient(150deg, var(--navy) 0%, var(--deep) 100%); color: #fff; border: 0; }
.rank-card .rk { font-family: var(--display); font-size: 30px; font-weight: 800; }
.rank-card .rk small { font-size: 15px; color: var(--gold); font-weight: 700; margin-left: 6px; }
.rank-ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; }
.rank-step { border-radius: 10px; padding: 8px 6px; text-align: center; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.08); color: #9FB3CC; }
.rank-step.got { background: var(--gold); color: #1d1300; }
.rank-step.next { outline: 2px dashed var(--gold); color: #fff; }
.bar { height: 10px; background: #E8ECF3; border-radius: 99px; overflow: hidden; }
.rank-card .bar { background: rgba(255,255,255,.14); }
.bar i { display: block; height: 100%; border-radius: 99px; }
.area-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.area-row .badge-ic { width: 30px; height: 30px; border-radius: 9px; }
.area-row .badge-ic .ic { width: 17px; height: 17px; }

/* GPR form */
.days { display: grid; grid-template-columns: 74px repeat(7, 1fr); gap: 4px; align-items: center; font-size: 13px; }
.days .hd { text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.days .lb { font-weight: 600; font-size: 13px; }
.pray { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 40px; font-weight: 800; cursor: pointer; font-size: 15px; }
.pray.full { background: var(--faith); color: #fff; border-color: var(--faith); }
.pray.part { background: #F1E8F7; color: var(--faith); border-color: #D8C2E8; }
.tick { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 38px; cursor: pointer; font-weight: 800; color: #C3CAD5; }
.tick.on { background: var(--faith); border-color: var(--faith); color: #fff; }
.counter { display: flex; align-items: center; gap: 8px; }
.counter button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 18px; cursor: pointer; }
.counter b { min-width: 38px; text-align: center; font-size: 18px; }
.pts-live { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 5; background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: 0 8px 22px rgba(11,36,64,.25); }
@media (min-width: 900px) { .pts-live { bottom: 12px; } }
.pts-live b { font-family: var(--display); font-size: 22px; color: var(--gold); }
.pts-live span { font-size: 12.5px; color: #C7D5E8; }

/* lists */
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: inherit; }
.list-row .grow { flex: 1; min-width: 0; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.av.coach { background: var(--gold); color: #1d1300; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; max-width: 80%; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 14px 14px 4px 14px; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--muted); }
.msg.mine .who { color: #C7D5E8; }
.msg.hiddenmsg { opacity: .45; }

/* attendance */
.att { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.att .chips .chip { padding: 6px 10px; font-size: 13px; }
.att .chip.p[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.att .chip.l[aria-pressed="true"] { background: var(--emotional); border-color: var(--emotional); }
.att .chip.a[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.att .chip.e[aria-pressed="true"] { background: var(--muted); border-color: var(--muted); }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; display: flex; flex-direction: column; align-items: center; padding-top: 5px; gap: 3px; cursor: pointer; font: inherit; }
.cal-day span { font-size: 13.5px; font-weight: 600; }
.cal-day i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.cal-day.has { background: var(--gold-soft); border-color: #F0D490; }
.cal-day.today { outline: 2px solid var(--navy); }
.cal-day.sel { background: var(--navy); color: #fff; }
.ev { display: flex; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.ev .d { width: 52px; text-align: center; flex: none; background: var(--navy); color: #fff; border-radius: 12px; padding: 6px 0; }
.ev .d b { display: block; font-size: 20px; font-family: var(--display); } .ev .d span { font-size: 11px; text-transform: uppercase; color: var(--gold); font-weight: 800; }

/* landing */
.hero { background: var(--deep); color: #fff; }
.hero img.poster { width: 100%; max-height: 520px; object-fit: cover; object-position: top center; }
.hero .verse { padding: 18px 0 26px; text-align: center; }
.hero .verse .ar { font-size: 24px; direction: rtl; font-family: 'Amiri', serif; }
.hero .verse .en { color: #C7D5E8; font-style: italic; margin-top: 4px; }
.fits { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.fit { border-radius: 14px; color: #fff; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.fit b { font-family: var(--display); font-size: 15px; }
.fit span { font-size: 13px; opacity: .9; }
.mile { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.mile .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 900; font-size: 14px; color: #fff; }
.mile.done .box { background: var(--green); border-color: var(--green); }
.stars { display: flex; gap: 4px; }
.stars button { width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; }
.stars button.on { background: var(--gold); border-color: var(--gold); color: #1d1300; }
.foot { text-align: center; padding: 22px 0 30px; color: var(--muted); font-size: 13px; }
