/* ============================================
   OUR JOURNAL — Style System
   Sophisticated · Editorial · Calm · Feminine
   ============================================ */

:root {
  /* Light Mode */
  --deep-emerald: #123C35;
  --emerald: #1F5A4D;
  --muted-gold: #C6A96B;
  --rich-brown: #5A4032;
  --warm-ivory: #F7F3E8;
  --soft-brown: #D8C9B8;
  --primary-text: #24332E;
  --secondary-text: #756B61;
  --muted-text: #9B9186;
  --soft-error: #A65D58;
  --muted-rose: #B88A7E;

  --bg: var(--warm-ivory);
  --bg-secondary: #F0EBE0;
  --bg-card: #FFFdf8;
  --text: var(--primary-text);
  --text-sec: var(--secondary-text);
  --text-muted: var(--muted-text);
  --accent: var(--emerald);
  --accent-gold: var(--muted-gold);
  --border: rgba(90, 64, 50, 0.12);
  --border-strong: rgba(90, 64, 50, 0.2);
  --shadow: 0 2px 12px rgba(18, 60, 53, 0.06);
  --header-bg: rgba(247, 243, 232, 0.92);
  --cursor-color: var(--deep-emerald);
  --cursor-glow: rgba(198, 169, 107, 0.35);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --max-w: 1200px;
  --header-h: 64px;
  --mobile-nav-h: 64px;
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0E2521;
  --bg-secondary: #16352F;
  --bg-card: #1A3A33;
  --text: #F4EFE4;
  --text-sec: #B8AEA2;
  --text-muted: #8A8076;
  --accent: #2A7A68;
  --accent-gold: #C6A96B;
  --border: rgba(244, 239, 228, 0.08);
  --border-strong: rgba(244, 239, 228, 0.15);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  --header-bg: rgba(14, 37, 33, 0.94);
  --cursor-color: var(--muted-gold);
  --cursor-glow: rgba(198, 169, 107, 0.45);
  --soft-error: #C47A74;
  --muted-rose: #A67A70;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* Paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::before { opacity: 0.025; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; line-height: 1.7; }

/* Custom Moon Cursor */
.moon-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, box-shadow 0.2s;
  display: none;
  background: transparent;
}
.moon-cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cursor-color);
  clip-path: path('M10 0A10 10 0 1 0 10 20A7 7 0 1 1 10 0Z');
}
.moon-cursor.hover {
  width: 24px;
  height: 24px;
  box-shadow: 0 0 12px var(--cursor-glow);
}
.cursor-trail {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}
body.has-custom-cursor .moon-cursor { display: block; }
body.has-custom-cursor, body.has-custom-cursor * { cursor: none !important; }

@media (hover: none), (pointer: coarse) {
  body.has-custom-cursor, body.has-custom-cursor * { cursor: auto !important; }
  .moon-cursor, .cursor-trail { display: none !important; }
}

/* Typography */
.amiri { font-family: var(--font-arabic); }
.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.section-title, .page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.page-subtitle {
  font-size: 1rem;
  color: var(--text-sec);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--deep-emerald);
  color: var(--warm-ivory);
}
[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: var(--text);
}
.btn-primary:hover {
  background: var(--emerald);
  transform: translateY(-1px);
}
.btn-primary .btn-arrow { transition: transform 0.25s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 0;
}
.btn-ghost:hover { color: var(--accent-gold); }
.btn.danger { color: var(--soft-error); }
.btn:focus-visible, .nav-link:focus-visible, .mood-btn:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  transition: background var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.logo-mark { color: var(--accent-gold); font-size: 0.9rem; }
.desktop-nav {
  display: flex;
  gap: 1.75rem;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sec);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--accent-gold);
  opacity: 0.7;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle, .settings-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-sec);
  transition: color 0.2s, background 0.2s;
}
.theme-toggle:hover, .settings-btn:hover {
  color: var(--accent);
  background: var(--border);
}
.theme-icon { font-size: 1.1rem; }
[data-theme="light"] .dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: none; }

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--mobile-nav-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  min-width: 56px;
  transition: color 0.2s;
}
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--accent); }
.mobile-nav-item svg { stroke: currentColor; }

.more-menu { position: fixed; inset: 0; z-index: 200; display: none; }
.more-menu:not([hidden]) { display: block; }
.more-menu[hidden] { display: none !important; }
.more-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}
.more-menu-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  padding: 0.75rem 1.5rem 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}
.more-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 1.25rem;
}
.more-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.more-item:last-child { border-bottom: none; }

/* Main & Pages */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--header-h) + 1rem) 1.5rem 4rem;
}
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.45s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

