/* ── Professional UX refresh ───────────────────────────────────────────── */
:root {
  --ink: #112f2a;
  --muted: #657772;
  --cream: #f5f2e9;
  --paper: #fffefa;
  --line: #dce5e1;
  --shadow: 0 18px 48px rgba(5,47,41,.09);
  --shadow-soft: 0 8px 26px rgba(5,47,41,.07);
  --focus-ring: 0 0 0 4px rgba(202,166,75,.27);
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 92% -8%, rgba(202,166,75,.16), transparent 31rem),
    radial-gradient(circle at 4% 18%, rgba(20,100,83,.07), transparent 28rem),
    var(--cream);
}

body.sheet-open { overflow: hidden; }

button, a, input, select, summary { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  box-shadow: var(--focus-ring);
}

.topbar {
  top: 10px;
  width: calc(100% - 32px);
  max-width: 1280px;
  min-height: 72px;
  margin: 10px auto 0;
  padding: 12px 16px;
  background: rgba(255,254,250,.86);
  border: 1px solid rgba(18,50,44,.09);
  border-radius: 20px;
  box-shadow: 0 9px 34px rgba(5,47,41,.07);
}

.brand-mark { width: 46px; height: 46px; border-radius: 15px; }
.brand strong { font-size: 19px; }
.brand small { font-size: 10px; }
.top-actions > * { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.top-actions > *:hover { transform: translateY(-2px); border-color: rgba(20,100,83,.26); background: #fff; }

main { max-width: 1280px; padding-top: 22px; }
.view { animation-duration: .28s; }

.hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 18px; }
.hero-card { min-height: 540px; padding: 56px 52px 42px; border-radius: 34px; box-shadow: 0 28px 70px rgba(5,47,41,.2); }
.hero-card h1 { max-width: 680px; margin-top: 22px; font-size: clamp(45px, 5.3vw, 70px); line-height: 1.18; }
.hero-card > p { font-size: 16px; }
.hero-quote { right: 44px; left: 44px; bottom: 40px; }
.planner-card { min-height: 540px; padding: 30px; border-radius: 34px; box-shadow: 0 18px 50px rgba(5,47,41,.1); }
.planner-card .section-heading.compact { margin-bottom: 26px; }
.input-row { min-height: 54px; border-radius: 14px; }
.mode-selector label span { min-height: 74px; }
.primary-button { min-height: 54px; box-shadow: 0 10px 24px rgba(7,58,50,.18); }

.home-command-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin: 16px 0 44px;
}
.home-command-bar > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 14px;
  text-align: right;
  color: var(--ink);
  background: rgba(255,254,250,.88);
  border: 1px solid rgba(18,50,44,.09);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.home-command-bar > button:hover { transform: translateY(-3px); border-color: rgba(202,166,75,.56); box-shadow: var(--shadow); }
.home-command-bar .command-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  background: var(--green-900);
  border-radius: 14px;
  font-size: 22px;
}
.home-command-bar .command-kaaba svg { width: 26px; }
.home-command-bar button > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.home-command-bar small, .home-command-bar b, .home-command-bar em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-command-bar small { color: var(--green-700); font-size: 8px; font-weight: 900; }
.home-command-bar b { font-size: 11px; }
.home-command-bar em { color: var(--muted); font-size: 8px; font-style: normal; }
.home-command-bar button > i { color: var(--gold); font-style: normal; }

.value-section { padding-top: 4px; }
.feature-grid { gap: 13px; }
.feature-card { min-height: 220px; border-radius: 24px; box-shadow: var(--shadow-soft); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(202,166,75,.55); box-shadow: var(--shadow); }

.content-view > :first-child { margin-top: 2px; }
.page-intro, .adhkar-hero, .manasik-hero, .heritage-hero, .quiz-hero, .zakat-hero, .ramadan-hero { border-radius: 30px; }
.manasik-tabs, .adhkar-tabs, .atlas-tabs { scrollbar-width: none; }
.manasik-tabs::-webkit-scrollbar, .adhkar-tabs::-webkit-scrollbar, .atlas-tabs::-webkit-scrollbar { display: none; }

.zamzam-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 128px minmax(0, 1.08fr) minmax(290px, .92fr);
  gap: 26px;
  align-items: stretch;
  margin-top: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #f3fbfc 0%, #fffefa 58%, #f7f0db 100%);
  border: 1px solid rgba(35,137,168,.2);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}
