/* Bunyan Al-Marsoos — Mobile-First PWA Styles
 * Design language: Calm, Trustworthy, Modern, Respectful, Premium, Spiritually aligned
 * Palette: Deep Islamic green, sand/cream, gold accents, dark neutrals
 */

:root {
  /* Color system */
  --green-900: #0a2a20;
  --green-800: #0f3d2e;
  --green-700: #15543f;
  --green-600: #1d6d52;
  --green-500: #2a8866;
  --green-400: #4ba888;
  --green-300: #8cc9b1;
  --green-100: #e1f0e8;

  --cream-50: #fdfaf3;
  --cream-100: #f8f1e3;
  --cream-200: #f0e6cf;
  --cream-300: #e3d4b0;

  --gold-500: #c9a96a;
  --gold-600: #b08d4a;
  --gold-700: #8a6c2d;

  --ink-900: #1a1f1c;
  --ink-700: #3d4642;
  --ink-500: #6b7570;
  --ink-300: #aab2ad;
  --ink-100: #e5e9e7;
  --ink-50: #f5f7f6;

  --danger: #c0392b;
  --warning: #b07d22;
  --success: #15543f;

  /* Spacing & layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(10, 42, 32, 0.06), 0 1px 2px rgba(10, 42, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 42, 32, 0.08), 0 2px 4px rgba(10, 42, 32, 0.05);
  --shadow-lg: 0 12px 32px rgba(10, 42, 32, 0.12), 0 4px 8px rgba(10, 42, 32, 0.06);

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;

  --header-h: 220px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--cream-50);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ============ Loading screen ============ */
.loading-screen {
  position: fixed; inset: 0; z-index: 999;
  background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--cream-100);
}
.loading-content { text-align: center; }
.logo-mark {
  width: 96px; height: 96px; border-radius: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(201, 169, 106, 0.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 42px; color: var(--gold-500);
}
.loading-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 600;
  letter-spacing: 0.5px; margin-bottom: 8px;
}
.loading-sub {
  font-size: 13px; color: rgba(255,255,255,0.6); letter-spacing: 0.3px;
}

/* ============ App container — mobile first ============ */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream-50);
  position: relative;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  body { background: var(--green-900); }
  .app {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.25);
  }
}

/* ============ Header bar (green dome banner) ============ */
.app-header {
  position: relative;
  background: linear-gradient(165deg, var(--green-800) 0%, var(--green-900) 100%);
  color: var(--cream-100);
  padding: calc(env(safe-area-inset-top) + 18px) 20px 56px;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  overflow: hidden;
}
.app-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><pattern id='p' x='0' y='0' width='20' height='20' patternUnits='userSpaceOnUse'><path d='M10 0 L20 10 L10 20 L0 10 Z' fill='none' stroke='%23c9a96a' stroke-width='0.5' opacity='0.15'/></pattern></defs><rect width='100' height='100' fill='url(%23p)'/></svg>");
  opacity: 0.45;
  pointer-events: none;
}
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}
.header-time { font-size: 13px; font-weight: 600; opacity: 0.85; }
.header-actions {
  display: flex; align-items: center; gap: 8px;
}
.header-lang {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--cream-100);
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.header-lang:hover, .header-lang:focus {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
}
.header-lang i { font-size: 13px; color: var(--gold-500); }
.header-lang-code { font-size: 11px; }
.header-bell {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--cream-100);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  cursor: pointer;
}
.header-bell .dot {
  position: absolute; top: 7px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-500); border: 1.5px solid var(--green-800);
}
.header-title {
  position: relative; z-index: 1;
  text-align: center;
  margin-top: 28px;
}
.header-title h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  letter-spacing: 1px; line-height: 1.1;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.header-title .subtitle {
  font-size: 12px; opacity: 0.7; letter-spacing: 0.4px;
  font-style: italic;
}
.header-greeting {
  position: relative; z-index: 1;
  margin-top: 22px;
  text-align: center;
}
.header-greeting .greet-line {
  font-family: var(--font-arabic); font-size: 22px; margin-bottom: 4px;
  color: var(--gold-500);
}
.header-greeting .greet-sub {
  font-size: 13px; opacity: 0.75;
}

/* ============ Main content panel (white card overlap) ============ */
.content-panel {
  background: var(--cream-50);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  margin-top: -32px;
  padding: 26px 18px 24px;
  position: relative;
  min-height: 60vh;
}

/* ============ Feature grid (dashboard) ============ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.feature-card {
  background: linear-gradient(180deg, var(--cream-100) 0%, var(--cream-200) 100%);
  border: 1px solid rgba(201, 169, 106, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 8px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center;
  min-height: 110px;
}
.feature-card:active { transform: scale(0.97); }
.feature-card:hover { box-shadow: var(--shadow-md); }
.feature-card .icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--cream-50);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  color: var(--green-700);
  font-size: 20px;
  border: 1px solid rgba(201, 169, 106, 0.3);
}
.feature-card .label {
  font-size: 11.5px; font-weight: 600;
  color: var(--green-900);
  line-height: 1.2;
}

/* ============ Section blocks ============ */
.section {
  margin-top: 22px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  color: var(--green-900);
  margin: 0;
  letter-spacing: 0.3px;
}
.section-header .see-all {
  font-size: 12px; color: var(--green-600); font-weight: 600;
}

/* Daily verse card */
.verse-card {
  background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
  color: var(--cream-100);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.verse-card::before {
  content: '\f4be'; /* fa-mosque */
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute;
  right: -10px; bottom: -10px;
  font-size: 90px;
  opacity: 0.08;
  color: var(--gold-500);
}
.verse-card .verse-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  opacity: 0.7; color: var(--gold-500); font-weight: 600;
  margin-bottom: 10px;
}
.verse-card .verse-arabic {
  font-family: var(--font-arabic); font-size: 22px; line-height: 1.7;
  text-align: right; direction: rtl; margin-bottom: 12px;
  color: var(--cream-50);
}
.verse-card .verse-translation {
  font-family: var(--font-display); font-size: 15px; line-height: 1.5;
  font-style: italic; opacity: 0.92;
  margin-bottom: 10px;
}
.verse-card .verse-ref {
  font-size: 12px; opacity: 0.65; letter-spacing: 0.3px;
}

