:root {
  --bg: #f4f0e6;
  --surface: #ffffff;
  --surface-2: #efe9db;
  --text: #17261f;
  --muted: #6c7a72;
  --line: rgba(13, 74, 61, .10);
  --primary: #0f6b55;
  --primary-soft: #e1efe9;
  --gold: #b88a2c;
  --gold-soft: #f6ecd2;
  --hero-1: #0f5544;
  --hero-2: #072e25;
  --on-hero: #fdf8ec;
  --danger: #b5412f;
  --shadow: 0 8px 28px rgba(7, 46, 37, .08);
  --radius: 22px;
  --ar: 'Amiri', 'Geeza Pro', 'Traditional Arabic', serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08130f; --surface: #101f1a; --surface-2: #172a23; --text: #e8efe9; --muted: #8ea398;
    --line: rgba(255, 255, 255, .08); --primary: #45c19a; --primary-soft: #143329; --gold: #dbb563;
    --gold-soft: #2a2414; --hero-1: #0f3f33; --hero-2: #04140f; --shadow: 0 8px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08130f; --surface: #101f1a; --surface-2: #172a23; --text: #e8efe9; --muted: #8ea398;
  --line: rgba(255, 255, 255, .08); --primary: #45c19a; --primary-soft: #143329; --gold: #dbb563;
  --gold-soft: #2a2414; --hero-1: #0f3f33; --hero-2: #04140f; --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 15px; line-height: 1.5;
  min-height: 100vh; overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
a { color: var(--primary); }
.ic { width: 22px; height: 22px; flex: none; }
.ar { font-family: var(--ar); direction: rtl; }

#view { max-width: 640px; margin: 0 auto; padding: env(safe-area-inset-top) 16px calc(100px + env(safe-area-inset-bottom)); }
/* Bande sous la barre d'état de l'iPhone (encoche / Dynamic Island) */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 30; }
.topbar { top: env(safe-area-inset-top) !important; }