.zamzam-card::after { content: ""; position: absolute; left: -90px; bottom: -125px; width: 250px; height: 250px; border: 1px solid rgba(35,137,168,.12); border-radius: 50%; box-shadow: 0 0 0 38px rgba(35,137,168,.035); }
.zamzam-visual { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; gap: 6px; min-height: 190px; color: #fff; background: linear-gradient(155deg, #2389a8, #0a536a); border-radius: 21px; }
.zamzam-visual span { color: #d8f7ff; font: 700 19px/1.2 "Amiri", "Traditional Arabic", serif; }
.zamzam-visual svg { width: 58px; height: 70px; }
.zamzam-visual path:first-child { fill: rgba(255,255,255,.95); }
.zamzam-visual path:last-child { fill: none; stroke: #2389a8; stroke-width: 3; stroke-linecap: round; }
.zamzam-copy, .zamzam-location { position: relative; z-index: 1; }
.zamzam-copy { align-self: center; }
.zamzam-copy h3, .zamzam-location h3 { margin: 7px 0 9px; font-size: 22px; }
.zamzam-copy blockquote { margin: 12px 0 8px; color: var(--green-950); font: 24px/1.75 "Amiri", "Traditional Arabic", serif; }
.zamzam-copy p, .zamzam-location p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.9; }
.zamzam-copy a { display: inline-block; margin-top: 10px; color: var(--green-700); font-size: 9px; font-weight: 900; }
.zamzam-location { padding: 20px; background: rgba(255,255,255,.76); border: 1px solid rgba(18,50,44,.08); border-radius: 20px; }
.zamzam-location > span { color: #2389a8; font-size: 9px; font-weight: 900; }
.zamzam-location > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.zamzam-location button, .zamzam-location a { padding: 9px 11px; border-radius: 10px; font-size: 8px; font-weight: 900; text-decoration: none; }
.zamzam-location button { color: #fff; background: #126e89; border: 0; cursor: pointer; }
.zamzam-location a { color: #126e89; background: #e4f5f9; }
.water-dot { background: #2389a8; }

.nav-scrim:not([hidden]) {
  position: fixed;
  z-index: 68;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(2,24,21,.52);
  border: 0;
  backdrop-filter: blur(4px);
  cursor: default;
  animation: scrim-in .2s ease;
}
.more-sheet:not([hidden]) {
  position: fixed;
  z-index: 72;
  right: 50%;
  bottom: 96px;
  transform: translateX(50%);
  width: min(920px, calc(100% - 30px));
  max-height: calc(100vh - 130px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  padding: 12px 22px 22px;
  background: rgba(255,254,250,.98);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(2,24,21,.3);
  animation: sheet-in .24s ease;
}
.sheet-handle { width: 46px; height: 4px; margin: 0 auto; background: #c9d4d0; border-radius: 99px; }
.more-sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.more-sheet-header span { color: var(--green-700); font-size: 9px; font-weight: 900; }
.more-sheet-header h2 { margin: 2px 0 0; font-size: 27px; }
.more-sheet-header > button { width: 40px; height: 40px; color: var(--muted); background: var(--cream); border: 0; border-radius: 13px; cursor: pointer; font-size: 24px; }
.service-search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: #f6f8f6; border: 1px solid var(--line); border-radius: 14px; }
.service-search:focus-within { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(20,100,83,.08); }
.service-search span { color: var(--green-700); font-size: 22px; }
.service-search input { flex: 1; min-width: 0; background: transparent; border: 0; }
.more-groups { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; overflow: auto; padding: 1px 1px 7px; }
.more-groups section[hidden] { display: none; }
.more-groups h3 { margin: 0 0 9px; color: var(--muted); font-size: 10px; }
.more-grid { display: grid; gap: 7px; }
.more-grid button { display: grid; grid-template-columns: 38px 1fr; gap: 0 10px; align-items: center; min-height: 62px; padding: 10px; text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.more-grid button:hover { border-color: rgba(202,166,75,.7); background: #fffdf5; }
.more-grid button[hidden] { display: none; }
.more-grid button > span { grid-row: 1 / span 2; width: 38px; height: 38px; display: grid; place-items: center; color: var(--gold-soft); background: var(--green-900); border-radius: 12px; font-size: 18px; }
.more-grid button b { font-size: 10px; }
.more-grid button small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.service-empty { margin: 0; padding: 25px; text-align: center; color: var(--muted); background: var(--cream); border-radius: 16px; font-size: 11px; }
@keyframes sheet-in { from { opacity: 0; transform: translate(50%, 18px) scale(.98); } to { opacity: 1; transform: translate(50%, 0) scale(1); } }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

.bottom-nav {
  z-index: 75;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(50%);
  width: min(590px, calc(100% - 28px));
  justify-content: stretch;
  gap: 5px;
  padding: 6px;
  background: rgba(5,47,41,.95);
  border-radius: 23px;
  box-shadow: 0 20px 55px rgba(2,33,29,.32);
}
.bottom-nav button { min-width: 0; min-height: 58px; flex: 1 1 20%; border-radius: 17px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.bottom-nav button:hover { color: #fff; transform: translateY(-1px); }
.bottom-nav button.active, .bottom-nav #moreNavBtn.active { color: var(--green-950); background: var(--gold-soft); }
.bottom-nav button b { font-size: 9px; }
.bottom-nav button span { line-height: 1; }

footer { margin-bottom: 55px; }

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card, .planner-card { min-height: 0; }
  .hero-card { min-height: 510px; }
  .home-command-bar { grid-template-columns: repeat(2, 1fr); }
  .zamzam-card { grid-template-columns: 110px 1fr; }
  .zamzam-location { grid-column: 1 / -1; }
  .more-groups { grid-template-columns: 1fr 1fr; }
  .more-groups section:last-child { grid-column: 1 / -1; }
  .more-groups section:last-child .more-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .app-shell { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .topbar { top: 6px; width: calc(100% - 16px); min-height: 62px; margin-top: 6px; padding: 8px 10px; border-radius: 17px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand strong { font-size: 16px; }
  .brand small, .streak-pill, .ruqyah-pill, .quran-radio-pill b { display: none; }
  .quran-radio-pill { width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .ruqyah-pill { width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .prayer-pill { min-height: 40px; padding: 6px 9px; }
  .prayer-pill span { display: none; }
  .top-actions { gap: 5px; }
  main { padding: 14px 12px 54px; }
  .hero-card { min-height: 445px; padding: 36px 23px 24px; border-radius: 26px; }
  .hero-card h1 { margin-top: 17px; font-size: clamp(39px, 13vw, 52px); }
  .hero-card > p { font-size: 13px; }
  .hero-quote { right: 22px; left: 22px; bottom: 22px; }
  .planner-card { padding: 23px 18px; border-radius: 26px; }
  .planner-card .section-heading.compact { align-items: start; }
  .privacy-badge { font-size: 8px; }
  .mode-selector { grid-template-columns: repeat(2, 1fr); }
  .home-command-bar { display: flex; gap: 9px; overflow-x: auto; margin: 12px 0 34px; padding: 2px 1px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .home-command-bar::-webkit-scrollbar { display: none; }
  .home-command-bar > button { flex: 0 0 min(83vw, 285px); scroll-snap-align: start; }
  .feature-card { min-height: 190px; }
  .zamzam-card { grid-template-columns: 1fr; gap: 16px; padding: 16px; border-radius: 22px; }
  .zamzam-visual { min-height: 130px; grid-template-columns: auto auto; gap: 14px; }
  .zamzam-visual svg { width: 46px; height: 56px; }
  .zamzam-location { grid-column: auto; padding: 17px; }
  .zamzam-copy blockquote { font-size: 21px; }
  .more-sheet:not([hidden]) { bottom: 80px; width: calc(100% - 14px); max-height: calc(100vh - 94px); padding: 9px 14px 16px; border-radius: 24px; }
  .more-groups { grid-template-columns: 1fr; gap: 15px; }
  .more-groups section:last-child { grid-column: auto; }
  .more-groups section:last-child .more-grid { grid-template-columns: 1fr; }
  .more-grid { grid-template-columns: 1fr 1fr; }
  .more-grid button { grid-template-columns: 34px 1fr; min-height: 60px; padding: 8px; }
  .more-grid button > span { width: 34px; height: 34px; }
  .bottom-nav { right: 7px; left: 7px; bottom: max(7px, env(safe-area-inset-bottom)); width: auto; transform: none; justify-content: stretch; overflow: visible; border-radius: 20px; }
  .bottom-nav button { min-width: 0; min-height: 55px; flex: 1 1 20%; padding: 4px 2px; }
  .bottom-nav button b { font-size: 8px; }
  footer { margin-bottom: 42px; }
}

@media (max-width: 430px) {
  .top-actions .ruqyah-pill { display: none; }
  .more-grid { grid-template-columns: 1fr; }
  .more-grid button { grid-template-columns: 38px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

* { box-sizing: border-box; }