/* Content list items */
.content-list { display: flex; flex-direction: column; gap: 10px; }
.content-item {
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.content-item:active { transform: scale(0.99); }
.content-item .ci-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.content-item .ci-body { flex: 1; min-width: 0; }
.content-item .ci-title {
  font-size: 14px; font-weight: 600; color: var(--ink-900);
  margin: 0 0 3px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.content-item .ci-meta {
  font-size: 11.5px; color: var(--ink-500);
  display: flex; align-items: center; gap: 8px;
}
.content-item .ci-meta .approved {
  color: var(--green-600);
}
.content-item .ci-chevron { color: var(--ink-300); font-size: 13px; }

/* ============ Bottom navigation ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: white;
  height: var(--nav-h);
  border-top: 1px solid var(--ink-100);
  display: grid; grid-template-columns: repeat(6, 1fr);
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(10, 42, 32, 0.06);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--ink-500);
  font-size: 10px; font-weight: 600;
  height: 100%;
  position: relative;
}
.nav-item i { font-size: 17px; }
.nav-item span { font-size: 9.5px; line-height: 1.1; text-align: center; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nav-item.active { color: var(--green-700); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0;
  width: 28px; height: 3px;
  background: var(--green-700);
  border-radius: 0 0 3px 3px;
}
.nav-fab {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.nav-fab .fab-button {
  position: absolute; top: -22px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(160deg, var(--green-500) 0%, var(--green-700) 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(21, 84, 63, 0.35), 0 2px 4px rgba(0,0,0,0.1);
  border: 4px solid white;
  font-size: 20px;
}
.nav-fab .fab-button:active { transform: scale(0.94); }
.nav-fab .label { margin-top: 30px; font-size: 10px; }

/* ============ Auth screens ============ */
.auth-screen {
  min-height: 100vh; min-height: 100dvh;
  background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  color: var(--cream-100);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 24px 24px;
}
.auth-hero {
  padding: 48px 0 24px;
  text-align: center;
}
.auth-hero .logo-mark { margin-bottom: 20px; }
.auth-hero h1 {
  font-family: var(--font-display); font-size: 34px; font-weight: 700;
  letter-spacing: 1px; margin: 0 0 6px;
  text-transform: uppercase;
}
.auth-hero .tagline {
  font-size: 13px; opacity: 0.7; font-style: italic;
}
.auth-card {
  background: var(--cream-50);
  color: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  margin-top: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  color: var(--green-900); margin: 0 0 6px;
}
.auth-card .auth-sub {
  font-size: 13px; color: var(--ink-500); margin-bottom: 22px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--ink-700);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.form-control {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: white;
  color: var(--ink-900);
  transition: border-color 0.15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(42, 136, 102, 0.12);
}
.form-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; color: var(--ink-700); line-height: 1.5;
  margin-bottom: 18px;
}
.form-check input { margin-top: 2px; accent-color: var(--green-700); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; letter-spacing: 0.3px;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--green-700);
  color: var(--cream-50);
  width: 100%;
}
.btn-primary:hover { background: var(--green-800); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  background: white;
  color: var(--green-800);
  border-color: var(--ink-100);
}
.btn-ghost {
  background: transparent; color: var(--green-700);
}
.btn-gold {
  background: var(--gold-600); color: white;
}

.auth-footer {
  text-align: center; margin-top: 18px;
  font-size: 13px; color: var(--ink-500);
}
.auth-footer a { color: var(--green-700); font-weight: 600; }

.auth-error, .alert-danger {
  background: #fff1f0; color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.auth-info, .alert-info {
  background: var(--green-100); color: var(--green-800);
  border: 1px solid rgba(21, 84, 63, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.alert-warning {
  background: #fdf6e3; color: var(--warning);
  border: 1px solid rgba(176, 125, 34, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ============ Page chrome (non-dashboard pages) ============ */
.page-header {
  position: sticky; top: 0; z-index: 30;
  background: white;
  border-bottom: 1px solid var(--ink-100);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; align-items: center; gap: 12px;
}
.page-header .back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-700);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  color: var(--green-900);
  margin: 0; flex: 1;
}
.page-body { padding: 16px; }

/* ============ AI Companion chat ============ */
.chat-screen {
  display: flex; flex-direction: column;
  /* Constrain to viewport so the inner .chat-messages becomes the scroller.
     Layout: sticky .page-header (~60px) on top, fixed .chat-input-bar + bottom
     nav at the bottom. We subtract the actual sticky header height (approx
     60px including safe-area-inset-top padding) plus the fixed input bar
     (~60px) plus the bottom nav (--nav-h, 76px) so the messages list takes
     exactly the remaining viewport space. */
  height: calc(100vh - 60px - var(--nav-h) - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  height: calc(100dvh - 60px - var(--nav-h) - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 240px;
  overflow: hidden;
}
.chat-messages {
  flex: 1 1 auto;
  min-height: 0;          /* allow flex child to actually shrink + scroll */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  padding: 16px 14px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.msg {
  max-width: 88%;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px; line-height: 1.55;
  word-wrap: break-word;
}
.msg-user {
  align-self: flex-end;
  background: var(--green-700);
  color: var(--cream-50);
  border-bottom-right-radius: 4px;
}
.msg-assistant {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--ink-100);
  color: var(--ink-900);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.msg-assistant strong { color: var(--green-800); }
.msg-assistant blockquote {
  border-left: 3px solid var(--gold-500);
  background: var(--cream-100);
  margin: 8px 0; padding: 8px 12px;
  font-style: italic; color: var(--ink-700);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.msg-assistant h1, .msg-assistant h2, .msg-assistant h3 {
  font-family: var(--font-display);
  color: var(--green-800);
  margin: 10px 0 6px;
  font-size: 15px;
}
.msg-assistant p { margin: 6px 0; }
.msg-assistant ul, .msg-assistant ol { margin: 6px 0; padding-left: 22px; }
.msg-assistant code {
  background: var(--cream-200); padding: 1px 6px;
  border-radius: 4px; font-size: 12.5px;
}
.msg-assistant hr { border: none; border-top: 1px dashed var(--ink-100); margin: 12px 0; }

.msg-citations {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.citation-pill {
  font-size: 11.5px;
  background: var(--cream-100);
  border: 1px solid var(--cream-300);
  color: var(--green-800);
  padding: 6px 10px;
  border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
}
.citation-pill i { color: var(--gold-600); font-size: 10px; }

.msg-warning {
  background: #fdf6e3; color: var(--warning);
  border: 1px solid rgba(176, 125, 34, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 12.5px; margin-bottom: 8px;
}

.chat-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-500);
}
.chat-empty .e-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--green-100);
  color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 16px;
}
.chat-empty h3 { font-family: var(--font-display); color: var(--green-900); font-size: 20px; margin: 0 0 8px; }
.chat-empty p { font-size: 13.5px; max-width: 280px; line-height: 1.55; }

.suggested-prompts {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 22px; width: 100%; max-width: 320px;
}
.prompt-chip {
  background: white; border: 1px solid var(--ink-100);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--ink-700);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.prompt-chip i { color: var(--gold-600); }
.prompt-chip:active { transform: scale(0.98); }

.chat-input-bar {
  position: fixed; bottom: var(--nav-h); left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: white;
  border-top: 1px solid var(--ink-100);
  padding: 10px 12px 10px;
  display: flex; gap: 10px; align-items: flex-end;
  z-index: 40;
}
.chat-input-bar textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--ink-100);
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 14px;
  max-height: 96px;
  min-height: 40px;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
}
.chat-input-bar textarea:focus { border-color: var(--green-500); }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-700); color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-send:disabled { opacity: 0.4; }
.chat-send:active:not(:disabled) { transform: scale(0.94); }

.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-500);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ============ Quran / Hadith / Content browsers ============ */
.tab-bar {
  display: flex; gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-chip {
  padding: 8px 14px; border-radius: 16px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
}
.tab-chip.active {
  background: var(--green-700);
  color: var(--cream-50);
  border-color: var(--green-700);
}

.surah-item {
  background: white; border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.surah-num {
  width: 38px; height: 38px;
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.surah-info { flex: 1; min-width: 0; }
.surah-name { font-weight: 600; font-size: 15px; color: var(--ink-900); }
.surah-meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.surah-arabic { font-family: var(--font-arabic); font-size: 22px; color: var(--green-700); }

.verse-block {
  background: white; border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 18px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.verse-block .ayah-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-100); color: var(--green-800);
  font-size: 12px; font-weight: 700;
  margin-bottom: 12px;
}
.verse-block .arabic {
  font-family: var(--font-arabic); font-size: 22px; line-height: 1.9;
  text-align: right; direction: rtl;
  color: var(--green-900);
  margin-bottom: 12px;
}
.verse-block .translation {
  font-size: 14px; line-height: 1.6;
  color: var(--ink-700);
  font-family: var(--font-display); font-style: italic;
}
.verse-block .v-source { font-size: 11px; color: var(--ink-500); margin-top: 6px; }

.hadith-block {
  background: white; border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.hadith-block .h-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.hadith-block .h-collection {
  font-size: 11px; font-weight: 700; color: var(--green-700);
  background: var(--green-100); padding: 3px 8px; border-radius: 10px;
  letter-spacing: 0.3px;
}
.hadith-block .h-grade {
  font-size: 10.5px; color: var(--gold-700);
  border: 1px solid var(--gold-500); padding: 2px 8px; border-radius: 10px;
  font-weight: 600;
}
.hadith-block .h-arabic {
  font-family: var(--font-arabic); font-size: 18px; line-height: 1.8;
  text-align: right; direction: rtl;
  color: var(--green-900); margin-bottom: 10px;
}
.hadith-block .h-english {
  font-size: 13.5px; line-height: 1.6; color: var(--ink-700);
}
.hadith-block .h-narrator {
  font-size: 11.5px; color: var(--ink-500); margin-top: 8px; font-style: italic;
}

/* ============ Content article view ============ */
.article-view { padding: 0 16px 30px; }
.article-view h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  color: var(--green-900); line-height: 1.2;
  margin: 16px 0 8px;
}
.article-view .a-meta {
  display: flex; gap: 12px; font-size: 12px; color: var(--ink-500);
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--ink-100);
}
.article-view .a-meta .approved { color: var(--green-600); font-weight: 600; }
.article-view .a-body {
  font-size: 15px; line-height: 1.75; color: var(--ink-900);
}
.article-view .a-body p { margin: 12px 0; }
.article-view .a-body strong { color: var(--green-800); }
.article-view .a-body ul { padding-left: 20px; }
.article-view .a-body h2, .article-view .a-body h3 {
  font-family: var(--font-display); color: var(--green-800); margin: 20px 0 8px;
}

/* ============ Finance / Donations ============ */
.cause-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cause-card {
  background: white; border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px 12px; text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.cause-card.selected {
  border-color: var(--green-500);
  background: var(--green-100);
}
.cause-card .c-icon {
  width: 44px; height: 44px; margin: 0 auto 10px;
  background: var(--green-100); color: var(--green-700);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.cause-card.selected .c-icon { background: white; }
.cause-card .c-name { font-weight: 600; font-size: 13px; color: var(--ink-900); margin-bottom: 4px; }
.cause-card .c-desc { font-size: 11px; color: var(--ink-500); line-height: 1.4; }

.amount-presets {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.amount-chip {
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--ink-50); border: 1.5px solid transparent;
  font-size: 14px; font-weight: 600; color: var(--ink-700);
}
.amount-chip.selected {
  background: var(--green-100); border-color: var(--green-500); color: var(--green-800);
}

/* ============ Profile / Settings ============ */
.profile-header {
  text-align: center; padding: 28px 16px 18px;
  background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  color: var(--cream-100);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gold-600); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.2);
}
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.profile-email { font-size: 13px; opacity: 0.7; margin-top: 4px; }

.settings-list {
  background: white; border-radius: var(--radius-md);
  margin-top: 16px; overflow: hidden;
  border: 1px solid var(--ink-100);
}
.setting-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 14px; color: var(--ink-900);
  cursor: pointer;
}
.setting-item:last-child { border-bottom: none; }
.setting-item .s-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--green-100); color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.setting-item .s-icon.danger { background: #fff1f0; color: var(--danger); }
.setting-item .s-label { flex: 1; font-weight: 500; }
.setting-item .s-chevron { color: var(--ink-300); font-size: 12px; }

/* ============ Admin portal ============ */
.admin-screen { padding: 0; }
.admin-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding: 16px;
}
.stat-card {
  background: white; border: 1px solid var(--ink-100);
  border-radius: var(--radius-md); padding: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: 11.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; color: var(--green-900);
  margin-top: 4px;
}
.stat-card .icon-corner { float: right; color: var(--gold-600); font-size: 18px; }

