/* =========================================================================
   Namaaz Tracker · v2 — mobile-first styles.
   Palette matches the Flutter app; landing keeps the classic-site cream
   and the original logo.
   ========================================================================= */

:root {
  --primary: #0E7C66;
  --primary-dark: #095645;
  --primary-soft: #E2F1ED;
  --accent: #E4B363;
  --accent-soft: #FBF2E2;

  --bg: #F7F6F2;
  --cream: #f6f3eb;
  --paper: #FFFFFF;
  --ink: #18211E;
  --ink-2: #45524D;
  --ink-3: #8A9892;
  --line: #E5E8E4;

  --ontime: #2E7D32;
  --qaza: #F9A825;
  --missed: #C62828;
  --unset: #BDBDBD;

  --radius: 18px;
  --shadow: 0 1px 3px rgba(20, 40, 30, .07), 0 6px 18px rgba(20, 40, 30, .05);
  --nav-h: 64px;
}

/* Dark mode is class-based (html.dark, toggled from the topbar + saved).
   The landing page always stays light. */
html.dark body:not(.landing) {
  --bg: #101413; --paper: #1B201E;
  --ink: #ECF1EE; --ink-2: #B6C2BC; --ink-3: #74817B;
  --line: #2A322E; --primary-soft: #163A32; --accent-soft: #38301D;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
body.landing { padding-bottom: 0; background: var(--cream); }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--primary); }

