/* =========================================================
   Sunnah platform — beige theme on Bootstrap 5 RTL
   ========================================================= */
/* ---------- Palettes ----------
   Default «sage»: off-white, sage green, earthy rose & beige details.
   [data-palette="slate"]: neutral greys. [data-palette="beige"]: the original warm look. */
:root {
  --bg: #F8F5ED;
  --surface: #FFFDF8;
  --surface-2: #F2EDE2;
  --surface-3: #E8E1D3;
  --line: #ECE5D7;
  --line-strong: #D9CFBC;
  --ink: #2C3A30;
  --ink-2: #5D665A;
  --ink-3: #959B8E;
  --brand: #3F5F4A;
  --brand-strong: #2E4837;
  --brand-tint: #E3EADF;
  --on-brand: #FFFFFF;
  --sage: #6F7F6B; --sage-tint: #E7ECE3;
  --rose: #E3C9C1; --rose-tint: #F7EBE6;
  --beige: #D8C6A9; --beige-tint: #F2EADB;
  --terra: #A2603F;
  --spiritual: #B0614A;
  --social: #4F8A5B;
  --physical: #5A7FA0;
  --c-brand: #3F5F4A;
  --c-olive: #6F7F6B;
  --c-blue: #5A7FA0;
  --c-rose: #B4705F;
  --danger: #B04A3A;
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(44, 58, 48, .04), 0 10px 28px rgba(44, 58, 48, .06);
  --pattern-opacity: 0;
  --font-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Amiri", "Traditional Arabic", serif;
  color-scheme: light;
}
:root[data-palette="slate"] {
  --bg: #F3F4F7;
  --surface: #FFFFFF;
  --surface-2: #EEF0F4;
  --surface-3: #E4E7EC;
  --line: #E6E8EE;
  --line-strong: #CDD2DB;
  --ink: #273246;
  --ink-2: #5F6B80;
  --ink-3: #98A1B1;
  --brand: #5B6987;
  --brand-strong: #44506A;
  --brand-tint: #E6E9F0;
  --on-brand: #FFFFFF;
  --spiritual: #B5554A;
  --social: #4E8A6A;
  --physical: #4C72A8;
  --c-brand: #5B6987;
  --c-olive: #4E8A6A;
  --c-blue: #4C72A8;
  --c-rose: #B06A7E;
  --danger: #B5453A;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(39, 50, 70, .04), 0 8px 24px rgba(39, 50, 70, .06);
  --pattern-opacity: 0;
  --font-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Amiri", "Traditional Arabic", serif;
  color-scheme: light;
}
:root[data-palette="slate"], :root[data-palette="beige"] { --sage-tint: var(--brand-tint); --rose-tint: var(--surface-2); --beige-tint: var(--surface-2); --terra: var(--brand); }
:root[data-palette="beige"] {
  --bg: #F2EBDD; --surface: #FFFBF3; --surface-2: #F7EFE1; --surface-3: #EFE4D0; --line: #E4D6BE; --line-strong: #D3C0A0;
  --ink: #2F261B; --ink-2: #6E5E48; --ink-3: #9A8A72; --brand: #8C6A3A; --brand-strong: #6B4F28; --brand-tint: #F0E2C8; --on-brand: #FFFBF3;
  --spiritual: #A24E38; --social: #5C7A3E; --physical: #3D6A8F; --c-brand: #8C6A3A; --c-olive: #6E7F45; --c-blue: #3D6A8F; --c-rose: #A35C5C;
  --danger: #A33D2F; --pattern-opacity: .38;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141915; --surface: #1C231E; --surface-2: #242D26; --surface-3: #2D3830; --line: #2B352D; --line-strong: #3A473C;
    --ink: #E9EEE7; --ink-2: #AEB8AA; --ink-3: #808B7D; --brand: #A9C4AF; --brand-strong: #C6DBCB; --brand-tint: #26332A; --on-brand: #141915;
    --sage-tint: #26332A; --rose-tint: #33282A; --beige-tint: #2F2B24; --terra: #DDA287;
    --spiritual: #E08A7E; --social: #7FC4A0; --physical: #8DB0E0; --c-brand: #9DAAC8; --c-olive: #7FC4A0; --c-blue: #8DB0E0; --c-rose: #DCA0B2;
    --danger: #E27A6A; --shadow: none; --pattern-opacity: 0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141915; --surface: #1C231E; --surface-2: #242D26; --surface-3: #2D3830; --line: #2B352D; --line-strong: #3A473C;
  --ink: #E9EEE7; --ink-2: #AEB8AA; --ink-3: #808B7D; --brand: #A9C4AF; --brand-strong: #C6DBCB; --brand-tint: #26332A; --on-brand: #141915;
  --sage-tint: #26332A; --rose-tint: #33282A; --beige-tint: #2F2B24; --terra: #DDA287;
  --spiritual: #E08A7E; --social: #7FC4A0; --physical: #8DB0E0; --c-brand: #9DAAC8; --c-olive: #7FC4A0; --c-blue: #8DB0E0; --c-rose: #DCA0B2;
  --danger: #E27A6A; --shadow: none; --pattern-opacity: 0; color-scheme: dark;
}
:root[data-theme="dark"][data-palette="beige"], :root[data-palette="beige"]:not([data-theme="light"]) { }

html { scroll-padding-top: 1rem; }
body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
/* The one decorative element: a faint eight-point-star lattice behind the header */
.page-pattern {
  position: absolute; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: -1;
  opacity: var(--pattern-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23C9B48F' stroke-width='.7'%3E%3Cpath d='M36 6l8.5 21.5L66 36l-21.5 8.5L36 66l-8.5-21.5L6 36l21.5-8.5z'/%3E%3Cpath d='M15 15h42v42H15z' transform='rotate(45 36 36)'/%3E%3Cpath d='M15 15h42v42H15z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.app-shell { position: relative; } /* no z-index: it would trap Bootstrap modals under their backdrop */

a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.text-muted, .muted { color: var(--ink-2) !important; }
.small-muted { color: var(--ink-3); font-size: .82rem; }
.font-text { font-family: var(--font-text); }
.container-app { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* ---------- Header ---------- */
.site-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.6rem 0 1rem; }
.brand-block { text-align: center; }
.brand-title {
  font-family: var(--font-text); font-weight: 700; font-size: 2.5rem; line-height: 1.2;
  color: var(--brand); margin: 0; letter-spacing: 0;
}
.brand-title a { color: inherit; }
.brand-rule { width: 64px; height: 2px; background: var(--line-strong); margin: .35rem auto .25rem; border-radius: 2px; }
.brand-tagline { font-family: var(--font-text); color: var(--ink-2); font-size: 1rem; margin: 0; }
.header-search { justify-self: start; width: 100%; max-width: 300px; position: relative; }
.header-search input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: .55rem 2.4rem .55rem 1rem; color: var(--ink); font-size: .9rem;
}
.header-search input::placeholder { color: var(--ink-3); }
.header-search svg { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.header-tools { justify-self: end; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.date-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .3rem .8rem; display: flex; align-items: center; gap: .5rem; line-height: 1.3;
}
.date-chip svg { color: var(--brand); width: 18px; height: 18px; }
.date-chip small { display: block; color: var(--ink-3); font-size: .72rem; }
.date-chip strong { font-size: .85rem; display: block; }
.date-chip .greg { display: block; font-size: .74rem; color: var(--ink-2); }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--brand); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--brand); color: var(--on-brand); border: 0; border-radius: 10px;
  padding: .45rem 1rem; font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: .4rem;
}
.btn-brand:hover, .btn-brand:focus { background: var(--brand-strong); color: var(--on-brand); }
.btn-soft {
  background: var(--brand-tint); color: var(--brand-strong); border: 1px solid transparent; border-radius: 10px;
  padding: .45rem .9rem; font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.btn-soft:hover { border-color: var(--line-strong); color: var(--brand-strong); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); border-radius: 10px;
  padding: .4rem .85rem; font-size: .85rem; display: inline-flex; align-items: center; gap: .35rem;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-danger-soft { background: transparent; border: 1px solid var(--line); color: var(--danger); border-radius: 10px; padding: .4rem .85rem; font-size: .85rem; }
.btn-brand svg, .btn-soft svg, .btn-ghost svg { width: 16px; height: 16px; }

/* ---------- Main nav ---------- */
.main-nav {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .6rem; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; margin: .75rem 0 2rem;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  position: relative; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .5rem .85rem; border-radius: 999px; color: var(--ink-2); font-size: .9rem; font-weight: 500;
}
.main-nav a svg { width: 17px; height: 17px; }
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a.active { color: var(--brand-strong); font-weight: 700; }
.main-nav a.active::after {
  content: ""; position: absolute; inset-inline: .85rem; bottom: .2rem; height: 2px; background: var(--brand); border-radius: 2px;
}
.nav-badge {
  position: absolute; top: .1rem; inset-inline-end: .35rem; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: .65rem; display: grid; place-items: center;
}

/* ---------- Panels & headings ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.35rem; }
.panel + .panel { margin-top: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.panel-title { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; font-weight: 700; margin: 0; }
.panel-title svg { width: 19px; height: 19px; color: var(--brand); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .55rem; }
.section-head h1 svg { color: var(--brand); width: 22px; height: 22px; }
.section-rule { position: relative; height: 1px; background: var(--line); margin: -.75rem 0 1.75rem; }
.section-rule::after { content: ""; position: absolute; inset-inline-end: 0; top: -1px; width: 90px; height: 3px; border-radius: 3px; background: var(--brand); opacity: .55; }
.lead-text { color: var(--ink-2); margin-top: -1rem; margin-bottom: 1.5rem; }

/* ---------- Daily wird ---------- */
.habit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.habit {
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; background: var(--surface);
  display: flex; flex-direction: column; gap: .55rem;
}
.habit-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.habit-name { font-weight: 600; font-size: .95rem; }
.habit-count { color: var(--ink-3); font-size: .85rem; font-variant-numeric: tabular-nums; direction: ltr; }
.habit.done .habit-count { color: var(--social); font-weight: 600; }
.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--hc, var(--c-brand)); transition: width .25s ease; }
.habit[data-color="olive"] { --hc: var(--c-olive); }
.habit[data-color="blue"] { --hc: var(--c-blue); }
.habit[data-color="rose"] { --hc: var(--c-rose); }
.habit-tap {
  width: 100%; border: 0; border-radius: 10px; padding: .55rem; background: var(--brand-tint); color: var(--brand-strong);
  font-family: var(--font-text); font-size: 1.05rem; font-weight: 700; cursor: pointer; user-select: none;
}
.habit-tap:active { transform: scale(.985); }
.habit-tap.pulse { animation: pulse .3s ease; }
@keyframes pulse { 50% { background: var(--line); } }
.habit-row { display: flex; gap: .5rem; }
.habit-row > * { flex: 1; }

/* ---------- Content cards ---------- */
.item-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.item-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; }
.item-desc { color: var(--brand-strong); font-size: .9rem; margin: 0; }
.quote { font-family: var(--font-text); font-size: 1.22rem; line-height: 2; color: var(--ink); margin: .25rem 0 .5rem; }
.quote.sm { font-size: 1.05rem; line-height: 1.9; }
.ref { color: var(--ink-3); font-size: .8rem; }
.ref::before { content: "— "; }
.card-actions { display: flex; gap: .35rem; margin-top: .6rem; }
.icon-act { border: 0; background: transparent; color: var(--ink-3); width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; cursor: pointer; }
.icon-act:hover { color: var(--brand); background: var(--surface-2); }
.icon-act svg { width: 18px; height: 18px; }
.icon-act.on { color: var(--c-rose); }
.icon-act.on svg { fill: currentColor; }

.check-btn {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  background: transparent; color: var(--ink-3); display: inline-grid; place-items: center; cursor: pointer;
}
.check-btn svg { width: 14px; height: 14px; }
.check-btn.on { background: var(--social); border-color: var(--social); color: var(--surface); }
.check-row { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row strong { display: block; font-size: .93rem; }

.sunan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
.sunan-grid .s-item { display: flex; gap: .7rem; }
.slot-chip { background: var(--brand-tint); color: var(--brand-strong); border-radius: 999px; padding: .1rem .7rem; font-size: .78rem; font-weight: 600; }

/* ---------- Adhkar counter cards ---------- */
.dhikr { position: relative; cursor: pointer; transition: border-color .15s; }
.dhikr:hover { border-color: var(--line-strong); }
.dhikr.done { background: var(--surface-2); }
.dhikr.done .quote { color: var(--ink-2); }
.dhikr-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .4rem; }
.counter {
  min-width: 74px; height: 38px; padding: 0 .8rem; border-radius: 999px; border: 1.5px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font-weight: 700; direction: ltr;
  font-variant-numeric: tabular-nums; color: var(--brand-strong); background: var(--surface);
}
.dhikr.done .counter { background: var(--social); border-color: var(--social); color: var(--surface); }
.virtue { font-size: .86rem; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: .4rem .7rem; margin: .25rem 0 .5rem; }
.pill-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.pill-tabs a { border: 1px solid var(--line); background: var(--surface); padding: .35rem .9rem; border-radius: 999px; color: var(--ink-2); font-size: .88rem; }
.pill-tabs a.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Prophet's day ---------- */
.legend { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1.5rem; font-size: .85rem; color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: .35rem; }
.t-spiritual { color: var(--spiritual); } .bg-spiritual { background: var(--spiritual); }
.t-social { color: var(--social); } .bg-social { background: var(--social); }
.t-physical { color: var(--physical); } .bg-physical { background: var(--physical); }
.period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.period { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.15rem 1.2rem; }
.period-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.period-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.period-head small { color: var(--ink-3); }
.tile-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.tile-icon svg { width: 20px; height: 20px; }
.period ul { list-style: none; padding: 0; margin: 0; }
.period li { display: flex; gap: .5rem; align-items: baseline; padding: .3rem 0; font-size: .92rem; }
.period li .dot { flex: none; transform: translateY(-1px); }