.section { margin-bottom: 3.5rem; }
.page-header { margin-bottom: 2.5rem; }

/* ========== HERO ========== */
.hero {
  padding: 4rem 0 3.5rem;
  text-align: center;
  position: relative;
}
.hero-ornament {
  color: var(--accent-gold);
  opacity: 0.45;
  margin-bottom: 1.5rem;
}
.geo-line { width: 160px; height: 40px; margin: 0 auto; }
.hero-bismillah {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  color: var(--accent);
  margin-bottom: 1.25rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-bottom: 0.5rem;
}
.hero-philosophy {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.hero-cta { margin-top: 0.5rem; }

/* Time Block */
.time-block {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
}
.time-display { margin-bottom: 1rem; }
.clock {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
}
.date-line {
  font-size: 1rem;
  color: var(--text-sec);
  margin-top: 0.4rem;
}
.tz-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.greeting {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent);
  line-height: 1.5;
}

/* Journey */
.journey-intro {
  font-size: 1.05rem;
  color: var(--text-sec);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.journey-progress { margin-bottom: 1.5rem; }
.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.journey-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.journey-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s;
}
.journey-item.done {
  border-color: var(--accent);
  color: var(--accent);
}
.journey-item .check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
}
.journey-item.done .check {
  background: var(--accent);
  border-color: var(--accent);
  position: relative;
}
.journey-item.done .check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--warm-ivory);
}

/* Actions Grid — asymmetric */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.action-card {
  grid-column: span 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
}
.action-card.action-large {
  grid-column: span 6;
  padding: 2rem;
}
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.action-icon {
  font-size: 1.25rem;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
  opacity: 0.85;
}
.action-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.action-card p {
  font-size: 0.9rem;
  color: var(--text-sec);
  margin-bottom: 1rem;
  flex: 1;
}
.action-cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

/* Prayer */
.prayer-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.prayer-next-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: 100%;
}
.prayer-next-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--accent);
}
.prayer-next-countdown {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: 0.04em;
}
.prayer-times {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}
.prayer-item {
  text-align: center;
  padding: 1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.prayer-item.next {
  border-color: var(--accent);
  background: var(--bg-secondary);
}
.prayer-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.prayer-time {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
}
.prayer-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--text-sec);
}
.prayer-fallback p { margin-bottom: 1rem; }
.prayer-fallback .btn { margin: 0.25rem; }

/* Quote */
.quote-section { text-align: center; }
.daily-quote {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.quote-arabic {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 2.1;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.quote-translation {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.quote-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
  letter-spacing: 0.04em;
}

/* Qur'an Journey Cards */
.quran-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.quran-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}
.quran-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.quran-card p { font-size: 0.9rem; color: var(--text-sec); margin-bottom: 1rem; }
.mini-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 0.5rem 0;
  overflow: hidden;
}
.mini-progress-fill {
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.4s;
}

/* Reflection teaser */
.reflection-input {
  margin-bottom: 1rem;
  min-height: 100px;
}
.mood-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.mood-btn {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-sec);
  transition: all 0.2s;
}
.mood-btn:hover, .mood-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-secondary);
}

/* Cycle teaser */
.cycle-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.25rem;
}
.cycle-stat .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.cycle-stat .stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--muted-rose);
}

