:root {
  color-scheme: dark;
  --bg: #0c3a2a;
  --bg-2: #12182b;
  --panel: rgba(18, 24, 43, 0.82);
  --line: rgba(212, 165, 116, 0.22);
  --gold: #d4a574;
  --gold-2: #f3e2cc;
  --green: #0e6b4a;
  --green-bright: #22c07a;
  --green-deep: #083325;
  --ink: #f6f1e8;
  --muted: #a7b0c2;
  --dim: #717b90;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --serif: "Fraunces", Palatino, serif;
  --sans: "Outfit", "Avenir Next", system-ui, sans-serif;
  --arab: "Amiri", serif;
  --radius: 22px;
}
[data-theme="day"] {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-2: #fffaf3;
  --panel: rgba(255, 250, 243, 0.9);
  --line: rgba(42, 52, 74, 0.12);
  --gold: #8d5e32;
  --gold-2: #243044;
  --green: #0e6b4a;
  --green-bright: #0e9b5e;
  --green-deep: #d9efe4;
  --ink: #172033;
  --muted: #5d6880;
  --dim: #7d879c;
  --shadow: 0 16px 40px rgba(48, 36, 18, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(880px 420px at 8% -10%, rgba(212, 165, 116, 0.16), transparent 55%),
    radial-gradient(640px 380px at 110% 0%, rgba(70, 96, 150, 0.18), transparent 50%),
    var(--bg);
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.5;
  background: url("/images/welcome-bg.webp") center/cover no-repeat fixed;
  mask-image: linear-gradient(#000, transparent 85%);
}
body[data-theme="day"]::before {
  background-image: url("/images/bg-pattern-green.webp");
  background-repeat: repeat;
  background-size: auto;
  background-position: top left;
  opacity: 0.3;
}
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { width: min(1120px, 100%); margin: 0 auto; }
header.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand-mark { width: 44px !important; height: 44px !important; border-radius: 0 !important; }
.brand-word { width: auto !important; height: 30px !important; border-radius: 0 !important; }
/* wordmark/mark are dark-navy artwork: render white on the dark theme */
/* Brand art is gold-on-transparent, made for the dark header — no filter. */
body[data-theme="day"] .brand-mark, body[data-theme="day"] .brand-word { filter: none; }
.brand b { font-family: var(--serif); font-weight: 560; font-size: 20px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.spacer { flex: 1; }
.chip, .icon-btn, .primary, .ghost {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 12px;
}
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
/* Verse search row: text input + voice-search mic button */
.vsearch-row { display: flex; gap: 8px; align-items: center; }
.vsearch-row .search { flex: 1; min-width: 0; }
.mic-btn { font-size: 20px; flex: 0 0 auto; }
.mic-btn.listening { animation: micPulse 1.1s ease-in-out infinite; border-color: var(--gold, #c9a227); }
@keyframes micPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.ghost { background: transparent; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 8px 10px; color: var(--muted); }
/* Quran reader view-mode buttons: slightly larger text */
#quranViewSeg button { font-size: 16.5px; }
.seg button.on { background: linear-gradient(135deg, #e8c476, #c9962e); color: #1b140c; font-weight: 700; }
main { padding: 28px 0 64px; }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.next { padding: 28px; min-height: 300px; }
.kicker { color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; }
.dates { display: flex; gap: 16px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.prayer-name {
  font-family: var(--serif);
  font-size: clamp(46px, 6vw, 76px);
  line-height: 0.92;
  margin: 16px 0 6px;
  letter-spacing: -0.03em;
}
.clock { font-variant-numeric: tabular-nums; font-size: clamp(28px, 4vw, 42px); color: var(--gold-2); }
/* Stop iOS Safari inflating some texts (e.g. long button labels) while leaving others alone */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.sub, .hint { color: var(--muted); line-height: 1.5; }
small.muted { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 6px; }
.ring-wrap { display: grid; place-items: center; padding: 22px; }
.ring { width: min(280px, 100%); }
.vakt-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.vakt { padding: 14px 12px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 75%, transparent); }
.vakt.on { border-color: var(--gold); }
.vakt .nm { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.vakt .tm { font-variant-numeric: tabular-nums; font-size: 22px; margin-top: 6px; }
.vakt .st { color: var(--dim); font-size: 12px; min-height: 16px; margin-top: 4px; }
.tabs { display: flex; gap: 8px; margin: 22px 0 12px; flex-wrap: wrap; }
.tabs button, .tiny { border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 8px 14px; color: var(--muted); }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.layout { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 18px; }
.pad { padding: 20px; }
h2 { font-family: var(--serif); font-weight: 540; font-size: 28px; margin: 0 0 6px; }
.hidden { display: none !important; }
.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
tr.today td { color: var(--gold-2); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.scroll { overflow: auto; max-height: 480px; }
.compass { width: min(100%, 440px); aspect-ratio: 1; max-width: none; margin: 8px auto; }
.compass svg { width: 100%; height: 100%; display: block; }
.radio { margin-top: 16px; }
.stations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stations button { border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 8px 12px; }
.stations button.on, #ramadanMode.on, #monthMode.on { background: var(--gold); color: #1a140e; border-color: transparent; }
.qibla-frame + .row a { color: var(--gold); }
.quran-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.chapters button, .results button {
  width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 4px; border-radius: 0;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chapters small, .results small { color: var(--muted); display: block; }
.verse { padding: 14px 0; border-bottom: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.verse .ar { font-family: var(--arab); font-size: 28px; line-height: 1.85; text-align: right; direction: rtl; }
/* ===== Mushaf (book) view ===== */
.mushaf-page { background: #f6efdb; color: #2b2118; border-radius: 14px; padding: 16px 14px 10px;
  margin: 0 0 16px; border: 1px solid #d8c795; box-shadow: 0 2px 14px rgba(0,0,0,.4); direction: rtl; }
.mushaf-pagehead { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: #7a5c2e; border-bottom: 1px solid #d8c795; padding-bottom: 6px; margin-bottom: 2px; }
.mph-surah { font-family: var(--arab); font-size: 18px; color: #6b4d1c; }
.mushaf-surahhead { text-align: center; margin: 12px 0 6px; }
.mushaf-surahhead span { display: inline-block; border: 2px solid #b98a2f; border-radius: 12px;
  padding: 6px 30px; font-family: var(--arab); font-size: 26px; color: #6b4d1c; background: #fbf6e8; }
.mushaf-basmala { text-align: center; font-family: var(--arab); font-size: 23px; margin: 10px 0 6px; }
.mline { text-align: justify; font-family: var(--arab); font-size: 21px; line-height: 2.15; }
.mverse { border-radius: 6px; transition: background .3s; user-select: none; -webkit-user-select: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.mverse.on { background: rgba(185,138,47,.38); box-shadow: 0 0 0 2px rgba(185,138,47,.18); }
.mw { white-space: normal; }
.ayah-end { display: inline-block; min-width: 1.6em; text-align: center; border: 1.5px solid #b98a2f;
  border-radius: 50%; color: #8a5f1c; font-size: .68em; padding: .05em .2em; margin: 0 .2em; }
.mushaf-pagefoot { text-align: center; margin-top: 10px; }
.mpg-num { display: inline-block; border: 1.5px solid #b98a2f; border-radius: 8px;
  padding: 1px 14px; font-size: 13px; color: #7a5c2e; }
.verse .tr { color: var(--muted); margin-top: 6px; }
.ayah { font-family: var(--arab); font-size: 28px; line-height: 1.7; text-align: right; direction: rtl; margin: 12px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
input.field, textarea.field {
  width: 100%; border-radius: 14px; border: 1px solid var(--line);
  background-color: var(--bg-2); color: var(--ink); padding: 12px 14px; font-size: 16px; outline: none;
  font-family: inherit; margin-top: 6px;
}
textarea.field { min-height: 110px; resize: vertical; line-height: 1.5; }
.search, select.field {
  width: 100%; border-radius: 14px; border: 1px solid var(--line);
  background-color: var(--bg-2); color: var(--ink); padding: 12px 14px; font-size: 16px; outline: none;
}
/* Android renders native option popups with system UI that can ignore
   color-scheme — force explicit colors so options stay readable. */
select.field option {
  background-color: var(--bg-2);
  color: var(--ink);
}
label.field { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(6, 8, 16, 0.55); display: grid; place-items: start center; padding: 16px; overflow-y: auto; }
.sheet { width: min(560px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px; padding: 18px; margin: 4vh auto; max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.sheet h3 { font-family: var(--serif); font-size: 28px; margin: 4px 0 12px; }
.results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.count-btn { width: 100%; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 10%, transparent); padding: 16px; text-align: left; }
.count-btn b { font-family: var(--serif); font-size: 32px; display: block; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 999px; z-index: 50; }
footer.foot { color: var(--dim); font-size: 12px; line-height: 1.5; padding-bottom: 20px; }
@media (max-width: 900px) {
  .hero, .layout, .quran-layout { grid-template-columns: 1fr; }
  .vakt-grid { grid-template-columns: repeat(3, 1fr); }
  .brand small { display: none; }
}
.menu-btn { display: none; }
.menu-panel { display: none; }
@media (min-width: 641px) { .menu-panel { display: none !important; } }
.info-page h1 { font-family: var(--serif); margin: 0 0 12px; }
.info-page p { color: var(--muted); line-height: 1.65; margin: 0 0 12px; }
.info-page a { color: var(--gold); }
.sound-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sound-row select { flex: 1 1 auto; min-width: 0; }
.rrows { display: grid; gap: 6px; margin-top: 8px; }
.rrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rrow select { max-width: 160px; }
/* Extra reminders: evening-before nudge under the Mon/Thu row */
.xrow-eve { display: flex; align-items: center; gap: 10px; padding: 2px 0 8px 4px; font-size: 14px; color: var(--muted); cursor: pointer; }
.xrow-eve input { accent-color: var(--gold); }
/* Temporary sync diagnostic (only shown with ?dbgsync=1) */
.xdbg { font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 10px; color: var(--muted); }
.foot-support { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bmc-btn { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--green), var(--green-deep)); border: 1px solid var(--green); color: #fff; font-weight: 600; padding: 8px 16px; border-radius: 999px; text-decoration: none; }
.bmc-btn:hover { filter: brightness(1.1); }
.foot-nav, .foot-apps { margin-bottom: 8px; }
.foot-nav a, .foot-apps a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover, .foot-apps a:hover { color: var(--gold); text-decoration: underline; }
.foot-note { margin-top: 6px; }
/* Settings rows: label left, chevron right — at every width, not just phones */
.menu-link, .menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 10px 12px; border: 0; background: transparent;
  color: var(--ink); text-decoration: none; border-radius: 10px; font-size: 17px; text-align: left;
}
/* Find-near-me buttons: slightly larger text */
#mosqueFind, #halalFind, #marketFind { font-size: 17px; }
.menu-link:hover, .menu-row:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.menu-div { border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-row .seg.sm button { padding: 6px 10px; font-size: 13px; }
@media (max-width: 640px) {
  .vakt-grid { grid-template-columns: repeat(2, 1fr); }
  .chip { max-width: 140px; }
  .top-inner > .seg, #themeBtn, #setBtn { display: none; }
  .menu-btn { display: grid; }
  .menu-panel.open {
    display: block; position: absolute; top: 100%; right: 12px; z-index: 30;
    min-width: 230px; max-width: calc(100vw - 24px);
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 6px; margin-top: 4px;
  }
  #mLocVal { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-inner { gap: 8px; }
  .brand { flex: 1 1 auto; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px; }
  .brand-mark { width: 36px !important; height: 36px !important; }
  .brand-word { height: 38px !important; max-width: 100%; object-fit: contain; object-position: left center; }
}

/* Settings: wide green Done button */
#setClose {
  width: 100%; background: #16a34a; border-color: #16a34a; color: #fff;
  font-weight: 700; padding: 13px; font-size: 16px;
}
#setClose:active { background: #15803d; }
/* Alert sound dropdown: light-blue outline so it stands out */
#soundSel {
  border: 2px solid #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
}

/* iOS install callout: prominent box so iPhone users don't miss it */
.ios-install-box {
  background: rgba(125, 211, 252, 0.1);
  border: 2px solid #7dd3fc;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}
.ios-install-box p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.ios-install-box p:last-child { margin-bottom: 0; }
.ios-install-box .steps { font-weight: 600; }

/* Qibla: green compass button, close under the dial */
#compassBtn {
  background: #16a34a; border-color: #16a34a; color: #fff;
  font-weight: 700; padding: 10px 22px; font-size: 15px;
}
#compassBtn:active { background: #15803d; }

/* prayer tracker */
.tracker { margin-top: 18px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 75%, transparent); }
.tracker-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; }
.tracker-head .streak { color: #f59e0b; font-weight: 700; }
.tracker-hint { color: var(--dim); font-size: 12px; margin-top: 4px; }
.tracker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.trk { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 13px; cursor: pointer; }
.trk.on { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; }
@media (max-width: 560px) { .tracker-grid { grid-template-columns: repeat(3, 1fr); } }

/* Ramadan hub */
.ramadan-hub { margin-top: 14px; padding: 16px 18px; border-radius: 18px; border: 1px solid #d4a574; background: linear-gradient(135deg, color-mix(in srgb, #d4a574 14%, transparent), transparent); text-align: center; }
.rh-title { font-weight: 800; font-size: 16px; letter-spacing: .04em; }
.rh-count { font-size: 20px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.rh-count b { color: #d4a574; }
.rh-note { color: var(--dim); font-size: 13px; margin-top: 4px; }

/* mosque finder */
.mosque-list { margin-top: 14px; display: grid; gap: 8px; }
/* Find page: the card spans the full device width; the two search buttons share
   the row equally, centered (stacking full-width on very narrow screens). */
#panel-mosques { display: block; }
#panel-mosques .row { flex-direction: column; align-items: stretch; max-width: 380px; margin-left: auto; margin-right: auto; }
#panel-mosques .row .primary { flex: none; width: 100%; max-width: none; }
/* Watch Live page: full-width panel, two stacked stream cards with 16:9 players */
#panel-live { display: block; }
#panel-feedback { display: block; }
.live-card { margin-top: 18px; }
.live-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.live-badge { background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.live-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.live-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.live-card .note a { color: var(--gold); }
.mosque { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 75%, transparent); text-decoration: none; color: var(--ink); }
.mosque:hover { border-color: #d4a574; }
.mq-name { font-weight: 600; }
.mq-d { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.mq-row { display: flex; gap: 6px; align-items: stretch; }
.mq-row .mosque { flex: 1; min-width: 0; }
.mq-fav { flex: 0 0 auto; width: 44px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 75%, transparent); color: var(--dim); font-size: 20px; cursor: pointer; }
.mq-fav.on { color: #e3b341; border-color: #d4a574; }
.mq-favhead { color: var(--gold); font-weight: 700; font-size: 13px; margin: 6px 0 2px; }

/* green identity accents */
.primary { background: linear-gradient(135deg, var(--green), var(--green-deep)); border-color: var(--green); color: #fff; font-weight: 700; }
.primary:active { filter: brightness(1.15); }
.primary.on { background: linear-gradient(135deg, #e8c476, #c9962e); border-color: #c9962e; color: #1b140c; box-shadow: 0 0 0 2px rgba(212, 165, 116, .35); }
.tabs button.on { background: var(--green); border-color: var(--green); color: #fff; }
.vakt.on { border-color: var(--green-bright); box-shadow: 0 0 0 1px var(--green-bright), 0 8px 24px rgba(14, 107, 74, 0.25); }
.vakt.on .nm { color: var(--green-bright); }
.stations button.on { background: var(--green); border-color: var(--green); color: #fff; }
#ramadanMode.on, #monthMode.on { background: linear-gradient(135deg, #e8c476, #c9962e); border-color: #c9962e; color: #1b140c; font-weight: 700; }
#arc { stroke: var(--green-bright); }
.prayer-name { color: var(--green-bright); }
.kicker { color: var(--green-bright); }
.mosque:hover { border-color: var(--green-bright); }
.trk.on { background: var(--green); border-color: var(--green); }
.tracker-head .streak { color: var(--green-bright); }
a { color: var(--green-bright); }

/* Hijri calendar */
#monthBody td.today { background: linear-gradient(135deg, #e8c476, #c9962e); color: #1b140c; border-radius: 10px; }
#monthBody td[data-calday] { cursor: pointer; text-align: center; }
#monthBody td span.hday { color: var(--gold); font-weight: 600; }
#monthHeading .hh { color: var(--gold); font-size: .85em; font-weight: 400; }
#monthBody td.today span.hday { color: #ffe9a8; }
#monthBody td.sel { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 10px; }
.cal-detail { margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); }
.cal-detail:empty { display: none; }
.cald-head { font-weight: 700; margin-bottom: 8px; }
.cald-times { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.cald-times span i { font-style: normal; opacity: .6; margin-right: 5px; }
#monthBody td b { display: block; font-size: 16px; }
#monthBody td span { font-size: 11px; color: var(--dim); }
#monthBody td.today span { color: rgba(27,20,12,.75); }
/* Month / Ramadan imsakiye table: fixed layout so all 7 columns (incl. Isha/Yatsi)
   always fit the phone screen instead of overflowing past the right edge. */
#panel-month table { table-layout: fixed; }
#panel-month th:first-child, #panel-month td:first-child { width: 20%; white-space: normal; }
#panel-month th:not(:first-child), #panel-month td:not(:first-child) { width: 13.33%; }
@media (max-width: 560px) {
  #panel-month table { font-size: 12.5px; }
  #panel-month th { font-size: 10px; letter-spacing: .02em; padding: 7px 1px; }
  #panel-month td { padding: 7px 1px; }
}
/* Month/Ramadan mode toggle row: centre the button group in the panel. */
.mode-row { justify-content: center; }
.zikir-back { text-align: center; }
#learnBack:active, #asrBack:active, #hsnBack:active, .hd-back:active, .zikir-back:active { filter: brightness(1.07); }
[data-setback] {
  background: linear-gradient(135deg, #e8c476, #c9962e);
  border-color: #c9962e;
  color: #1b140c;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, .35);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}
.back-link a {
  display: inline-block;
  background: linear-gradient(135deg, #e8c476, #c9962e);
  color: #1b140c;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #c9962e;
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, .35);
}

/* professional 5-column footer */
.foot { padding: 40px 20px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto; text-align: left; }
.footer-col h4 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 10px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footer-col a:hover { color: var(--green-bright); text-decoration: underline; }
.paid-note { font-size: 11px; color: var(--dim); opacity: .8; white-space: nowrap; }
.footer-brand { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0 0 10px; letter-spacing: -.01em; }
.footer-tag { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.footer-copy { font-size: 12px; color: var(--dim); }
.footer-note { font-size: 12px; color: var(--dim); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* footer support buttons: stack neatly, same size */
.foot-cta { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.foot-cta .bmc-btn, .foot-cta .primary { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none; min-height: 42px; box-sizing: border-box; width: 100%; }

/* prayer-card tracker checkboxes */
.vakt { position: relative; }
.vakt-check { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(212,165,116,.6); background: rgba(212,165,116,.08); cursor: pointer; font-size: 15px; line-height: 1; color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.vakt-check.on { background: #d4a574; border-color: #d4a574; color: #221a10; }
.vakt-check.off { opacity: 0.22; cursor: default; }
.tracker-congrats { text-align: center; font-size: 17px; line-height: 1.55; padding: 12px 8px 4px; }

/* ===== Reference-style homepage (2026-10-11) ===== */
.app-hdr {
  background: transparent;
  color: #fff;
  position: sticky; top: 0; z-index: 30;
}
.hdr-in {
  width: min(1120px, 100%); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.hdr-place { background: none; border: 0; color: #fff; text-align: left; padding: 0; cursor: pointer; flex: 1 1 auto; min-width: 0; }
.hdr-place b { display: block; font-size: 20px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-place span { display: block; font-size: 11px; opacity: .75; line-height: 1.35; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-wx { display: flex; flex-direction: row; align-items: center; gap: 12px; flex: 0 0 auto; margin-left: 12px; }
.wx-day { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.wx-dn { font-size: 9px; opacity: .65; text-transform: uppercase; letter-spacing: .5px; }
.wx-di { font-size: 16px; line-height: 1.25; }
.wx-dt { font-size: 12px; font-weight: 700; }
.wx-t { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-c { font-size: 10px; opacity: .75; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }


.hero {
  display: block;
  background: transparent; color: var(--ink);
  text-align: center; padding: 18px 16px 40px;
}
body[data-theme="day"] .date-pill { border-color: var(--line); }
.hero-label { color: #f59e0b; font-size: clamp(20px, 5vw, 26px); font-weight: 700; letter-spacing: .3px; }
.hero-clock {
  font-size: clamp(52px, 15vw, 88px); font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: 2px;
  margin: 6px 0 14px;
}
.date-pill {
  display: inline-flex; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 999px;
  padding: 10px 22px; font-size: 14px; font-weight: 500;
  max-width: calc(100% - 32px); flex-wrap: wrap; justify-content: center;
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
}
.dp-dot { opacity: .6; }
.hero-sub { display: none; }
.hero-k { margin-top: 8px; font-size: 13px; color: #fbbf24; font-weight: 600; }
.hero-k:empty { display: none; }

.sheet {
  background: var(--bg-2);
  border-radius: 28px 28px 0 0;
  margin-top: -36px; position: relative; z-index: 5;
  padding: 18px 8px 90px;
}
#panel-home { max-width: 1120px; margin: 0 auto; }
body[data-theme="day"] .sheet { background: #fffdf8; }

.strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 6px 2px 12px;
}
.strip .vakt {
  text-align: center;
  padding: 14px 8px; border-radius: 16px;
  background: transparent; border: 0;
}
.strip .vakt b { display: block; font-size: 14px; font-weight: 600; }
.strip .vakt span { font-size: 18px; font-variant-numeric: tabular-nums; }
.strip .vakt.now b, .strip .vakt.now span { color: #ea580c; }

.quick { display: flex; justify-content: space-around; padding: 8px 0 4px; }
.qc {
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink); padding: 8px;
}
.qc-i {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: var(--bg);
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
              linear-gradient(135deg, #ec4899, #f59e0b) border-box;
}

.dcards { display: grid; gap: 14px; margin-top: 16px; }
.dcard {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 18px;
}
.dcard-share { width: 100%; border: none; border-radius: 999px; background: #3b82f6; color: #fff; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.dcard-share svg { width: 18px; height: 18px; fill: #fff; }
/* "A moment for today" image cards */
.moment { margin: 18px 0; }
.moment h2 { font-size: 24px; margin: 0 0 4px; text-shadow: 0 2px 12px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.9); }
.moment-sub { color: #ddd; font-size: 14px; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; text-shadow: 0 1px 8px rgba(0,0,0,0.85); }
.moment-lang { font-size: 12px; opacity: 0.92; }
.moment-cards { display: flex; flex-direction: column; gap: 16px; }
.mcard { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; justify-content: flex-end; }
.mcard-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcard-veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,5,12,0.88) 0%, rgba(5,5,12,0.45) 45%, rgba(5,5,12,0.15) 70%, rgba(5,5,12,0.05) 100%); }
.mcard-pill { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(10,10,18,0.72); border: 1px solid rgba(255,255,255,0.22); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(4px); }
.mcard-body { position: relative; z-index: 1; padding: 20px 20px 8px; }
.mcard-ar { font-family: 'Amiri', serif; color: #fff; font-size: 30px; line-height: 1.9; text-align: right; margin-bottom: 12px; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
#mAsma .mcard-ar { font-size: 64px; text-align: center; line-height: 1.6; }
#mAsma .mcard-tx { text-align: center; font-size: 20px; }
#mAsma .mcard-ref { text-align: center; }
.mcard-tx { color: #fff; font-size: 17px; line-height: 1.5; margin: 0 0 8px; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
.mcard-ref { color: rgba(255,255,255,0.75); font-size: 14px; margin: 0 0 4px; }
.mcard-wm { color: rgba(255,255,255,0.65); font-size: 14px; margin: 0; }
.mcard-share { position: relative; z-index: 1; margin: 12px 16px 16px; width: calc(100% - 32px); border: none; border-radius: 999px; color: #fff; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.mcard-share svg { width: 20px; height: 20px; fill: #fff; }
/* Names card with baby faces top-right */
.mcard-names { min-height: 0; background: var(--bg-2); justify-content: flex-start; padding-top: 64px; }
.mcard-names .mcard-pill { background: var(--bg-2); border-color: var(--line); }
.mcard-faces { position: absolute; top: 12px; right: 14px; z-index: 2; display: flex; gap: 8px; }
.mcard-faces img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.35); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.mcard-names .mcard-body { padding-top: 4px; }
.mcard-names .mcard-wm { color: var(--dim, #999); }
.mcard-names .name-line { color: inherit; }
body[data-theme="day"] .dcard { background: #fff; }
.dcard-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dcard-ic {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 48px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--bg); border: 1px solid var(--line);
}
.dcard-h b { display: block; font-size: 16px; }
.dcard-h span { font-size: 13px; color: var(--muted); }
.dcard p { margin: 0; font-size: 15px; line-height: 1.55; }
.asma-ar { font-size: 44px; text-align: center; margin: 6px 0 10px; color: #059669; font-family: var(--arab); }

.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--bg-2); border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bnav button {
  background: none; border: 0; font-size: 26px; padding: 8px 12px;
  cursor: pointer; opacity: .55; border-radius: 50%;
  transition: opacity .25s, box-shadow .25s, transform .25s, background .25s;
}
.bnav button.on {
  opacity: 1; transform: scale(1.12);
  background: radial-gradient(circle, rgba(45,212,191,.38) 0%, rgba(45,212,191,0) 72%);
  box-shadow: 0 0 16px 3px rgba(45,212,191,.5);
}
body[data-theme="day"] .bnav { background: #fffdf8; }

.verse-ar { font-family: var(--arab); font-size: 26px; text-align: right; direction: rtl; line-height: 1.9; margin: 4px 0 8px; }
.verse-trans { font-size: 13px; font-style: italic; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }

/* ===== Qibla lock-on celebration + turn guidance (2026-10-11) ===== */
#qiblaNeedle.locked #qiblaMark {
  animation: qiblaPulse 1.2s ease-in-out infinite;
  transform-origin: 110px 66px;
  transform-box: fill-box;
}
@keyframes qiblaPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .85; }
}
#qiblaTurn { text-align: center; margin-top: 10px; min-height: 44px; }
#qiblaTurn .turn-dir { font-size: 34px; vertical-align: middle; color: #d4a574; }
#qiblaTurn .turn-deg { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
#qiblaTurn .turn-word { font-size: 17px; color: var(--muted); }
#qiblaTurn .turn-found {
  display: inline-block; font-size: 22px; font-weight: 700; color: #22c55e;
  animation: foundPop .5s ease-out;
}
@keyframes foundPop {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== Tab pages with Home button + Kaaba vertical view (2026-10-11) ===== */
.tabbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.tabbar h2 { margin: 0; font-size: 22px; }
.backbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: 0 0 40px;
}
.kaaba-pano {
  position: relative; overflow: hidden; border-radius: 16px;
  height: 320px; background: #000;
}
.kaaba-pano img {
  position: absolute; top: 0; left: 0; height: 100%; width: auto;
  max-width: none; transition: transform .15s linear;
}

/* Tab pages: full-width like home (break out of .wrap constraint) */
#panel-month, #panel-qibla, #panel-quran, #panel-quiet, #panel-mosques, #panel-more {
  margin: 0; padding: 0 2px;
}
#panel-qibla .panel, #panel-quiet .panel, #panel-mosques .panel, #panel-month .panel, #panel-live .panel, #panel-feedback .panel { padding: 14px 10px; }
/* Quran reader: let the verses use nearly the full device width */
#panel-quran .panel { padding: 14px 6px; }
/* Reciter dropdown must shrink inside its flex row instead of forcing the page wider */
#reciterSel { min-width: 0; }
/* Follow-recitation toggle: pill button so the option is easy to spot */
.follow-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--gold-2); background: rgba(212, 165, 116, 0.14); border: 1px solid rgba(212, 165, 116, 0.55); border-radius: 999px; padding: 8px 14px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.follow-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }

/* Settings page */
#panel-settings { padding: 0 2px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rrow > span { flex: 1; font-size: 15px; }
.rrow input[type="checkbox"] { width: 22px; height: 22px; accent-color: #16a34a; }
.rrow select { flex: 0 0 130px; }
.rrow select:disabled { opacity: .4; }

#panel-settings { grid-template-columns: 1fr; }

/* Light theme: readable header/hero (was white-on-cream) */
body[data-theme="day"] .app-hdr { color: var(--ink); }
body[data-theme="day"] .hdr-place { color: var(--ink); }
body[data-theme="day"] .hero-label { color: #b45309; }
body[data-theme="day"] .hero-k { color: #b45309; }
.hero-clock { color: var(--ink); }

/* Qibla map: full width (breaks out of main 18px + section 2px inset) */
#panel-qibla .map-panel { margin-left: -20px; margin-right: -20px; padding: 14px 0 10px; border-radius: 0; }
#panel-qibla .map-panel h2, #panel-qibla .map-panel .row { padding: 0 12px; }
.qibla-frame { width: 100%; height: 420px; border: 0; display: block; }

/* More page rows */
#panel-more .menu-row { text-decoration: none; color: var(--ink); }

.name-line { font-size: 15px; margin: 6px 0; line-height: 1.5; }
.name-line b { font-size: 16px; }
#stations select { width: 100%; margin-top: 10px; }

/* Quran reader: pronunciation + follow shading */
.verse .pron { font-style: italic; color: var(--muted); margin-top: 6px; line-height: 1.65; font-size: 15px; }
.verse.on { background: color-mix(in srgb, var(--green-bright) 15%, transparent); box-shadow: inset 0 0 0 2px var(--green-bright); border-radius: 12px; padding-left: 10px; padding-right: 10px; }

/* Tasbih beads mode */
.bead-count { text-align: center; font-size: 46px; font-weight: 700; line-height: 1.1; }
.bead-count span { font-size: 22px; color: var(--muted); font-weight: 500; }
#beadStage { position: relative; overflow: hidden; height: 96px; margin: 12px -4px 4px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#beadStage::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line); }
#beadStrip { display: flex; gap: 10px; position: absolute; top: 50%; margin-top: -22px; left: 0; padding-left: 44%; will-change: transform; }
.bead { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset -4px -6px 10px rgba(0,0,0,.35), 0 2px 5px rgba(0,0,0,.25); }
.bead-styles { display: flex; gap: 12px; justify-content: center; margin: 10px 0 4px; }
.bead-styles button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.bead-styles button.on { border-color: var(--green-bright); transform: scale(1.15); }
/* Tasbih: big, easy-to-tap Reset buttons */
#tasbihReset, #beadReset { padding: 14px 32px; font-size: 17px; font-weight: 700; border-radius: 14px; }
/* More page: shortcut tile grid */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 6px 13px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer; }
.tile .tic { width: 54px; height: 54px; border-radius: 15px; background: rgba(201,162,39,.16); display: flex; align-items: center; justify-content: center; font-size: 27px; }
.tile .tlabel { font-size: 13.5px; font-weight: 600; line-height: 1.25; text-align: center; }
.tile.soon { opacity: .55; }
/* Library shelf: book tiles in a 3-column grid */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.book { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); font: inherit; cursor: pointer; padding: 0; text-align: center; }
.book-cover { aspect-ratio: 3 / 3.6; display: grid; place-items: center; font-size: 42px; position: relative; background: linear-gradient(150deg, #0e3b2e, #1a5c40); }
.book:nth-child(3n+2) .book-cover { background: linear-gradient(150deg, #3d1a1a, #6b2323); }
.book:nth-child(3n) .book-cover { background: linear-gradient(150deg, #1c2340, #2c3a6b); }
.book-cover::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(201,162,39,.55); border-radius: 6px; pointer-events: none; }
.book-name { padding: 8px 4px 2px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.book-sub { padding: 0 4px 9px; font-size: 11px; color: var(--muted); line-height: 1.3; }
.book.ext .book-sub::after { content: " \2197"; }
/* Verse window (single-ayah view from search / Asr list) */
.vm-key { font-weight: 700; color: var(--gold, #c9a227); margin: 0 0 6px; font-size: 15px; }
.vm-ar { font-family: var(--arab); font-size: 27px; line-height: 2; text-align: right; margin: 0 0 10px; }
.vm-tr { color: var(--muted); line-height: 1.6; margin: 0; font-size: 14.5px; }
/* Voice search window: Google-style dialog with a big tap-to-start mic */
.voice-sheet { text-align: center; padding: 30px 22px 24px; }
.voice-title { font-family: var(--serif); font-size: 25px; margin: 0 0 20px; }
.voice-mic { width: 104px; height: 104px; border-radius: 50%; font-size: 46px; cursor: pointer; border: 2px solid var(--gold, #c9a227); background: color-mix(in srgb, var(--gold) 14%, transparent); display: inline-grid; place-items: center; color: var(--ink); }
.voice-mic.listening { animation: micPulse 1.1s ease-in-out infinite; background: color-mix(in srgb, var(--gold) 32%, transparent); }
.voice-status { margin: 18px 0 6px; font-size: 16.5px; }
.voice-lang { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
/* Verse long-press / right-click menu */
.vmenu { position: fixed; z-index: 60; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 8px 30px rgba(0,0,0,.45); min-width: 200px; }
.vmenu button { background: transparent; border: 0; color: var(--ink); font: inherit; font-size: 15px; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.vmenu button:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.more-legal { text-align: center; margin: 18px 0 2px; font-size: 14px; }
.more-legal a { color: var(--accent2); }
/* Quran: searchable surah dropdown */
.surah-picker { position: relative; }
.surah-drop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: 320px; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.35); padding: 6px; }
.surah-drop.hidden { display: none; }
.surah-drop button { width: 100%; text-align: left; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.resume-banner { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin: 10px 0 0; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(212, 165, 116, .5); background: rgba(212, 165, 116, .22); color: var(--gold-2); font-size: 15px; font-weight: 600; cursor: pointer; }
.resume-banner.hidden { display: none; }
.resume-banner b { font-weight: 700; }
/* ===== Quran verse search results ===== */
.vres { display: block; width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 8px; cursor: pointer; color: inherit;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vres:last-child { border-bottom: 0; }
.vres-key { display: inline-block; font-size: 12px; color: var(--gold); border: 1px solid var(--gold);
  border-radius: 8px; padding: 1px 8px; margin-bottom: 6px; }
.vres-ar { display: block; font-family: var(--arab); font-size: 20px; line-height: 1.9; text-align: right; }
.vres-tr { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
#verses .flash { animation: vflash 2.3s ease; border-radius: 8px; }
@keyframes vflash { 0%, 55% { box-shadow: 0 0 0 2px var(--gold); } 100% { box-shadow: none; } }
.surah-drop button.active { outline: 2px solid #c9a227; }
/* Day theme: pattern more present — stronger behind the page, and cards
   go slightly translucent so it shows through them too */
body[data-theme="day"]::before { opacity: 0.6; }
body[data-theme="day"] .panel { background: color-mix(in srgb, var(--panel) 70%, transparent); }
body[data-theme="day"] .sheet { background: color-mix(in srgb, var(--bg-2) 74%, transparent); }
/* Day theme: gradual transparency everywhere — nav and sheet surfaces too,
   pattern fades smoothly down the whole page */
body[data-theme="day"] .bnav { background: color-mix(in srgb, var(--bg-2) 82%, transparent); backdrop-filter: blur(3px); }
/* Day theme: pale pattern painted directly on the surfaces (visible in cards) */
body[data-theme="day"] .panel { background-image: url("/images/bg-pattern-green-light.webp"); background-repeat: repeat; }
body[data-theme="day"] .sheet { background-image: url("/images/bg-pattern-green-light.webp"); background-repeat: repeat; }
body[data-theme="day"] .vakt { background-image: url("/images/bg-pattern-green-light.webp"); background-repeat: repeat; }
/* Day theme: pale pattern on daily cards + tracker too */
body[data-theme="day"] .dcard { background-image: url("/images/bg-pattern-green-light.webp"); background-repeat: repeat; }
body[data-theme="day"] .tracker { background-image: url("/images/bg-pattern-green-light.webp"); background-repeat: repeat; }
/* Floral artwork background everywhere — as-is, full strength, no fade (both themes) */
body::before, body[data-theme="day"]::before {
  background: url("/images/floral-bg.webp") center/cover no-repeat fixed;
  opacity: 1;
  mask-image: none;
  -webkit-mask-image: none;
}
/* Day theme: soft cream halo so header text stays readable over the artwork */
body[data-theme="day"] .hdr-place, body[data-theme="day"] .hdr-wx { text-shadow: 0 0 6px rgba(253,250,240,.95), 0 0 14px rgba(253,250,240,.85), 0 1px 2px rgba(253,250,240,.9); }
/* Dark theme: green pattern inside the cards (floral stays as the screen bg) */
body:not([data-theme="day"]) .panel, body:not([data-theme="day"]) .sheet,
body:not([data-theme="day"]) .vakt, body:not([data-theme="day"]) .dcard,
body:not([data-theme="day"]) .tracker { background-image: url("/images/bg-pattern-green.webp"); background-repeat: repeat; }
/* Dark theme: soft dark halo so hero text (countdown) reads over the bright artwork */
body:not([data-theme="day"]) .hero-clock, body:not([data-theme="day"]) .hero-label,
body:not([data-theme="day"]) .hero-k { text-shadow: 0 2px 16px rgba(0,0,0,.6), 0 0 4px rgba(0,0,0,.65); }
/* Background layer must sit BEHIND all content (hero text was painted under it) */
body::before { z-index: -1; }
/* Footer support buttons keep their own text colors (footer link color was overriding them) */
.foot-cta .bmc-btn { color: #fff; }
.foot-cta .primary { color: #fff; }
/* Dark theme fine-tune (page-by-page audit): lift secondary text over the pattern */
body:not([data-theme="day"]) { --dim: #9aa5bb; --muted: #c0c9da; }
body:not([data-theme="day"]) .kicker { color: #d9b84a; }
body:not([data-theme="day"]) .hdr-place, body:not([data-theme="day"]) .hdr-wx { text-shadow: 0 1px 10px rgba(0,0,0,.55), 0 0 3px rgba(0,0,0,.6); }
/* Dark tone pilot (Home first): richer pattern, gold next-prayer highlight,
   warmer hero gold, deep-emerald nav */
body:not([data-theme="day"]) .panel, body:not([data-theme="day"]) .sheet,
body:not([data-theme="day"]) .vakt, body:not([data-theme="day"]) .dcard,
body:not([data-theme="day"]) .tracker { background-image: url("/images/bg-pattern-green-rich.webp"); }
body:not([data-theme="day"]) .vakt.on { border-color: #d9a441; box-shadow: 0 0 0 1px #d9a441, 0 8px 24px rgba(217,164,65,.22); }
body:not([data-theme="day"]) .hero-label { color: #e3b341; }
body:not([data-theme="day"]) .bnav { background: #081c16; }
/* Dark tone roll-out: the same emerald + gold language on every page */
body:not([data-theme="day"]) .qc-i { background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, linear-gradient(135deg, #d9a441, #2fbf71) border-box; }
body:not([data-theme="day"]) .verse.on { background: color-mix(in srgb, #d9a441 14%, transparent); box-shadow: inset 0 0 0 2px #d9a441; }
body:not([data-theme="day"]) .qibla-frame { filter: brightness(.9) saturate(.92); }
.tile.soon { opacity: .78; }

/* Learning Center */
.learn-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.learn-card { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 14px 15px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer; }
.learn-ic { font-size: 30px; line-height: 1; }
.learn-tx { display: flex; flex-direction: column; gap: 2px; }
.learn-ti { font-weight: 700; font-size: 16px; }
.learn-de { opacity: .72; font-size: 13px; }
.learn-go { margin-left: auto; opacity: .45; font-size: 24px; line-height: 1; }
.learn-article h3 { margin: 14px 0 4px; font-size: 22px; }
.learn-article h4 { margin: 20px 0 6px; font-size: 17px; color: var(--gold, #d4a017); }
.learn-article p { margin: 8px 0; line-height: 1.65; }
.learn-article .ar { font-family: var(--arab); font-size: 23px; line-height: 2; text-align: right; }
.learn-article .tn { font-style: italic; opacity: .85; }
.learn-article .dm { opacity: .72; font-size: 14px; }
.learn-article .dua { border-left: 3px solid var(--gold, #d4a017); padding: 2px 0 2px 13px; margin: 12px 0; }
.learn-article .learn-inlink { margin: 8px 0; }
.learn-article .learn-inlink { border-color: color-mix(in srgb, var(--gold, #d4a017) 45%, var(--line)); }
.learn-article .learn-inlink .learn-go { color: var(--gold, #d4a017); opacity: 1; }
/* Learn back buttons: gold so they read as navigation */
#learnBack, #asrBack, #hsnBack { color: var(--gold, #d4a017); border-color: color-mix(in srgb, var(--gold, #d4a017) 50%, transparent); }
.learn-article .hsn-meta { display: flex; gap: 14px; font-size: 12.5px; opacity: .62; margin-top: 6px; }
.qadha-total { text-align: center; margin: 22px 0 10px; }
.qadha-num { font-size: 54px; font-weight: 800; color: var(--gold); display: block; line-height: 1.1; }
.qadha-lbl { opacity: .65; font-size: 14px; }
.qadha-zero { font-size: 17px; font-weight: 600; }
.qadha-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 22px; }
.qadha-row { padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.qadha-row.owes { border-color: var(--gold); }
.qadha-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.qadha-name { font-weight: 700; font-size: 16px; }
.qadha-name i { font-style: normal; font-weight: 400; opacity: .55; font-size: 13px; margin-left: 6px; }
.qadha-count { font-size: 21px; font-weight: 800; min-width: 44px; text-align: center; padding: 3px 10px; border-radius: 11px; background: color-mix(in srgb, var(--gold) 16%, transparent); }
.qadha-row:not(.owes) .qadha-count { opacity: .35; background: transparent; }
.qadha-actions { display: flex; gap: 10px; }
.qbtn { flex: 1; height: 46px; border-radius: 13px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.qbtn:disabled { opacity: .25; cursor: default; }
.qbtn.done { border-color: var(--gold); color: var(--gold); }
.qbtn.miss { border-color: #e08080; color: #e08080; }
#qadhaMissDay { width: 100%; margin-top: 2px; }
.qadha-recent-h { margin: 22px 0 4px; font-size: 14px; font-weight: 700; opacity: .7; }
.qadha-logrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.qadha-logtx i { font-style: normal; opacity: .55; }
.qadha-ts { opacity: .5; font-size: 13px; white-space: nowrap; }
.qadha-xlink { text-align: center; margin: 20px 0 4px; }
.qadha-xlink button { background: none; border: none; padding: 8px; color: var(--gold); font: inherit; font-size: 14px; cursor: pointer; opacity: .92; }
.res-hero { width: 100%; max-width: 480px; display: block; margin: 4px auto 0; }
.kutub-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.kutub-card { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--ink) 4%, transparent); text-decoration: none; color: inherit; }
.kutub-num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--gold); border: 1px solid var(--gold); margin-top: 2px; }
.kutub-main { display: flex; flex-direction: column; gap: 2px; }
.kutub-ar { font-size: 21px; }
.kutub-en { font-weight: 700; font-size: 16px; }
.kutub-meta { font-size: 13px; opacity: .6; }
.kutub-desc { font-size: 14px; opacity: .85; margin-top: 4px; }
.kutub-link { color: var(--gold); font-weight: 600; font-size: 14px; margin-top: 6px; }
.kutub-actions { display: flex; gap: 12px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.kutub-inapp { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); background: transparent; font-weight: 700; font-size: 14px; }
/* Hadith reader */
.hd-wrap { display: flex; flex-direction: column; gap: 10px; }
.hd-back { align-self: flex-start; }
.hd-title { margin: 4px 0; line-height: 1.4; }
.hd-search { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; font-size: 15px; }
.hd-chlist { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.hd-chrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--ink) 4%, transparent); color: inherit; text-align: left; width: 100%; }
.hd-cht { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.hd-chen { font-weight: 700; font-size: 15px; }
.hd-chc { font-size: 12px; opacity: .6; }
.hd-chev { color: var(--gold); font-size: 22px; }
.hd-cards { display: flex; flex-direction: column; gap: 12px; }
.hd-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.hd-num { color: var(--gold); font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.hd-ar { font-size: 19px; line-height: 2; font-family: var(--arab); margin: 0 0 10px; }
.hd-en { font-size: 14.5px; line-height: 1.65; opacity: .92; margin: 0; }
.hd-show-ar .hd-en { display: none; }
.hd-show-en .hd-ar { display: none; }
.hd-show-en .hd-ar, .hd-show-ar .hd-ar { margin-bottom: 0; }
.hd-langrow { display: flex; gap: 8px; }
.hd-langbtn { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; font-size: 13px; }
.hd-langbtn.on { border-color: var(--gold); color: var(--gold); font-weight: 700; }
.hd-resrow { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: inherit; margin-bottom: 8px; }
.hd-rMain { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.hd-rSec { font-size: 12px; color: var(--gold); font-weight: 700; }
.hd-rSnip { font-size: 13.5px; opacity: .85; line-height: 1.6; }
.hd-attr { font-size: 12px; opacity: .55; margin-top: 14px; }
.hd-continue { margin: 4px 0; align-self: flex-start; }
.hd-prog { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.hd-prog > i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }
/* Library shelf */
.shelf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; margin-top: 14px; }
/* Shelf bleeds to the screen edges: no side padding on the panel, title keeps its inset. */
#panel-resources .panel { padding-left: 0; padding-right: 0; }
#panel-resources .panel > h3, #panel-resources .panel > p.note { padding-left: 18px; padding-right: 18px; }
#panel-resources .panel > #resSearchWrap { padding-left: 18px; padding-right: 18px; }
#resSearch { margin-bottom: 4px; }
.hd-search { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.hd-hl { background: color-mix(in srgb, var(--gold) 20%, transparent); border-radius: 3px; padding: 0 2px; }
.res-bookhead { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; }
.res-bookhead img { width: 40px; height: 53px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.res-bookt { font-weight: 700; flex: 1 1 auto; min-width: 0; }
.res-bookc { font-size: 12px; color: var(--gold); white-space: nowrap; }
.res-hits { margin-left: -18px; margin-right: -18px; }
.res-dlrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.res-dlrow img { width: 34px; height: 45px; object-fit: cover; border-radius: 5px; flex: 0 0 auto; }
.res-dlbtn { margin-left: auto; padding: 8px 14px; font-size: 14px; flex: 0 0 auto; }
/* Reader: cards bleed to the screen edges like the shelf; chrome keeps its inset. */
#panel-hadith .panel { padding-left: 0; padding-right: 0; }
#panel-hadith .hd-wrap { padding-left: 18px; padding-right: 18px; }
#panel-hadith .hd-cards, #panel-hadith .hd-chlist, #panel-hadith #hdResults { margin-left: -18px; margin-right: -18px; }
.hd-card { scroll-margin-top: 78px; }
.shelf-book { background: none; border: none; padding: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; cursor: pointer; }
.shelf-cover { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.shelf-dl { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #14100a; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
/* Download prompt */
.hd-dlcard { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 16px 0; }
.hd-dlcover { width: 130px; border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.hd-dlbtns { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.hd-dlcard .hd-prog { width: 100%; }
/* Ramadan fasting tracker (reuses .qadha-* card styles) */
#ramadanSubRow { justify-content: center; }
#ramadanSubRow .ghost.on { border-color: var(--gold); color: var(--gold); }
.fast-progress { margin-top: 8px; font-size: 14px; opacity: .65; }
.fast-badge { font-size: 15px; font-weight: 800; min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.fast-badge.miss { background: color-mix(in srgb, #e08080 18%, transparent); color: #e08080; }
.qadha-row.done-mark { border-color: var(--green); }
.learn-fig { margin: 10px 0; }
.learn-fig img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; }
.learn-fig figcaption { font-size: 12px; opacity: .55; text-align: center; margin-top: 6px; }
.learn-support { margin-top: 20px; padding: 18px 16px 14px; border-radius: 16px; border: 1px solid var(--line); text-align: center; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.learn-support p { margin: 0 0 10px; font-size: 14px; opacity: .8; line-height: 1.6; }
.learn-support a { color: var(--gold); font-weight: 600; }
.foot-quiet { margin: 8px 0 0; font-size: 13px; opacity: .75; }
.foot-quiet a { color: inherit; }
.grid-daybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 10px; }
.grid-daylabel { background: none; border: none; color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; padding: 6px 12px; border-radius: 999px; }
.grid-daylabel:active { opacity: .6; }
/* prayer-grid day-step slide animation */
#vaktGrid.dslide-next { animation: dslideNext .28s ease; }
#vaktGrid.dslide-prev { animation: dslidePrev .28s ease; }
@keyframes dslideNext { from { transform: translateX(34px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes dslidePrev { from { transform: translateX(-34px); opacity: .25; } to { transform: none; opacity: 1; } }

/* Main app container: phone-card look on mobile, normal web-app width on desktop */
.app-main { width: min(560px, 100%); background: transparent; border: 0; border-radius: 24px; padding: 18px; margin: 4vh auto; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overflow-x: hidden; }
.app-main h3 { font-family: var(--serif); font-size: 28px; margin: 4px 0 12px; }
@media (min-width: 901px) {
  .app-main { width: min(1120px, calc(100% - 48px)); background: transparent; border: 0; border-radius: 0; padding: 26px 8px 120px; margin: 0 auto; max-height: none; overflow: visible; }
  .narrow { max-width: none; }
  /* single-child tab panels: drop the empty second .layout column */
  .layout:not(:has(> :nth-child(2))) { display: block; }
  .strip { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .dcards { grid-template-columns: repeat(2, 1fr); }
  .more-grid { grid-template-columns: repeat(5, 1fr); }
  /* desktop inset is only 8px + 2px: restore the smaller full-bleed margins */
  #panel-qibla .map-panel { margin-left: -10px; margin-right: -10px; }
  .shelf-grid { grid-template-columns: repeat(6, 1fr); }
}
/* Settings: Done button always visible (sticky footer) */
.set-foot { position: sticky; bottom: 0; z-index: 5; background: var(--panel); border-top: 1px solid var(--line); margin: 14px -20px -20px; padding: 12px 20px; border-radius: 0 0 var(--radius) var(--radius); }
.set-foot .primary { width: 100%; }
/* Tasbih classic: giant centered counter, whole stage is the tap target */
.tasbih-frame { position: relative; padding: 34px; }
#tasbihBeadFrame { position: absolute; inset: 0; pointer-events: none; }
#tasbihBeadFrame img { position: absolute; border-radius: 50%; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.tasbih-stage { text-align: center; padding: 48px 16px; min-height: 54vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tasbih-stage .sub { font-size: 24px; margin: 0; }
.tasbih-bigcount b { font-family: var(--serif); font-size: clamp(120px, 32vw, 220px); line-height: 1; font-variant-numeric: tabular-nums; display: block; transition: transform .08s ease; }
.tasbih-stage:active .tasbih-bigcount b { transform: scale(.94); }
.tasbih-hint { color: var(--muted); font-size: 15px; margin: 0; }
/* Tasbih beads: big centered stage, tap anywhere moves a bead */
.bead-stage { text-align: center; padding: 40px 16px; min-height: 54vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.bead-stage .sub { font-size: 24px; margin: 0; }
.bead-stage .bead-count { font-size: clamp(84px, 22vw, 150px); font-weight: 700; line-height: 1.1; }
.bead-stage .bead-count span { font-size: 26px; color: var(--muted); font-weight: 500; }
.bead-stage #beadStage { width: 100%; align-self: stretch; height: 120px; }

/* Screen-reader-only (SEO h1, keeps visual design unchanged) */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Holy days list */
.hd-year { font-weight: 700; font-size: 15px; color: var(--gold, #c9a227); margin: 14px 0 2px; }
.hd-past { opacity: .45; }
.hd-isnext { border: 1px solid var(--gold, #c9a227); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.hd-next { border: 1px solid var(--gold, #c9a227); border-radius: 12px; padding: 10px 12px; background: rgba(201,162,39,.08); margin-bottom: 6px; }
.hd-date, .hd-when { white-space: nowrap; font-size: 13px; color: var(--dim, #999); }
.hd-when { color: var(--gold, #c9a227); font-weight: 700; }
/* Greeting cards */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.greet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.greet-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: none; }
.greet-item img { width: 100%; height: auto; display: block; }
.greet-share { width: 100%; border: none; border-radius: 999px; color: #fff; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 4px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.greet-share svg { width: 20px; height: 20px; fill: #fff; }
.greet-item { cursor: pointer; }
#greetViewer { position: fixed; inset: 0; z-index: 300; background: rgba(4, 10, 20, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
#greetViewer.hidden { display: none; }
#greetViewerImg { max-width: 100%; max-height: 74vh; border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
#greetViewerShare { font-size: 17px; padding: 13px 34px; margin-bottom: 0; }
.names-h { margin: 20px 0 8px; font-family: var(--serif); font-size: 21px; }
.gv-actions { display: flex; gap: 12px; align-items: center; }
.gv-backbtn { border: 1px solid rgba(232, 196, 118, .55); background: rgba(10, 18, 32, .6); color: #e8c476; border-radius: 999px; padding: 12px 26px; font-size: 16px; font-weight: 700; cursor: pointer; margin: 0; }
.greet-item { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: none; padding: 10px; }
.card-thumb { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 0; background: none; cursor: pointer; aspect-ratio: 4/5; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#cardsCanvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0 12px; }
.flabel { display: block; font-size: 13px; color: var(--dim, #999); margin: 10px 0 4px; }
#cardsMsg { width: 100%; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.chips .chip { border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; background: none; color: inherit; font-size: 13px; cursor: pointer; }
.cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.cards-row label { display: block; font-size: 13px; color: var(--dim, #999); }
.cards-row .field { width: 100%; margin-top: 4px; }
.cards-row input[type="range"] { width: 100%; margin-top: 12px; }
.swatches { display: flex; gap: 8px; margin-top: 6px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatches button.on { border-color: var(--gold, #c9a227); }
.segbtns { display: flex; gap: 6px; margin-top: 6px; }
.segbtns button { flex: 1; border: 1px solid var(--line); border-radius: 8px; background: none; color: inherit; padding: 8px 4px; font-size: 13px; cursor: pointer; }
.segbtns button.on { border-color: var(--gold, #c9a227); color: var(--gold, #c9a227); }
.cards-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.linkbtn { background: none; border: none; color: var(--gold, #c9a227); font-size: 14px; cursor: pointer; padding: 4px 0; margin-bottom: 4px; }
/* Greeting cards v2: direct-manipulation stage */
.card-stage { position: relative; width: 100%; aspect-ratio: 4/5; max-height: 68dvh; margin: 8px auto; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); touch-action: pan-y; }
#cardBgImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cardText { position: absolute; transform: translateX(-50%); min-width: 40%; max-width: 96%; text-align: center; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.9); outline: none; cursor: text; line-height: 1.3; padding: 8px 12px; border-radius: 8px; }
#cardText:empty::before { content: attr(placeholder); opacity: .55; }
#cardText:focus { background: rgba(0,0,0,.25); }
.card-wh { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid #3b82f6; z-index: 5; cursor: ew-resize; transform: translate(-50%, -50%); touch-action: none; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.fabbtn { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(20,20,25,.72); color: #fff; font-size: 22px; cursor: pointer; backdrop-filter: blur(4px); z-index: 5; }
.fabbtn.small { width: 40px; height: 40px; font-size: 18px; }
#cardBackBtn { top: 10px; left: 10px; }
#cardShareFab { top: 10px; right: 10px; }
#cardPlusFab { bottom: 14px; right: 12px; background: #d6336c; font-size: 28px; line-height: 1; }
#cardPlusMenu { position: absolute; bottom: 70px; right: 12px; z-index: 6; background: rgba(18,18,24,.94); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 170px; backdrop-filter: blur(8px); }
#cardPlusMenu button { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: none; color: #fff; padding: 12px 14px; font-size: 15px; cursor: pointer; text-align: left; }
#cardPlusMenu button + button { border-top: 1px solid rgba(255,255,255,.08); }
#cardSheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; background: rgba(16,16,22,.96); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 12px 14px 18px; backdrop-filter: blur(10px); max-height: 70%; overflow-y: auto; color: #fff; }
#cardSheet .sheet-title { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
#cardSheet .sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#cardSheet .card-thumb.sel { outline: 3px solid var(--gold, #c9a227); }
#cardSheet .segbtns button { color: #fff; }
#cardSheet .flabel { color: #bbb; }
.fontrows { display: flex; flex-direction: column; gap: 6px; }
.fontrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid transparent; color: #fff; text-align: left; cursor: pointer; }
.fontrow.on { border-color: #c9a227; background: rgba(201,162,39,.12); }
.fontprev { font-size: 24px; line-height: 1; min-width: 44px; text-align: center; }
.fontname { flex: 1; font-size: 15px; }
.fontcheck { color: #c9a227; font-weight: 700; }

/* Khatm tracker */
.khatm-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.khatm-tab { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: #fff; font-size: 14px; cursor: pointer; }
.khatm-tab.on { border-color: #c9a227; background: rgba(201,162,39,.15); font-weight: 600; }
.khatm-prog { margin: 12px 0; }
.khatm-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.khatm-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0f6b4a, #c9a227); transition: width .3s; }
.khatm-count { margin-top: 6px; font-size: 14px; color: #bbb; }
.khatm-done { margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(201,162,39,.12); border: 1px solid #c9a227; text-align: center; font-weight: 600; }
.khatm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.khatm-jz { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #fff; cursor: pointer; }
.khatm-jz.on { border-color: #0f6b4a; background: rgba(15,107,74,.25); }
.kj-n { font-size: 12px; color: #999; }
.khatm-jz.on .kj-n { color: #7fd6a8; }
.kj-ar { font-size: 19px; font-family: Amiri, serif; line-height: 1.4; }
.kj-t { font-size: 11px; color: #999; }

/* Articles: About + FAQ accordion */
.art-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.art-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.03); }
.art-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; background: none; border: none; color: #fff; text-align: left; cursor: pointer; font-size: 15px; }
.art-ic { font-size: 20px; }
.art-ti { flex: 1; font-weight: 600; }
.art-ch { color: #c9a227; font-size: 20px; font-weight: 700; }
.art-a { padding: 0 14px 14px; color: #ddd; font-size: 14.5px; line-height: 1.65; }
.art-a p + p { margin-top: 8px; }

/* Big Quran play button with tap-pop feedback */
.big-play {
  width: 78px; height: 78px; border-radius: 50%;
  background: #e8734a; color: #fff; border: none;
  font-size: 32px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(232,115,74,.45);
  -webkit-tap-highlight-color: transparent;
}
.big-play.pop { animation: btnPop .38s ease; }
@keyframes btnPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* qadha auto-estimate calculator */
.qadha-calc { margin: 14px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(212,165,116,.06); }
.qadha-calc-h { margin: 0 0 8px; font-size: 15px; }
.qadha-calc-row { margin-bottom: 8px; }
.qadha-calc-row label { display: block; font-size: 13px; opacity: .85; }
.qadha-calc-row input { width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: inherit; font-size: 15px; color-scheme: dark; }
.qadha-calc-prev { margin: 8px 0 0; font-size: 14px; color: #d4a574; min-height: 1.2em; }

/* zikirmatik */
.zikir-list { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.zikir-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.zikir-row:active { background: rgba(212,165,116,.08); }
.zikir-name { flex: 1; }
.zikir-count { color: #d4a574; font-weight: 600; }
.zikir-go { opacity: .4; }
.zikir-sep { margin: 14px 0 4px; font-size: 14px; opacity: .7; }
.zikir-back { background: none; border: 0; color: #d4a574; font-size: 15px; padding: 8px 0; cursor: pointer; text-align: left; }
.zikir-form { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.zikir-form label { display: block; font-size: 13px; opacity: .85; }
.zikir-form input, .zikir-form textarea { width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: inherit; font-size: 15px; }
.tasbih-target { font-size: 22px; color: #d4a574; margin-left: 6px; }
.zikir-form textarea { resize: vertical; min-height: 64px; font-family: inherit; }
#kaabaImg { transition: transform .3s ease-out; will-change: transform; }
.vres-pin { border: 1px solid rgba(212,165,116,.7); background: rgba(212,165,116,.12); }
.vres-pin .vres-key { color: #d4a574; font-weight: 700; }

/* Custom gold Quran player: fixed bottom bar, only on the Quran tab */
#audio { display: none; }
#quranPlayer { display: none; }
body.quran-open #quranPlayer {
  display: flex;
  align-items: center;
  gap: 10px;
  position: fixed;
  left: 0; right: 0; bottom: 66px;
  z-index: 60;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 30, .96);
  border-top: 1px solid rgba(212, 165, 116, .45);
  backdrop-filter: blur(8px);
}
#qpPlay {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid #d4a574;
  background: radial-gradient(circle at 35% 30%, #e8c48a, #d4a574 60%, #a87c3f);
  color: #1a1206;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(212, 165, 116, .35);
}
#qpPlay:active { transform: scale(.94); }
.qp-time { color: #d4a574; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }
#qpSeek {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px;
  background: rgba(212, 165, 116, .25);
  outline: none; cursor: pointer;
}
#qpSeek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d09a, #d4a574 65%, #a87c3f);
  border: 1px solid #8d5e32;
  box-shadow: 0 1px 6px rgba(212, 165, 116, .5);
}
#qpSeek::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d09a, #d4a574 65%, #a87c3f);
  border: 1px solid #8d5e32;
}
#qpSeek::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(212, 165, 116, .25); }
body.quran-open #panel-quran { padding-bottom: 20px; }
/* The reader card's bottom clearance is small — the space belongs to the
   reading area: #verses grows (viewport-relative cap) to fill the card
   instead of leaving empty green below the text. */
body.quran-open #panel-quran .reader-card { padding-bottom: 16px; }
#verses { max-height: max(480px, calc(100dvh - 170px)) !important; }

.tile-live { position: relative; }
.tile-live .tic { position: relative; display: inline-block; }
.tile-play-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 30px; height: 22px;
  background: #f00; border-radius: 6px;
  color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,.4);
  pointer-events: none;
}

/* Back buttons: FINAL word (kept at end of file so no earlier per-button
   rule can override) — same gold + dark text as the Find-nearby highlight. */
#learnBack, #asrBack, #hsnBack, .hd-back, .zikir-back, .back-gold, #radioBtn, #compassBtn, #qiblaOpen, #tasbihReset, #beadReset, #voiceClose, #locClose, #vmClose, #gpsBtn {
  background: linear-gradient(135deg, #e8c476, #c9962e);
  border: 1px solid #c9962e;
  color: #1b140c;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, .35);
  border-radius: 999px;
  padding: 9px 18px;
}
.back-gold { margin-bottom: 10px; cursor: pointer; font-size: 15px; }
#qiblaOpen { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Round gold discs: Tasbih speaker + Quran reader microphones (2026-10-21). */
#tasbihMute, #voiceSearchBtn, #voiceMicBig {
  background: linear-gradient(135deg, #e8c476, #c9962e);
  border: 1px solid #c9962e;
  color: #1b140c;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, .35);
  border-radius: 50%;
}
#tasbihMute { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; font-size: 20px; }

/* Merged Reminders page: Notifications section at the same scale as the
   Reminders block above it (2026-10-21, his consistency note). */
#setSub-remind h3.sub { margin-top: 26px; }
.notif-row { display: flex; gap: 10px; align-items: center; margin: 13px 0; font-size: 17px; color: var(--ink); }
.notif-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.notif-head { font-size: 17px; }

/* Muted speaker: dark, dim disc — the state must read at a glance (2026-10-21). */
#tasbihMute.muted { background: #232f47; border-color: #3c4c6e; color: #8fa1bd; box-shadow: none; opacity: .8; }

/* Labels only — gold/black (2026-10-21, his correction of the gold-family
   pass): the next-prayer name, the date pill under the countdown, and the
   moment-card label pills. Cards and hero keep their classic look. */
.hero-label { display: inline-block; background: linear-gradient(135deg, #e8c476, #c9962e); color: #1b140c; padding: 6px 18px; border-radius: 999px; }
.date-pill { background: linear-gradient(135deg, #e8c476, #c9962e); border-color: #c9962e; color: #1b140c; font-weight: 600; }
.mcard-pill, .mcard-names .mcard-pill { background: linear-gradient(135deg, #e8c476, #c9962e); border-color: transparent; color: #1b140c; }

/* Previous/next day steppers on Home: round gold discs (2026-10-21). */
#gridDayPrev, #gridDayNext {
  background: linear-gradient(135deg, #e8c476, #c9962e);
  border: 1px solid #c9962e;
  color: #1b140c;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, .35);
  border-radius: 50%;
  width: 42px; height: 42px;
  font-size: 17px; font-weight: 700;
}

/* Header labels in gold text (2026-10-21, pilot): the city name and the
   Today label of the weather strip. Labels only — no cards change. */
#locLabel { color: #e8c476; }
.wx-day:first-child .wx-dn { color: #e8c476; opacity: 1; font-weight: 700; }

/* Next-prayer cell: its name is a label — gold, with a gold ring to match
   (was the last green on Home). */
.vakt.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(201, 150, 46, .25); }
.vakt.on .nm { color: #e8c476; }

/* Day labels in gold (2026-10-21): the day-stepper's Today/Tomorrow/
   Yesterday label and the calendar's weekday header row. Labels only. */
.grid-daylabel { color: #e8c476; }
#monthBody tr:first-child th { color: #e8c476; }

/* Day-stepper label: soft shade so the gold label reads over the floral
   art (2026-10-21, his suggestion). */
.grid-daylabel { background: rgba(8, 12, 22, .42); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); backdrop-filter: blur(3px); }

/* Install popup readability (2026-10-21, his iPhone report): the body and
   the iPhone steps were 12px notes — now full-size text with airy steps. */
#installPopup .note { font-size: 17px; line-height: 1.6; color: var(--ink); }
#installPopup #installPopIOS { line-height: 2; }
#installPopup .steps { color: #e8c476; font-weight: 800; }
#installPopup .row button { font-size: 16px; padding: 12px 20px; }

/* Settings install block: same readable size as the install popup
   (2026-10-21) — the hint/steps were 12px notes. */
#installRow #installHint { font-size: 16px; line-height: 1.9; color: var(--ink); }
#installRow .steps { color: #e8c476; font-weight: 800; }