/* =========================== LANDING =========================== */
.land-hero {
  text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 44px) 24px 36px;
  background: var(--cream);
}
.land-logo { width: 170px; max-width: 60vw; height: auto; margin-bottom: 18px; }
.land-hero h1 { margin: 0 0 12px; font-size: clamp(26px, 6vw, 38px); letter-spacing: -.02em; line-height: 1.15; color: #0f1a17; }
.land-hero h1 em { color: var(--primary); font-style: italic; }
.land-hero p { margin: 0 auto; max-width: 480px; color: #5b6b65; font-size: 16px; }
.land-trust { margin-top: 14px !important; font-size: 14px !important; }
.land-trust strong { color: var(--primary); }

.land-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }

.alert { border-radius: 14px; padding: 13px 16px; margin-bottom: 16px; font-size: 14.5px; font-weight: 600; }
.alert.err { background: #fdecea; color: var(--missed); border: 1px solid #f3c7c3; }
.alert.ok  { background: #e7f4ea; color: #087f21; border: 1px solid #bfe3c8; }

.eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.eyebrow.green { color: var(--primary); }
.eyebrow.gold { color: #b07c1f; }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
@media (max-width: 720px) { .auth-grid { grid-template-columns: 1fr; } }

.auth-card {
  background: #fff; border: 1px solid #e3e8e5; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 22px;
}
.auth-card h2 { margin: 0 0 4px; font-size: 21px; color: #0f1a17; }
.auth-lede { margin: 0 0 18px; color: #5b6b65; font-size: 14px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; color: #45524D; margin-bottom: 14px; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  display: block; width: 100%; margin-top: 6px;
  padding: 13px 14px; font-size: 16px;
  border: 1.5px solid #e3e8e5; border-radius: 12px;
  background: #faf9f6; color: #0f1a17; outline: none;
}
.auth-card input:focus { border-color: var(--primary); }
.auth-card label.check {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; color: #5b6b65; margin-bottom: 10px; font-size: 13.5px;
}
.auth-card label.check input { accent-color: var(--primary); width: 17px; height: 17px; }
.auth-foot { text-align: center; font-size: 13.5px; color: #5b6b65; margin: 14px 0 0; }

.btn-primary {
  display: block; width: 100%; padding: 15px; margin-top: 6px;
  background: var(--primary); color: #fff;
  border-radius: 14px; font-size: 16px; font-weight: 700;
  transition: transform .08s, background .15s;
}
.btn-primary:active { transform: scale(.985); }

/* --- tutorial videos --- */
.videos {
  background: #fff; border: 1px solid #e3e8e5; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 22px; margin-bottom: 28px;
}
.videos-copy h2 { margin: 0 0 4px; font-size: 21px; color: #0f1a17; }
.videos-copy p { margin: 0 0 18px; color: #5b6b65; font-size: 14px; }
.video-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.vid {
  position: relative; border-radius: 16px; overflow: hidden; background: #000;
  flex: 1 1 240px; padding: 0; display: block;
}
.vid-short { max-width: 240px; aspect-ratio: 9 / 16; flex: 0 1 240px; }
.vid-wide { aspect-ratio: 16 / 9; min-width: 260px; }
.vid img { width: 100%; height: 100%; object-fit: cover; opacity: .85; display: block; }
.vid iframe { width: 100%; height: 100%; border: 0; position: absolute; inset: 0; }
.vid-play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.vid-play svg { width: 64px; height: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.vid-label {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0, 0, 0, .65); color: #fff;
  font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
}

/* --- features --- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: #fff; border: 1px solid #e3e8e5; border-radius: 16px; padding: 18px;
}
.feature h3 { margin: 0 0 6px; font-size: 15.5px; color: #0f1a17; }
.feature p { margin: 0; font-size: 13.5px; color: #5b6b65; line-height: 1.55; }

.play-badge { display: inline-block; margin-top: 16px; }
.play-badge img { height: 56px; width: auto; }

.land-foot { text-align: center; font-size: 13.5px; color: #8a9892; }
.land-foot a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* =========================== APP CHROME =========================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--bg);
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none;
}
.topbar .brand img { width: 26px; height: 26px; border-radius: 7px; }
.topbar-right { display: inline-flex; align-items: center; gap: 10px; }
.topbar-user { font-size: 13px; color: var(--ink-3); font-weight: 600; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-btn {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--paper); box-shadow: var(--shadow); color: var(--ink-2);
}
.theme-btn svg { width: 19px; height: 19px; fill: currentColor; }
.theme-btn .ic-sun { display: none; fill: none; stroke: currentColor; }
.theme-btn .ic-sun circle { fill: currentColor; stroke: none; }
html.dark .theme-btn .ic-moon { display: none; }
html.dark .theme-btn .ic-sun { display: block; }
.logout-btn { color: var(--missed); }
.logout-btn svg { fill: currentColor; }

#view { max-width: 520px; margin: 0 auto; padding: 0 14px 24px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; justify-content: space-around;
  background: var(--paper); border-top: 1px solid var(--line);
}
.bottomnav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-3); font-size: 10px; font-weight: 600; text-decoration: none;
  white-space: nowrap; overflow: hidden;
}
.bottomnav svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.bottomnav a.active { color: var(--primary); }

/* =========================== HERO (Today) =========================== */
.hero {
  margin: 6px 0 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='rgba(255,255,255,.08)' stroke-width='1.4'%3E%3Crect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/%3E%3Crect x='18' y='18' width='36' height='36'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(150deg, #0E7C66, #095645);
  color: #fff; border-radius: 22px; padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-date { min-width: 0; }
.hero-date .greet { font-size: 13px; opacity: .8; }
.hero-date h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-date .hijri { font-size: 13px; opacity: .85; margin-top: 1px; }

.datenav { display: flex; align-items: center; gap: 6px; }
.datenav .datepick {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  font-size: 13.5px; font-weight: 700;
}
.datenav .datepick em { font-style: normal; }
.datenav svg { width: 18px; height: 18px; fill: currentColor; }
.datenav input[type="date"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
}
.datenav .today-jump {
  height: 38px; display: inline-flex; align-items: center; padding: 0 13px;
  border-radius: 12px; background: #fff; color: var(--primary-dark);
  font-size: 13px; font-weight: 800; text-decoration: none;
}

/* swipeable day strip */
.day-strip {
  display: flex; gap: 6px; margin-top: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 0 0 44px; display: flex; flex-direction: column; align-items: center;
  padding: 7px 0 6px; border-radius: 13px; text-decoration: none;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1.5px solid transparent;
}
.day-chip small { font-size: 10px; font-weight: 700; opacity: .75; text-transform: uppercase; }
.day-chip b { font-size: 15px; line-height: 1.3; }
.day-chip i { width: 6px; height: 6px; border-radius: 50%; margin-top: 3px; background: transparent; }
.day-chip i.full { background: #fff; }
.day-chip i.part { background: var(--qaza); }
.day-chip i.miss { background: #ff8a80; }
.day-chip.is-today { border-color: rgba(255, 255, 255, .55); }
.day-chip.sel { background: #fff; color: var(--primary-dark); }
.day-chip.sel small { opacity: .6; }
.day-chip.sel i.full { background: var(--primary); }

.hero-body { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.ring-wrap { position: relative; width: 96px; height: 96px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { stroke: rgba(255, 255, 255, .2); }
.ring-fill { stroke: #fff; transition: stroke-dashoffset .6s cubic-bezier(.22, 1, .36, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-label b { font-size: 24px; line-height: 1; }
.ring-label span { font-size: 10px; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }

.hero-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chip-streak {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px; padding: 6px 13px; color: #fff; font-weight: 700; font-size: 14px;
}
.chip-streak small { font-weight: 500; opacity: .8; }
.next-prayer { font-size: 13.5px; opacity: .95; line-height: 1.45; min-height: 0; }
.next-prayer b { font-size: 15px; }
.btn-loc {
  font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, .14);
  padding: 7px 12px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, .4);
}

/* =========================== PROVERB =========================== */
.proverb {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border-radius: 16px;
  padding: 13px 15px; margin-bottom: 14px;
  color: var(--ink-2); font-style: italic; font-size: 14px; line-height: 1.45;
}
.proverb svg { width: 20px; height: 20px; fill: var(--accent); flex: none; margin-top: 1px; }

/* =========================== PRAYER CARDS =========================== */
.prayer-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow); border: 1.5px solid transparent;
  width: 100%; text-align: left;
  transition: transform .08s;
}
.prayer-card:active { transform: scale(.99); }
.prayer-card.now { border-color: var(--primary); }
.prayer-card.now .p-time::after {
  content: "NOW"; margin-left: 7px; font-size: 10px; font-weight: 800;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 7px; border-radius: 999px; letter-spacing: .05em;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

.p-icon {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.p-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-weight: 700; font-size: 16px; }
.p-time { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.p-slot { flex: none; display: grid; place-items: center; min-width: 76px; }
.p-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 999px;
}
.p-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.p-status.unset { color: var(--ink-3); border: 1.5px dashed var(--line); background: transparent; }
.p-spin {
  width: 16px; height: 16px; border: 2.5px solid var(--line);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.all-done {
  text-align: center; background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 16px; padding: 14px; font-weight: 700; margin-top: 4px;
}
html.dark body:not(.landing) .all-done { color: #9fd8c9; }

/* =========================== SHEET =========================== */
#sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 18, 15, .45);
  animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0; } }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 520px; margin: 0 auto;
  background: var(--paper); border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: slideup .25s cubic-bezier(.22, 1, .36, 1);
  max-height: 78vh; overflow-y: auto;
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
#sheet h3 { margin: 0 0 12px; font-size: 17px; }

.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 14px; margin-bottom: 8px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 14px;
  font-weight: 600; font-size: 15px;
  transition: transform .06s;
}
.opt:active { transform: scale(.985); }
.opt .swatch { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.opt.clear { color: var(--ink-3); }
.opt.clear .swatch { background: transparent; border: 2px dashed var(--line); }

/* =========================== CALENDAR =========================== */
.viewhead { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 12px; }
.viewhead h2 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.viewhead .mnav { display: flex; gap: 6px; }
.viewhead .mnav a {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center;
  text-decoration: none;
}
.viewhead .mnav a.disabled { opacity: .35; pointer-events: none; }
.viewhead .mnav svg { width: 18px; height: 18px; fill: var(--ink-2); }

.cal-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 4px 0 8px; }
.cal-day {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  border: 1.5px solid transparent; text-decoration: none;
}
a.cal-day:active { transform: scale(.95); }
.cal-day.disabled { opacity: .3; }
.cal-day.today { border-color: var(--primary); }
.cal-day .pips { display: flex; gap: 2px; height: 5px; }
.cal-day .pip { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.8); }
.cal-day.full { background: var(--primary); color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* =========================== STATS =========================== */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: var(--paper); border-radius: 16px; box-shadow: var(--shadow);
  padding: 14px 8px; text-align: center;
}
.stat-card b { display: block; font-size: 23px; }
.stat-card span { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card.fire b { color: #E65100; }

.bars-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.bars-card h3 { margin: 0 0 14px; font-size: 15px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.bar-row .bname { width: 64px; font-weight: 700; color: var(--ink-2); }
.bar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; display: flex; }
.bar-seg { height: 100%; }
.bar-row .bcount { width: 38px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bars-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.bars-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* =========================== PROFILE =========================== */
.pro-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; text-align: center; margin-bottom: 14px;
}
.avatar {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
}
.pro-card h3 { margin: 0; font-size: 19px; }
.pro-card .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.pro-chip {
  display: inline-block; margin-top: 10px; background: var(--primary); color: #fff;
  font-size: 12.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px;
}

.list-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.list-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 15px 16px; text-align: left; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.list-item:last-child { border-bottom: 0; }
.list-item > svg { width: 22px; height: 22px; fill: var(--primary); flex: none; }
.list-item.danger { color: var(--missed); }
.list-item.danger > svg { fill: var(--missed); }
.list-item .li-sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.list-item .chev { margin-left: auto; fill: var(--ink-3); width: 18px; height: 18px; flex: none; }

/* =========================== MISC =========================== */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px); transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  animation: toastin .25s cubic-bezier(.22, 1, .36, 1);
  max-width: 86vw; text-align: center;
}
@keyframes toastin { from { transform: translate(-50%, 14px); opacity: 0; } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
#confetti i {
  position: absolute; top: -4vh; width: 9px; height: 14px; border-radius: 2px;
  animation: fall 1.7s ease-in forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

.empty-note { text-align: center; color: var(--ink-3); font-size: 14px; padding: 18px 16px; }
.empty-note a { color: var(--primary); }

/* =========================== SETTINGS =========================== */
.set-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.set-card h3 { margin: 0 0 12px; font-size: 15.5px; }
.set-hint { margin: -6px 0 12px; font-size: 12.5px; color: var(--ink-3); }
.set-card label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 13px; }
.set-card label small { font-weight: 500; color: var(--ink-3); }
.set-card input[type="text"], .set-card input[type="password"], .set-card input[type="number"] {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 13px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); outline: none;
}
.set-card input:focus { border-color: var(--primary); }
.set-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-card label.check {
  display: flex; align-items: center; gap: 9px;
  font-weight: 500; color: var(--ink-2); font-size: 14px; margin-bottom: 11px;
}
.set-card label.check input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.set-def { display: flex !important; align-items: center; gap: 10px; }
.set-def span { width: 76px; flex: none; }
.set-def select, .set-card select {
  flex: 1; width: 100%; padding: 11px 12px; font: inherit; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); outline: none;
}
.btn-primary.ghosted { background: var(--paper); color: var(--primary); border: 1.5px solid var(--primary); }
body:not(.landing) .alert.err { background: #fdecea; color: var(--missed); border: 1px solid #f3c7c3; }
body:not(.landing) .alert.ok  { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary); }

/* =========================== SHARE POPOVER =========================== */
.share-pop-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 18, 15, .45);
  display: grid; place-items: end center;
  animation: fadein .2s;
}
.share-pop {
  width: 100%; max-width: 420px;
  background: var(--paper); border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: slideup .25s cubic-bezier(.22, 1, .36, 1);
}
.share-pop h4 { margin: 0 0 12px; font-size: 16px; color: var(--ink); }
.share-opt {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 13px 14px; margin-bottom: 8px;
  border: 1.5px solid var(--line); border-radius: 14px;
  font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none;
  background: var(--paper); cursor: pointer; text-align: left;
}
.share-opt i { font-style: normal; }
.share-opt.cancel { justify-content: center; color: var(--ink-3); border-style: dashed; }
@media (min-width: 880px) {
  .share-pop-backdrop { place-items: center; }
  .share-pop { border-radius: 20px; padding-bottom: 18px; }
}

/* =========================== ANDROID APP BANNER =========================== */
.app-banner {
  position: relative; margin-top: 10px;
  background: var(--paper); border: 1.5px dashed var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.app-banner > a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 40px 12px 14px; text-decoration: none; color: var(--ink);
}
.app-banner img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.app-banner span { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; }
.app-banner span small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.app-banner > a > svg { width: 18px; height: 18px; fill: var(--primary); flex: none; }
.app-banner #app-banner-x {
  position: absolute; top: 6px; right: 8px;
  font-size: 18px; line-height: 1; color: var(--ink-3); padding: 4px;
}

/* =========================== FOOTER (ad) =========================== */
.pagefoot { text-align: center; padding: 8px 16px 14px; }
.pagefoot img { max-width: 100%; height: auto; border-radius: 10px; }
.pagefoot p { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.pagefoot a { color: var(--ink-3); }

/* =========================== BULK UPDATE =========================== */
.range-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.range-lbl input[type="date"] {
  padding: 8px 10px; font: inherit; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--paper); color: var(--ink); outline: none;
}
.bulk-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.bulk-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bulk-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.bulk-table th, .bulk-table td { padding: 6px 5px; text-align: left; white-space: nowrap; }
.bulk-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.bulk-table tbody tr:nth-child(even) { background: var(--bg); }
.bulk-table select, .applyrow select {
  padding: 7px 6px; font: inherit; font-size: 12.5px; max-width: 96px;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); outline: none;
}
.applyrow th { padding-bottom: 10px; }
.bulk-date a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* =========================== MISSED REPORT =========================== */
.miss-cell small { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.miss-list { display: flex; flex-direction: column; }
.miss-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.miss-row:last-child { border-bottom: 0; }
.miss-date { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.miss-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.miss-chips i {
  font-style: normal; font-size: 10.5px; font-weight: 700;
  padding: 3px 7px; border-radius: 999px; white-space: nowrap;
}
.miss-chips i.ok   { background: var(--primary-soft); color: var(--ontime); }
.miss-chips i.miss { background: #fdecea; color: var(--missed); }
.miss-chips i.ns   { background: var(--bg); color: var(--ink-3); border: 1px dashed var(--line); }
html.dark .miss-chips i.miss { background: #3a2020; }

/* =========================== PERIOD / CALENDAR CONTROLS =========================== */
.period-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px;
}
.period-bar select {
  padding: 9px 12px; font: inherit; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--paper); color: var(--ink); outline: none;
}
.period-bar select:focus { border-color: var(--primary); }
.btn-mini {
  padding: 9px 15px; border-radius: 11px; font-size: 13.5px; font-weight: 700;
  background: var(--primary); color: #fff; text-decoration: none; border: 0; cursor: pointer;
}
.btn-mini.ghost { background: var(--paper); color: var(--primary); box-shadow: var(--shadow); }
.cal-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.cal-summary b { color: var(--ink); }

/* =========================== STATS EXTRAS =========================== */
.donut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.donut-cell { text-align: center; }
.donut {
  width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; position: relative;
}
.donut .hole {
  width: 68px; height: 68px; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center; text-align: center; line-height: 1.1;
}
.donut .hole b { font-size: 16px; }
.donut .hole span { font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.donut-cell h4 { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.legend-wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend-wrap span { display: inline-flex; align-items: center; gap: 6px; }
.legend-wrap i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.yr-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.yr-row .yname { width: 56px; font-weight: 700; color: var(--ink-2); }
.yr-row .yscore { width: 64px; text-align: right; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.miss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.miss-cell { background: var(--bg); border-radius: 13px; padding: 12px 8px; text-align: center; }
.miss-cell b { display: block; font-size: 20px; color: var(--missed); }
.miss-cell span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* =========================== DESKTOP LAYOUT =========================== */
@media (min-width: 880px) {
  body:not(.landing) { padding-bottom: 24px; padding-left: 96px; }

  /* bottom nav becomes a left rail */
  .bottomnav {
    top: 0; bottom: 0; right: auto; left: 0; width: 96px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 86px 10px 16px; border-top: 0; border-right: 1px solid var(--line);
  }
  .bottomnav a { flex: 0 0 auto; padding: 12px 0; border-radius: 14px; width: 100%; }
  .bottomnav a.active { background: var(--primary-soft); }

  .topbar {
    position: fixed; top: 0; left: 0; width: 96px; z-index: 35;
    padding: 16px 0 0; background: transparent; justify-content: center;
  }
  .topbar .brand { flex-direction: column; font-size: 0; gap: 0; }
  .topbar .brand img { width: 40px; height: 40px; border-radius: 11px; }
  .topbar-user { display: none; }
  .topbar-right { position: fixed; top: 16px; right: 22px; }

  #view { max-width: 1020px; padding: 24px 28px; }

  /* Today: hero + proverb on the left, prayer cards on the right */
  .today-grid { display: grid; grid-template-columns: 400px 1fr; gap: 22px; align-items: start; }
  .today-grid .hero { margin-top: 0; }
  #prayer-list .prayer-card { padding: 16px 18px; }

  /* Calendar + stats spread out */
  .cal-card { max-width: 640px; }
  .cal-day { font-size: 14.5px; }
  .stat-cards { max-width: 640px; }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

  #toast { bottom: 30px; }
}