.admin-tabs {
  display: flex; gap: 4px; padding: 0 12px 12px;
  border-bottom: 1px solid var(--ink-100);
  overflow-x: auto;
}
.admin-tab {
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-500); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.admin-tab.active { color: var(--green-700); border-bottom-color: var(--green-700); }

.admin-table {
  font-size: 13px;
}
.admin-row {
  background: white; padding: 12px 16px;
  border-bottom: 1px solid var(--ink-100);
  display: flex; gap: 10px; align-items: center;
}
.admin-row .r-main { flex: 1; min-width: 0; }
.admin-row .r-title { font-weight: 600; color: var(--ink-900); margin-bottom: 2px; }
.admin-row .r-meta { font-size: 11.5px; color: var(--ink-500); }
.admin-row .r-actions { display: flex; gap: 6px; }
.admin-row .r-actions button {
  padding: 6px 10px; font-size: 11.5px; border-radius: 6px;
  background: var(--ink-50); color: var(--ink-700); font-weight: 600;
}
.admin-row .r-actions .danger { background: #fff1f0; color: var(--danger); }
.admin-row .r-actions .primary { background: var(--green-100); color: var(--green-800); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-success { background: var(--green-100); color: var(--green-800); }
.badge-warning { background: #fdf6e3; color: var(--warning); }
.badge-danger { background: #fff1f0; color: var(--danger); }
.badge-info { background: #eef3ff; color: #3a55a8; }

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 42, 32, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--cream-50);
  width: 100%; max-width: 480px;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: 22px 20px 28px;
  animation: slide-up 0.25s ease;
  max-height: 85vh; overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-card h3 { font-family: var(--font-display); font-size: 19px; color: var(--green-900); margin: 0 0 6px; }
.modal-card .modal-sub { font-size: 13px; color: var(--ink-500); margin-bottom: 16px; }
.modal-close {
  position: absolute; right: 16px; top: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink-50); color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
}

/* ============ Utilities ============ */
.text-muted { color: var(--ink-500); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.empty-state {
  padding: 40px 20px; text-align: center; color: var(--ink-500);
}
.empty-state i { font-size: 36px; color: var(--ink-300); margin-bottom: 12px; }
.empty-state p { font-size: 13.5px; }

.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid rgba(21, 84, 63, 0.18);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
}

/* hide loading screen when app mounted */
.app-mounted .loading-screen { display: none; }

/* ============ i18n: RTL support + Arabic typography ============ */
html[dir="rtl"] body { font-family: 'Tajawal', 'Cairo', var(--font-arabic), var(--font-sans); }

/* Mirror header chrome */
html[dir="rtl"] .header-top { flex-direction: row-reverse; }
html[dir="rtl"] .page-header { flex-direction: row-reverse; }
html[dir="rtl"] .page-header .back-btn i.fa-arrow-left::before { content: "\f061"; /* fa-arrow-right */ }
html[dir="rtl"] .content-item { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .ci-chevron { transform: rotate(180deg); }
html[dir="rtl"] .surah-item { flex-direction: row-reverse; }
html[dir="rtl"] .surah-info { text-align: right; }
html[dir="rtl"] .setting-item { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .s-chevron { transform: rotate(180deg); }
html[dir="rtl"] .auth-card, html[dir="rtl"] .auth-hero { text-align: right; }
html[dir="rtl"] .auth-hero { text-align: center; }
html[dir="rtl"] .form-group label { text-align: right; }
html[dir="rtl"] .form-control { text-align: right; }
html[dir="rtl"] .form-check { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .verse-card { text-align: right; }
html[dir="rtl"] .verse-card .verse-label { text-align: right; }
html[dir="rtl"] .verse-card .verse-translation { text-align: right; }
html[dir="rtl"] .verse-card::before { right: auto; left: -10px; }
html[dir="rtl"] .section-header { flex-direction: row-reverse; }
html[dir="rtl"] .admin-row { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .msg-user { align-self: flex-start; border-bottom-right-radius: var(--radius-md); border-bottom-left-radius: 4px; }
html[dir="rtl"] .msg-assistant { align-self: flex-end; border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: 4px; }
html[dir="rtl"] .chat-input-bar { flex-direction: row-reverse; }
html[dir="rtl"] .chat-messages { direction: rtl; }
html[dir="rtl"] .msg-assistant blockquote { border-left: none; border-right: 3px solid var(--gold-500); border-radius: 6px 0 0 6px; }
html[dir="rtl"] .citation-pill { flex-direction: row-reverse; }
html[dir="rtl"] .feature-card { text-align: center; }
html[dir="rtl"] .modal-close { right: auto; left: 16px; }
html[dir="rtl"] .hadith-block .h-header { flex-direction: row-reverse; }
html[dir="rtl"] .tab-bar { direction: rtl; }
html[dir="rtl"] .nav-item.active::before { left: 50%; right: auto; transform: translateX(-50%); }

/* Arabic typography refinement when in RTL */
html[dir="rtl"] .feature-card .label,
html[dir="rtl"] .nav-item span,
html[dir="rtl"] .ci-title,
html[dir="rtl"] .ci-meta { font-family: 'Tajawal', 'Cairo', var(--font-sans); }
html[dir="rtl"] .header-title h1 { font-family: 'Amiri', 'Cairo', serif; font-size: 26px; letter-spacing: 0; }
html[dir="rtl"] .auth-hero h1 { font-family: 'Amiri', 'Cairo', serif; letter-spacing: 0; }
html[dir="rtl"] .section-header h2 { font-family: 'Amiri', 'Cairo', serif; }

/* Language selector modal */
.lang-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.lang-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: white; border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-option:hover { border-color: var(--green-500); }
.lang-option.active { border-color: var(--green-700); background: var(--green-100); }
.lang-option .flag {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cream-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
  border: 1px solid var(--gold-500);
  flex-shrink: 0;
}
.lang-option .lang-info { flex: 1; text-align: left; }
html[dir="rtl"] .lang-option .lang-info { text-align: right; }
.lang-option .lang-native { font-weight: 600; color: var(--ink-900); font-size: 15px; }
.lang-option .lang-name { font-size: 12px; color: var(--ink-500); }
.lang-option.active .check { color: var(--green-700); font-size: 18px; }
.lang-option:not(.active) .check { display: none; }

/* Language modal: centered, not bottom-sheet — ensures all 3 options always visible */
.lang-modal-backdrop { align-items: center !important; padding: 20px; }
.lang-modal-card {
  border-radius: var(--radius-xl) !important;
  max-width: 400px !important;
  max-height: 80vh !important;
  animation: fade-in 0.2s ease !important;
  position: relative;
}
.lang-modal-card .lang-list { gap: 10px; }

/* ============ Micro-Finance UI ============ */
.finance-tabs {
  display: flex; gap: 4px;
  padding: 0 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ink-100);
}
.finance-tab {
  padding: 12px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-500);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.finance-tab.active { color: var(--green-700); border-bottom-color: var(--green-700); }

/* Wallet hero */
.wallet-hero {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-900) 100%);
  color: var(--cream-100);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin: 0 16px 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.wallet-hero::after {
  content: '\f4be';
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; right: -20px; bottom: -20px;
  font-size: 120px; opacity: 0.06; color: var(--gold-500);
}
html[dir="rtl"] .wallet-hero::after { right: auto; left: -20px; }
.wallet-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.7; color: var(--gold-500); font-weight: 600; }
.wallet-balance { font-family: var(--font-display); font-size: 36px; font-weight: 700; margin: 6px 0; }
.wallet-balance .currency { font-size: 18px; opacity: 0.7; vertical-align: top; margin-right: 4px; }
html[dir="rtl"] .wallet-balance .currency { margin-right: 0; margin-left: 4px; }
.wallet-sub { font-size: 12px; opacity: 0.75; font-style: italic; }
.wallet-actions { display: flex; gap: 10px; margin-top: 16px; }
.wallet-btn {
  flex: 1;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--cream-100);
  padding: 10px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.wallet-btn i { font-size: 16px; }

/* Product cards (financing offers) */
.mf-product {
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.mf-product-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.mf-product-title { font-weight: 700; color: var(--green-900); font-size: 15px; margin-bottom: 2px; }
.mf-product-type { font-size: 11px; color: var(--gold-700); background: var(--cream-100); padding: 2px 8px; border-radius: 10px; font-weight: 700; letter-spacing: 0.3px; display: inline-block; }
.mf-product-rate { text-align: right; }
html[dir="rtl"] .mf-product-rate { text-align: left; }
.mf-product-rate-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--green-700); }
.mf-product-rate-label { font-size: 10px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.5px; }
.mf-product-desc { font-size: 13px; color: var(--ink-700); line-height: 1.5; margin-bottom: 12px; }
.mf-product-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; padding-top: 10px; border-top: 1px dashed var(--ink-100); }
.mf-stat { text-align: center; }
.mf-stat-label { font-size: 10px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.3px; }
.mf-stat-value { font-size: 13px; font-weight: 700; color: var(--green-800); margin-top: 2px; }
.mf-product-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.mf-shariah {
  font-size: 11px; color: var(--green-600);
  display: flex; align-items: center; gap: 4px;
}
.mf-shariah i { color: var(--gold-600); }
.mf-apply {
  background: var(--green-700); color: white;
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
}

/* Loan progress */
.mf-loan-card {
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.mf-loan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mf-loan-name { font-weight: 700; color: var(--ink-900); }
.mf-loan-status { font-size: 10.5px; padding: 3px 8px; border-radius: 10px; font-weight: 700; letter-spacing: 0.3px; }
.mf-progress-bar {
  height: 8px;
  background: var(--ink-100);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.mf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500) 0%, var(--green-700) 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.mf-loan-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-500); }
.mf-loan-amounts { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ink-100); }
.mf-loan-amount { font-size: 12px; }
.mf-loan-amount strong { display: block; font-size: 14px; color: var(--green-800); font-family: var(--font-display); font-weight: 700; }

