/*
 * Life & ethics area (Marriage & Family, Business Ethics, Inheritance, Women's Worship, Daily Sunnah, Halal
 * Ingredients): the shared look. Each area sets its accent on .lf--{area}; the feature files add only what is
 * unique to them. Logical properties throughout so Arabic and Urdu mirror; motion respects reduced-motion.
 */
.lf {
  --lf-accent: #1f7a63;
  --lf-accent-strong: #16624f;
  --lf-accent-soft: #eefaf0;
  --lf-accent-ink: #ffffff;
  --lf-hero-a: #0d3b29;
  --lf-hero-b: #1f7a63;
  --lf-hero-c: #c99a3b;
  --lf-card: var(--ip-surface, #fff);
  --lf-card-line: var(--ip-line, #e6dfcd);
  --lf-ink: var(--ip-ink, #13221d);
  --lf-muted: var(--ip-muted, #5a6963);
  --lf-radius: 22px;
  --lf-shadow: 0 1px 2px rgba(27, 31, 46, .05), 0 12px 32px -18px rgba(27, 31, 46, .28);
  --lf-shadow-hover: 0 2px 4px rgba(27, 31, 46, .06), 0 24px 48px -22px rgba(27, 31, 46, .36);
  color: var(--lf-ink);
  padding-block-end: 4rem;
}
.lf--family,
.lf--business,
.lf--inheritance,
.lf--womens,
.lf--sunnah,
.lf--halal { --lf-accent: #1f7a63; --lf-accent-strong: #16624f; --lf-accent-soft: #eefaf0; --lf-hero-a: #0b3324; --lf-hero-b: #1a6b55; }
/* Every topic shares the design's deep-green hero; each keeps its own warm highlight. */
.lf--family { --lf-hero-c: #e9b46a; }
.lf--business { --lf-hero-c: #d7a84b; }
.lf--inheritance { --lf-hero-c: #e2b65a; }
.lf--womens { --lf-hero-c: #efc0a4; }
.lf--sunnah { --lf-hero-c: #f7d58a; }
.lf--halal { --lf-hero-c: #d9c36a; }

[data-theme="dark"] .lf {
  --lf-accent-soft: rgba(255, 255, 255, .06);
  --lf-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -18px rgba(0, 0, 0, .7);
  --lf-shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .8);
}
[data-theme="dark"] .lf--family { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }
[data-theme="dark"] .lf--business { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }
[data-theme="dark"] .lf--inheritance { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }
[data-theme="dark"] .lf--womens { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }
[data-theme="dark"] .lf--sunnah { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }
[data-theme="dark"] .lf--halal { --lf-accent: #2eb872; --lf-accent-strong: #5fd49a; --lf-accent-ink: #03140b; }

.lf a { color: var(--lf-accent); }
.lf a:hover { color: var(--lf-accent-strong); }
.lf :focus-visible { outline: 3px solid var(--ip-focus, #b07f22); outline-offset: 3px; border-radius: 10px; }

/* ---------- Hero ---------- */
.lf-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--lf-hero-c) 38%, transparent) 0%, transparent 46%),
    linear-gradient(135deg, var(--lf-hero-a) 0%, var(--lf-hero-b) 100%);
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.75rem) clamp(2.75rem, 2rem + 3vw, 4.5rem);
  isolation: isolate;
}
.lf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--ip-pattern-light);
  background-size: 96px 96px;
  opacity: .9;
  z-index: -1;
}
.lf-hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  height: 42px;
  background: var(--ip-bg, #f8f5ec);
  clip-path: ellipse(70% 100% at 50% 100%);
  z-index: 0;
}
.lf-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; position: relative; z-index: 1; }
.lf-hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  color: color-mix(in srgb, var(--lf-hero-c) 80%, #fff);
  margin-block-end: .85rem;
}
.lf-hero-eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.lf-hero-title {
  font-family: var(--ip-font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
  color: #fff;
  text-wrap: balance;
}
.lf-hero-title em { font-style: italic; color: color-mix(in srgb, var(--lf-hero-c) 85%, #fff); }
.lf-hero-lead { font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem); line-height: 1.7; max-width: 38rem; color: rgba(255, 255, 255, .86); margin: 0 0 1.6rem; }
.lf-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.lf-hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-block-start: 1.5rem; font-size: .9rem; color: rgba(255, 255, 255, .78); }
.lf-hero-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.lf-hero-art { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 1; }
.lf-hero-art svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .25)); }
.lf-hero .ip-review-badge { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .28); }
.lf-hero--compact { padding-block: 2.25rem 3rem; }
.lf-hero--compact .lf-hero-title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); }