/* ---------- Stories ---------- */
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.story-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1rem;
  text-align: center; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: .6rem; min-height: 120px; justify-content: center;
}
.story-tile:hover { border-color: var(--line-strong); color: var(--ink); }
.story-tile svg { color: var(--brand); width: 24px; height: 24px; }
.story-tile span { font-weight: 600; }
.story-body { font-family: var(--font-text); font-size: 1.2rem; line-height: 2.1; max-width: 68ch; }
.lesson { border-inline-start: 3px solid var(--brand); padding: .3rem 1rem; color: var(--ink-2); margin: 1.25rem 0; }

/* ---------- Achievements ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat b { display: block; font-size: 1.6rem; color: var(--brand-strong); line-height: 1.2; }
.stat span { color: var(--ink-2); font-size: .85rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.badge-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface); opacity: .65; }
.badge-card.earned { opacity: 1; border-color: var(--brand); }
.badge-card .tile-icon { margin-bottom: .5rem; }
.badge-card.earned .tile-icon { background: var(--brand); color: var(--on-brand); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background-color: var(--surface); border-color: var(--line); color: var(--ink); border-radius: 10px;
}
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--ink); border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 20%, transparent); }
.form-control::placeholder { color: var(--ink-3); }
.form-label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.invalid-msg { color: var(--danger); font-size: .82rem; margin-top: .25rem; }
.is-invalid { border-color: var(--danger) !important; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.modal-content { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.dropdown-item { color: var(--ink); font-size: .9rem; }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Alerts / toast ---------- */
.flash { border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1.25rem; border: 1px solid var(--line); background: var(--surface); display: flex; gap: .5rem; align-items: center; }
.flash svg { width: 18px; height: 18px; flex: none; }
.flash-success svg { color: var(--social); } .flash-error svg { color: var(--danger); } .flash-info svg { color: var(--physical); }
.toast-box { position: fixed; bottom: 1.25rem; inset-inline-start: 50%; transform: translateX(50%); z-index: 1080; background: var(--ink); color: var(--bg); padding: .55rem 1.1rem; border-radius: 999px; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast-box.show { opacity: 1; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.empty svg { width: 32px; height: 32px; color: var(--ink-3); margin-bottom: .5rem; }
.review-flag { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--ink-3); border: 1px dashed var(--line-strong); padding: 0 .45rem; border-radius: 6px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand-title { font-size: 2rem; }

.site-footer { text-align: center; color: var(--ink-3); font-size: .82rem; padding: 2.5rem 0 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .period-grid, .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .site-header { grid-template-columns: 1fr; text-align: center; }
  .brand-block { order: -1; }
  .header-search { justify-self: stretch; max-width: none; }
  .header-tools { justify-self: center; justify-content: center; }
  .brand-title { font-size: 2rem; }
  .habit-grid, .sunan-grid, .period-grid, .story-grid { grid-template-columns: 1fr; }
  .main-nav { border-radius: var(--radius); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Prayers ---------- */
.prayer-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.prayer-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .55rem .4rem;
  display: flex; flex-direction: column; align-items: center; gap: .1rem; cursor: pointer; color: var(--ink);
}
.prayer-chip .p-name { font-weight: 700; font-size: .95rem; }
.prayer-chip .p-status { font-size: .74rem; color: var(--ink-3); }
.prayer-chip.st-jamaah, .seg-btn.st-jamaah.on { background: var(--social); border-color: var(--social); color: var(--surface); }
.prayer-chip.st-ontime, .seg-btn.st-ontime.on { background: var(--c-blue); border-color: var(--c-blue); color: var(--surface); }
.prayer-chip.st-late, .seg-btn.st-late.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-strong); }
.prayer-chip.st-missed, .seg-btn.st-missed.on { background: transparent; border-color: var(--spiritual); color: var(--spiritual); }
.prayer-chip[class*="st-"] .p-status { color: inherit; opacity: .9; }
.prayer-grid { display: grid; gap: .6rem; }
.prayer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.prayer-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.seg-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .3rem .75rem; font-size: .82rem; cursor: pointer; }
.seg-btn:hover { border-color: var(--line-strong); }
.seg-btn.on:not([class*="st-"]) { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Routine ---------- */
.block-title { font-size: .85rem; font-weight: 700; color: var(--ink-3); margin: 1.1rem 0 .5rem; }
.block-title:first-of-type { margin-top: 0; }
.task-list { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.task {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: start; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .6rem .75rem; color: var(--ink);
}
.task-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-tint); color: var(--hc, var(--brand)); flex: none; }
.task-icon svg { width: 18px; height: 18px; }
.task[data-color="olive"] { --hc: var(--c-olive); } .task[data-color="blue"] { --hc: var(--c-blue); } .task[data-color="rose"] { --hc: var(--c-rose); }
.task-title { flex: 1; font-weight: 500; }
.task-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.task-check svg { width: 14px; height: 14px; }
.task.done { background: var(--surface-2); }
.task.done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task.done .task-check { background: var(--social); border-color: var(--social); color: var(--surface); }
.icon-pick, .day-pick, .suggest-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.icon-pick input, .day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span, .day-pick span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 .4rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-pick span svg { width: 18px; height: 18px; }
.icon-pick input:checked + span, .day-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.icon-pick input:focus-visible + span, .day-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.suggest-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; cursor: pointer; }
.suggest-chip svg { width: 15px; height: 15px; color: var(--brand); }
.suggest-chip:hover, .suggest-chip.on { border-color: var(--brand); }
.sub-details { border-top: 1px dashed var(--line); padding-top: .75rem; }
.sub-details summary { cursor: pointer; }

/* ---------- Focus timer ---------- */
.focus-panel { text-align: center; }
.ring-wrap { position: relative; width: min(280px, 80vw); margin: 0 auto; aspect-ratio: 1; }
svg.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.ring-wrap .ring-fg { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0; transition: stroke-dashoffset .9s linear; }
.focus-panel.break .ring-fg { stroke: var(--c-olive); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-time { font-size: 3.2rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; color: var(--ink); line-height: 1.1; }

@media (max-width: 767.98px) {
  .prayer-chips { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
  .prayer-chip { padding: .45rem .2rem; }
  .prayer-chip .p-name { font-size: .82rem; }
  .prayer-chip .p-status { font-size: .66rem; }
  .task-list { grid-template-columns: 1fr; }
  .prayer-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
.takhrij { margin-top: .5rem; font-size: .85rem; }
.takhrij summary { cursor: pointer; color: var(--ink-3); display: inline-flex; align-items: center; gap: .3rem; }
.takhrij summary svg { width: 15px; height: 15px; }
.takhrij[open] summary { color: var(--brand-strong); margin-bottom: .4rem; }
.takhrij-grade { display: inline-block; background: var(--surface-2); border-radius: 6px; padding: .1rem .5rem; color: var(--social); font-weight: 600; margin-bottom: .35rem; }
.takhrij .quote { color: var(--ink-2); }

/* ---------- Tasks ---------- */
.todo-add { display: flex; gap: .4rem; margin-bottom: 1rem; }
.todo-add .form-control { flex: 1; }
.todo-add .form-select { width: auto; }
.top-check input { position: absolute; opacity: 0; }
.top-check span { display: inline-grid; place-items: center; width: 40px; height: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3); cursor: pointer; background: var(--surface); }
.top-check input:checked + span { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.top-check input:focus-visible + span { outline: 2px solid var(--brand); }
.top-check svg, .block-title svg { width: 15px; height: 15px; }
.todo-list { display: grid; gap: .35rem; margin-bottom: .5rem; }
.todo { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.todo-title { flex: 1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.todo.done .todo-title { color: var(--ink-3); text-decoration: line-through; }
.todo-actions { display: flex; gap: .1rem; }
.todo-actions form { margin: 0; }
.icon-act.on-star { color: var(--brand); }
.icon-act.on-star svg { fill: currentColor; }
.prio { font-size: .7rem; border-radius: 6px; padding: 0 .4rem; }
.prio-high { background: color-mix(in srgb, var(--spiritual) 14%, transparent); color: var(--spiritual); }
.prio-low { background: var(--surface-2); color: var(--ink-3); }
.seg-radio input { position: absolute; opacity: 0; }
.seg-radio span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font-size: .82rem; cursor: pointer; color: var(--ink-2); }
.seg-radio input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--brand); }

/* ---------- Worship ---------- */
.heart-item { display: flex; gap: .7rem; align-items: center; width: 100%; text-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .55rem .7rem; margin-bottom: .45rem; cursor: pointer; color: var(--ink); }
.heart-item.on { background: var(--surface-2); }
.heart-item.on .task-check { background: var(--social); border-color: var(--social); color: var(--surface); }
.qada-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; }
.qada { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; }
.qada-num span { font-size: 1.6rem; font-weight: 700; color: var(--brand-strong); display: block; line-height: 1.1; }
.qada-num small { color: var(--ink-3); }
.choose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem 1rem; max-height: 320px; overflow-y: auto; }

/* ---------- Quran ---------- */
.quran-msg { background: var(--surface-2); border-radius: 10px; padding: .5rem .8rem; color: var(--brand-strong); font-weight: 600; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.quran-msg svg { width: 17px; height: 17px; }
.khatma { --p: 0; width: 150px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c-rose) calc(var(--p) * 1%), var(--surface-2) 0); }
.khatma span { width: 76%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; }
.journal-item { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; background: var(--surface); margin-bottom: .5rem; }

/* ---------- Hadith & akhlaq ---------- */
.hadith-quote { font-size: 1.45rem; line-height: 2; }
.hadith-meta { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--ink-2); font-size: .88rem; align-items: center; }
.hadith-meta svg { width: 15px; height: 15px; margin-inline-end: .25rem; vertical-align: -2px; }
.reflect { border-top: 1px dashed var(--line); padding-top: 1rem; }
.trait-icon { width: 52px; height: 52px; }
.week-dots { display: flex; gap: .35rem; justify-content: center; }
.wd { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: .8rem; color: var(--ink-3); }
.wd.on { background: var(--social); border-color: var(--social); color: var(--surface); }
.wd.today { border-color: var(--brand); border-width: 2px; }

/* ---------- Journal ---------- */
.kind-pick { display: flex; flex-wrap: wrap; gap: .35rem; }
.kind-pick input { position: absolute; opacity: 0; }
.kind-pick span { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; cursor: pointer; color: var(--ink-2); }
.kind-pick span svg { width: 14px; height: 14px; }
.kind-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.kind-pick input:focus-visible + span { outline: 2px solid var(--brand); }
.prompt-of-day { color: var(--ink-2); font-size: .88rem; display: flex; gap: .35rem; align-items: center; }
.prompt-of-day svg { width: 15px; height: 15px; color: var(--brand); }

/* ---------- Harvest ---------- */
.harvest-row { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; margin-bottom: .8rem; align-items: center; }
.harvest-row .bar { grid-column: 1 / -1; }