/* Zakat calculator */
.zakat-card {
  background: linear-gradient(135deg, var(--cream-100) 0%, var(--cream-200) 100%);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 0 16px 16px;
}
.zakat-card h3 { font-family: var(--font-display); color: var(--green-900); margin: 0 0 6px; font-size: 18px; }
.zakat-card .nisab { font-size: 11.5px; color: var(--ink-500); margin-bottom: 12px; }
.zakat-input-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.zakat-input-row label { flex: 1; font-size: 13px; color: var(--ink-700); font-weight: 500; }
.zakat-input-row input {
  width: 130px;
  padding: 8px 10px;
  border: 1.5px solid var(--ink-100);
  border-radius: 8px;
  font-size: 14px;
  text-align: right;
}
html[dir="rtl"] .zakat-input-row input { text-align: left; }
.zakat-result {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--green-600);
  text-align: center;
}
.zakat-result .label { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.5px; }
.zakat-result .value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--green-700); margin: 4px 0; }
.zakat-result .note { font-size: 12px; color: var(--ink-700); font-style: italic; }

/* Shariah board badge */
.shariah-board {
  background: var(--cream-50);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 0 16px 14px;
  display: flex; gap: 12px; align-items: center;
}
.shariah-board .sb-icon {
  width: 38px; height: 38px;
  background: var(--green-700); color: var(--gold-500);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.shariah-board .sb-text { flex: 1; }
.shariah-board .sb-title { font-size: 12.5px; font-weight: 700; color: var(--green-900); }
.shariah-board .sb-sub { font-size: 11px; color: var(--ink-700); margin-top: 2px; }

/* Section heading inside finance */
.finance-section-head {
  padding: 0 16px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--green-900);
  display: flex; justify-content: space-between; align-items: center;
}

/* Modal-step indicator for application flow */
.mf-steps {
  display: flex; gap: 6px;
  margin-bottom: 14px;
}
.mf-step {
  flex: 1; height: 4px;
  background: var(--ink-100);
  border-radius: 2px;
}
.mf-step.active { background: var(--green-600); }
.mf-step-label { font-size: 11px; color: var(--ink-500); margin-bottom: 8px; }