/* ---------- Buttons ---------- */
.lf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.35rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none; border: 1px solid transparent;
  transition: transform .2s var(--ip-ease, ease), box-shadow .2s, background-color .2s, color .2s;
  cursor: pointer;
}
.lf-btn:hover { transform: translateY(-1px); }
.lf-btn-light { background: #fff; color: var(--lf-hero-a) !important; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45); }
.lf-btn-light:hover { background: #fffaf0; }
.lf-btn-glass { background: rgba(255, 255, 255, .1); color: #fff !important; border-color: rgba(255, 255, 255, .32); backdrop-filter: blur(6px); }
.lf-btn-glass:hover { background: rgba(255, 255, 255, .18); }
.lf-btn-accent { background: var(--lf-accent); color: var(--lf-accent-ink) !important; }
.lf-btn-accent:hover { background: var(--lf-accent-strong); }
.lf-btn-ghost { background: transparent; color: var(--lf-accent) !important; border-color: color-mix(in srgb, var(--lf-accent) 40%, transparent); }
.lf-btn-ghost:hover { background: var(--lf-accent-soft); }
.lf-btn-sm { min-height: 40px; padding: .45rem 1rem; font-size: .9rem; }
.lf-flip { display: inline-block; }
[dir="rtl"] .lf-flip { transform: scaleX(-1); }

/* ---------- Area switcher ---------- */
.lf-areas { position: relative; z-index: 2; margin-block-start: -1.4rem; }
.lf-areas-inner {
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  padding: .45rem; background: var(--lf-card); border: 1px solid var(--lf-card-line);
  border-radius: 999px; box-shadow: var(--lf-shadow); width: max-content; max-width: 100%; margin-inline: auto;
}
.lf-areas-inner::-webkit-scrollbar { display: none; }
.lf-area-link {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  padding: .55rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500;
  color: var(--lf-muted) !important; text-decoration: none; transition: background-color .2s, color .2s;
}
.lf-area-link:hover { background: var(--ip-primary-soft, #eef6f2); color: var(--lf-ink) !important; }
.lf-area-link.is-active { background: var(--lf-accent); color: var(--lf-accent-ink) !important; }

/* ---------- Sections ---------- */
.lf-section { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) 0; }
.lf-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-block-end: 1.75rem; }
.lf-kicker { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--lf-accent); margin: 0 0 .4rem; }
.lf-h2 { font-family: var(--ip-font-display); font-weight: 600; font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.2rem); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.lf-sub { color: var(--lf-muted); margin: .5rem 0 0; max-width: 42rem; line-height: 1.65; }

/* ---------- Category cards ---------- */
.lf-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.lf-cat {
  position: relative; display: flex; flex-direction: column; gap: .7rem;
  padding: 1.35rem 1.35rem 1.2rem; border-radius: var(--lf-radius);
  background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow);
  color: var(--lf-ink) !important; text-decoration: none;
  transition: transform .25s var(--ip-ease, ease), box-shadow .25s, border-color .25s;
}
.lf-cat:hover { transform: translateY(-3px); box-shadow: var(--lf-shadow-hover); border-color: color-mix(in srgb, var(--lf-accent) 35%, var(--lf-card-line)); }
.lf-cat-top { display: flex; align-items: center; justify-content: space-between; }
.lf-cat-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--lf-accent-soft); color: var(--lf-accent); font-size: 1.35rem;
}
.lf-cat-num { font-family: var(--ip-font-display); font-size: 1.05rem; color: var(--lf-muted); }
.lf-cat-title { font-weight: 650; font-size: 1.08rem; line-height: 1.3; margin: 0; }
.lf-cat-text { color: var(--lf-muted); font-size: .93rem; line-height: 1.55; margin: 0; flex: 1; }
.lf-cat-foot { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; color: var(--lf-muted); padding-block-start: .55rem; border-top: 1px dashed var(--lf-card-line); }
.lf-cat-foot .bi-arrow-right { color: var(--lf-accent); transition: transform .2s; }
.lf-cat:hover .lf-cat-foot .bi-arrow-right { transform: translateX(4px); }
[dir="rtl"] .lf-cat:hover .lf-cat-foot .bi-arrow-right { transform: scaleX(-1) translateX(4px); }