/* ---------- Barre d'onglets ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
#tabbar button {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0; border-radius: 14px; transition: color .2s;
}
#tabbar .ti { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background .2s; }
#tabbar button.active { color: var(--primary); }
#tabbar button.active .ti { background: var(--primary-soft); }

/* ---------- En-têtes ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 18px 0 14px; position: sticky; top: 0; z-index: 10; background: var(--bg); }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.page-title { font-size: 26px; font-weight: 800; margin: 22px 0 14px; letter-spacing: -.02em; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 4px 10px; }

/* ---------- Hero ---------- */
.hero {
  margin: 12px -4px 0; border-radius: 28px; padding: 18px 20px 20px; color: var(--on-hero); position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, rgba(219, 181, 99, .28), transparent 55%), linear-gradient(160deg, var(--hero-1), var(--hero-2));
  box-shadow: 0 18px 40px rgba(7, 46, 37, .25);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .09; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23f6e7bf' stroke-width='1'%3E%3Cpath d='M30 5l7 18 18 7-18 7-7 18-7-18-18-7 18-7z'/%3E%3Crect x='17' y='17' width='26' height='26' transform='rotate(45 30 30)'/%3E%3C/g%3E%3C/svg%3E");
}
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 7px 12px 7px 9px; font-size: 13px; font-weight: 700; min-width: 0; flex-shrink: 1; }
.hero-top > .row { flex: none; }
.chip-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn .ic { width: 17px; height: 17px; }
.hero .icon-btn { background: rgba(255, 255, 255, .12); box-shadow: none; color: var(--on-hero); }
.hero-date { margin-top: 14px; font-size: 13px; opacity: .85; text-transform: capitalize; }
.hero-date b { color: #f0d48f; font-weight: 700; }
.hero-next { text-align: center; margin: 18px 0 10px; }
.hero-next .label { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; opacity: .7; font-weight: 700; }
.hero-next .name { font-size: 26px; font-weight: 800; margin-top: 2px; display: flex; gap: 10px; justify-content: center; align-items: baseline; }
.hero-next .name .ar { font-size: 26px; color: #f0d48f; font-weight: 700; }
.countdown { font-size: 50px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-next .at { opacity: .75; font-size: 14px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #e8c672, #f6e3a7); transition: width .6s; }
.progress-labels { display: flex; justify-content: space-between; font-size: 11.5px; opacity: .7; margin-top: 6px; }

.src-tag { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 11.5px; font-weight: 700; opacity: .75; letter-spacing: .02em; }
.src-tag .ic { width: 14px; height: 14px; }
.lang-seg { padding: 3px; border-radius: 12px; gap: 2px; }
.lang-seg button { padding: 5px 9px; font-size: 12px; border-radius: 9px; }
.hero .lang-seg { background: rgba(255, 255, 255, .12); }
.hero .lang-seg button { color: rgba(253, 248, 236, .7); }
.hero .lang-seg button.on { background: #f0d48f; color: #072e25; box-shadow: none; }
.dyn-current { display: flex; gap: 12px; align-items: center; background: var(--primary-soft); color: var(--primary); border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
.dyn-current b { display: block; color: var(--text); }
.dyn-current small { color: var(--muted); font-size: 12.5px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.card h2, .card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }

.banner { display: flex; gap: 12px; align-items: center; background: var(--gold-soft); border-radius: 18px; padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.banner .btn { margin-left: auto; }

/* Horaires */
.times { padding: 6px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 16px; transition: background .2s; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow.current { background: var(--primary-soft); border-color: transparent; }
.prow.current + .prow { border-color: transparent; }
.prow .pico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); flex: none; }
.prow.current .pico { background: var(--primary); color: #fff; }
.prow .pname { font-weight: 700; line-height: 1.2; flex: 1; min-width: 0; }
.prow .pname small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.prow .par { font-family: var(--ar); color: var(--muted); font-size: 17px; }
.prow .ptime { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.prow.next .ptime { color: var(--primary); }
.bell { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.bell.on { color: var(--gold); }
.bell .ic { width: 19px; height: 19px; }
.bell-spacer { width: 34px; flex: none; }
.badge { white-space: nowrap; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--primary); color: #fff; padding: 2px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }

/* Suivi */
.tracker-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.tchip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 9px; border-radius: 16px; background: var(--surface-2); font-size: 12px; font-weight: 700; transition: transform .15s, background .2s; }
.tchip .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: all .2s; }
.tchip.done { background: var(--primary-soft); color: var(--primary); }
.tchip.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.tchip:active { transform: scale(.95); }
.tchip .dot .ic { width: 15px; height: 15px; }
.week { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.week .d { flex: 1; text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; }
.week .bar { height: 34px; border-radius: 8px; background: var(--surface-2); position: relative; overflow: hidden; margin-bottom: 4px; }
.week .bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--primary); border-radius: 8px; }
.week .d.today { color: var(--primary); }

/* Grille d'accès rapide */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 4px 12px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; color: var(--text); transition: transform .15s; }
.tile:active { transform: scale(.96); }
.tile .tic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tile:nth-child(even) .tic { background: var(--gold-soft); color: var(--gold); }

/* Verset du jour */
.verse .ar { font-size: 25px; line-height: 2; text-align: right; margin: 8px 0; }
.verse .fr { font-size: 14.5px; color: var(--text); opacity: .85; }
.verse .ref { font-size: 12.5px; font-weight: 700; color: var(--gold); margin-top: 8px; display: inline-block; text-decoration: none; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--gold); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
:root[data-theme="dark"] .btn { color: #06241b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #06241b; } }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }

/* Champs */
.input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--primary); }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; }
.search .input { padding-left: 42px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border-radius: 99px; transition: background .2s; cursor: pointer; border: 1px solid var(--line); }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }

.setting { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting .lbl { flex: 1; font-weight: 600; }
.setting .lbl small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); font-weight: 800; font-size: 17px; }
.stepper output { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }

/* Listes */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 14px; }
.litem { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; text-decoration: none; color: var(--text); }
.litem + .litem { border-top: 1px solid var(--line); }
.litem:active { background: var(--surface-2); }
.litem .lic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.litem .lt { flex: 1; min-width: 0; font-weight: 700; }
.litem .lt small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.chev { color: var(--muted); width: 18px; }