/* ===== Additional microfinance / wallet / zakat styling ===== */
.wh-accounts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 14px;
  position: relative; z-index: 2;
}
.wh-account {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 8px;
  text-align: center;
}
.wh-account-name { font-size: 10.5px; opacity: 0.85; margin-bottom: 4px; }
.wh-account-balance { font-family: var(--font-display); font-size: 15px; font-weight: 700; }

.mf-product-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.mf-product-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--green-50, #e8f1ec); color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.mf-product-titles { flex: 1; min-width: 0; }
.mf-product-name {
  font-family: var(--font-display); font-weight: 700;
  color: var(--green-900); font-size: 17px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.mf-product-arabic { font-size: 14px; color: var(--gold, #b08832); font-weight: 600; }
.mf-product-tag {
  font-size: 12px; color: var(--gold-700, #8a6a1f);
  background: var(--cream-100, #fbf6e8);
  padding: 4px 10px; border-radius: 12px;
  display: inline-block; margin-bottom: 10px; font-weight: 600;
}
.mf-product-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 12px 0; padding: 10px 0;
  border-top: 1px dashed var(--ink-100);
  border-bottom: 1px dashed var(--ink-100);
  font-size: 11.5px;
}
.mf-product-meta > div { display: flex; flex-direction: column; gap: 2px; }
.mf-product-meta span { color: var(--ink-500); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.mf-product-meta strong { color: var(--ink-900); font-size: 12px; }
.mf-product-features { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.mf-feature { font-size: 11.5px; color: var(--ink-700); }
.mf-feature i { color: var(--green-600); margin-right: 6px; }
html[dir="rtl"] .mf-feature i { margin-right: 0; margin-left: 6px; }
.mf-product-evidence {
  font-size: 11px; color: var(--ink-500);
  font-style: italic; margin: 10px 0;
  padding: 8px 10px;
  background: var(--cream-50, #fdfaf3);
  border-radius: 8px;
}
.mf-product-evidence i { color: var(--gold, #b08832); margin-right: 4px; }
html[dir="rtl"] .mf-product-evidence i { margin-right: 0; margin-left: 4px; }
.mf-apply { width: 100%; margin-top: 6px; }

/* Application modal */
.mf-modal { max-width: 480px; }
.mf-summary {
  background: var(--cream-50, #fdfaf3);
  border-radius: 12px; padding: 14px;
  margin: 12px 0;
}
.mf-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--ink-100);
  font-size: 13px;
}
.mf-row:last-child { border-bottom: none; }
.mf-row span { color: var(--ink-600); }
.mf-row strong { color: var(--ink-900); }
.mf-row.total { padding-top: 10px; border-top: 1px solid var(--ink-200); border-bottom: none; }
.mf-row.total strong { color: var(--green-900); font-size: 15px; }
.mf-row.big {
  background: var(--green-700); color: white;
  border-radius: 8px; padding: 10px 12px;
  margin-top: 8px; border: none;
}
.mf-row.big span, .mf-row.big strong { color: white; }
.mf-row.big strong { font-size: 18px; font-family: var(--font-display); }

.mf-evidence-box {
  font-size: 12px; color: var(--ink-600);
  padding: 10px 12px;
  background: var(--cream-100, #fbf6e8);
  border-left: 3px solid var(--gold, #b08832);
  border-radius: 8px;
  margin: 12px 0; font-style: italic;
}
html[dir="rtl"] .mf-evidence-box { border-left: none; border-right: 3px solid var(--gold, #b08832); }
.mf-evidence-box i { color: var(--gold, #b08832); margin-right: 6px; }
html[dir="rtl"] .mf-evidence-box i { margin-right: 0; margin-left: 6px; }

.mf-actions { display: flex; gap: 8px; margin-top: 14px; }
.mf-actions .btn { flex: 1; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  padding: 11px 18px; border-radius: 12px;
  font-weight: 600; cursor: pointer;
}

.mf-success { text-align: center; padding: 14px 0; }
.mf-success-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--green-50, #e8f1ec); color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 12px;
}
.mf-success h3 { font-family: var(--font-display); color: var(--green-900); margin: 0 0 6px; }
.mf-success code {
  background: var(--cream-100, #fbf6e8);
  padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; color: var(--green-900);
}
.mf-next-steps { margin: 14px 0; }
.mf-next-steps h4 { font-size: 13px; color: var(--green-900); margin: 0 0 8px; }
.mf-next-steps ol { padding-left: 20px; font-size: 13px; color: var(--ink-700); }
html[dir="rtl"] .mf-next-steps ol { padding-left: 0; padding-right: 20px; }
.mf-next-steps li { margin-bottom: 6px; }
.mf-disclaimer {
  font-size: 11.5px; color: var(--ink-600);
  padding: 10px 12px;
  background: var(--cream-50, #fdfaf3);
  border-radius: 8px; margin: 12px 0;
  line-height: 1.5;
}

/* Loan card additional */
.mf-loan-card { /* augments existing */ }
.mf-loan-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 8px; }
.mf-loan-product { font-family: var(--font-display); font-weight: 700; color: var(--green-900); font-size: 15px; }
.mf-loan-purpose { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.mf-loan-status.ok { background: var(--green-50, #e8f1ec); color: var(--green-700); }
.mf-loan-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; font-size: 11.5px; }
.mf-loan-numbers > div { display: flex; flex-direction: column; }
.mf-loan-numbers span { color: var(--ink-500); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.mf-loan-numbers strong { color: var(--ink-900); font-size: 13px; font-family: var(--font-display); }
.mf-progress { margin-top: 8px; }
.mf-progress-bar {
  width: 100%; height: 6px; background: var(--ink-100);
  border-radius: 3px; overflow: hidden;
}
.mf-progress-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--green-800));
  border-radius: 3px;
}
.mf-progress-label { font-size: 11px; color: var(--ink-500); margin-top: 4px; text-align: right; }
html[dir="rtl"] .mf-progress-label { text-align: left; }

/* Zakat result */
.zakat-form { display: flex; flex-direction: column; gap: 0; }
.zakat-result-card {
  margin-top: 16px; padding: 16px;
  background: var(--cream-50, #fdfaf3);
  border-radius: 14px;
  border: 1px solid var(--ink-100);
}
.zakat-result-card.eligible {
  background: linear-gradient(135deg, var(--green-50, #e8f1ec), var(--cream-50, #fdfaf3));
  border-color: var(--green-200, #b9d3c2);
}
.zr-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; }
.zr-row span { color: var(--ink-600); }
.zr-row strong { color: var(--ink-900); }
.zr-hero {
  margin: 14px 0;
  background: var(--green-700); color: white;
  border-radius: 12px; padding: 14px;
  text-align: center;
}
.zr-label { font-size: 11.5px; opacity: 0.9; letter-spacing: 0.3px; }
.zr-amount { font-family: var(--font-display); font-size: 32px; font-weight: 700; margin: 4px 0; }
.zr-rate { font-size: 11px; opacity: 0.85; }
.zr-evidence { font-size: 11.5px; color: var(--ink-600); font-style: italic; margin: 10px 0; padding: 8px; background: var(--cream-100, #fbf6e8); border-radius: 8px; }
.zr-evidence i { color: var(--gold, #b08832); margin-right: 4px; }
html[dir="rtl"] .zr-evidence i { margin-right: 0; margin-left: 4px; }
.zr-recipients { font-size: 12px; color: var(--ink-700); margin: 10px 0; }
.zr-recipients ul { margin: 6px 0 0; padding-left: 20px; }
html[dir="rtl"] .zr-recipients ul { padding-left: 0; padding-right: 20px; }
.zr-note { font-size: 11px; color: var(--ink-500); margin-top: 10px; line-height: 1.5; }

/* Shariah board card details */
.shariah-board {
  display: flex; align-items: center; gap: 10px;
}
.shariah-board > i {
  font-size: 22px; color: var(--gold, #b08832);
  flex-shrink: 0;
}
.shariah-board .sb-title { font-size: 12.5px; font-weight: 700; color: var(--green-900); }
.shariah-board .sb-sub { font-size: 11px; color: var(--ink-600); margin-top: 2px; }
.sb-link {
  background: transparent; border: 1px solid var(--green-200, #b9d3c2);
  color: var(--green-700); padding: 6px 12px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  flex-shrink: 0;
}
.sb-members { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.sb-member { padding: 8px 10px; background: var(--cream-50, #fdfaf3); border-radius: 8px; }
.sb-m-name { font-weight: 700; font-size: 12.5px; color: var(--green-900); }
.sb-m-spec { font-size: 11px; color: var(--ink-600); }

/* Wallet activity amount column */
.ci-amount {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; flex-shrink: 0;
}
.ci-amount.pos { color: var(--green-700); }
.ci-amount.neg { color: var(--ink-600); }

/* Form hint */
.form-hint { font-size: 11px; color: var(--ink-500); margin-top: 4px; }

/* Finance tabs override (override earlier definition for better mobile UX) */
.finance-tabs {
  display: flex; gap: 4px; padding: 8px 12px;
  overflow-x: auto;
  background: white;
  border-bottom: 1px solid var(--ink-100);
}
.finance-tab {
  flex: 1; min-width: max-content;
  background: var(--cream-50, #fdfaf3);
  border: 1px solid transparent;
  color: var(--ink-700);
  padding: 8px 10px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; justify-content: center;
}
.finance-tab.active {
  background: var(--green-700); color: white; border-color: var(--green-700);
}
.finance-tab i { font-size: 12px; }


/* ============================================================
   TRANCHE 2: P2P / Investments / Spiritual / Notifications
   ============================================================ */

/* Notification badge on bell */
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #c0392b; color: #fff; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center; display: none;
}
.notif-badge.show { display: inline-block; }
.header-bell { position: relative; }

/* Notification drawer */
.notif-drawer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.notif-drawer.open { pointer-events: auto; }
.notif-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  opacity: 0; transition: opacity .24s ease;
}
.notif-drawer.open .notif-backdrop { opacity: 1; }
.notif-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 92%; max-width: 380px; background: #fafaf6;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(0,0,0,0.18);
}
[dir="rtl"] .notif-panel { right: auto; left: 0; transform: translateX(-100%); box-shadow: 8px 0 28px rgba(0,0,0,0.18); }
.notif-drawer.open .notif-panel { transform: translateX(0); }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 8px; font-weight: 700; color: #0f3d2e;
}
.notif-head i { margin-right: 8px; }
.notif-close { background: transparent; border: 0; font-size: 18px; color: #0f3d2e; cursor: pointer; }
.notif-actions { padding: 0 18px 6px; }
.notif-readall {
  font-size: 12px; padding: 6px 12px; border: 1px solid rgba(15,61,46,0.18);
  background: white; border-radius: 14px; color: #0f3d2e; cursor: pointer;
}
.notif-list { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(0,0,0,0.05);
  position: relative; cursor: pointer;
}
.notif-item.unread { background: rgba(240,199,94,0.08); }
.ni-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,61,46,0.08); color: #0f3d2e; flex-shrink: 0;
}
.ni-icon.ni-streak { background: rgba(255,138,0,0.12); color: #d35400; }
.ni-icon.ni-transfer { background: rgba(46,134,193,0.12); color: #1f6391; }
.ni-icon.ni-request { background: rgba(155,89,182,0.12); color: #6c3483; }
.ni-icon.ni-system { background: rgba(15,61,46,0.12); color: #0f3d2e; }
.ni-body { flex: 1; min-width: 0; }
.ni-title { font-size: 14px; font-weight: 600; color: #1c1c1c; }
.ni-sub { font-size: 12px; color: #5a5a5a; margin-top: 2px; }
.ni-time { font-size: 11px; color: #8a8a8a; margin-top: 2px; }
.ni-dot { width: 8px; height: 8px; border-radius: 50%; background: #c0392b; align-self: center; }

/* Bottom sheet (P2P send, invest buy) */
.bottom-sheet { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.bottom-sheet.open { pointer-events: auto; }
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity .22s ease;
}
.bottom-sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fafaf6; border-radius: 18px 18px 0 0;
  padding: 16px 18px 28px;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  max-height: 80vh; overflow-y: auto;
}
.bottom-sheet.open .sheet-panel { transform: translateY(0); }
.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.sheet-head > div:nth-child(2) { flex: 1; min-width: 0; }
.sheet-title { font-weight: 700; color: #0f3d2e; font-size: 16px; }
.sheet-sub { font-size: 11px; color: #5a5a5a; margin-top: 2px; }
.sheet-close { background: transparent; border: 0; font-size: 18px; color: #0f3d2e; cursor: pointer; }
.sheet-tabs { display: flex; gap: 6px; padding: 12px 0; }
.sheet-tab {
  flex: 1; padding: 8px 0; border: 1px solid rgba(15,61,46,0.12);
  background: white; border-radius: 12px; font-size: 13px; font-weight: 600;
  color: #0f3d2e; cursor: pointer;
}
.sheet-tab.active { background: #0f3d2e; color: white; border-color: #0f3d2e; }
.sheet-body { padding-top: 6px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #5a5a5a; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.amount-input {
  display: flex; align-items: center; background: white;
  border: 1px solid rgba(15,61,46,0.15); border-radius: 12px; padding: 10px 14px;
}
.amount-input .cur { font-size: 24px; font-weight: 700; color: #0f3d2e; margin-right: 6px; }
.amount-input input {
  flex: 1; border: 0; outline: 0; font-size: 28px; font-weight: 700;
  color: #1c1c1c; background: transparent;
}
.p2p-submit { margin-top: 16px; }

/* P2P contacts strip */
.p2p-section { padding: 8px 0 0; }
.p2p-note {
  font-size: 12px; color: #0f3d2e; background: rgba(240,199,94,0.18);
  padding: 8px 12px; border-radius: 10px; margin-bottom: 12px;
}
.p2p-note i { margin-right: 6px; color: #b8923c; }
.p2p-contacts {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 0 12px;
  scroll-snap-type: x mandatory;
}
.p2p-contact {
  flex: 0 0 78px; background: white; border: 0; border-radius: 14px;
  padding: 12px 6px; text-align: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05); position: relative;
}
.p2p-avatar {
  width: 48px; height: 48px; margin: 0 auto 8px;
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f);
  color: white; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.p2p-avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.p2p-name { font-size: 12px; font-weight: 600; color: #1c1c1c; }
.p2p-fav { position: absolute; top: 6px; right: 8px; color: #f0c75e; font-size: 10px; }
.p2p-history { display: flex; flex-direction: column; gap: 6px; }
.p2p-tx { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: white; border-radius: 12px; }
.p2p-tx-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,61,46,0.08); color: #0f3d2e;
}
.p2p-tx.in .p2p-tx-icon { background: rgba(39,174,96,0.12); color: #27ae60; }
.p2p-tx-body { flex: 1; min-width: 0; }
.p2p-tx-name { font-size: 13px; font-weight: 600; color: #1c1c1c; }
.p2p-tx-meta { font-size: 11px; color: #8a8a8a; margin-top: 2px; }
.p2p-tx-amount { font-weight: 700; font-size: 14px; }
.p2p-tx-amount.pos { color: #27ae60; } .p2p-tx-amount.neg { color: #c0392b; }
.empty-state-mini { text-align: center; color: #8a8a8a; padding: 12px; font-size: 12px; }

/* Investments */
.invest-sub-tabs { display: flex; gap: 6px; padding: 4px 0 8px; }
.invest-sub-tab {
  flex: 1; padding: 7px 6px; background: white; border: 1px solid rgba(15,61,46,0.12);
  border-radius: 10px; font-size: 12px; font-weight: 600; color: #5a5a5a; cursor: pointer;
}
.invest-sub-tab.active { background: #0f3d2e; color: white; border-color: #0f3d2e; }
.invest-note {
  font-size: 11px; color: #0f3d2e; background: rgba(240,199,94,0.16);
  padding: 8px 12px; border-radius: 10px; margin: 4px 0 12px;
}
.invest-note i { color: #b8923c; margin-right: 6px; }
.invest-section { margin-bottom: 18px; }
.invest-section-h { font-size: 13px; font-weight: 700; color: #0f3d2e; margin-bottom: 8px; }
.invest-section-h i { margin-right: 6px; color: #b8923c; }
.invest-cards { display: flex; flex-direction: column; gap: 8px; }
.invest-card { background: white; border-radius: 14px; padding: 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.ic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.ic-name { font-weight: 700; color: #0f3d2e; font-size: 14px; }
.ic-sub { font-size: 11px; color: #8a8a8a; margin-top: 2px; }
.ic-yield { font-size: 18px; font-weight: 800; color: #27ae60; text-align: right; }
.ic-yield small { display: block; font-size: 9px; color: #8a8a8a; font-weight: 500; }
.ic-row { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; margin-bottom: 8px; }
.ic-row span { color: #8a8a8a; } .ic-row strong { color: #1c1c1c; margin-right: 8px; }
.ic-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ic-tag {
  font-size: 10px; padding: 3px 8px; border-radius: 8px;
  background: rgba(15,61,46,0.07); color: #0f3d2e; font-weight: 500;
}
.ic-tag.halal { background: rgba(39,174,96,0.12); color: #1e8449; }
.ic-tag.halal i { margin-right: 4px; }
.ic-btn { width: 100%; margin: 0; padding: 8px; font-size: 13px; }

/* Portfolio */
.portfolio-hero {
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f);
  color: white; padding: 18px; border-radius: 16px; text-align: center; margin-bottom: 12px;
}
.ph-label { font-size: 12px; opacity: 0.85; }
.ph-value { font-size: 28px; font-weight: 800; margin: 4px 0; }
.ph-pnl { font-size: 13px; font-weight: 600; }
.ph-pnl.pos { color: #6cf09a; } .ph-pnl.neg { color: #ffb3a7; }
.holdings { display: flex; flex-direction: column; gap: 8px; }
.holding { background: white; border-radius: 12px; padding: 12px; }
.h-head { display: flex; justify-content: space-between; align-items: flex-start; }
.h-name { font-weight: 700; color: #1c1c1c; font-size: 13px; }
.h-sub { font-size: 11px; color: #8a8a8a; margin-top: 2px; }
.h-val { text-align: right; }
.h-amount { font-weight: 700; color: #0f3d2e; }
.h-pnl { font-size: 11px; font-weight: 600; margin-top: 2px; }
.h-pnl.pos { color: #27ae60; } .h-pnl.neg { color: #c0392b; }
.h-bar { height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; margin: 8px 0 4px; overflow: hidden; }
.h-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f0c75e, #b8923c); }
.h-meta { font-size: 10px; color: #8a8a8a; }

/* Orders */
.orders-list { display: flex; flex-direction: column; gap: 6px; }
.order-row { display: flex; gap: 12px; padding: 10px 12px; background: white; border-radius: 12px; align-items: center; }
.or-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.or-icon.buy { background: rgba(39,174,96,0.12); color: #27ae60; }
.or-icon.sell { background: rgba(192,57,43,0.12); color: #c0392b; }
.or-body { flex: 1; }
.or-title { font-weight: 600; color: #1c1c1c; font-size: 13px; }
.or-sub { font-size: 11px; color: #8a8a8a; }
.or-total { font-weight: 700; color: #0f3d2e; }
.inst-rows { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.inst-rows > div { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,0.08); }
.inst-rows span { color: #8a8a8a; } .inst-rows strong { color: #1c1c1c; }
.inst-desc { font-size: 13px; color: #444; line-height: 1.5; }

/* Spiritual Hub subnav — horizontally scrollable with edge fade hint */
.spiritual-subnav {
  display: flex; gap: 6px; padding: 8px 14px 10px;
  overflow-x: auto; overflow-y: hidden;
  background: rgba(255,255,255,0.6);
  scrollbar-width: thin; scrollbar-color: rgba(15,61,46,0.3) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  /* Right-edge fade to hint there's more to scroll */
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
}
.spiritual-subnav::-webkit-scrollbar { height: 4px; }
.spiritual-subnav::-webkit-scrollbar-thumb { background: rgba(15,61,46,0.25); border-radius: 2px; }
.spiritual-subnav::-webkit-scrollbar-track { background: transparent; }
.sp-tab {
  flex: 0 0 auto; padding: 7px 12px; border: 1px solid rgba(15,61,46,0.12);
  background: white; border-radius: 16px; font-size: 12px; font-weight: 600;
  color: #5a5a5a; cursor: pointer; white-space: nowrap;
  scroll-snap-align: start;
}
.sp-tab.active { background: #0f3d2e; color: white; border-color: #0f3d2e; }
.sp-tab i { margin-right: 4px; }

/* Same scroll polish for finance/investment tab rows */
.finance-tabs, .invest-sub-tabs {
  scrollbar-width: thin; scrollbar-color: rgba(15,61,46,0.3) transparent;
  -webkit-overflow-scrolling: touch;
}
.finance-tabs::-webkit-scrollbar, .invest-sub-tabs::-webkit-scrollbar { height: 4px; }
.finance-tabs::-webkit-scrollbar-thumb, .invest-sub-tabs::-webkit-scrollbar-thumb { background: rgba(15,61,46,0.25); border-radius: 2px; }

/* Routines */
.routine-hero {
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f);
  color: white; padding: 20px; border-radius: 16px; text-align: center;
  margin-bottom: 14px; position: relative;
}
.rh-date { font-size: 12px; opacity: 0.8; }
.rh-progress-ring { position: relative; width: 96px; height: 96px; margin: 12px auto 6px; }
.rh-progress-ring svg { width: 100%; height: 100%; }
.rh-progress-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; font-weight: 800;
}
.rh-progress-text strong { font-size: 24px; }
.rh-progress-text small { font-size: 12px; opacity: 0.85; }
.rh-label { font-size: 12px; opacity: 0.85; }
.routine-list { display: flex; flex-direction: column; gap: 6px; }
.routine-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: white; border: 0; border-radius: 12px;
  text-align: left; cursor: pointer; width: 100%;
}
.routine-item.done { background: rgba(39,174,96,0.08); }
.ri-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(15,61,46,0.08); color: #0f3d2e;
  display: flex; align-items: center; justify-content: center;
}
.routine-item.done .ri-icon { background: #27ae60; color: white; }
.ri-body { flex: 1; }
.ri-label { font-weight: 600; color: #1c1c1c; }
.ri-sub { font-size: 11px; color: #8a8a8a; margin-top: 2px; }
.ri-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #27ae60;
}
.routine-item.done .ri-check { background: #27ae60; border-color: #27ae60; color: white; }

/* Week strip */
.week-strip { display: flex; gap: 4px; justify-content: space-between; }
.ws-day { flex: 1; text-align: center; }
.ws-label { font-size: 10px; color: #8a8a8a; margin-bottom: 4px; }
.ws-bar { height: 50px; background: rgba(0,0,0,0.04); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.ws-bar span { width: 100%; background: linear-gradient(180deg, #f0c75e, #b8923c); border-radius: 4px; }
.ws-count { font-size: 11px; font-weight: 600; margin-top: 4px; color: #1c1c1c; }

/* Streaks */
.streak-hero { text-align: center; padding: 24px 0 14px; }
.sh-flame {
  display: inline-flex; flex-direction: column; align-items: center;
  font-size: 64px; color: rgba(0,0,0,0.15); position: relative;
}
.sh-flame.lit { color: #ff6b00; text-shadow: 0 0 24px rgba(255,107,0,0.4); }
.sh-streak-n { font-size: 28px; font-weight: 800; color: #1c1c1c; margin-top: -28px; }
.sh-label { font-weight: 600; color: #1c1c1c; margin-top: 8px; }
.sh-sub { font-size: 12px; color: #8a8a8a; margin-top: 4px; }
.level-card { background: white; border-radius: 14px; padding: 14px; margin: 14px 0; }
.lc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.lc-level { font-size: 16px; font-weight: 800; color: #0f3d2e; }
.lc-xp { font-size: 12px; color: #8a8a8a; }
.lc-next { font-size: 11px; color: #8a8a8a; }
.lc-bar { height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.lc-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f0c75e, #b8923c); }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.badge-tile {
  background: white; padding: 12px; border-radius: 12px; text-align: center;
  position: relative;
}
.badge-tile.locked { opacity: 0.45; }
.bt-icon { font-size: 28px; color: #b8923c; margin-bottom: 6px; }
.badge-tile.locked .bt-icon { color: #8a8a8a; }
.bt-title { font-weight: 700; font-size: 13px; color: #1c1c1c; }
.bt-sub { font-size: 10px; color: #5a5a5a; margin: 4px 0; }
.bt-tag {
  display: inline-block; font-size: 9px; font-weight: 600;
  background: rgba(240,199,94,0.2); color: #b8923c; padding: 2px 8px; border-radius: 8px;
}
.badge-tile.locked .bt-tag { background: rgba(0,0,0,0.05); color: #8a8a8a; }

/* Calendar */
.hijri-today-card {
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f); color: white;
  padding: 14px 16px; border-radius: 14px; margin-bottom: 12px;
}
.ht-label { font-size: 11px; opacity: 0.8; }
.ht-value { font-size: 18px; font-weight: 800; margin: 2px 0; }
.ht-sub-ar { font-size: 14px; opacity: 0.9; }
.cal-controls { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.cal-nav { background: white; border: 0; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: #0f3d2e; }
.cal-title { font-weight: 700; color: #0f3d2e; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: 10px; color: #8a8a8a; text-align: center; padding: 4px 0; font-weight: 600; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; background: white;
  border-radius: 6px; padding: 4px; display: flex; flex-direction: column;
  justify-content: space-between; font-size: 11px;
}
.cal-cell.today { background: #0f3d2e; color: white; }
.cal-cell.has-event { background: rgba(240,199,94,0.2); }
.cal-cell.today.has-event { background: #0f3d2e; }
.cc-greg { font-weight: 700; }
.cc-hijri { font-size: 9px; opacity: 0.65; text-align: right; }
.cal-cell.today .cc-hijri { opacity: 0.8; }
.cc-dot { width: 4px; height: 4px; border-radius: 50%; background: #b8923c; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); }
.event-list { display: flex; flex-direction: column; gap: 6px; }
.event-row { display: flex; gap: 12px; padding: 10px; background: white; border-radius: 10px; }
.ev-date { width: 44px; text-align: center; background: rgba(240,199,94,0.18); border-radius: 8px; padding: 4px; }
.ev-d { font-size: 18px; font-weight: 800; color: #b8923c; }
.ev-m { font-size: 9px; color: #8a8a8a; text-transform: uppercase; }
.ev-name { font-weight: 600; color: #1c1c1c; font-size: 13px; }
.ev-sub { font-size: 11px; color: #8a8a8a; margin-top: 2px; }

/* Prayer times */
.prayer-hero {
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f); color: white;
  padding: 20px; border-radius: 16px; text-align: center; margin-bottom: 12px;
}
.ph-loc { font-size: 12px; opacity: 0.85; margin-bottom: 8px; }
.ph-next-label { font-size: 11px; opacity: 0.7; }
.ph-next-name { font-size: 18px; font-weight: 700; margin: 4px 0; }
.ph-next-time { font-size: 36px; font-weight: 800; color: #f0c75e; }
.ph-method { font-size: 11px; opacity: 0.7; margin-top: 8px; }
.prayer-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.prayer-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: white; border-radius: 12px; }
.prayer-row.next { background: rgba(240,199,94,0.15); }
.pr-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(15,61,46,0.08); color: #0f3d2e; }
.pr-name { flex: 1; font-weight: 600; color: #1c1c1c; }
.pr-time { font-weight: 700; color: #0f3d2e; font-size: 16px; }

/* Geolocation prompt */
.geo-prompt { text-align: center; padding: 40px 24px; }
.gp-icon { font-size: 48px; color: #b8923c; margin-bottom: 12px; }
.gp-title { font-weight: 700; font-size: 18px; color: #0f3d2e; }
.gp-sub { font-size: 13px; color: #5a5a5a; margin: 8px 0 20px; line-height: 1.5; }

/* Qibla compass */
.qibla-wrap { text-align: center; padding: 14px 0; }
.qibla-label { font-size: 12px; color: #8a8a8a; }
.qibla-compass {
  position: relative; width: 260px; height: 260px; margin: 14px auto;
  border-radius: 50%; background: radial-gradient(circle, #fff 60%, #f3efe2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1), inset 0 0 0 2px rgba(15,61,46,0.15);
}
.qc-n, .qc-e, .qc-s, .qc-w {
  position: absolute; font-weight: 800; color: #0f3d2e; font-size: 14px;
}
.qc-n { top: 8px; left: 50%; transform: translateX(-50%); color: #c0392b; }
.qc-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.qc-e { right: 8px; top: 50%; transform: translateY(-50%); }
.qc-w { left: 8px; top: 50%; transform: translateY(-50%); }
.qc-needle {
  position: absolute; inset: 0; transform-origin: center; transition: transform .4s ease;
}
.qc-kaaba {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #1c1c1c, #3a3a3a); color: #f0c75e;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.qc-stem {
  position: absolute; top: 48px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 80px; background: linear-gradient(180deg, #b8923c, transparent);
  border-radius: 2px;
}
.qc-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%; background: #0f3d2e;
}
.qibla-deg { font-size: 28px; font-weight: 800; color: #0f3d2e; margin-top: 4px; }
.qibla-sub { font-size: 13px; color: #5a5a5a; margin: 4px 0 10px; }
.qibla-loc { font-size: 12px; color: #8a8a8a; }
.qibla-loc i { margin-right: 4px; }
.qibla-hint { font-size: 11px; color: #b8923c; margin-top: 12px; padding: 0 14px; }

/* RTL adjustments */
[dir="rtl"] .ic-row strong { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .notif-actions { text-align: left; }
[dir="rtl"] .cc-hijri { text-align: left; }

/* AI Companion: thinking bubble */
.thinking-bubble {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(15,61,46,0.06);
  border-radius: 18px 18px 18px 4px; max-width: 80%;
}
.thinking-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #0f3d2e, #1e6b4f);
  color: #f0c75e; display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  animation: thinking-pulse 1.6s infinite ease-in-out;
}
.thinking-body { display: flex; flex-direction: column; gap: 4px; }
.thinking-label {
  font-size: 12px; font-weight: 600; color: #0f3d2e;
  font-style: italic;
}
@keyframes thinking-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(15,61,46,0.3); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(15,61,46,0); }
}