/* Ending */
.ending-section {
  text-align: center;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
}
.ending-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-sec);
  margin-bottom: 0.5rem;
}
.ending-ameen {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* ========== JOURNAL PAGE ========== */
.journal-layout {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2.5rem;
}
.journal-textarea {
  min-height: 220px;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.75;
}
.gratitude-block { margin-bottom: 1.25rem; }
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.gratitude-input { margin-bottom: 0.5rem; }
.journal-sidebar { position: sticky; top: calc(var(--header-h) + 1rem); }
.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.calendar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.cal-nav { display: flex; gap: 0.5rem; }
.cal-nav button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
}
.cal-nav button:hover { background: var(--border); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-day-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  font-weight: 600;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  color: var(--text-sec);
}
.cal-day:hover { background: var(--border); }
.cal-day.today { font-weight: 600; color: var(--accent); }
.cal-day.has-entry::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
}
.cal-day.selected {
  background: var(--accent);
  color: var(--warm-ivory);
}
.cal-day.other-month { opacity: 0.35; }
.history-list { display: flex; flex-direction: column; gap: 0.5rem; }
.history-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.history-date { font-size: 0.75rem; color: var(--text-muted); }
.history-preview {
  font-size: 0.9rem;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 1.5rem;
}
.entry-content .entry-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.entry-content .entry-mood {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  color: var(--accent);
}
.entry-content .entry-body {
  font-size: 1.05rem;
  line-height: 1.8;
  white-space: pre-wrap;
  margin-bottom: 1rem;
}
.entry-content .entry-gratitude {
  font-size: 0.9rem;
  color: var(--text-sec);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ========== ADHKAR ========== */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.75rem;
}
.tab {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sec);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.tab.active, .tab[aria-selected="true"] {
  background: var(--deep-emerald);
  color: var(--warm-ivory);
  border-color: var(--deep-emerald);
}
[data-theme="dark"] .tab.active {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
}
.tab-desc {
  font-size: 0.95rem;
  color: var(--text-sec);
  margin-bottom: 1rem;
}
.adhkar-progress { margin-bottom: 2rem; }
.adhkar-list { display: flex; flex-direction: column; gap: 1rem; }
.adhkar-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.adhkar-item.completed { border-color: var(--accent); }
.adhkar-arabic {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  line-height: 2;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.adhkar-title {
  font-size: 0.9rem;
  color: var(--text-sec);
  margin-bottom: 0.75rem;
}
.adhkar-counter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.adhkar-count {
  font-family: var(--font-display);
  font-size: 1.25rem;
  min-width: 70px;
}
.count-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-sec);
  transition: all 0.2s;
}
.count-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.count-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.focus-mode-btn { margin-top: 2rem; }

/* Focus Mode */
.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.focus-overlay:not([hidden]) {
  display: flex;
}
.focus-overlay[hidden] {
  display: none !important;
}
.focus-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-sec);
}
.focus-close:hover { background: var(--border); }
.focus-content { text-align: center; max-width: 560px; }
.focus-arabic {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 2.1;
  margin-bottom: 1rem;
}
.focus-title {
  font-size: 0.95rem;
  color: var(--text-sec);
  margin-bottom: 2rem;
}
.focus-counter {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}
.focus-sep { color: var(--text-muted); margin: 0 0.25rem; }
.focus-tap {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: all 0.2s;
}
.focus-tap:active, .focus-tap:hover {
  background: var(--accent);
  color: var(--warm-ivory);
  transform: scale(0.97);
}
[data-theme="dark"] .focus-tap:hover { color: var(--text); }
.focus-complete {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-top: 1.5rem;
}

/* ========== QUR'AN ========== */
.quran-panel { display: none; }
.quran-panel.active { display: block; }
.quran-continue {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.quran-continue h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  flex: 1;
}
.juz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.juz-btn {
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.juz-btn:hover, .juz-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-secondary);
}
.surah-search { margin-bottom: 1rem; }
.surah-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 400px;
  overflow-y: auto;
}
.surah-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: pointer;
}
.surah-item:hover { background: var(--bg-secondary); }
.surah-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-muted);
  min-width: 28px;
}
.surah-names { flex: 1; }
.surah-en { font-weight: 500; font-size: 0.95rem; }
.surah-ar {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--text-sec);
  direction: rtl;
}
.surah-ayahs {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Reader */
.quran-reader {
  background: var(--bg);
  min-height: 60vh;
}
.reader-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.reader-meta {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.reader-en {
  display: block;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-style: normal;
}
.reader-controls { display: flex; gap: 0.35rem; }
.ctrl-btn {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  color: var(--text-sec);
}
.ctrl-btn:hover, .ctrl-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}
.reader-body {
  padding: 1rem 0 2rem;
}
.ayah {
  margin-bottom: 1.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.ayah-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.ayah-arabic {
  font-family: var(--font-arabic);
  font-size: var(--arabic-size, 1.55rem);
  line-height: 2.2;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.ayah-trans {
  font-size: 0.95rem;
  color: var(--text-sec);
  line-height: 1.7;
}
.ayah-trans.hidden { display: none; }
.reader-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Murojaah */
.murojaah-setup h3,
.murojaah-result h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}
.muro-options, .diff-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.radio-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-secondary);
  color: var(--accent);
}
.radio-card input { width: auto; margin: 0; }
.muro-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.muro-selects select { width: auto; min-width: 120px; }
.ayah-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ayah-range input { width: 80px; }
.muro-mode { margin-bottom: 1.5rem; }
.muro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.muro-status { font-size: 0.85rem; color: var(--accent); }
.muro-instruction {
  font-size: 0.9rem;
  color: var(--text-sec);
  margin-bottom: 1.5rem;
}
.muro-ayah {
  font-size: 1.6rem;
  line-height: 2.1;
  text-align: center;
  min-height: 80px;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}
