/* Palette choisie par Islam le 16/11/2026 : #8C7764 · #BFAC95 · #D9C6B0 · #D9CEC5
   + teintes de lecture de la même famille (texte #4A3D32 / #7A6656, fond #F6F1EB). */
:root {
  --bg: #F6F1EB; --card: #FFFFFF; --line: #D9CEC5; --sand: #D9C6B0; --gold: #BFAC95;
  --brown: #8C7764; --btn: #7A6656; --text: #4A3D32; --muted: #7A6656; --deep: #3A2E24;
  --soft: #EFE7DD; --danger: #9E4A3C; --danger-bg: #F6E4DF; --ok: #5E7350;
  --r: 18px; --r-sm: 12px;
  --f: 'Tajawal', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
  --ft: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}
body.shape-b { --ft: 'Amiri', 'Traditional Arabic', serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f); font-size: 16px; line-height: 1.6; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--btn); }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }
.wrap { max-width: 560px; margin: 0 auto; padding: 14px 16px 24px; }

/* en-tête */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.hello { font-family: var(--ft); font-size: 22px; font-weight: 700; color: var(--deep); line-height: 1.3; }
.dates { font-size: 13px; color: var(--muted); }
.icons { display: flex; gap: 6px; }
.ib { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--brown); padding: 0; }
.ib svg { width: 20px; height: 20px; }

