*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg:          #f7f5f2;
  --bg2:         #edecea;
  --bg3:         #e5e3e0;
  --sage:        #4a7c6f;
  --sage-dim:    rgba(74,124,111,0.08);
  --sage-border: rgba(74,124,111,0.18);
  --text:        #222222;
  --text-muted:  #666666;
  --text-dim:    #999999;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── HOME PAGE ── */
.home { max-width: 480px; margin: 0 auto; padding: 48px 24px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.home-header { text-align: center; margin-bottom: 36px; }
.home-crescent { font-size: 2rem; margin-bottom: 12px; }
.home-title { font-family: 'Playfair Display', serif; color: var(--text); font-size: clamp(1.5rem, 5vw, 2rem); margin-bottom: 6px; }
.home-sub { font-size: 0.82rem; color: var(--text-dim); letter-spacing: 0.04em; text-transform: uppercase; }

/* ── HOME EXTRAS ── */
.home-countdown { text-align: center; margin-bottom: 16px; padding: 14px 18px; background: var(--bg2); border-radius: 8px; }
.hc-label { font-size: 0.72rem; font-weight: 600; color: var(--sage); letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.hc-timer { display: flex; justify-content: center; gap: 4px; align-items: baseline; }
.hc-num { font-size: 1.45rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.hc-unit { font-size: 0.72rem; color: var(--text-dim); margin-right: 10px; }
.hc-nights { display: flex; justify-content: space-between; align-items: baseline; }
.rn-night { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.rn-remaining { font-size: 0.88rem; color: var(--text-muted); }

.tonight-pill { display: inline-block; background: var(--sage-dim); border: 1px solid var(--sage-border); color: var(--sage); font-size: 0.78rem; font-weight: 600; padding: 5px 14px; border-radius: 20px; letter-spacing: 0.04em; margin-bottom: 14px; }
.tonight-pill.odd { background: rgba(74,124,111,0.14); border-color: var(--sage); }

/* ── HADITH BLOCK ── */
.home-hadith { padding: 14px 18px; background: var(--bg2); border-left: 3px solid var(--sage); border-radius: 6px; margin-bottom: 16px; }
.hh-ar { font-family: 'Amiri', serif; font-size: 1.1rem; line-height: 2; direction: rtl; text-align: right; color: #111111; margin-bottom: 6px; }
.hh-transl { color: var(--text-muted); font-size: 0.84rem; line-height: 1.6; font-style: italic; margin-bottom: 5px; }
.hh-src { font-size: 0.7rem; color: var(--text-dim); }

/* ── QADR BLOCK ── */
.home-qadr { padding: 16px 20px; background: var(--bg2); border-left: 4px solid var(--sage); border-radius: 6px; margin-bottom: 14px; }
.hq-label { font-size: 0.68rem; font-weight: 600; color: var(--sage); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.hq-ar { font-family: 'Amiri', serif; font-size: 1.3rem; line-height: 2; direction: rtl; text-align: right; color: #111111; margin-bottom: 8px; }
.hq-translit { font-style: italic; color: var(--text-muted); font-size: 0.82rem; margin-bottom: 5px; }
.hq-transl { color: var(--text); font-size: 0.88rem; line-height: 1.6; margin-bottom: 5px; }
.hq-src { font-size: 0.72rem; color: var(--text-dim); }

/* ── SECTION CARDS ── */
.home-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-full { grid-column: 1 / -1; }
.section-card { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--bg2); border: none; border-left: 4px solid var(--sage); border-radius: 6px; cursor: pointer; transition: background 0.15s; text-align: left; width: 100%; font-family: 'Inter', sans-serif; }
.section-card:hover { background: var(--bg3); }
.section-card:active { background: var(--sage-dim); }
.sc-left { display: flex; flex-direction: column; gap: 3px; }
.sc-label { font-size: 0.72rem; font-weight: 600; color: var(--sage); letter-spacing: 0.1em; text-transform: uppercase; }
.sc-name { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.sc-count { font-size: 0.78rem; color: var(--text-dim); }
.sc-arrow { font-size: 1rem; color: var(--text-dim); }
.section-card:hover .sc-arrow { color: var(--sage); }

/* ── UMMI MENU ── */
.ummi-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ummi-theme-full { grid-column: 1 / -1; }
.ummi-back { background: none; border: none; color: var(--sage); font-family: 'Inter', sans-serif; font-size: 0.82rem; cursor: pointer; display: block; margin-bottom: 18px; padding: 0; letter-spacing: 0.01em; }
.ummi-back:hover { color: #2d5c52; }

/* ── OVERLAY ── */
#companion { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
#companion.open { opacity: 1; pointer-events: all; }

/* Header */
.cmp-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 52px; background: #ffffff; border-bottom: 1px solid var(--bg3); flex-shrink: 0; }
.cmp-back { background: none; border: none; color: var(--sage); font-family: 'Inter', sans-serif; font-size: 0.88rem; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 8px 0; letter-spacing: 0.01em; }
.cmp-back:hover { color: #2d5c52; }
.cmp-meta { display: flex; align-items: center; gap: 10px; }
.cmp-tab-label { font-size: 0.82rem; font-weight: 600; color: var(--text); letter-spacing: 0.06em; text-transform: uppercase; }
.cmp-counter { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Tabs */
.cmp-tabs { display: flex; overflow-x: auto; background: #ffffff; border-bottom: 1px solid var(--bg3); flex-shrink: 0; scrollbar-width: none; }
.cmp-tabs::-webkit-scrollbar { display: none; }
.cmp-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 500; padding: 11px 18px; cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s; letter-spacing: 0.02em; }
.cmp-tab.active { color: var(--sage); border-bottom-color: var(--sage); }
.cmp-tab:hover:not(.active) { color: var(--text); }

/* Body */
.cmp-body { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 28px 24px 24px; }
.cmp-card { max-width: 580px; width: 100%; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Dua card */
.card-label { display: inline-block; font-size: 0.72rem; font-weight: 600; color: var(--sage); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 20px; }
.card-ar { font-family: 'Amiri', serif; font-size: clamp(1.65rem, 5vw, 2.1rem); line-height: 2; direction: rtl; text-align: right; color: #111111; margin-bottom: 20px; padding: 18px 20px; background: #eeebe6; border-radius: 8px; }
.card-translit { font-style: italic; color: var(--text-muted); font-size: 1rem; line-height: 1.8; margin-bottom: 14px; }
.card-transl { color: var(--text); font-size: 1.05rem; line-height: 1.8; margin-bottom: 14px; }
.card-src { font-size: 0.76rem; color: var(--text-dim); }

/* Virtue reward block */
.card-virtue { background: var(--sage-dim); border-left: 3px solid var(--sage); padding: 12px 16px; border-radius: 6px; margin-top: 14px; font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

/* Info card (Last 10 tab) */
.info-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: var(--text); margin-bottom: 12px; }
.info-body { color: var(--text); font-size: 0.95rem; line-height: 1.8; margin-bottom: 10px; }
.info-src { font-size: 0.76rem; color: var(--text-dim); }
.fard-badge { display: inline-block; background: var(--sage); color: #ffffff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 4px; margin-bottom: 12px; }

/* Scroll article (Last 10 Nights guide) */
.scroll-article { max-width: 580px; width: 100%; }
.scroll-article h2 { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--text); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--bg3); }
.scroll-article h2:first-child { margin-top: 0; }
.scroll-article p { color: var(--text); font-size: 1.05rem; line-height: 1.8; margin-bottom: 8px; }
.scroll-article ul { padding-left: 18px; margin-bottom: 10px; }
.scroll-article li { color: var(--text); font-size: 1.05rem; line-height: 1.8; margin-bottom: 4px; }
.scroll-article .callout { background: var(--sage-dim); border-left: 3px solid var(--sage); padding: 12px 16px; border-radius: 6px; margin: 12px 0; font-size: 0.95rem; color: var(--text-muted); }
.scroll-article .src { font-size: 0.76rem; color: var(--text-dim); margin-top: 6px; }

/* Footer */
.cmp-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 60px; background: #ffffff; border-top: 1px solid var(--bg3); flex-shrink: 0; }
.cmp-footer.hidden { display: none; }
.cmp-nav-btn { background: none; border: 1px solid var(--bg3); color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.84rem; font-weight: 500; padding: 9px 20px; border-radius: 6px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.cmp-nav-btn:hover:not(:disabled) { background: var(--bg2); border-color: var(--sage); color: var(--sage); }
.cmp-nav-btn:disabled { opacity: 0.22; cursor: default; }
.cmp-footer-counter { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Site footer */
.site-footer { text-align: center; padding: 32px 24px 48px; }
.footer-ar { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--text-muted); direction: rtl; margin-bottom: 10px; }
.footer-tagline { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.05em; }

@media (max-width: 600px) {
  .cmp-header { padding: 0 14px; }
  .cmp-body { padding: 20px 16px 16px; }
  .cmp-footer { padding: 0 14px; }
  .cmp-nav-btn { padding: 9px 14px; font-size: 0.8rem; }
  .cmp-tab { padding: 11px 14px; font-size: 0.79rem; }
}