/* ---------- Notifications ---------- */
.notif-btn { position: relative; }
.notif-btn .nav-badge { top: -4px; inset-inline-end: -4px; }
.notif-menu { width: 300px; max-height: 360px; overflow-y: auto; }
.notif-item { display: block; padding: .5rem 1rem; border-top: 1px solid var(--line); color: var(--ink); font-size: .88rem; }
.notif-item:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Dhikr session (distraction-free) ---------- */
.focus-body { background: var(--bg); min-height: 100vh; }
.dhikr-session { min-height: 100vh; display: flex; flex-direction: column; padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
.ds-top, .ds-bottom { display: flex; align-items: center; gap: .6rem; justify-content: space-between; }
.ds-select { max-width: 320px; }
.ds-net { color: var(--spiritual); }
.ds-tap { flex: 1; margin: 1rem 0; border: 0; border-radius: 28px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; cursor: pointer; color: var(--ink); user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ds-tap:active { background: var(--surface-2); }
.ds-phrase { font-size: clamp(1.6rem, 6vw, 2.6rem); color: var(--brand-strong); text-align: center; padding: 0 1rem; }
.ds-count { font-size: clamp(4rem, 18vw, 8rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ds-tap.reached .ds-count { color: var(--social); }

@media (max-width: 767.98px) {
  .qada-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choose-grid { grid-template-columns: 1fr; }
  .todo-add { flex-wrap: wrap; }
  .todo-add .form-control { flex-basis: 100%; }
}

/* ---------- History ---------- */
.cal-nav, .day-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.cal-head { text-align: center; font-size: .78rem; color: var(--ink-3); padding-bottom: .2rem; }
.cal-day { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); background: var(--surface); line-height: 1.2; }
.cal-day .g { font-weight: 700; }
.cal-day .h { font-size: .66rem; color: var(--ink-3); }
.cal-day:hover { border-color: var(--brand); color: var(--ink); }
.cal-day.today { outline: 2px solid var(--brand); outline-offset: 1px; }
.cal-day.future { opacity: .4; }
.lv-1 { background: color-mix(in srgb, var(--social) 14%, var(--surface)); }
.lv-2 { background: color-mix(in srgb, var(--social) 32%, var(--surface)); }
.lv-3 { background: color-mix(in srgb, var(--social) 55%, var(--surface)); }
.lv-4 { background: color-mix(in srgb, var(--social) 80%, var(--surface)); }
.cal-day.lv-3, .cal-day.lv-4 { color: var(--surface); }
.cal-day.lv-3 .h, .cal-day.lv-4 .h { color: inherit; opacity: .85; }
.cal-legend { display: flex; align-items: center; gap: .3rem; justify-content: center; margin-top: 1rem; }
.cal-legend i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.cal-legend .lv-0 { background: var(--surface); }
.hist-habit { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; margin-bottom: .7rem; }
.hist-habit .bar { grid-column: 1 / -1; }
.hist-count { width: 90px; }
.heart-inline { display: flex; flex-wrap: wrap; gap: .35rem; }
.heart-pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.heart-pill.on { background: var(--social); border-color: var(--social); color: var(--surface); }
@media (max-width: 575.98px) { .cal-grid { gap: .2rem; } .cal-head { font-size: .62rem; } .cal-day .h { display: none; } }

/* ---------- Voice dhikr player ---------- */
.player-panel { text-align: center; padding: 2rem 1.5rem; }
.player-state { margin-bottom: .5rem; }
.player-text { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.9; min-height: 4.2rem; color: var(--brand-strong); margin-bottom: 1rem; }
.player-progress { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 0 auto .5rem; max-width: 320px; }
.player-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .5s linear; }
.btn-lg-play { padding: .6rem 1.6rem; font-size: 1rem; }
.play-dhikr { color: var(--brand); }
.play-dhikr.playing { color: var(--social); }
.cal-panel { max-width: 640px; margin-inline: auto; }
.day-nav { max-width: 640px; margin-inline: auto; }
.player-diag { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; text-align: start; color: var(--ink-2); }
.player-diag.bad { border-inline-start: 3px solid var(--danger); }
.player-diag.good { border-inline-start: 3px solid var(--social); }
.simple-audio { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.simple-audio audio { height: 36px; max-width: 100%; }

/* =====================================================================
   v2 — "soft app" style (week strip, ring cards, floating tab bar)
   ===================================================================== */
body { background: var(--bg); font-size: 15px; }
.page-pattern { display: var(--pattern-display, block); }
:root:not([data-palette="beige"]) .page-pattern { display: none; }
:root:not([data-palette]) { }

/* surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.item-card, .period, .story-tile, .stat, .badge-card, .journal-item, .qada, .todo, .task, .heart-item, .habit { border-color: var(--line); border-radius: var(--radius); }
.btn-brand { border-radius: 14px; padding: .55rem 1.1rem; }
.btn-soft { background: var(--surface-2); color: var(--brand-strong); border-radius: 14px; }
.btn-ghost { border-radius: 14px; background: var(--surface); }
.icon-btn { width: 44px; height: 44px; border: 0; background: var(--surface-2); color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.form-control, .form-select { background-color: var(--surface-2); border-color: transparent; border-radius: 12px; min-height: 44px; }
.form-control:focus, .form-select:focus { background-color: var(--surface); }
.flash { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border-color: var(--line); }

/* desktop header + menu */
.site-header { padding: 1.4rem 0 .6rem; }
.brand-title { font-size: 2rem; }
.brand-tagline { font-size: .92rem; }
.main-nav { background: var(--surface); border: 0; box-shadow: var(--shadow); border-radius: 18px; padding: .4rem; margin: .6rem 0 1.6rem; }
.main-nav a { border-radius: 12px; }
.main-nav a.active { background: var(--brand-tint); color: var(--brand-strong); }
.main-nav a.active::after { display: none; }
.date-chip { border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 16px; }

/* section blocks (title + "see all") */
.block { margin-bottom: 1.6rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.block-head h2 { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--ink); }
.block-head a { font-size: .88rem; color: var(--ink-2); }
.block-head a:hover { color: var(--brand); }
.hint { color: var(--ink-3); font-size: .8rem; margin: .5rem 0 0; }

/* week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; margin: .2rem 0 1.6rem; }
.wday { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .35rem; padding: .7rem 0 .45rem;
  border-radius: 999px; background: var(--surface-2); color: var(--ink-2); min-height: 112px; }
.wday:hover { color: var(--ink); background: var(--surface-3); }
.wd-name { font-size: .82rem; font-weight: 600; }
.wd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.wday.lvl-1 .wd-dot { background: color-mix(in srgb, var(--social) 45%, var(--line-strong)); }
.wday.lvl-2 .wd-dot, .wday.lvl-3 .wd-dot, .wday.lvl-4 .wd-dot { background: var(--social); }
.wd-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; background: var(--surface); }
.wday.today .wd-num { background: var(--brand); color: var(--on-brand); }
.wday.today .wd-name { color: var(--ink); }
.wday.future { opacity: .45; }

/* ring */
span.ring { --p: 0; position: relative; width: 58px; height: 58px; flex: none; display: inline-grid; place-items: center; }
span.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
span.ring circle { fill: none; stroke-width: 3.4; }
span.ring .ring-bg { stroke: var(--surface-3); }
span.ring .ring-fg { stroke: var(--hc, var(--brand)); stroke-linecap: round; stroke-dasharray: var(--p) 100; transition: stroke-dasharray .35s ease; }
span.ring b { font-size: .72rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.done .ring-fg { stroke: var(--social); }

/* ring cards ("Daily routine" rows) */
.hcard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.hcard { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: start; padding: .85rem 1rem; border: 0; border-radius: 22px;
  background: var(--surface-2); color: var(--ink); position: relative; font: inherit; }
.hcard.tappable { cursor: pointer; transition: transform .08s ease, background .15s; -webkit-tap-highlight-color: transparent; }
.hcard.tappable:hover { background: var(--surface-3); }
.hcard.tappable:active { transform: scale(.985); }
.hcard-ico { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: none; color: var(--hc, var(--brand)); }
.hcard-ico svg { width: 22px; height: 22px; }
.hcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.hcard-body strong { font-size: 1.02rem; font-weight: 600; }
.hcard-body .sub { color: var(--ink-2); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcard-body .sub.font-text { font-size: 1rem; }
.hcard-body .meta { color: var(--ink-3); font-size: .76rem; font-variant-numeric: tabular-nums; }
.hcard[data-color="olive"] { --hc: var(--c-olive); } .hcard[data-color="blue"] { --hc: var(--c-blue); } .hcard[data-color="rose"] { --hc: var(--c-rose); }
.hcard-mini { display: inline-flex; align-items: center; gap: .4rem; margin-top: .2rem; }
.mini-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.mini-btn svg { width: 16px; height: 16px; }
.hcard .task-check { position: absolute; inset-inline-end: 66px; top: 10px; width: 20px; height: 20px; border-width: 1.5px; }
.hcard.task.done .task-check { background: var(--social); border-color: var(--social); color: var(--surface); }
.hcard.task.done .hcard-body strong { color: var(--ink-3); text-decoration: line-through; }
.hcard.pulse { animation: pulse .3s ease; }

/* "Inspire" banner carousel */
.carousel-snap { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 26px; }
.carousel-snap::-webkit-scrollbar { display: none; }
.hero-card { scroll-snap-align: start; display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.4rem 1.4rem; border-radius: 26px;
  background: var(--surface-2); color: var(--ink); min-height: 170px; overflow: hidden; position: relative; }
.hero-card:hover { color: var(--ink); }
.hero-card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.7; margin: .2rem 0 .3rem; }
.hero-card h3.font-text { font-size: 1.25rem; font-weight: 400; }
.hero-card p { color: var(--ink-2); font-size: .86rem; margin-bottom: .8rem; }
.hero-card .btn-brand { pointer-events: none; }
.eyebrow { font-size: .76rem; color: var(--ink-3); font-weight: 600; }
.hero-art { flex: none; width: 110px; height: 110px; border-radius: 26px; background: var(--surface); box-shadow: 10px 10px 0 var(--surface-3);
  display: grid; place-items: center; color: var(--brand); transform: rotate(-6deg); }
.hero-art svg { width: 42px; height: 42px; }
.snap-dots { display: flex; justify-content: center; gap: .3rem; margin-top: .6rem; }
.snap-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: width .2s; }
.snap-dots i.on { width: 18px; background: var(--brand); }

/* shortcut tiles ("Routine · Test · Article · Mood") */
.shortcut-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: .45rem; color: var(--ink-2); font-size: .86rem; font-weight: 500; text-align: center; }
.shortcut:hover { color: var(--ink); }
.tile-sq { width: 58px; height: 58px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); }
.tile-sq svg { width: 24px; height: 24px; }

/* list rows ("Reflection" list) */
.row-list { display: grid; gap: .6rem; }
.row-card { display: flex; align-items: center; gap: .9rem; background: var(--surface-2); border-radius: 20px; padding: .55rem .9rem .55rem .55rem; color: var(--ink); }
[dir="rtl"] .row-card { padding: .55rem .55rem .55rem .9rem; }
a.row-card:hover { background: var(--surface-3); color: var(--ink); }
.row-thumb { width: 58px; height: 58px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; color: var(--brand); flex: none; }
.row-thumb svg { width: 22px; height: 22px; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-body strong { font-weight: 600; font-size: .98rem; }
.row-body span { color: var(--ink-3); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-btn { width: 30px; height: 30px; border: 0; background: var(--surface-3); color: transparent; }
.check-btn.on { background: var(--ink-2); color: var(--surface); }
.row-card .check-btn { flex: none; }

/* prayers as soft pills */
.prayer-chip { background: var(--surface-2); border: 0; border-radius: 18px; padding: .7rem .3rem; }
.prayer-chip.st-late { background: var(--brand-tint); }

/* floating action button */
.fab { position: fixed; z-index: 1030; inset-inline-end: 22px; bottom: 28px; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--brand); color: var(--on-brand); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(39, 50, 70, .25); cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
.fab:hover { background: var(--brand-strong); }

/* ---------- mobile app shell ---------- */
.app-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding: 1rem 0 1rem; }
.app-title { font-size: 1.75rem; font-weight: 700; margin: 0; line-height: 1.3; color: var(--ink); }
.app-date { color: var(--ink-2); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .1rem .35rem; }
.app-date .greg { color: var(--ink-3); }
.app-top-actions { display: flex; gap: .5rem; }

.tabbar { position: fixed; z-index: 1040; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); display: flex; justify-content: space-around; align-items: center; padding: .45rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 999px; box-shadow: 0 6px 30px rgba(39, 50, 70, .16); border: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: .1rem; border: 0; background: none; color: var(--ink-2); font: inherit; padding: 0; min-width: 56px; cursor: pointer; }
.tab-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.tab-ico svg { width: 21px; height: 21px; }
.tab-label { font-size: .64rem; line-height: 1; }
.tab.active { color: var(--brand-strong); }
.tab.active .tab-ico { background: var(--brand); color: var(--on-brand); }

.more-sheet { height: auto !important; max-height: 88vh; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--ink); border: 0; }
.more-sheet .offcanvas-header { padding-bottom: .4rem; }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem .5rem; }
.tile { display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--ink-2); font-size: .78rem; text-align: center; }
.tile.active .tile-sq { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.sheet-foot { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sheet-foot form { margin: 0; }

@media (max-width: 991.98px) {
  .container-app { padding: 0 16px; }
  body.has-tabbar main { padding-bottom: 104px; }
  body.has-tabbar .fab { bottom: 96px; }
  body.has-tabbar .site-footer { padding-bottom: 110px; }
  /* the page title lives in the app header; keep the in-page actions */
  .section-head h1 { display: none; }
  .section-head { justify-content: flex-end; margin-bottom: 1rem; }
  .section-head:not(:has(> :not(h1))) { display: none; }
  .section-rule { display: none; }
  .panel { padding: 1rem; border-radius: 20px; }
  .lead-text { margin-top: 0; font-size: .9rem; }
  .hcard-grid { grid-template-columns: 1fr; }
  .pill-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .pill-tabs::-webkit-scrollbar { display: none; }
  .pill-tabs a { white-space: nowrap; }
}
@media (max-width: 575.98px) {
  .week-strip { gap: .3rem; }
  .wday { min-height: 100px; }
  .wd-num { width: 32px; height: 32px; font-size: .85rem; }
  .hero-card { padding: 1.1rem; min-height: 160px; }
  .hero-art { width: 76px; height: 76px; border-radius: 20px; box-shadow: 7px 7px 0 var(--surface-3); }
  .hero-art svg { width: 30px; height: 30px; }
  .hero-card h3 { font-size: 1rem; }
  .hero-card h3.font-text { font-size: 1.1rem; }
  .ring { width: 52px; height: 52px; }
  .hcard { padding: .75rem .85rem; gap: .75rem; }
  .hcard-ico { width: 44px; height: 44px; }
  .hcard .task-check { inset-inline-end: 58px; }
  .prayer-chips { gap: .3rem; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat b { font-size: 1.3rem; }
  .modal-footer { position: sticky; bottom: 0; background: var(--surface); }
}
.row-list { grid-template-columns: minmax(0, 1fr); }
.row-card, .hcard { min-width: 0; }
@media (max-width: 991.98px) { .hcard-grid { grid-template-columns: minmax(0, 1fr); } }
.ring.zero .ring-fg { opacity: 0; }
.hcard.task.done .hcard-ico { background: var(--social); color: var(--surface); }
.row-end { color: var(--ink-3); flex: none; }
.row-end svg { width: 18px; height: 18px; }
.todo { background: var(--surface-2); border: 0; border-radius: 16px; padding: .55rem .7rem; }
.todo-add { background: var(--surface-2); padding: .4rem; border-radius: 18px; }
.todo-add .form-control, .todo-add .form-select { background: var(--surface); }
.block-title { font-size: .9rem; color: var(--ink-2); margin: 1rem 0 .55rem; }
@media (min-width: 992px) {
  .week-strip { max-width: 640px; }
  .wday { min-height: 104px; }
}

/* «زاد اليوم» (from the earlier home iteration) */
.zad-card { background: var(--sage-tint); border-color: transparent; }
.zad-kind { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; color: var(--terra); }
.zad-kind svg { width: 15px; height: 15px; }
.zad-text { font-size: 1.15rem; font-weight: 700; color: var(--brand-strong); margin: .6rem 0 .2rem; }
.zad-chosen.done .zad-text::after { content: " ✓"; color: var(--social); }
.zad-options { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; cursor: pointer; color: var(--ink-2); }
.chip-radio input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand); }
.zad-card .seg-radio span { background: var(--surface); }

/* =====================================================================
   v3 — calm green home (welcome · your day · six sections · cards)
   ===================================================================== */

h1, h2, h3, .block-head h2 { color: var(--brand-strong); }
:root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3 { color: var(--ink); }

/* ① welcome with soft landscape */
.welcome { position: relative; overflow: hidden; border-radius: 28px; padding: 1.4rem 1.4rem 4.2rem; margin-bottom: 1rem;
  background: linear-gradient(180deg, #EEF2EA 0%, #F6F2E8 100%); }
:root[data-theme="dark"] .welcome { background: linear-gradient(180deg, #1F2A23, #1A211C); }
.welcome-art { position: absolute; inset: auto 0 0 0; width: 100%; height: 120px; }
.w-sun { fill: #EFD9A8; opacity: .85; }
.w-hill3 { fill: #B9C8B4; opacity: .55; }
.w-hill2 { fill: #8FA48C; opacity: .55; }
.w-hill1 { fill: #6F7F6B; opacity: .45; }
.welcome-text { position: relative; }
.welcome-hello { margin: 0; color: var(--ink-2); font-size: .95rem; }
.welcome-name { margin: 0; font-size: 2rem; font-weight: 700; color: var(--brand-strong); line-height: 1.25; }
.welcome-line { margin: .25rem 0 0; color: var(--ink-2); font-size: .92rem; }

/* ② your day (dark green card) */
.day-card { background: var(--brand-strong); color: #EEF3EC; border-radius: 26px; padding: 1.15rem 1.2rem; margin-bottom: 1.2rem; box-shadow: 0 10px 26px rgba(47, 74, 58, .22); }
.day-card h2 { color: #FFFFFF; font-size: 1.12rem; margin: 0; }
.day-card p { color: #C9D6CB; font-size: .9rem; }
.day-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.day-link { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.day-link svg { width: 18px; height: 18px; }
.day-row { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid rgba(255,255,255,.1); }
.day-ico { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.day-ico svg { width: 18px; height: 18px; color: #D9E6D6; }
.day-body { flex: 1; min-width: 0; }
.day-line { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; margin-bottom: .35rem; }
.day-line span { color: #C9D6CB; }
.day-line b { color: #FFFFFF; font-weight: 600; text-align: end; }
.day-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; }
.day-bar span { display: block; height: 100%; border-radius: 99px; background: #B9D3B2; transition: width .3s; }
.day-prayers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
.prayer-chip.mini { background: rgba(255,255,255,.1); color: #EAF1E8; border-radius: 12px; padding: .35rem .1rem; }
.prayer-chip.mini .p-name { font-size: .78rem; }
.prayer-chip.mini .p-status { font-size: .62rem; color: #C2D0C3; }
.prayer-chip.mini.st-jamaah { background: #B9D3B2; color: #1E3326; }
.prayer-chip.mini.st-ontime { background: #E4EADF; color: #1E3326; }
.prayer-chip.mini.st-late { background: #EFD9A8; color: #3A2E15; }
.prayer-chip.mini.st-missed { background: rgba(227,201,193,.25); color: #F2D3CA; }
.btn-light, .btn-outline-light { display: inline-flex; align-items: center; gap: .35rem; border-radius: 14px; padding: .5rem 1rem; font-weight: 600; font-size: .88rem; border: 1px solid transparent; cursor: pointer; }
.btn-light { background: #FFFFFF; color: var(--brand-strong); }
.btn-light svg { width: 16px; height: 16px; }
.btn-outline-light { background: transparent; color: #FFFFFF; border-color: rgba(255,255,255,.35); }
.btn-outline-light:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ③ six sections, 2 rows */
.six-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1.4rem; }
.six-tile { display: flex; flex-direction: column; gap: .2rem; padding: .85rem .8rem; border-radius: 22px; color: var(--ink); min-height: 112px; border: 1px solid var(--line); background: var(--surface); }
.six-tile:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.six-tile.tint-1 { background: var(--sage-tint); } .six-tile.tint-2 { background: var(--rose-tint); } .six-tile.tint-3 { background: var(--beige-tint); }
.six-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--brand-strong); margin-bottom: .35rem; }
.six-ico svg { width: 20px; height: 20px; }
.six-tile strong { font-size: .95rem; color: var(--brand-strong); }
.six-hint { font-size: .74rem; color: var(--ink-3); line-height: 1.4; }

.home-cols { display: grid; gap: 0 1.2rem; }
@media (min-width: 992px) { .home-cols { grid-template-columns: 1fr 1fr; } .six-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ④ wird card */
.wird-card { display: block; background: var(--brand); color: #fff; border-radius: 26px; padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.wird-card:hover { color: #fff; }
.wird-card.done { background: var(--social); }
.wird-top { display: flex; gap: .8rem; align-items: center; }
.wird-ico { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.wird-ico svg { width: 22px; height: 22px; }
.wird-card .eyebrow { color: #E2EADF; }
.wird-card h2 { color: #fff; font-size: 1.05rem; margin: .1rem 0 0; line-height: 1.6; }
.wird-progress { height: 6px; background: rgba(255,255,255,.22); border-radius: 99px; margin: .9rem 0 .7rem; overflow: hidden; }
.wird-progress span { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .3s; }
.wird-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; color: #E8EEE5; flex-wrap: wrap; }

/* ⑤⑥⑦ soft cards */
.soft-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.05rem 1.15rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.soft-card.rose { background: var(--rose-tint); border-color: color-mix(in srgb, var(--rose) 70%, transparent); }
.soft-card.beige { background: var(--beige-tint); border-color: color-mix(in srgb, var(--beige) 60%, transparent); }
.soft-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.soft-title { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--terra); font-size: .95rem; }
.soft-card:not(.rose) .soft-title { color: var(--brand-strong); }
.soft-title svg { width: 18px; height: 18px; }
.soft-quote { font-size: 1.22rem; line-height: 2; margin: .2rem 0 .5rem; color: var(--ink); }
.soft-q { color: var(--ink-2); font-size: .9rem; display: flex; gap: .35rem; align-items: flex-start; }
.soft-q svg { width: 17px; height: 17px; flex: none; margin-top: .25rem; color: var(--brand); }
.soft-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .85rem; }
.soft-foot a { font-weight: 600; color: var(--brand-strong); }
.tag-grade, .tag-done { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: .1rem .55rem; }
.tag-grade { background: var(--brand-tint); color: var(--brand-strong); }
.tag-done { background: var(--social); color: #fff; }
.tag-done svg { width: 13px; height: 13px; }
.focus-kinds { display: flex; gap: .35rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.focus-kind { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .35rem .8rem; font-size: .84rem; cursor: pointer; }
.focus-kind svg { width: 15px; height: 15px; }
.focus-kind.on { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.focus-text { font-size: 1rem; color: var(--ink); margin-bottom: .6rem; }
.focus-actions { display: grid; gap: .5rem; }
.focus-actions .form-control { background: var(--surface); }

/* tab bar: full-width bottom bar with soft active pill */
.tabbar { left: 0; right: 0; transform: none; bottom: 0; width: 100%; border-radius: 22px 22px 0 0; padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(38, 53, 44, .07); }
.tab-ico { width: 52px; height: 34px; border-radius: 14px; }
.tab-label { font-size: .7rem; margin-top: .1rem; }
.tab.active .tab-ico { background: var(--brand-tint); color: var(--brand-strong); }
.tab.active { color: var(--brand-strong); font-weight: 600; }
.fab { background: var(--brand-strong); }
@media (max-width: 991.98px) {
  body.has-tabbar main { padding-bottom: 96px; }
  body.has-tabbar .fab { bottom: 88px; }
}

/* small screens */
@media (max-width: 575.98px) {
  .welcome { padding: 1.1rem 1.1rem 3.6rem; border-radius: 24px; }
  .welcome-name { font-size: 1.7rem; }
  .six-tile { min-height: 104px; padding: .75rem .65rem; border-radius: 20px; }
  .six-hint { display: none; }
  .soft-quote { font-size: 1.12rem; }
}

/* home header on mobile: small logo instead of a page title */
.app-logo { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--brand-strong); font-size: 1.05rem; }
.app-logo svg { width: 22px; height: 22px; color: var(--brand); }

:root[data-palette="slate"] .day-card { background: linear-gradient(160deg, #5B6987, #44506A); }
:root[data-palette="beige"] .day-card { background: linear-gradient(160deg, #8C6A3A, #6B4F28); }

/* =====================================================================
   غُصن — brand lockup
   ===================================================================== */
@font-face { font-family: "Aref Ruqaa"; src: url("../fonts/aref-ruqaa-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Aref Ruqaa"; src: url("../fonts/aref-ruqaa-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
:root { --font-brand: "Aref Ruqaa", "Amiri", serif; --gold: #B89B6A; --pink: #E3C9C1; --beige: #D8C6A9; }
.brand-logo { display: inline-flex; align-items: center; gap: .35rem; color: var(--brand-strong); line-height: 1; }
.brand-logo img { display: block; }
.brand-leaf { width: 1.35em; height: 1.35em; }
.brand-word { font-family: var(--font-brand); font-weight: 700; letter-spacing: 0; }
.brand-logo.sm { font-size: 1.45rem; }
.brand-logo.lg { font-size: 2.6rem; }
.brand-logo.xl { font-size: 3.4rem; }
.brand-logo:not(:has(.brand-word)) img { height: 1.6em; width: auto; }
.app-logo { display: inline-flex; align-items: center; }
.app-logo .brand-logo.sm { font-size: 1.6rem; }
.brand-title { display: inline-block; text-decoration: none; }
.brand-title:hover .brand-word { color: var(--brand); }
.brand-tagline { font-family: var(--font-text); color: var(--ink-2); font-size: 1.02rem; margin-top: .25rem; }
/* auth: arch frame, as in the identity sheet */
.auth-card .brand-block { position: relative; padding: 2.2rem 1rem 1rem; }
.auth-card .brand-block::before { content: ""; position: absolute; inset: 0 18% auto; height: 100%; border: 1.5px solid var(--gold); border-bottom: 0;
  border-radius: 999px 999px 0 0; opacity: .55; pointer-events: none; }
.auth-card .brand-tagline::after { content: ""; display: block; width: 120px; height: 14px; margin: .6rem auto 0;
  background: linear-gradient(var(--gold), var(--gold)) left 50%/42px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) right 50%/42px 1px no-repeat,
  url("../brand/leaf.svg") center/14px 14px no-repeat; opacity: .8; }
.soft-leaf { width: 20px; height: 20px; }

/* Section icons, after the identity sheet: soft filled squares with a gentle highlight */
.six-tile.tone-sage, .six-tile.tone-pink, .six-tile.tone-beige { background: var(--surface); }
.six-tile .six-ico { width: 46px; height: 46px; border-radius: 15px; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 10px rgba(46,58,45,.10); }
.six-tile.tone-sage .six-ico { background: linear-gradient(160deg, #7E8D79, #6F7F6B); color: #FFFDF8; }
.six-tile.tone-pink .six-ico { background: linear-gradient(160deg, #EBD5CE, #E3C9C1); color: #6B4E47; }
.six-tile.tone-beige .six-ico { background: linear-gradient(160deg, #E4D6BE, #D8C6A9); color: #5E5139; }
:root[data-theme="dark"] .six-tile .six-ico { box-shadow: none; filter: saturate(.8) brightness(.85); }
.six-tile .six-ico svg { width: 22px; height: 22px; }
/* gold hairline accent under section titles, as in the identity */
.block-head h2::after, .soft-title::after { content: none; }

/* greeting landscape: fixed height so hills never rise over the text on wide screens */
.welcome-art { height: 84px; }
.welcome { padding-bottom: 4.6rem; }
@media (min-width: 992px) { .welcome-art { height: 74px; } .welcome { padding-bottom: 4.2rem; min-height: 0; } }
.w-sun-dot { position: absolute; inset-inline-end: 14%; bottom: 46px; width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #F3DFB5, #E9CF98); opacity: .85; }
:root[data-theme="dark"] .w-sun-dot { opacity: .35; }
@media (min-width: 992px) { .w-sun-dot { width: 52px; height: 52px; bottom: 40px; inset-inline-end: 10%; } }
@media (min-width: 992px) { .welcome { padding-bottom: 6.4rem; } .welcome-art { height: 110px; } .w-sun-dot { bottom: 70px; } }

/* =====================================================================
   Palette «زمرّدي» (default): deep emerald, bright green, lime gradient,
   yellow highlights, mint-to-cream background, white cards.
   ===================================================================== */
:root[data-palette="emerald"] {
  --bg: #EEF4EF; --surface: #FFFFFF; --surface-2: #F2F7F3; --surface-3: #E3ECE5; --line: #E2EBE4; --line-strong: #C9D7CC;
  --ink: #15241B; --ink-2: #52635A; --ink-3: #8A988F;
  --brand: #1F5A40; --brand-strong: #163F2D; --brand-tint: #E1F2E6; --on-brand: #FFFFFF;
  --accent: #2EB872; --lime: #C6DA3B; --yellow: #FFD60A;
  --social: #2EB872; --spiritual: #D9534F; --physical: #2A8C9E;
  --c-brand: #1F5A40; --c-olive: #2EB872; --c-blue: #2A8C9E; --c-rose: #D9A40B;
  --sage-tint: #E4F4E9; --rose-tint: #FFF9DC; --rose: #F5DC6B; --beige-tint: #EEF6E7; --beige: #DCEBD3; --terra: #2EB872;
  --pink: #FFE680; --gold: #D9A40B;
  --shadow: 0 1px 2px rgba(21, 36, 27, .04), 0 10px 26px rgba(21, 36, 27, .06);
}
:root[data-palette="emerald"][data-theme="dark"] {
  --bg: #0E1611; --surface: #152019; --surface-2: #1B2920; --surface-3: #243429; --line: #223128; --line-strong: #33473A;
  --ink: #E9F1EB; --ink-2: #AEBDB3; --ink-3: #7F8F85; --brand: #5ED39A; --brand-strong: #8BE3B6; --brand-tint: #1C3527; --on-brand: #0E1611;
  --accent: #3FD08A; --sage-tint: #183024; --rose-tint: #2B2810; --beige-tint: #1A2A1F; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="emerald"]:not([data-theme="light"]) {
    --bg: #0E1611; --surface: #152019; --surface-2: #1B2920; --surface-3: #243429; --line: #223128; --line-strong: #33473A;
    --ink: #E9F1EB; --ink-2: #AEBDB3; --ink-3: #7F8F85; --brand: #5ED39A; --brand-strong: #8BE3B6; --brand-tint: #1C3527; --on-brand: #0E1611;
    --accent: #3FD08A; --sage-tint: #183024; --rose-tint: #2B2810; --beige-tint: #1A2A1F; --shadow: none;
  }
}
[data-palette="emerald"] body { background: linear-gradient(165deg, #E7F2EA 0%, #F2F6EE 45%, #F8F6E7 100%) fixed; }
[data-palette="emerald"][data-theme="dark"] body { background: var(--bg); }

/* greeting: mint → soft yellow, like the "Next prayer" card */
[data-palette="emerald"] .welcome { background: linear-gradient(105deg, #C8F0D3 0%, #E3F2C2 55%, #F4ECA8 100%); padding-bottom: 1.4rem; border: 0; }
[data-palette="emerald"] .welcome-art, [data-palette="emerald"] .w-sun-dot { display: none; }
[data-palette="emerald"] .welcome-name { color: var(--brand-strong); }
[data-palette="emerald"][data-theme="dark"] .welcome { background: linear-gradient(105deg, #173A26, #2A3417); }

/* «يومك»: deep emerald with green→lime bars */
[data-palette="emerald"] .day-card { background: linear-gradient(160deg, #1F5A40 0%, #163F2D 100%); box-shadow: 0 12px 28px rgba(22, 63, 45, .25); }
[data-palette="emerald"] .day-bar span { background: linear-gradient(90deg, #2EB872, #C6DA3B); }
[data-palette="emerald"] .prayer-chip.mini.st-jamaah { background: #2EB872; color: #fff; }
[data-palette="emerald"] .prayer-chip.mini.st-ontime { background: #C6DA3B; color: #1B2A0C; }
[data-palette="emerald"] .prayer-chip.mini.st-late { background: #FFD60A; color: #2B2300; }

/* today's wird: emerald card, yellow main action */
[data-palette="emerald"] .wird-card { background: linear-gradient(135deg, #1F5A40 0%, #2C7A54 100%); }
[data-palette="emerald"] .wird-card.done { background: linear-gradient(135deg, #2EB872, #7CC94B); }
[data-palette="emerald"] .wird-progress span, [data-palette="emerald"] [data-wird-bar] { background: linear-gradient(90deg, #FFD60A, #C6DA3B) !important; }
[data-palette="emerald"] .btn-light { background: #FFD60A; color: #2B2300; }
[data-palette="emerald"] .btn-light:hover { background: #FFDF3D; color: #2B2300; }

/* six sections: white tiles, coloured line icons (like Quran Read · Tasbih · Qibla) */
[data-palette="emerald"] .six-tile { background: var(--surface) !important; border: 1px solid var(--line); box-shadow: var(--shadow); }
[data-palette="emerald"] .six-tile .six-ico { background: none; box-shadow: none; width: auto; height: 34px; justify-content: start; }
[data-palette="emerald"] .six-tile .six-ico svg { width: 28px; height: 28px; stroke-width: 1.8; }
[data-palette="emerald"] .six-tile.tone-sage .six-ico { color: #1F5A40; }
[data-palette="emerald"] .six-tile.tone-pink .six-ico { color: #2EB872; }
[data-palette="emerald"] .six-tile.tone-beige .six-ico { color: #A68A00; }
[data-palette="emerald"] .six-tile strong { color: var(--ink); }

/* dua of the day: soft yellow; hadith: white */
[data-palette="emerald"] .soft-card.rose { background: #FFF9DC; border-color: #F3E3A0; }
[data-palette="emerald"] .soft-card.rose .soft-title { color: #8A6D00; }
[data-palette="emerald"][data-theme="dark"] .soft-card.rose { background: #2B2810; border-color: #4A4318; }

/* progress rings: green → lime gradient (defs in the layout) */
[data-palette="emerald"] .ring-fg { stroke: url(#ring-grad); }
[data-palette="emerald"] .done .ring-fg { stroke: url(#ring-grad); }

/* checks, toggles, chips */
[data-palette="emerald"] .check-btn.on, [data-palette="emerald"] .task-check, [data-palette="emerald"] .hcard.task.done .hcard-ico { --social: #2EB872; }
[data-palette="emerald"] .check-btn.on { background: #2EB872; color: #fff; }
[data-palette="emerald"] .seg-btn.on:not([class*="st-"]), [data-palette="emerald"] .pill-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-palette="emerald"] .slot-chip { background: #FFF3B0; color: #6B5600; }

/* bottom navigation: white bar, active item in emerald */
[data-palette="emerald"] .tabbar { background: rgba(255, 255, 255, .96); }
[data-palette="emerald"][data-theme="dark"] .tabbar { background: rgba(21, 32, 25, .96); }
[data-palette="emerald"] .tab.active .tab-ico { background: transparent; color: var(--brand); }
[data-palette="emerald"] .tab.active { color: var(--brand); font-weight: 700; }
[data-palette="emerald"] .fab { background: var(--brand); box-shadow: 0 10px 24px rgba(31, 90, 64, .35); }
[data-palette="emerald"] .brand-logo { color: var(--brand-strong); }
.prayer-chip.mini[class*="st-"] .p-status { color: inherit; opacity: .85; }

/* =====================================================================
   v3 — desktop sidebar + phone app shell; palette «طحلبي» (moss)
   ===================================================================== */
:root { --font-ui: "Bahij TheSansArabic", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
body { font-family: var(--font-ui); }

/* ---------- moss palette (default) ---------- */
:root[data-palette="moss"] {
  --bg: #EEF0EA; --surface: #FFFFFF; --surface-2: #F5F6F2; --surface-3: #ECEEE7; --line: #E3E6DD; --line-strong: #D0D5C8;
  --ink: #1B1E19; --ink-2: #5A5F56; --ink-3: #969A90;
  --brand: #4E7A3A; --brand-strong: #2F5226; --brand-tint: #E5EEDC; --on-brand: #FFFFFF;
  --black: #1C1E1B; --peach: #FBE7D8; --peach-ink: #B85A26; --mint: #E3EFDA; --mint-ink: #3D6B2C;
  --social: #4E7A3A; --spiritual: #B85A26; --physical: #3F6E86;
  --c-brand: #4E7A3A; --c-olive: #4E7A3A; --c-blue: #3F6E86; --c-rose: #B85A26;
  --sage-tint: #E5EEDC; --rose-tint: #FDF1E7; --rose: #F2CDB2; --beige-tint: #F4F2EA; --beige: #E2DDCC; --terra: #B85A26; --gold: #A88A4A;
  --ring-a: #6A9E4E; --ring-b: #2F5226;
  --shadow: 0 1px 0 rgba(27, 30, 25, .02), 0 10px 30px rgba(27, 30, 25, .05);
  --radius-lg: 20px; --radius: 16px;
}
:root[data-palette="moss"][data-theme="dark"] {
  --bg: #121411; --surface: #1A1D18; --surface-2: #20241E; --surface-3: #282D25; --line: #2A2F27; --line-strong: #3A4136;
  --ink: #ECEFE8; --ink-2: #B0B6A9; --ink-3: #7F857A; --brand: #8FC173; --brand-strong: #B4DA9E; --brand-tint: #26331F; --on-brand: #121411;
  --black: #ECEFE8; --peach: #3A2A20; --peach-ink: #F0B48C; --mint: #23331D; --mint-ink: #A9D493; --sage-tint: #22301C; --rose-tint: #2E241D; --beige-tint: #23241F; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="moss"]:not([data-theme="light"]) {
    --bg: #121411; --surface: #1A1D18; --surface-2: #20241E; --surface-3: #282D25; --line: #2A2F27; --line-strong: #3A4136;
    --ink: #ECEFE8; --ink-2: #B0B6A9; --ink-3: #7F857A; --brand: #8FC173; --brand-strong: #B4DA9E; --brand-tint: #26331F; --on-brand: #121411;
    --black: #ECEFE8; --peach: #3A2A20; --peach-ink: #F0B48C; --mint: #23331D; --mint-ink: #A9D493; --sage-tint: #22301C; --rose-tint: #2E241D; --beige-tint: #23241F; --shadow: none;
  }
}
/* faint drafting grid, as in the reference */
[data-palette="moss"] body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(60, 75, 50, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 75, 50, .045) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; padding: 0 16px; }
.sidebar, .topbar { display: none; }
.container-app, .app-shell { max-width: none; padding: 0; }
@media (min-width: 992px) {
  .shell { align-items: flex-start; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: 264px; flex: none;
    background: var(--surface); border-inline-start: 1px solid var(--line); padding: 1.1rem .9rem; overflow-y: auto; }
  .main-col { padding: 0 2rem 2rem; max-width: 1280px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0 1.4rem; }
  .app-top, .tabbar, .more-sheet, .fab-phone { display: none !important; }
  body.has-tabbar main { padding-bottom: 0; }
}
@media (max-width: 991.98px) {
  .app-top { display: flex; }
}

/* sidebar */
.side-brand { display: block; padding: .3rem .4rem 1rem; margin-bottom: .4rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.lockup { display: flex; flex-direction: column; gap: .2rem; }
.lockup-tag { font-size: .78rem; color: var(--ink-3); line-height: 1.5; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-group { font-size: .74rem; color: var(--ink-3); font-weight: 600; padding: .9rem .6rem .3rem; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 12px; color: var(--ink-2); font-size: .92rem; }
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.active { background: var(--black); color: var(--surface); font-weight: 600; }
:root[data-theme="dark"] .side-link.active { color: #121411; }
.side-badge { margin-inline-start: auto; font-size: .7rem; background: var(--peach); color: var(--peach-ink); border-radius: 99px; padding: 0 .45rem; }
.side-foot { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; display: flex; flex-direction: column; gap: 2px; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .3rem .3rem .6rem; }
.side-user .avatar { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--ring-a, #6A9E4E), var(--brand-strong)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.side-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user .who strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { font-size: .72rem; color: var(--ink-3); }
.side-user form { margin: 0; }
.icon-btn.sm { width: 34px; height: 34px; }

/* top bar */
.topbar-title { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.topbar-title h1 { font-size: 1.45rem; font-weight: 700; margin: 0; white-space: nowrap; }
.chip-live { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .3rem .75rem; font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.chip-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.topbar-tools { display: flex; align-items: center; gap: .5rem; }
.top-search { display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 .9rem; height: 40px; min-width: 220px; }
.top-search svg { width: 16px; height: 16px; color: var(--ink-3); }
.top-search input { border: 0; background: transparent; outline: none; flex: 1; font: inherit; font-size: .88rem; color: var(--ink); min-width: 0; }
.top-search:focus-within { border-color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: .3rem; height: 36px; padding: 0 .85rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; white-space: nowrap; }
.pill b { color: var(--ink); }
.pill.warn { background: var(--peach); border-color: transparent; color: var(--peach-ink); }
.pill.warn b { color: var(--peach-ink); }
.pill.ok { background: var(--mint); border-color: transparent; color: var(--mint-ink); }
.pill.ok b { color: var(--mint-ink); }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 .4rem; color: var(--ink); }

/* brand tile (logo square like the reference) */
.brand-tile { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #7FA35C 0%, #4E7A3A 55%, #2F5226 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.brand-tile img { width: 24px; height: 24px; filter: brightness(1.9) saturate(.3); }
.brand-logo.side .brand-word { font-size: 1.55rem; }
.brand-logo.has-img img { display: block; max-height: 46px; width: auto; max-width: 200px; object-fit: contain; }
.brand-logo.sm.has-img img { max-height: 36px; }
.brand-logo.xl.has-img img { max-height: 90px; max-width: 260px; }
.brand-logo.sm .brand-tile { width: 30px; height: 30px; border-radius: 9px; }
.brand-logo.sm .brand-tile img { width: 20px; height: 20px; }
.brand-logo.xl .brand-tile { width: 54px; height: 54px; border-radius: 16px; }
.brand-logo.xl .brand-tile img { width: 36px; height: 36px; }

/* ---------- moss components ---------- */
[data-palette="moss"] .panel, [data-palette="moss"] .soft-card, [data-palette="moss"] .item-card, [data-palette="moss"] .six-tile,
[data-palette="moss"] .welcome, [data-palette="moss"] .wird-card:not(.done) { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; }
[data-palette="moss"] .six-tile { background: var(--surface) !important; }
[data-palette="moss"] .six-tile .six-ico { background: var(--surface-2); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
[data-palette="moss"] .six-tile.tone-sage .six-ico { background: var(--black); color: var(--surface); border-color: var(--black); }

/* black pill buttons ("Mark ready"), white pill secondary ("Hold") */
[data-palette="moss"] .btn-brand { background: var(--black); color: var(--surface); border-radius: 99px; border: 0; }
[data-palette="moss"] .btn-brand:hover { background: #2E312C; color: #fff; }
:root[data-palette="moss"][data-theme="dark"] .btn-brand { color: #121411; }
[data-palette="moss"] .btn-ghost, [data-palette="moss"] .btn-soft { border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
[data-palette="moss"] .btn-soft:hover, [data-palette="moss"] .btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
[data-palette="moss"] .fab { background: linear-gradient(135deg, #6A9E4E, #2F5226); }

/* the green gradient highlight card ("Overdue ticket") */
[data-palette="moss"] .day-card { background: linear-gradient(140deg, #5E9446 0%, #3D6E30 55%, #2B5223 100%); box-shadow: 0 16px 34px rgba(47, 82, 38, .28); border: 0; }
[data-palette="moss"] .day-bar { background: rgba(255,255,255,.22); }
[data-palette="moss"] .day-bar span { background: #FFFFFF; }
[data-palette="moss"] .prayer-chip.mini { background: rgba(255,255,255,.14); }
[data-palette="moss"] .prayer-chip.mini.st-jamaah { background: #FFFFFF; color: #2B5223; }
[data-palette="moss"] .prayer-chip.mini.st-ontime { background: #DDEBCF; color: #2B5223; }
[data-palette="moss"] .prayer-chip.mini.st-late { background: #FBE7D8; color: #8A4219; }

/* wird card = a white "ticket" with a black action */
[data-palette="moss"] .wird-card:not(.done) { color: var(--ink); }
[data-palette="moss"] .wird-card:not(.done) .eyebrow, [data-palette="moss"] .wird-card:not(.done) .wird-foot span { color: var(--ink-3); }
[data-palette="moss"] .wird-card:not(.done) .wird-ico { background: var(--surface-2); color: var(--ink); }
[data-palette="moss"] .wird-card:not(.done) .wird-progress { background: var(--surface-3); }
[data-palette="moss"] .wird-card:not(.done) .wird-progress span { background: var(--brand) !important; }
[data-palette="moss"] .wird-card:not(.done) .btn-light { background: var(--black); color: var(--surface); border-radius: 99px; }
[data-palette="moss"] .wird-card:not(.done) .btn-outline-light { color: var(--ink-2); border-color: var(--line-strong); border-radius: 99px; }
[data-palette="moss"] .wird-card.done { background: linear-gradient(140deg, #5E9446, #2B5223); }

/* soft status pills ("Fire now" peach / "In progress" grey / "26 left" mint) */
[data-palette="moss"] .soft-card.rose { background: #FDF6F0; border-color: #F3DCCB; }
[data-palette="moss"] .soft-card.rose .soft-title { color: var(--peach-ink); }
[data-palette="moss"] .review-flag, [data-palette="moss"] .slot-chip { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; }
[data-palette="moss"] .takhrij-grade, [data-palette="moss"] .grade-chip { background: var(--mint); color: var(--mint-ink); border-radius: 99px; }
[data-palette="moss"] .welcome { background: var(--surface); }
[data-palette="moss"] .welcome-art, [data-palette="moss"] .w-sun-dot { display: none; }
[data-palette="moss"] .welcome { padding-bottom: 1.3rem; }
[data-palette="moss"] .seg-btn.on:not([class*="st-"]), [data-palette="moss"] .pill-tabs a.active { background: var(--black); border-color: var(--black); color: var(--surface); }
[data-palette="moss"] .check-btn.on { background: var(--brand); color: #fff; }
[data-palette="moss"] .tab.active .tab-ico { background: var(--black); color: var(--surface); }
[data-palette="moss"] .tab.active { color: var(--ink); font-weight: 700; }
[data-palette="moss"] .ring-fg { stroke: url(#ring-grad); }
[data-palette="moss"] .form-control, [data-palette="moss"] .form-select { background-color: var(--surface-2); border: 1px solid var(--line); }

/* ---------- desktop home: a real dashboard, not a stretched phone ---------- */
@media (min-width: 992px) {
  .home-grid { display: grid; gap: 1.2rem; align-items: start;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    grid-template-areas: "welcome tiles" "day tiles" "day cols" "habits cols"; }
  .home-grid > * { margin-bottom: 0 !important; }
  .g-welcome { grid-area: welcome; }
  .g-day { grid-area: day; }
  .g-tiles { grid-area: tiles; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .g-cols { grid-area: cols; display: flex !important; flex-direction: column; gap: 1.1rem; }
  .g-cols > div { display: flex; flex-direction: column; gap: 1.1rem; }
  .g-cols section { margin-bottom: 0 !important; }
  .g-habits { grid-area: habits; }
  .g-habits .hcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) { .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); } }

/* settings page */
.settings-form { max-width: 920px; display: grid; gap: 1rem; }
.settings-form .panel { margin: 0; }
.logo-field { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 16px; padding: .8rem 1rem; min-width: 220px; }
.palette-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.pal input { position: absolute; opacity: 0; }
.pal span { display: flex; align-items: center; gap: .3rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.pal input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.pal input:focus-visible + span { outline: 2px solid var(--brand); }
.pal i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.pal b { font-weight: 500; font-size: .85rem; margin-inline-start: .3rem; }
.pal-moss i:nth-child(1) { background: #EEF0EA; } .pal-moss i:nth-child(2) { background: #4E7A3A; } .pal-moss i:nth-child(3) { background: #1C1E1B; }
.pal-emerald i:nth-child(1) { background: #EEF4EF; } .pal-emerald i:nth-child(2) { background: #1F5A40; } .pal-emerald i:nth-child(3) { background: #FFD60A; }
.pal-sage i:nth-child(1) { background: #F8F5ED; } .pal-sage i:nth-child(2) { background: #6F7F6B; } .pal-sage i:nth-child(3) { background: #E3C9C1; }
.pal-slate i:nth-child(1) { background: #F3F4F7; } .pal-slate i:nth-child(2) { background: #5B6987; } .pal-slate i:nth-child(3) { background: #E4E7EC; }
.pal-beige i:nth-child(1) { background: #F2EBDD; } .pal-beige i:nth-child(2) { background: #8C6A3A; } .pal-beige i:nth-child(3) { background: #EFE4D0; }
.font-sample { font-size: 1.15rem; }
.settings-save { position: sticky; bottom: 0; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 40%); }
/* wird «ticket» on moss: dark text on white */
[data-palette="moss"] .wird-card:not(.done), [data-palette="moss"] .wird-card:not(.done):hover { color: var(--ink); }
[data-palette="moss"] .wird-card:not(.done) h2 { color: var(--ink); }
[data-palette="moss"] .wird-card:not(.done) .wird-foot { color: var(--ink-2); }

/* home: two independent columns on desktop; on phones one column in the brief's order */
.home-grid { display: flex; flex-direction: column; }
.hg-main, .hg-side { display: contents; }
.g-welcome { order: 1; } .g-day { order: 2; } .g-tiles { order: 3; } .g-cols { order: 4; } .g-habits { order: 5; }
@media (min-width: 992px) {
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); grid-template-areas: none; gap: 1.2rem; align-items: start; }
  .hg-main, .hg-side { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
  .home-grid .g-welcome, .home-grid .g-day, .home-grid .g-tiles, .home-grid .g-cols, .home-grid .g-habits { grid-area: auto; order: 0; }
}
@media (min-width: 1400px) { .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); } }
@media (min-width: 992px) { .hg-main > *, .hg-side > *, .g-cols > div > * { margin: 0 !important; } }

/* =====================================================================
   v4 — palette «غابة» (forest): deep forest green + fresh lime on misty green-grey,
   youthful components (stat cards, weekly bars, streak, floating black tab bar), landing page
   ===================================================================== */
:root[data-palette="forest"] {
  --bg: #EDF1EB; --surface: #FFFFFF; --surface-2: #F4F7F2; --surface-3: #E8EDE5; --line: #E1E7DD; --line-strong: #CAD4C4;
  --ink: #16211A; --ink-2: #56625A; --ink-3: #93A096;
  --brand: #2F4A35; --brand-strong: #1F3325; --brand-tint: #E2EFDB; --on-brand: #FFFFFF;
  --lime: #C5EDA5; --lime-strong: #A8DD80; --lime-ink: #2F4A35;
  --black: #1A1F1B; --peach: #FDEBDD; --peach-ink: #B5612E; --mint: #DDF3CC; --mint-ink: #3C7027;
  --info: #E1EAFE; --info-ink: #3A5DB0;
  --social: #2F4A35; --spiritual: #B5612E; --physical: #3A5DB0;
  --c-brand: #2F4A35; --c-olive: #4F7A3F; --c-blue: #3A5DB0; --c-rose: #B5612E;
  --sage-tint: #E2EFDB; --rose-tint: #FDF3EA; --rose: #F2D2B9; --beige-tint: #F3F5EF; --beige: #DDE5D6; --terra: #B5612E; --gold: #9C8A4C;
  --ring-a: #A8DD80; --ring-b: #2F4A35;
  --shadow: 0 1px 2px rgba(22, 33, 26, .04), 0 12px 32px rgba(22, 33, 26, .06);
  --radius-lg: 22px; --radius: 16px;
}
:root[data-palette="forest"][data-theme="dark"] {
  --bg: #0F1511; --surface: #172019; --surface-2: #1D2820; --surface-3: #263329; --line: #253128; --line-strong: #364639;
  --ink: #EAF1EA; --ink-2: #AFBDB2; --ink-3: #7E8D82; --brand: #A8DD80; --brand-strong: #C5EDA5; --brand-tint: #22331F; --on-brand: #0F1511;
  --black: #EAF1EA; --peach: #3B2A1F; --peach-ink: #F2B48A; --mint: #22351A; --mint-ink: #B4E492; --info: #1E2A45; --info-ink: #9DB6F2;
  --sage-tint: #1F2E1C; --rose-tint: #2E241D; --beige-tint: #1B231D; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="forest"]:not([data-theme="light"]) {
    --bg: #0F1511; --surface: #172019; --surface-2: #1D2820; --surface-3: #263329; --line: #253128; --line-strong: #364639;
    --ink: #EAF1EA; --ink-2: #AFBDB2; --ink-3: #7E8D82; --brand: #A8DD80; --brand-strong: #C5EDA5; --brand-tint: #22331F; --on-brand: #0F1511;
    --black: #EAF1EA; --peach: #3B2A1F; --peach-ink: #F2B48A; --mint: #22351A; --mint-ink: #B4E492; --info: #1E2A45; --info-ink: #9DB6F2;
    --sage-tint: #1F2E1C; --rose-tint: #2E241D; --beige-tint: #1B231D; --shadow: none;
  }
}
/* misty hills background, like the reference */
[data-palette="forest"] body {
  background: radial-gradient(120% 60% at 50% -10%, #FFFFFF 0%, rgba(255,255,255,0) 60%),
              linear-gradient(180deg, #EEF2EC 0%, #E9EFE6 55%, #E2EBDC 100%) fixed;
}
[data-palette="forest"][data-theme="dark"] body { background: var(--bg); }

/* surfaces & controls */
[data-palette="forest"] .panel, [data-palette="forest"] .soft-card, [data-palette="forest"] .item-card, [data-palette="forest"] .six-tile,
[data-palette="forest"] .welcome, [data-palette="forest"] .wird-card:not(.done), [data-palette="forest"] .sidebar, [data-palette="forest"] .stat-card {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
[data-palette="forest"] .six-tile { background: var(--surface) !important; border-radius: 20px; }
[data-palette="forest"] .six-tile .six-ico, [data-palette="forest"] .sc-ico { background: var(--brand); color: #fff; border: 0; box-shadow: none; }
[data-palette="forest"] .six-tile.tone-sage .six-ico { background: var(--lime); color: var(--lime-ink); }
[data-palette="forest"] .btn-brand { background: var(--brand); color: #fff; border-radius: 12px; border: 0; }
[data-palette="forest"] .btn-brand:hover { background: var(--brand-strong); color: #fff; }
:root[data-palette="forest"][data-theme="dark"] .btn-brand { color: #0F1511; }
[data-palette="forest"] .btn-ghost, [data-palette="forest"] .btn-soft { border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
[data-palette="forest"] .side-link.active { background: var(--brand); color: #fff; }
:root[data-palette="forest"][data-theme="dark"] .side-link.active { color: #0F1511; }
[data-palette="forest"] .side-badge { background: var(--lime); color: var(--lime-ink); }
[data-palette="forest"] .pill.ok { background: var(--mint); color: var(--mint-ink); }
[data-palette="forest"] .pill.warn { background: var(--peach); color: var(--peach-ink); }
[data-palette="forest"] .chip-live i { background: var(--lime-strong); box-shadow: 0 0 0 3px var(--mint); }
[data-palette="forest"] .form-control, [data-palette="forest"] .form-select { background-color: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
[data-palette="forest"] .ring-fg { stroke: url(#ring-grad); }
[data-palette="forest"] .check-btn.on { background: var(--brand); color: #fff; }
[data-palette="forest"] .seg-btn.on:not([class*="st-"]), [data-palette="forest"] .pill-tabs a.active { background: var(--black); border-color: var(--black); color: var(--surface); }
[data-palette="forest"] .fab { background: var(--brand); }
[data-palette="forest"] .review-flag, [data-palette="forest"] .slot-chip { background: var(--info); color: var(--info-ink); border: 0; border-radius: 99px; }
[data-palette="forest"] .takhrij-grade, [data-palette="forest"] .grade-chip { background: var(--mint); color: var(--mint-ink); border-radius: 99px; }
[data-palette="forest"] .welcome { background: linear-gradient(120deg, #FFFFFF 0%, #F2F8EE 100%); padding-bottom: 1.3rem; }
[data-palette="forest"] .welcome-art, [data-palette="forest"] .w-sun-dot { display: none; }
/* «يومك»: deep forest with lime */
[data-palette="forest"] .day-card { background: linear-gradient(150deg, #2F4A35 0%, #22382A 100%); border: 0; box-shadow: 0 16px 34px rgba(31, 51, 37, .25); }
[data-palette="forest"] .day-bar { background: rgba(255,255,255,.15); }
[data-palette="forest"] .day-bar span { background: var(--lime); }
[data-palette="forest"] .prayer-chip.mini.st-jamaah { background: var(--lime); color: #1F3325; }
[data-palette="forest"] .prayer-chip.mini.st-ontime { background: #E7F5DC; color: #1F3325; }
[data-palette="forest"] .prayer-chip.mini.st-late { background: var(--peach); color: #7A3C14; }
[data-palette="forest"] .prayer-chip.mini[class*="st-"] .p-status { color: inherit; }
/* wird: white ticket with progress in forest */
[data-palette="forest"] .wird-card:not(.done), [data-palette="forest"] .wird-card:not(.done):hover, [data-palette="forest"] .wird-card:not(.done) h2 { color: var(--ink); }
[data-palette="forest"] .wird-card:not(.done) .eyebrow, [data-palette="forest"] .wird-card:not(.done) .wird-foot { color: var(--ink-3); }
[data-palette="forest"] .wird-card:not(.done) .wird-ico { background: var(--lime); color: var(--lime-ink); }
[data-palette="forest"] .wird-card:not(.done) .wird-progress { background: var(--surface-3); }
[data-palette="forest"] .wird-card:not(.done) .wird-progress span { background: var(--brand) !important; }
[data-palette="forest"] .wird-card:not(.done) .btn-light { background: var(--brand); color: #fff; }
[data-palette="forest"] .wird-card:not(.done) .btn-outline-light { color: var(--ink-2); border-color: var(--line-strong); }
[data-palette="forest"] .wird-card.done { background: linear-gradient(150deg, #2F4A35, #4F7A3F); }
[data-palette="forest"] .soft-card.rose { background: #FFFAF5; border-color: #F3E0D0; }
[data-palette="forest"] .soft-card.rose .soft-title { color: var(--peach-ink); }

/* JAGOO-style floating black tab bar on phones */
[data-palette="forest"] .tabbar, [data-palette="moss"] .tabbar {
  background: #1A1F1B; border: 0; border-radius: 26px; left: 50%; right: auto; transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); bottom: max(12px, env(safe-area-inset-bottom)); padding: .5rem .4rem; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
[data-palette="forest"] .tab, [data-palette="moss"] .tab { color: #A9B3AB; }
[data-palette="forest"] .tab-label, [data-palette="moss"] .tab-label { display: none; }
[data-palette="forest"] .tab.active .tab-ico { background: var(--lime); color: #1A1F1B; }
[data-palette="moss"] .tab.active .tab-ico { background: #fff; color: #1A1F1B; }
[data-palette="forest"] .tab.active, [data-palette="moss"] .tab.active { color: #fff; }
[data-palette="forest"] .tab-ico, [data-palette="moss"] .tab-ico { width: 46px; height: 46px; }

/* ---------- «نبض يومك»: stat cards, streak, weekly bars ---------- */
.pulse { display: flex; flex-direction: column; gap: .9rem; }
.pulse .block-head { margin-bottom: 0; }
.streak { display: inline-flex; align-items: center; gap: .3rem; background: var(--peach, #FDEBDD); color: var(--peach-ink, #B5612E); border-radius: 99px; padding: .3rem .8rem; font-size: .82rem; font-weight: 600; }
.streak svg { width: 15px; height: 15px; }
.streak.muted { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .5rem; color: var(--ink); box-shadow: var(--shadow); }
.stat-card:hover { color: var(--ink); border-color: var(--line-strong); }
.sc-head { display: flex; align-items: center; gap: .45rem; font-size: .86rem; font-weight: 600; }
.sc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.sc-ico svg { width: 16px; height: 16px; }
.sc-body { display: flex; align-items: flex-end; justify-content: space-between; gap: .4rem; }
.sc-body > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.sc-num { font-size: 1.55rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-body small { color: var(--ink-3); font-size: .74rem; }
.stat-card .ring { width: 46px; height: 46px; }
.stat-card .ring b { font-size: .62rem; }
.sc-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.sc-bars i { width: 5px; border-radius: 3px; background: var(--brand); opacity: .85; }
.sc-bars i:last-child { background: var(--lime-strong, #A8DD80); opacity: 1; }
.week-chart { padding: 1rem 1.1rem; margin: 0; }
.wc-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.wc-legend { display: flex; gap: .9rem; font-size: .78rem; color: var(--ink-2); }
.wc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: .3rem; }
.k-w, .b-w { background: var(--brand); }
.k-t, .b-t { background: var(--lime, #C5EDA5); }
.wc-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; height: 150px; }
.wc-day { display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--ink-3); font-size: .74rem; }
.wc-col { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-radius: 10px; }
.wc-col i { width: min(16px, 40%); border-radius: 8px 8px 4px 4px; transition: height .4s; }
.wc-day.today .wc-lbl { color: var(--ink); font-weight: 700; }
.wc-day.today .wc-col { background: var(--surface-2); }
@media (max-width: 575.98px) {
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-num { font-size: 1.3rem; }
  .wc-bars { height: 120px; gap: .25rem; }
}
@media (min-width: 992px) { .g-pulse { order: 0; } }
.g-pulse { order: 2; }

/* ---------- landing page ---------- */
body.landing { padding: 0 16px; }
.landing .lp-nav { max-width: 1160px; margin: 14px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(255,255,255,.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 18px; padding: .6rem .9rem; position: sticky; top: 10px; z-index: 50; }
:root[data-theme="dark"] .landing .lp-nav { background: rgba(23,32,25,.8); }
.lp-links { display: flex; gap: 1.4rem; }
.lp-links a { color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.lp-links a:hover { color: var(--ink); }
.lp-cta { display: flex; gap: .5rem; }
.btn-brand.lg, .btn-ghost.lg { padding: .75rem 1.4rem; font-size: 1rem; }
.btn-brand.sm, .btn-ghost.sm { padding: .3rem .7rem; font-size: .76rem; }
.lp-hero { max-width: 1160px; margin: 0 auto; text-align: center; padding: 4.5rem 0 0; }
.lp-badge { display: inline-flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .3rem .4rem .3rem .8rem; font-size: .86rem; color: var(--ink-2); }
.lp-badge b { display: inline-flex; align-items: center; gap: .3rem; background: var(--lime, #C5EDA5); color: var(--lime-ink, #2F4A35); border-radius: 9px; padding: .2rem .6rem; }
.lp-badge svg { width: 14px; height: 14px; }
.lp-hero h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); font-weight: 800; line-height: 1.35; margin: 1.3rem auto .9rem; max-width: 860px; letter-spacing: 0; }
.lp-lead { color: var(--ink-2); font-size: clamp(.98rem, 1.6vw, 1.12rem); max-width: 640px; margin: 0 auto 1.6rem; line-height: 1.9; }
.lp-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.lp-preview { margin: 3.2rem auto 0; max-width: 1060px; display: grid; grid-template-columns: 190px 1fr; gap: .9rem; text-align: start;
  background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 26px; padding: .9rem; box-shadow: 0 40px 80px rgba(31, 51, 37, .14);
  transform: perspective(1600px) rotateX(6deg); transform-origin: top center; }
:root[data-theme="dark"] .lp-preview { background: rgba(23,32,25,.6); }
.pv-side { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: .8rem .6rem; display: flex; flex-direction: column; gap: .2rem; }
.pv-logo { padding: .2rem .4rem .7rem; }
.pv-side i { font-style: normal; display: flex; align-items: center; gap: .45rem; padding: .45rem .55rem; border-radius: 10px; font-size: .82rem; color: var(--ink-2); }
.pv-side i svg { width: 15px; height: 15px; }
.pv-side i.on { background: var(--brand); color: #fff; }
.pv-main { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.pv-top { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .6rem .9rem; }
.pv-chip { font-size: .72rem; background: var(--info, #E1EAFE); color: var(--info-ink, #3A5DB0); border-radius: 99px; padding: .15rem .6rem; }
.pv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.pv-stats .stat-card { padding: .7rem; }
.pv-stats .sc-num { font-size: 1.15rem; }
.pv-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: .8rem; }
.pv-row .wc-bars { height: 120px; }
.pv-ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.pv-prog { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pv-prog i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.pv-btns { display: flex; gap: .4rem; margin-top: auto; }
.lp-section { max-width: 1160px; margin: 0 auto; padding: 5rem 0 0; text-align: center; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: .35rem; background: var(--mint, #DDF3CC); color: var(--mint-ink, #3C7027); border-radius: 99px; padding: .25rem .8rem; font-size: .82rem; font-weight: 600; }
.lp-eyebrow svg { width: 14px; height: 14px; }
.lp-section h2, .lp-join h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 800; margin: .9rem 0 .6rem; }
.lp-sub { color: var(--ink-2); max-width: 640px; margin: 0 auto 2rem; line-height: 1.9; }
.lp-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; text-align: start; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.4rem; box-shadow: var(--shadow); }
.lp-card.wide { grid-column: span 2; }
.lp-card.dark { background: linear-gradient(150deg, #2F4A35, #1F3325); color: #EAF3E6; border: 0; }
.lp-card.dark p { color: #C3D5BE; }
.lp-card.dark .lp-ico { background: var(--lime, #C5EDA5); color: #1F3325; }
.lp-card h3 { font-size: 1.12rem; font-weight: 700; margin: .9rem 0 .4rem; }
.lp-card p { color: var(--ink-2); margin: 0; line-height: 1.85; font-size: .94rem; }
.lp-ico { width: 44px; height: 44px; border-radius: 13px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.lp-ico svg { width: 21px; height: 21px; }
.lp-ico.sm { width: 36px; height: 36px; border-radius: 11px; flex: none; }
.lp-ico.sm svg { width: 18px; height: 18px; }
.lp-mini-prayers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; margin-top: 1rem; }
.lp-mini-prayers span { background: var(--surface-2); border-radius: 12px; padding: .5rem .2rem; text-align: center; display: flex; flex-direction: column; font-size: .8rem; }
.lp-mini-prayers span.ok { background: var(--lime, #C5EDA5); color: #1F3325; }
.lp-mini-prayers small { font-size: .68rem; opacity: .8; }
.lp-strip { max-width: 1160px; margin: 2rem auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.lp-chip { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .8rem; }
.lp-chip b { display: block; font-size: .9rem; }
.lp-chip small { color: var(--ink-3); font-size: .76rem; }
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; text-align: start; }
.lp-step { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.4rem; position: relative; }
.lp-step h3 { font-size: 1.08rem; font-weight: 700; margin: .9rem 0 .4rem; }
.lp-step p { color: var(--ink-2); margin: 0; font-size: .94rem; line-height: 1.85; }
.lp-num { position: absolute; inset-inline-end: 1.2rem; top: 1rem; font-size: 2.4rem; font-weight: 800; color: var(--surface-3); line-height: 1; }
.lp-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.lp-numbers div { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.lp-numbers b { font-size: 2.2rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.lp-numbers span { color: var(--ink-2); font-size: .9rem; }
.lp-faq { max-width: 760px; text-align: center; }
.lp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: .6rem; text-align: start; }
.lp-faq summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary svg { width: 18px; height: 18px; transition: transform .2s; color: var(--ink-3); flex: none; }
.lp-faq details[open] summary svg { transform: rotate(180deg); }
.lp-faq details p { padding: 0 1.2rem 1rem; margin: 0; color: var(--ink-2); line-height: 1.9; }
.lp-join { max-width: 1160px; margin: 5rem auto 0; display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center;
  background: linear-gradient(150deg, #2F4A35 0%, #1F3325 100%); color: #EAF3E6; border-radius: 30px; padding: 2.4rem; overflow: hidden; position: relative; }
.lp-join::after { content: ""; position: absolute; inset: auto -10% -60% auto; width: 60%; height: 120%; background: radial-gradient(closest-side, rgba(197,237,165,.25), transparent); pointer-events: none; }
.lp-join h2 { color: #fff; margin-top: 0; }
.lp-join-copy p { color: #C3D5BE; line-height: 1.9; }
.lp-checks { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.lp-checks li { display: flex; align-items: center; gap: .5rem; }
.lp-checks svg { width: 18px; height: 18px; background: var(--lime, #C5EDA5); color: #1F3325; border-radius: 50%; padding: 3px; }
.lp-form { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 1.5rem; position: relative; z-index: 1; }
.lp-form h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.lp-foot { max-width: 1160px; margin: 3rem auto 0; padding: 1.6rem 0 2rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.lp-foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.lp-foot nav a { color: var(--ink-2); font-size: .9rem; }
@media (max-width: 991.98px) {
  .lp-links { display: none; }
  .lp-hero { padding-top: 3rem; }
  .lp-preview { grid-template-columns: 1fr; transform: none; }
  .pv-side { display: none; }
  .lp-bento, .lp-steps { grid-template-columns: 1fr 1fr; }
  .lp-strip, .lp-numbers { grid-template-columns: 1fr 1fr; }
  .lp-join { grid-template-columns: 1fr; padding: 1.6rem; }
}
@media (max-width: 575.98px) {
  .lp-bento, .lp-steps { grid-template-columns: 1fr; }
  .lp-card.wide { grid-column: auto; }
  .pv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-row { grid-template-columns: 1fr; }
  .lp-cta .btn-ghost { display: none; }
  .lp-mini-prayers { gap: .25rem; }
  .lp-mini-prayers span { font-size: .7rem; }
}
.pal-forest i:nth-child(1) { background: #EDF1EB; } .pal-forest i:nth-child(2) { background: #2F4A35; } .pal-forest i:nth-child(3) { background: #C5EDA5; }
.lp-card.dark h3 { color: #FFFFFF; }
span.ring b { position: relative; white-space: nowrap; line-height: 1; }
/* palette gradients apply to progress rings only, never to the focus timer */
.ring-wrap .ring-fg { stroke: var(--brand) !important; }
.wc-lbl { font-size: .7rem; white-space: nowrap; }
@media (max-width: 575.98px) { .wc-lbl { font-size: .62rem; } }
/* lighter, clearer base for the forest palette */
:root[data-palette="forest"][data-theme="light"] { --bg: #F6F9F4; --surface-2: #F3F7F1; --line: #E3EAE0; --ink-2: #4E5A52; --ink-3: #85928A; }
[data-palette="forest"][data-theme="light"] body {
  background: radial-gradient(120% 55% at 50% -12%, #FFFFFF 0%, rgba(255,255,255,0) 62%), linear-gradient(180deg, #F8FBF6 0%, #F2F7EF 60%, #EAF2E5 100%) fixed;
}

/* compact sidebar */
@media (min-width: 992px) {
  .sidebar { width: 232px; padding: .9rem .7rem; }
  .side-brand { padding: .2rem .35rem .8rem; margin-bottom: .3rem; }
  .brand-logo.side .brand-word { font-size: 1.35rem; }
  .brand-logo.side .brand-tile { width: 32px; height: 32px; border-radius: 10px; }
  .side-nav { gap: 1px; }
  .side-group { padding: .75rem .55rem .2rem; font-size: .7rem; }
  .side-link { padding: .42rem .6rem; font-size: .9rem; border-radius: 10px; }
  .side-link svg { width: 17px; height: 17px; }
  .side-foot { padding-top: .7rem; margin-top: .6rem; gap: .5rem; }
  .side-user { padding: 0 .2rem; }
  .side-user .who small { direction: ltr; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-tools { display: flex; justify-content: space-between; gap: .2rem; }
  .side-tools form { margin: 0; }
  .side-tools .icon-btn.sm { width: 34px; height: 34px; background: var(--surface-2); }
}
.section-tabs { margin-bottom: 1.1rem; }
@media (min-width: 992px) { .home-grid .g-pulse { order: 0; } }
.db-now { display: flex; gap: .9rem; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; }
.db-now > div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.db-now code { font-size: .82rem; color: var(--ink-2); word-break: break-all; }
.db-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--brand); color: #fff; }
.db-now.is-file .db-ico { background: var(--peach, #FDEBDD); color: var(--peach-ink, #B5612E); }

/* app: organized like the reference — header subtitle + action, «يومك» card in the sidebar */
.tt-stack { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tt-stack h1 { font-size: 1.45rem; font-weight: 800; margin: 0; }
.tt-stack p { margin: 0; color: var(--ink-3); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.top-action { border-radius: 99px !important; padding: .55rem 1.1rem !important; white-space: nowrap; }
.side-day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding: .7rem .75rem 0; margin-bottom: .6rem; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow); }
.sd-row { display: flex; justify-content: space-between; align-items: center; }
.sd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime-strong, #2EB872); box-shadow: 0 0 0 3px var(--mint, #E3F3E8); }
.side-day strong { font-size: .88rem; }
.sd-meta { display: flex; justify-content: space-between; gap: .3rem; font-size: .74rem; color: var(--ink-2); flex-wrap: wrap; }
.sd-meta svg { width: 13px; height: 13px; margin-inline-end: .2rem; vertical-align: -2px; }
.sd-chip { border-radius: 99px; padding: 0 .45rem; background: var(--mint, #E3F3E8); color: var(--mint-ink, #3C7027); }
.sd-chip.warn { background: var(--peach, #FDEBDD); color: var(--peach-ink, #B5612E); }
.sd-btn { display: flex; justify-content: center; align-items: center; gap: .35rem; margin: .35rem -.75rem 0; padding: .45rem; background: var(--ink-3); color: #fff; font-size: .78rem; font-weight: 600; }
.sd-btn:hover { background: var(--ink-2); color: #fff; }
.sd-btn svg { width: 14px; height: 14px; }
/* status badges, framed numbers and pagination are shared with the admin panel */
.sbadge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 7px; padding: .12rem .5rem; font-size: .75rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.sbadge svg { width: 13px; height: 13px; }
.sb-ok { background: #EAF8EE; color: #23864A; border-color: #BFE7CB; }
.sb-info { background: #EBF0FE; color: #3B5BC4; border-color: #C9D5FA; }
.sb-muted { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-strong); }
.sb-warn { background: #FFF2E8; color: #C2551B; border-color: #F8D2B8; }
.id-chip { display: inline-block; border: 1.5px solid var(--ink-2); border-radius: 6px; padding: 0 .4rem; font-size: .76rem; font-weight: 700; color: var(--ink); background: var(--surface); line-height: 1.6; white-space: nowrap; }
.pager2 { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.pg-step { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); font-size: .86rem; }
.pg-step svg { width: 16px; height: 16px; }
.pg-step.off { opacity: .35; }
.pg-nums { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.pg-num { min-width: 30px; height: 26px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); font-size: .8rem; padding: 0 .4rem; }
.pg-num.on { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
@media (max-width: 1199.98px) { .top-search { min-width: 160px; } .tt-stack p { max-width: 36vw; } }
.sd-btn { background: var(--ink-2); } .sd-btn:hover { background: var(--ink); }
/* the page title lives in the header (desktop top bar / phone app bar) — no repeated title in the body */
.section-head h1 { display: none; }
.section-head:not(:has(> :not(h1))) { display: none; }
.section-rule { display: none; }
/* top bar on smaller laptops: keep title, action and bell; drop the extras progressively */
@media (min-width: 992px) and (max-width: 1279.98px) {
  .topbar .pill { display: none; }
  .top-search { min-width: 0; width: 190px; }
  .tt-stack p { max-width: 28vw; }
}
@media (min-width: 992px) and (max-width: 1149.98px) {
  .topbar .clock, .top-search { display: none; }
}
.topbar-title { min-width: 0; flex: 1; }

/* full width on desktop: the content fills the space beside the sidebar (no empty band on wide screens) */
@media (min-width: 992px) {
  .main-col { max-width: none; width: 100%; padding: 0 2rem 2rem; }
  .main-col > main, .main-col > .topbar, .main-col > .site-footer { max-width: 2000px; margin-inline: auto; width: 100%; }
}
@media (min-width: 1600px) {
  .home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); }
  .stat-cards { gap: .9rem; }
  .wc-bars { height: 180px; }
}
/* desktop has the header action button; the floating «+» is for phones only */
@media (min-width: 992px) { .fab { display: none; } }