/* Coran */
.snum { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--primary); position: relative; }
.snum::before { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--gold); border-radius: 8px; transform: rotate(45deg); opacity: .6; }
.sname-ar { font-family: var(--ar); font-size: 21px; color: var(--primary); }
.continue { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: var(--on-hero); border-radius: var(--radius); padding: 16px; text-decoration: none; margin-top: 4px; }
.continue .ic { width: 26px; height: 26px; color: #f0d48f; }
.continue small { display: block; opacity: .75; font-weight: 500; }

.surah-head { text-align: center; padding: 22px 16px; border-radius: var(--radius); color: var(--on-hero); background: radial-gradient(100% 120% at 50% 0%, rgba(219, 181, 99, .25), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--hero-2)); }
.surah-head .ar { font-size: 38px; color: #f0d48f; line-height: 1.5; }
.surah-head .meta { font-size: 13px; opacity: .8; }
.bismillah { text-align: center; font-family: var(--ar); font-size: 30px; margin: 18px 0 4px; color: var(--text); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; position: sticky; top: 72px; z-index: 9; background: var(--bg); padding: 8px 0; }
.toggle { padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.toggle.on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.ayah { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow); scroll-margin-top: 140px; transition: box-shadow .3s, background .3s; }
.ayah.playing { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.ayah-bar { display: flex; align-items: center; gap: 4px; }
.ayah-num { font-size: 12px; font-weight: 800; color: var(--primary); background: var(--primary-soft); padding: 3px 10px; border-radius: 99px; margin-right: auto; }
.ayah-bar button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.ayah-bar button.on { color: var(--gold); }
.ayah-bar .ic { width: 19px; height: 19px; }
.ayah .ar-text { font-family: var(--ar); direction: rtl; text-align: right; line-height: 2.1; margin: 10px 0 6px; }
.ayah-end { color: var(--gold); font-size: .8em; white-space: nowrap; }
.ayah .tr { color: var(--gold); font-size: 14px; font-style: italic; margin: 6px 0; }
.ayah .fr { font-size: 15px; margin: 6px 0 0; opacity: .9; }
.surah-nav { display: flex; gap: 10px; margin-top: 18px; }
.surah-nav .btn { flex: 1; }

/* Qibla */
.compass-wrap { display: grid; place-items: center; padding: 18px 0 8px; }
.compass { width: min(78vw, 320px); aspect-ratio: 1; position: relative; }
.compass .pointer { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 16px solid var(--gold); z-index: 2; }
.dial { position: absolute; inset: 0; transition: transform .25s ease-out; }
.dial svg { width: 100%; height: 100%; }
.qibla-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.aligned { text-align: center; font-weight: 800; color: var(--primary); min-height: 24px; margin-top: 6px; }

/* Tasbih */
.dhikr-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.dhikr-chips::-webkit-scrollbar { display: none; }
.dhikr-chips button { flex: none; padding: 9px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.dhikr-chips button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.tasbih-text { text-align: center; margin-top: 14px; }
.tasbih-text .ar { font-size: 36px; line-height: 1.6; }
.tasbih-text .fr { color: var(--muted); font-size: 14px; }
.counter { display: grid; place-items: center; margin: 18px 0; }
.counter-btn { width: min(70vw, 270px); aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--hero-1), var(--hero-2)); color: var(--on-hero); box-shadow: 0 20px 50px rgba(7, 46, 37, .35), inset 0 2px 0 rgba(255, 255, 255, .12); transition: transform .08s; user-select: none; touch-action: manipulation; }
.counter-btn:active { transform: scale(.97); }
.counter-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.counter-btn .num { font-size: 68px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.counter-btn .of { font-size: 14px; opacity: .7; margin-top: 4px; }
.tasbih-actions { display: flex; gap: 10px; justify-content: center; }

/* Douas / Noms */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chips button { padding: 7px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--muted); }
.chips button.on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.dua .cat { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.dua h3 { margin: 2px 0 8px !important; }
.dua .ar { font-size: 24px; line-height: 2; text-align: right; }
.dua .tr { font-style: italic; color: var(--gold); font-size: 14px; margin: 6px 0; }
.dua .fr { margin: 6px 0; }
.dua .src { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.name-card { background: var(--surface); border-radius: 18px; padding: 14px 12px; text-align: center; box-shadow: var(--shadow); position: relative; }
.name-card .n { position: absolute; top: 10px; left: 12px; font-size: 11px; font-weight: 800; color: var(--muted); }
.name-card .ar { font-size: 28px; color: var(--primary); line-height: 1.7; }
.name-card b { display: block; font-size: 14px; }
.name-card span { font-size: 12.5px; color: var(--muted); }

/* Calendrier */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head .t { flex: 1; text-align: center; }
.cal-head .t b { display: block; font-size: 17px; text-transform: capitalize; }
.cal-head .t span { font-size: 12.5px; color: var(--gold); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal .wd { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); padding-bottom: 4px; }
.cal .c { aspect-ratio: 1 / 1.05; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; background: var(--surface-2); }
.cal .c b { font-size: 15px; }
.cal .c small { font-size: 10.5px; color: var(--gold); font-weight: 700; }
.cal .c.today { background: var(--primary); color: #fff; }
.cal .c.today small { color: #f6e3a7; }
.cal .c.ev::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.cal .c.fri b { color: var(--primary); }
.cal .c.today.fri b { color: #fff; }
.event { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.event + .event { border-top: 1px solid var(--line); }
.event .date { width: 52px; text-align: center; flex: none; background: var(--gold-soft); border-radius: 14px; padding: 6px 0; }
.event .date b { display: block; font-size: 19px; line-height: 1.1; color: var(--gold); }
.event .date span { font-size: 11px; text-transform: uppercase; font-weight: 800; color: var(--gold); }
.event .info { flex: 1; min-width: 0; }
.event .info b { display: block; }
.event .info small { color: var(--muted); }
.event .in { font-size: 12px; font-weight: 800; color: var(--primary); white-space: nowrap; }

/* Tableau mensuel */
.table-wrap { overflow-x: auto; margin-top: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.mt { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.mt th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 6px 8px; position: sticky; top: 0; background: var(--surface); }
.mt td { text-align: center; padding: 8px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.mt td:first-child { text-align: left; padding-left: 12px; font-weight: 700; }
.mt td:first-child small { display: block; color: var(--gold); font-size: 10.5px; font-weight: 700; }
.mt tr.today td { background: var(--primary-soft); font-weight: 800; }
.mt tr.fri td:first-child { color: var(--primary); }

/* Guide */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 10px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.steps b { display: block; }
table.rk { width: 100%; border-collapse: collapse; font-size: 14px; }
.rk th, .rk td { padding: 9px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.rk th { font-size: 11.5px; text-transform: uppercase; color: var(--muted); }
.rk td:first-child { text-align: left; font-weight: 800; }
.rk .f { font-weight: 800; color: var(--primary); font-size: 16px; }

/* Zakat */
.field { margin-top: 12px; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.field label small { color: var(--muted); font-weight: 500; }
.result { text-align: center; padding: 22px 16px; }
.result .big { font-size: 38px; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }

/* Résultats de recherche */
.results { margin-top: 8px; }
.results button { display: block; width: 100%; text-align: left; padding: 11px 6px; border-top: 1px solid var(--line); }
.results button small { color: var(--muted); }

.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 380px) {
  .countdown { font-size: 42px; }
  .grid { gap: 8px; }
  .tile { font-size: 11px; }
  .prow .par { display: none; }
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