/* bandeau grossesse : forme a (simple) / b (arche) */
.hero { background: var(--sand); color: var(--deep); border-radius: 22px; padding: 18px 16px 16px; text-align: center; margin-bottom: 12px; cursor: pointer; }
body.shape-b .hero { background: var(--gold); border-radius: 180px 180px 22px 22px; padding-top: 34px; }
.hero .wk { font-family: var(--ft); font-size: 30px; font-weight: 700; line-height: 1.2; }
.hero .sub { font-size: 14px; color: #5A4A3D; }
.hero .fruit { font-size: 15px; margin-top: 2px; }
.bar { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; margin: 12px 6px 6px; }
.bar > i { display: block; height: 100%; background: var(--brown); border-radius: 8px; }
.hero .left { font-size: 13px; color: #5A4A3D; }

/* cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-family: var(--ft); font-size: 17px; font-weight: 700; color: var(--deep); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 small { font-family: var(--f); font-size: 13px; font-weight: 400; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--soft); }
.row:first-of-type { border-top: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t b { font-weight: 500; display: block; overflow-wrap: anywhere; }
.row .t span { font-size: 13px; color: var(--muted); display: block; }
.row .t span span { display: inline; font-size: inherit; }
.muted { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.danger { color: var(--danger); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* cases à cocher rondes */
.chk { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 2px solid var(--gold); background: var(--card); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.chk.on { background: var(--brown); border-color: var(--brown); }
.chk svg { width: 14px; height: 14px; }
.done .t b { text-decoration: line-through; color: var(--muted); }

/* boutons */
.btn { border: 1px solid var(--gold); background: var(--card); color: var(--btn); border-radius: 12px; padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 15px; }
.btn.p { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.s { padding: 4px 12px; font-size: 14px; }
.btn.full { width: 100%; padding: 12px; font-size: 16px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.red { color: var(--danger); border-color: #E2C2BA; }
.btn:disabled { opacity: .55; }
.pill { border-radius: 20px; padding: 4px 12px; font-size: 13px; background: var(--btn); color: #fff; border: 0; cursor: pointer; font-weight: 500; white-space: nowrap; }
.pill.off { background: var(--soft); color: var(--btn); }

/* puces de filtre */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 20px; padding: 5px 14px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--brown); color: #fff; border-color: var(--brown); }

/* onglets du module grossesse */
.tabs { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 2px; margin-bottom: 12px; overflow-x: auto; }
.tab { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 7px 8px; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--card); color: var(--deep); font-weight: 700; }

/* formulaires */
label.f { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=tel], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; font-size: 16px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brown); }
textarea { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; gap: 8px; margin-top: 8px; }
.quick input { flex: 1; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* feuille modale */
.veil { position: fixed; inset: 0; background: rgba(58, 46, 36, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet .grab { width: 44px; height: 5px; background: var(--line); border-radius: 4px; margin: 0 auto 10px; }
.sheet h2 { font-family: var(--ft); font-size: 20px; margin: 0 0 6px; color: var(--deep); }
.sheet .acts { display: flex; gap: 8px; margin-top: 16px; }
.sheet .acts .btn { flex: 1; padding: 11px; }
@media (min-width: 700px) { .veil { align-items: center; } .sheet { border-radius: 24px; } }

/* navigation basse */
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
.nav .in { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-around; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; font-size: 12px; color: #A8957F; text-decoration: none; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--brown); font-weight: 700; }

/* écran de verrouillage */
.lock { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.lock .logo { width: 84px; height: 84px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; color: var(--brown); margin-bottom: 14px; }
.lock .logo svg { width: 42px; height: 42px; }
.lock h1 { font-family: var(--ft); font-size: 26px; margin: 0; color: var(--deep); }
.dots { display: flex; gap: 12px; justify-content: center; margin: 22px 0 8px; direction: ltr; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brown); }
.dots i.on { background: var(--brown); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-top: 10px; direction: ltr; }
.pad button { height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 24px; color: var(--deep); cursor: pointer; }
.pad button.x { border: 0; background: transparent; font-size: 15px; color: var(--muted); }
.who { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.who button { min-width: 120px; }

/* semaine de grossesse */
.wknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; text-align: center; }
.facts div { background: var(--soft); border-radius: 12px; padding: 8px 4px; }
.facts b { display: block; font-size: 17px; color: var(--deep); }
.facts span { font-size: 12px; color: var(--muted); }
.para { margin: 8px 0; }
.para b { color: var(--deep); }
.alert { background: var(--danger-bg); border: 1px solid #E2C2BA; color: var(--danger); border-radius: var(--r); padding: 12px 16px; margin-bottom: 12px; }
.alert ul { margin: 6px 0 10px; padding-inline-start: 20px; font-size: 14px; }
.alert .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.alert a { text-decoration: none; }

/* album */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.album .it { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.album img { width: 100%; height: 100%; object-fit: cover; }
.album .cap { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(58,46,36,.55); color: #fff; font-size: 11px; padding: 2px 4px; }

/* prières */
.ptab { width: 100%; border-collapse: collapse; }
.ptab td { padding: 9px 4px; border-top: 1px solid var(--soft); }
.ptab tr:first-child td { border-top: 0; }
.ptab tr.next td { color: var(--deep); font-weight: 700; }
.ptab td.tm { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.compass { width: 190px; height: 190px; margin: 6px auto; position: relative; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.compass .needle { position: absolute; inset: 0; transition: transform .25s ease-out; }
.compass .n { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.mini { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
.mini i { width: 10px; height: 10px; border-radius: 50%; background: var(--soft); }
.mini i.on { background: var(--brown); }
.pchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* jours */
.month { font-family: var(--ft); font-weight: 700; color: var(--deep); margin: 14px 2px 6px; font-size: 16px; }
.ev { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; margin-bottom: 6px; }
.ev .em { font-size: 20px; width: 28px; text-align: center; }
.ev .t { flex: 1; min-width: 0; }
.ev .t b { font-weight: 500; display: block; }
.ev .t span { font-size: 12px; color: var(--muted); }
.ev .d { font-size: 12px; color: var(--btn); white-space: nowrap; text-align: left; }
.ev.mine { border-color: var(--gold); background: #FFFCF8; }
.tag { font-size: 11px; background: var(--soft); color: var(--muted); border-radius: 8px; padding: 0 6px; margin-inline-start: 4px; }

/* nom d'Islam en calligraphie (ruqʿa), encadré d'un ornement à étoile marocaine */
.brand { position: relative; text-align: center; padding: 8px 0 2px; margin-bottom: 14px; }
.brand .greet { font-size: 14px; color: var(--muted); letter-spacing: .3px; }
.brand .nm { font-family: 'Aref Ruqaa', 'Amiri', serif; font-size: 58px; line-height: 1.15; color: var(--brown); font-weight: 700; margin: 2px 0 0; }
.orn { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px auto 6px; max-width: 240px; color: var(--gold); }
.orn i { flex: 1; height: 1px; background: linear-gradient(to left, transparent, var(--gold)); }
.orn i:last-child { background: linear-gradient(to right, transparent, var(--gold)); }
.orn svg { width: 18px; height: 18px; }
.brand .dates { font-size: 13px; }
.brand .tools { position: absolute; top: 4px; left: 0; display: flex; gap: 6px; }
.lock .nm { font-family: 'Aref Ruqaa', 'Amiri', serif; font-size: 52px; color: var(--brown); line-height: 1.2; }
.setbtn { display: inline-flex; align-items: center; gap: 5px; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--btn); padding: 0 12px 0 10px; font-size: 14px; cursor: pointer; font-weight: 500; }
.setbtn svg { width: 18px; height: 18px; }

/* notes d'amélioration numérotées */
.fb { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.fb .no { min-width: 36px; height: 36px; border-radius: 50%; background: var(--sand); color: var(--deep); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.fb.done .no { background: var(--brown); color: #fff; }
.fb .t { flex: 1; min-width: 0; }
.fb .t p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb .meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.st { font-size: 11px; border-radius: 8px; padding: 1px 8px; background: var(--soft); color: var(--btn); }
.st.doing { background: #F3E6CF; color: #7A5A1E; }
.st.done { background: var(--brown); color: #fff; }
.reply { margin-top: 8px; background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 14px; border-inline-start: 3px solid var(--gold); }

.toast { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--deep); color: #fff; padding: 9px 18px; border-radius: 20px; font-size: 14px; z-index: 80; max-width: 90vw; text-align: center; }
svg.spark { width: 100%; height: 70px; }