.muro-ayah.hidden-mode { color: transparent; user-select: none; }
.muro-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.muro-feedback {
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.muro-feedback.matched {
  background: rgba(31, 90, 77, 0.12);
  color: var(--accent);
}
.muro-feedback.review {
  background: rgba(166, 93, 88, 0.1);
  color: var(--soft-error);
}
.muro-progress-bar { margin-top: 1rem; }
.result-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.result-stats .stat {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.result-stats .stat span {
  display: block;
  font-size: 2rem;
  font-weight: 500;
}
.result-stats .matched { color: var(--accent); }
.result-stats .review { color: var(--soft-error); }
.result-time {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== QUIZ ========== */
.quiz-setup h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.quiz-choose, .quiz-difficulty { margin-bottom: 1.5rem; }
.quiz-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.quiz-question-type {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.25rem 0 0.75rem;
}
.quiz-arabic {
  font-size: 1.5rem;
  line-height: 2.1;
  text-align: center;
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.quiz-opt {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: var(--bg-card);
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.correct {
  border-color: var(--accent);
  background: rgba(31, 90, 77, 0.1);
  color: var(--accent);
}
.quiz-opt.wrong {
  border-color: var(--soft-error);
  background: rgba(166, 93, 88, 0.08);
  color: var(--soft-error);
}
.quiz-opt:disabled { cursor: default; }
.quiz-feedback {
  text-align: center;
  padding: 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.quiz-feedback.correct { color: var(--accent); }
.quiz-feedback.wrong { color: var(--soft-error); }
.quiz-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.result-score {
  text-align: center;
  margin: 1.5rem 0;
}
.score-big {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
}
.score-pct {
  font-size: 1.25rem;
  color: var(--text-sec);
}
#quizSummary {
  text-align: center;
  color: var(--text-sec);
  margin-bottom: 1.5rem;
}

/* ========== CYCLE ========== */
.cycle-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.cycle-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.cycle-stat-card .stat-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.cycle-stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--muted-rose);
}
.cycle-stat-card .stat-value.large { font-size: 2.25rem; }
.cycle-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.cycle-form, .cycle-notes {
  margin-bottom: 2rem;
}
.cycle-form h3, .cycle-notes h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.cycle-form input[type="date"] { max-width: 220px; margin-bottom: 0.75rem; display: block; }
.disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ========== PROGRESS ========== */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.progress-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.progress-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.progress-stat:last-child { border-bottom: none; }
.progress-stat .val { font-weight: 500; color: var(--accent); }

/* ========== MODALS ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal:not([hidden]) {
  display: flex;
}
.modal[hidden] {
  display: none !important;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.modal-sheet {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.3s ease;
}
.modal-sheet.small { max-width: 360px; margin: auto; border-radius: var(--radius); }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
}
.modal-close:hover { background: var(--border); }
.setting-group {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.setting-group:last-child { border-bottom: none; }
.setting-group h3 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.theme-pills, .font-size-ctrl { display: flex; gap: 0.35rem; }
.pill {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
}
.pill.active, .font-size-ctrl button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-secondary);
}
.font-size-ctrl button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}
.font-size-ctrl button:nth-child(1) { font-size: 0.75rem; }
.font-size-ctrl button:nth-child(3) { font-size: 1rem; }
.city-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}
.city-item {
  padding: 0.85rem 1rem;
  text-align: left;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.city-item:hover { background: var(--bg-secondary); }
.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
#confirmMessage {
  font-size: 1rem;
  color: var(--text-sec);
  line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; }
  main { padding-bottom: calc(var(--mobile-nav-h) + 2rem); }
  .actions-grid { grid-template-columns: 1fr 1fr; }
  .action-card, .action-card.action-large { grid-column: span 1; }
  .prayer-times { grid-template-columns: repeat(3, 1fr); }
  .prayer-times .prayer-item:nth-child(4),
  .prayer-times .prayer-item:nth-child(5) { grid-column: span 1; }
  .quran-cards { grid-template-columns: 1fr; }
  .journal-layout { grid-template-columns: 1fr; }
  .journal-sidebar { position: static; }
  .cycle-overview { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 1rem; }
  main { padding-left: 1rem; padding-right: 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .actions-grid { grid-template-columns: 1fr; }
  .prayer-times { grid-template-columns: 1fr 1fr; }
  .prayer-next { flex-direction: column; gap: 0.35rem; }
  .time-block { padding: 1.5rem 1.25rem; }
  .reader-header { flex-direction: column; align-items: flex-start; }
  .muro-selects { flex-direction: column; align-items: stretch; }
  .muro-selects select { width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .action-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .focus-tap:hover { transform: none; }
}