/* Colour themes on cards from the seed's ColorTheme. */
.lf-theme-emerald { --lf-accent: #0f7a5c; --lf-accent-soft: #e5f4ee; }
.lf-theme-gold { --lf-accent: #a36f12; --lf-accent-soft: #fcf2dd; }
.lf-theme-sky { --lf-accent: #1f6fa8; --lf-accent-soft: #e7f1fa; }
.lf-theme-violet { --lf-accent: #6b4fb0; --lf-accent-soft: #f0ebfa; }
.lf-theme-rose { --lf-accent: #b23b62; --lf-accent-soft: #fcebf1; }
.lf-theme-teal { --lf-accent: #11757a; --lf-accent-soft: #e3f4f4; }
[data-theme="dark"] .lf-theme-emerald { --lf-accent: #5fd0a8; }
[data-theme="dark"] .lf-theme-gold { --lf-accent: #e8b860; }
[data-theme="dark"] .lf-theme-sky { --lf-accent: #74b6e8; }
[data-theme="dark"] .lf-theme-violet { --lf-accent: #b9a2ef; }
[data-theme="dark"] .lf-theme-rose { --lf-accent: #f08fb0; }
[data-theme="dark"] .lf-theme-teal { --lf-accent: #66cfd3; }
[data-theme="dark"] [class*="lf-theme-"] { --lf-accent-soft: rgba(255, 255, 255, .07); }

/* ---------- Notices ---------- */
.lf-notice {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: 1rem 1.2rem; border-radius: 16px;
  background: var(--lf-accent-soft); border: 1px solid color-mix(in srgb, var(--lf-accent) 22%, transparent);
  font-size: .95rem; line-height: 1.6;
}
.lf-notice > i { color: var(--lf-accent); font-size: 1.25rem; line-height: 1.3; }
.lf-notice p { margin: 0; }
.lf-notice strong { display: block; margin-block-end: .15rem; }

.lf-safety {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem 1.25rem; align-items: center;
  padding: 1.25rem 1.4rem; border-radius: var(--lf-radius);
  background: linear-gradient(135deg, #fff6f3, #fdecef);
  border: 1px solid #f2c7cf; box-shadow: var(--lf-shadow);
}
.lf-safety-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #c2334f; color: #fff; font-size: 1.4rem; }
.lf-safety h2, .lf-safety h3 { font-size: 1.12rem; font-weight: 700; margin: 0 0 .2rem; color: #7d1d31; }
.lf-safety p { margin: 0; color: #5d2a35; line-height: 1.55; }
[data-theme="dark"] .lf-safety { background: linear-gradient(135deg, #2a1418, #33141d); border-color: #5d2a35; }
[data-theme="dark"] .lf-safety h2, [data-theme="dark"] .lf-safety h3 { color: #ffb3c2; }
[data-theme="dark"] .lf-safety p { color: #f1cdd5; }
.lf-safety .lf-btn { background: #c2334f; color: #fff !important; }
.lf-safety .lf-btn:hover { background: #a3283f; }

/* ---------- Section page: layout with a contents rail ---------- */
.lf-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.lf-rail { position: sticky; top: calc(var(--ip-header-h, 72px) + 1rem); }
.lf-rail-card { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 18px; padding: 1rem; box-shadow: var(--lf-shadow); }
.lf-rail-title { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lf-muted); font-weight: 600; margin: .25rem .5rem .6rem; }
.lf-rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; max-height: 60vh; overflow: auto; }
.lf-rail a { display: flex; gap: .55rem; align-items: baseline; padding: .45rem .6rem; border-radius: 10px; color: var(--lf-ink) !important; text-decoration: none; font-size: .92rem; line-height: 1.35; }
.lf-rail a:hover { background: var(--lf-accent-soft); }
.lf-rail a.is-active { background: var(--lf-accent-soft); color: var(--lf-accent) !important; font-weight: 600; }
.lf-rail a.lf-btn-accent { color: var(--lf-accent-ink) !important; }
.lf-rail-num { font-variant-numeric: tabular-nums; color: var(--lf-muted); font-size: .8rem; min-width: 1.4rem; }

.lf-intro { font-size: 1.06rem; line-height: 1.8; color: var(--lf-ink); }
.lf-intro p { margin-block-end: .9rem; }

.lf-topic {
  scroll-margin-top: calc(var(--ip-header-h, 72px) + 1.25rem);
  background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: var(--lf-radius);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem); box-shadow: var(--lf-shadow); margin-block-end: 1.25rem;
}
.lf-topic-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-block-end: .75rem; }
.lf-topic-title { font-family: var(--ip-font-display); font-weight: 600; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.55rem); margin: 0; line-height: 1.25; }
.lf-topic-sub { color: var(--lf-muted); margin: -.25rem 0 1rem; font-size: 1rem; }
.lf-topic-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.lf-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; letter-spacing: .02em; padding: .2rem .6rem; border-radius: 999px; background: var(--lf-accent-soft); color: var(--lf-accent); }
.lf-tag--ruling { background: #f6efe1; color: #8a5a00; }
[data-theme="dark"] .lf-tag--ruling { background: rgba(243, 215, 155, .12); color: #f3d79b; }
.lf-rich { font-size: 1.02rem; line-height: 1.8; }
.lf-rich p { margin-block-end: .85rem; }
.lf-rich h4 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.lf-rich ul, .lf-rich ol { padding-inline-start: 1.3rem; margin-block-end: .9rem; }
.lf-rich li { margin-block-end: .35rem; }
.lf-rich li::marker { color: var(--lf-accent); }

.lf-held {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: 16px;
  background: repeating-linear-gradient(135deg, var(--lf-accent-soft) 0 12px, transparent 12px 24px), var(--lf-card);
  border: 1px dashed color-mix(in srgb, var(--lf-accent) 40%, var(--lf-card-line));
}
.lf-held > i { font-size: 1.5rem; color: var(--lf-accent); }
.lf-held p { margin: 0; line-height: 1.6; }
.lf-held strong { display: block; margin-block-end: .2rem; }

.lf-evidence { margin-block-start: 1.25rem; display: grid; gap: .9rem; }
.lf-evidence-title { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lf-muted); font-weight: 600; margin: 0; }
.lf-evidence .ip-verse { margin: 0; border-inline-start-color: var(--lf-accent); background: var(--lf-accent-soft); }

.lf-hadith { margin: 0; padding: 1.1rem 1.25rem; border-radius: 16px; background: color-mix(in srgb, var(--ip-gold-50, #fcf6e8) 75%, var(--lf-card)); border: 1px solid color-mix(in srgb, #c99a3b 30%, var(--lf-card-line)); }
[data-theme="dark"] .lf-hadith { background: rgba(201, 154, 59, .08); }
.lf-hadith-label { display: flex; align-items: center; gap: .45rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #7d570f; margin-block-end: .5rem; }
[data-theme="dark"] .lf-hadith-label { color: #e8c27a; }
.lf-hadith blockquote { margin: 0 0 .6rem; font-size: 1rem; line-height: 1.75; }
.lf-hadith details { margin-block-end: .5rem; }
.lf-hadith summary { cursor: pointer; font-size: .85rem; color: var(--lf-muted); }
.lf-hadith [lang="ar"] { font-family: var(--ip-font-arabic); font-size: 1.3rem; line-height: 2; margin: .5rem 0 0; }
.lf-hadith figcaption { font-size: .85rem; color: var(--lf-muted); display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.lf-grade { display: inline-flex; padding: .05rem .5rem; border-radius: 999px; background: rgba(15, 107, 85, .1); color: #0f6b55; font-weight: 600; }
[data-theme="dark"] .lf-grade { color: #7fd8b8; background: rgba(127, 216, 184, .12); }

.lf-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block-start: 2rem; }
.lf-pager a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; border-radius: 16px; border: 1px solid var(--lf-card-line); background: var(--lf-card); text-decoration: none; color: var(--lf-ink) !important; }
.lf-pager a:hover { border-color: var(--lf-accent); }
.lf-pager small { color: var(--lf-muted); }
.lf-pager .is-next { text-align: end; grid-column: 2; }

/* ---------- Courses ---------- */
.lf-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.1rem; }
.lf-course {
  display: flex; flex-direction: column; border-radius: var(--lf-radius); overflow: hidden;
  background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow);
  color: var(--lf-ink) !important; text-decoration: none; transition: transform .25s, box-shadow .25s;
}
.lf-course:hover { transform: translateY(-3px); box-shadow: var(--lf-shadow-hover); }
.lf-course-band {
  position: relative; height: 110px; display: flex; align-items: flex-end; padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--lf-hero-a), var(--lf-hero-b)); color: #fff;
}
.lf-course-band::before { content: ""; position: absolute; inset: 0; background-image: var(--ip-pattern-light); background-size: 72px; opacity: .8; }
.lf-course-letter { position: relative; font-family: var(--ip-font-display); font-size: 2.6rem; line-height: 1; opacity: .95; }
.lf-course-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.lf-course-title { font-weight: 700; font-size: 1.1rem; margin: 0; line-height: 1.3; }
.lf-course-text { color: var(--lf-muted); font-size: .93rem; line-height: 1.55; margin: 0; flex: 1; }
.lf-course-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .83rem; color: var(--lf-muted); }
.lf-course-meta span { display: inline-flex; gap: .35rem; align-items: center; }

/* ---------- Scenarios ---------- */
.lf-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-end: 1.5rem; }
.lf-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; min-height: 40px; border-radius: 999px;
  border: 1px solid var(--lf-card-line); background: var(--lf-card); color: var(--lf-ink); font-size: .9rem; font-weight: 500;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; text-decoration: none;
}
.lf-chip:hover { border-color: var(--lf-accent); }
.lf-chip[aria-pressed="true"], .lf-chip.is-active { background: var(--lf-accent); color: var(--lf-accent-ink); border-color: var(--lf-accent); }
.lf-chip .lf-chip-count { font-size: .75rem; opacity: .9; }

.lf-scn {
  background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: var(--lf-radius);
  box-shadow: var(--lf-shadow); padding: clamp(1.25rem, 1rem + 1vw, 2rem); margin-block-end: 1.25rem;
}
.lf-scn[hidden] { display: none; }
.lf-scn-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: center; margin-block-end: .8rem; }
.lf-scn-cat { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--lf-accent); text-transform: uppercase; letter-spacing: .08em; }
.lf-scn-title { font-family: var(--ip-font-display); font-weight: 600; font-size: clamp(1.2rem, 1.05rem + .5vw, 1.5rem); margin: 0 0 .75rem; }
.lf-scn-situation {
  position: relative; font-size: 1.06rem; line-height: 1.75; padding: 1rem 1.2rem 1rem 1.2rem; margin: 0 0 1.1rem;
  border-radius: 16px; background: var(--lf-accent-soft); border-inline-start: 4px solid var(--lf-accent);
}
.lf-scn-ask { font-weight: 600; margin: 0 0 .7rem; }
.lf-choices { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.lf-choice {
  width: 100%; text-align: start; display: flex; gap: .8rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: 14px; border: 1.5px solid var(--lf-card-line); background: var(--lf-card);
  color: var(--lf-ink); font-size: 1rem; line-height: 1.5; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.lf-choice:hover:not([disabled]) { border-color: var(--lf-accent); transform: translateY(-1px); }
.lf-choice-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--lf-card-line); font-size: .8rem; font-weight: 700; color: var(--lf-muted); }
.lf-choice.is-best { border-color: #2f8a5b; background: rgba(47, 138, 91, .08); }
.lf-choice.is-best .lf-choice-mark { background: #2f8a5b; border-color: #2f8a5b; color: #fff; }
.lf-choice.is-other { border-color: #d8a34a; background: rgba(216, 163, 74, .08); }
.lf-choice.is-other .lf-choice-mark { background: #d8a34a; border-color: #d8a34a; color: #fff; }
.lf-choice[disabled] { cursor: default; }
.lf-feedback { margin-block: .45rem 0; margin-inline: 2.6rem 0; font-size: .95rem; line-height: 1.6; color: var(--lf-muted); }
.lf-feedback[hidden] { display: none; }
.lf-reveal { margin-block-start: 1.25rem; padding-block-start: 1.25rem; border-top: 1px dashed var(--lf-card-line); animation: lf-rise .4s var(--ip-ease, ease) both; }
.lf-reveal[hidden] { display: none; }
.lf-practical {
  display: flex; gap: .8rem; align-items: flex-start; margin-block-start: 1rem; padding: .95rem 1.1rem;
  border-radius: 14px; background: linear-gradient(135deg, #fff7e6, #fdf0d8); border: 1px solid #f1d79e; color: #5c3d07;
}
[data-theme="dark"] .lf-practical { background: rgba(240, 176, 102, .1); border-color: rgba(240, 176, 102, .3); color: #f5d9b2; }
.lf-practical i { font-size: 1.3rem; color: #c27f15; }
.lf-schools { margin-block-start: 1rem; font-size: .95rem; line-height: 1.6; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--lf-card-line); }
.lf-schools strong { display: block; margin-block-end: .2rem; }
.lf-scn-source { margin-block-start: 1rem; font-size: .82rem; color: var(--lf-muted); }

.lf-empty { text-align: center; padding: 3rem 1rem; color: var(--lf-muted); border: 1px dashed var(--lf-card-line); border-radius: var(--lf-radius); }
.lf-empty i { font-size: 2rem; color: var(--lf-accent); display: block; margin-block-end: .5rem; }

.lf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; }
.lf-tile { padding: 1.25rem; border-radius: var(--lf-radius); border: 1px solid var(--lf-card-line); background: var(--lf-card); box-shadow: var(--lf-shadow); text-decoration: none; color: var(--lf-ink) !important; display: flex; flex-direction: column; gap: .5rem; transition: transform .2s, box-shadow .2s; }
.lf-tile:hover { transform: translateY(-2px); box-shadow: var(--lf-shadow-hover); }
.lf-tile i { font-size: 1.5rem; color: var(--lf-accent); }
.lf-tile strong { font-size: 1.05rem; }
.lf-tile span { color: var(--lf-muted); font-size: .92rem; line-height: 1.5; }

@keyframes lf-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lf-in { animation: lf-rise .5s var(--ip-ease, ease) both; }

@media (prefers-reduced-motion: reduce) {
  .lf *, .lf *::before, .lf *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 991.98px) {
  .lf-hero-grid { grid-template-columns: 1fr; }
  .lf-hero-art { width: min(64vw, 260px); order: -1; justify-self: start; }
  .lf-layout { grid-template-columns: minmax(0, 1fr); }
  .lf-rail { position: static; min-width: 0; }
  .lf-rail ol { max-height: none; display: flex; overflow-x: auto; gap: .35rem; }
  .lf-rail li { flex: none; }
  .lf-rail a { white-space: nowrap; border: 1px solid var(--lf-card-line); }
}
@media (max-width: 575.98px) {
  .lf-hero-art { display: none; }
  .lf-safety { grid-template-columns: 1fr; text-align: start; }
  .lf-pager { grid-template-columns: 1fr; }
  .lf-pager .is-next { grid-column: 1; }
  .lf-feedback { margin-inline-start: 0; }
  .lf-areas { margin-block-start: -1.2rem; padding-inline: 16px; }
}

@media print {
  .lf-hero, .lf-areas, .lf-rail, .lf-safety, .ip-header, .ip-footer, .lf-hero-actions { display: none !important; }
  .lf-topic { box-shadow: none; break-inside: avoid; }
}

.lf-narrow { max-width: 940px; }

/* Stored translations are often English: on Arabic and Urdu pages let each paragraph take its own direction. */
[dir="rtl"] .lf-evidence .ip-verse-translation,
[dir="rtl"] .inh-verse .ip-verse-translation { unicode-bidi: plaintext; text-align: start; }

/* Content that has not been translated yet is shown in English on Arabic and Urdu pages: each block of text
   takes the direction of its own first letter, so English sentences read left to right with their punctuation
   in place while the translated interface stays right to left. */
[dir="rtl"] .lf :is(p, li, h1, h2, h3, h4, blockquote, figcaption, summary, dt, dd, td, th, label, legend, span, strong, .sn-option) { unicode-bidi: plaintext; }

/* Form fields in dark mode: dark surfaces, light text and a light arrow on selects. */
[data-theme="dark"] .lf :is(.form-select, .form-control) { background-color: var(--lf-card); border-color: var(--lf-card-line); color: var(--lf-ink); color-scheme: dark; }
[data-theme="dark"] .lf .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d6d3c8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
[data-theme="dark"] .lf .form-control::placeholder { color: var(--lf-muted); }

/* ---------- Reading progress on the hubs (life.js) ---------- */
.lf-hero-progress { display: inline-flex; align-items: center; gap: .8rem; margin-block-start: 1.25rem; padding-block: .5rem .5rem; padding-inline: .5rem 1.1rem; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: lf-progress-in .5s var(--ip-ease) both; }
.lf-hero-progress[hidden] { display: none; }
@keyframes lf-progress-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lf-ring { position: relative; width: 44px; height: 44px; flex: none; }
.lf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lf-ring circle { fill: none; stroke-width: 5; }
.lf-ring-track { stroke: rgba(255, 255, 255, .2); }
.lf-ring-value { stroke: #f4d48b; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ip-ease); }
.lf-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; }
.lf-hero-progress-text { display: grid; line-height: 1.3; }
.lf-hero-progress-text strong { font-size: .92rem; color: #fff; }
.lf-hero-progress-text a { font-size: .85rem; font-weight: 600; color: #f4d48b; text-decoration: none; }
.lf-hero-progress-text a:hover { color: #fff; text-decoration: underline; }
.lf-cat-read { display: inline-flex; align-items: center; gap: .3rem; margin-inline-start: auto; margin-inline-end: .5rem; padding: .15rem .55rem; border-radius: 999px; background: var(--ip-success-soft); color: var(--ip-success); font-size: .72rem; font-weight: 700; }
.lf-cat-read[hidden] { display: none; }
.lf-cat.is-read { border-color: color-mix(in srgb, var(--ip-success) 30%, var(--lf-card-line)); }
@media (prefers-reduced-motion: reduce) { .lf-hero-progress { animation: none; } .lf-ring-value { transition: none; } }
