:root {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  color: #252525;
  background: #fdfce7;
  --page: #fdfce7;
  --surface: #fffef8;
  --surface-muted: #f4f2e7;
  --green: #004839;
  --green-soft: #eaf0e8;
  --beige: #d8cdb8;
  --text: #252525;
  --secondary: #5e5b50;
  --muted: #797568;
  --line: #e5e1d4;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { min-width: 320px; margin: 0; background: var(--page); }
button, a, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible + .check-ui {
  outline: 2px solid #477263; outline-offset: 3px;
}
main { overflow: hidden; }
.topbar {
  height: 64px; max-width: 1440px; margin: auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 17px; }
.brand i { color: var(--secondary); font-style: normal; }
.brand-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--beige); border-radius: 50%; color: var(--green); }
.brand-icon svg { width: 16px; height: 16px; }
.topbar nav { height: 100%; display: flex; align-items: center; gap: 28px; color: var(--secondary); font-size: 13px; }
.topbar nav a { height: 36px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--green); border-color: var(--beige); }
.nav-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.nav-note svg { width: 16px; height: 16px; flex: none; color: var(--green); }

.hero {
  max-width: 1280px; min-height: 476px; margin: auto; padding: 40px 32px 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 32px;
}
.hero-copy { width: 100%; max-width: 480px; justify-self: end; padding-right: 24px; }
.eyebrow, .section-kicker { color: var(--muted); font-size: 12px; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { width: 20px; height: 1px; background: var(--beige); }
.hero h1 { margin: 16px 0 12px; color: #26352c; font-size: 60px; line-height: 1.2; font-weight: 400; letter-spacing: -1px; }
.hero h1 span { color: var(--green); }
.subtitle { max-width: 440px; margin: 0; color: var(--secondary); font-size: 17px; line-height: 2; }
.primary-btn {
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 0 20px; border: 1px solid var(--green); border-radius: 8px;
  background: var(--green); color: #fff; font-size: 14px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.primary-btn:hover { background: #0c5746; border-color: #0c5746; }
.primary-btn svg { width: 16px; height: 16px; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.hero-note svg { width: 16px; height: 16px; color: var(--green); }
.hero-art { width: 100%; min-height: 384px; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.home-scene { display: block; width: min(400px, 100%); height: auto; }
.art-caption { position: relative; z-index: 2; text-align: center; color: #5e644d; font-size: 12px; line-height: 1.8; }
.art-caption span { color: var(--muted); font-size: 11px; }

.overview { padding: 28px 32px 32px; border-block: 1px solid var(--line); background: #f5f3e8; }
.overview-title { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.overview-title .line { width: 24px; height: 1px; background: var(--beige); }
.stats { max-width: 960px; margin: auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; }
.stat-card { min-height: 80px; display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.progress-card { gap: 16px; }
.progress-ring { width: 52px; height: 52px; flex: none; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--green) var(--progress), #e8e5db 0); }
.progress-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.progress-ring > div { z-index: 1; display: flex; flex-direction: column; text-align: center; line-height: 1.15; }
.progress-ring b { color: var(--green); font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; }
.progress-ring b small { font-size: 10px; }.progress-ring span { color: var(--muted); font-size: 9px; }
.stat-card h2 { margin: 0 0 4px; font-size: 14px; font-weight: 400; }
.stat-card p { margin: 0; color: var(--muted); font-size: 12px; }
.stat-card strong { color: var(--green); font-size: 22px; font-weight: 400; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card > div > span { color: var(--muted); font-size: 12px; }

.journey-section, .dua-section { max-width: 1280px; margin: auto; padding: 64px 32px 24px; }
.section-heading, .dua-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.section-heading h2, .dua-heading h2 { margin: 4px 0; color: #26382d; font-size: 28px; line-height: 1.5; font-weight: 400; }
.section-heading p, .dua-heading p { margin: 0; color: var(--secondary); font-size: 14px; line-height: 1.6; }
.reset-btn { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--secondary); font-size: 12px; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.reset-btn:hover { border-color: #c8c1ae; background: var(--surface-muted); }
.reset-btn svg { width: 16px; height: 16px; }
.stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stage-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stage-top { min-height: 32px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stage-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--green); }
.stage-icon svg { width: 18px; height: 18px; }
.stage-count, .stage-label { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stage-label { color: #81795f; }
.stage-card h3 { margin: 4px 0 12px; color: #354136; font-size: 17px; font-weight: 400; }
.mini-track { height: 4px; overflow: hidden; border-radius: 2px; background: #e8e5dc; }
.mini-track i { height: 100%; display: block; border-radius: 2px; background: #66836f; }
.task-list { display: grid; gap: 4px; margin-top: 12px; }
.task { min-height: 36px; display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 13px; cursor: pointer; }
.task input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-ui { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border: 1px solid #c8c4b7; border-radius: 4px; color: transparent; font-size: 11px; }
.task:hover .check-ui { border-color: #7d9482; }
.task input:checked + .check-ui { border-color: var(--green); background: var(--green); color: #fff; }
.task.is-done > span:last-child { color: #817f74; text-decoration: line-through; }

.dua-section { padding-top: 64px; padding-bottom: 64px; }
.dua-heading { align-items: center; margin-bottom: 24px; }
.dua-heading h2 { font-size: 30px; line-height: 1.45; }
.dua-count { width: 144px; flex: none; display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dua-count > span { color: var(--muted); font-size: 12px; }
.dua-count strong { color: var(--green); font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; }
.dua-count strong small { color: var(--muted); font-size: 12px; }
.dua-count .mini-track { margin-top: 4px; }
.dua-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.filter-pills { display: flex; align-items: center; gap: 4px; }
.filter-pills button { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--secondary); font-size: 12px; cursor: pointer; }
.filter-pills button:hover { background: #f5f3e8; }
.filter-pills button.selected { border-color: #dfe4da; background: var(--green-soft); color: var(--green); }
.filter-pills button span { margin-right: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.source-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.source-legend i { width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; }
.quran-dot { background: #507a55; }.prophet-dot { background: #a98452; }.general-dot { background: #969184; }
.dua-categories { display: grid; gap: 16px; }
.dua-category { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.category-heading { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.category-number { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e6e9df; color: var(--green); font-size: 12px; }
.category-heading h3 { margin: 0; color: #364437; font-size: 15px; font-weight: 400; }
.category-amount { margin-right: auto; color: var(--muted); font-size: 12px; }
.dua-list { padding: 0 16px; }
.dua-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px 4px; border-bottom: 1px solid #eeece4; }
.dua-card:last-child { border: 0; }
.dua-index { width: 24px; height: 24px; flex: none; display: grid; place-items: center; margin-top: 2px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dua-content { min-width: 0; flex: 1; }
.dua-content p { margin: 0 0 8px; color: #34362f; font-size: 15px; line-height: 1.9; }
.dua-meta { display: flex; align-items: center; gap: 8px; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.badge-quran { background: #e8efe3; color: #365e3c; }.badge-prophet { background: #f1ebdd; color: #795e35; }.badge-general { background: #efeee8; color: #625f55; }
.reference { color: var(--muted); font-size: 12px; }
.dua-actions { display: flex; gap: 4px; padding-top: 0; }
.dua-actions button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color 140ms var(--ease), background-color 140ms var(--ease); }
.dua-actions button:hover { background: var(--surface-muted); color: var(--green); }
.dua-actions button svg { width: 16px; height: 16px; }
.dua-actions .favorited { color: #8a554a; }.dua-actions .read-action { color: var(--green); }
footer { padding: 28px 24px; border-top: 1px solid var(--line); background: #f5f3e8; text-align: center; color: var(--secondary); }
footer .footer-flower { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--green); }
footer .footer-flower svg { width: 18px; height: 18px; }
footer p { margin: 8px 0; font-size: 14px; }
footer > span:last-child { color: var(--muted); font-size: 12px; }

@media (max-width: 1024px) {
  .topbar { padding-inline: 24px; }
  .hero { min-height: 456px; padding: 32px 24px; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
  .hero-copy { padding-right: 8px; }
  .hero h1 { font-size: 52px; }
  .hero-art { min-height: 368px; }
  .home-scene { width: min(400px, 100%); }
  .journey-section, .dua-section { padding-inline: 24px; }
  .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) and (min-width: 601px) {
  .hero { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 16px; }
  .hero-copy { padding-right: 0; }
  .hero h1 { font-size: 44px; }
  .subtitle { font-size: 15px; }
  .home-scene { width: min(360px, 100%); }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 68px; }
  .topbar { height: 60px; padding-inline: 16px; }
  .brand { font-size: 15px; }
  .brand-icon { width: 24px; height: 24px; }
  .topbar nav { gap: 12px; font-size: 12px; }
  .topbar nav a { display: inline-flex; height: 36px; font-size: 11px; }
  .nav-note { display: none; }
  .hero { min-height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 32px 20px 24px; }
  .hero-copy { padding: 0; }
  .eyebrow { font-size: 11px; }
  .hero h1 { margin: 12px 0 8px; font-size: 44px; line-height: 1.2; }
  .subtitle { font-size: 15px; line-height: 1.9; }
  .subtitle .desktop { display: none; }
  .primary-btn { margin-top: 16px; }
  .hero-note { margin-top: 16px; font-size: 11px; }
  .hero-art { width: 100%; min-height: 0; height: auto; gap: 8px; margin: 4px auto 0; transform: none; }
  .hero-art .home-scene { width: min(320px, 100%); }
  .hero-art .art-caption { padding: 0 8px; font-size: 11px; }
  .overview { padding: 24px 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 68px; gap: 12px; padding: 12px; }
  .progress-card { min-height: 80px; grid-column: 1 / -1; }
  .stat-card p { font-size: 11px; }
  .stat-card strong { font-size: 20px; }
  .journey-section, .dua-section { padding: 48px 16px 16px; }
  .section-heading, .dua-heading { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .section-heading h2, .dua-heading h2 { font-size: 22px; line-height: 1.45; }
  .section-heading p, .dua-heading p { max-width: 36ch; font-size: 12px; }
  .reset-btn { min-height: 36px; gap: 4px; padding-inline: 8px; font-size: 11px; white-space: nowrap; }
  .stage-grid { grid-template-columns: 1fr; gap: 12px; }
  .stage-card { padding: 16px; }
  .stage-card h3 { font-size: 16px; }
  .task { min-height: 36px; font-size: 13px; }
  .dua-heading { align-items: flex-end; }
  .dua-count { width: 104px; padding: 12px; }
  .dua-count strong { font-size: 19px; }
  .dua-tools { display: grid; gap: 12px; }
  .filter-pills { gap: 2px; }
  .filter-pills button { min-height: 36px; padding-inline: 8px; font-size: 11px; }
  .source-legend { gap: 6px; font-size: 10px; }
  .dua-categories { gap: 12px; }
  .category-heading { min-height: 48px; gap: 8px; padding: 8px 12px; }
  .category-heading h3 { font-size: 13px; }
  .category-amount { font-size: 10px; }
  .dua-list { padding-inline: 12px; }
  .dua-card { gap: 8px; padding: 12px 0; }
  .dua-content p { font-size: 13px; line-height: 1.9; }
  .dua-actions { gap: 0; }
  .dua-actions button { width: 28px; height: 28px; }
  .badge, .reference { font-size: 10px; }
  footer { padding: 24px 16px; }
  footer p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Cross-device sync */
.sync-open { min-height: 36px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; }
.sync-open:hover { color: var(--green); background: var(--surface-muted); }
.sync-open svg { width: 16px; height: 16px; }
.sync-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #b4a88b; }
.sync-dot[data-connected="true"] { background: #527b59; }
.sync-dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  position: fixed; inset: 0; margin: auto; padding: 28px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: 0 16px 48px #25252520;
}
.sync-dialog[open] { display: block; }
.sync-dialog::backdrop { background: #25252566; }
.sync-close { position: absolute; inset-block-start: 16px; inset-inline-start: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--secondary); font-size: 20px; cursor: pointer; }
.sync-dialog-mark { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--green); }
.sync-dialog-mark svg { width: 20px; height: 20px; }
.sync-dialog h2 { margin: 4px 0; color: #26382d; font-size: 24px; font-weight: 400; }
.sync-intro { margin: 8px 0 20px; color: var(--secondary); font-size: 14px; line-height: 1.8; }
.sync-status { padding: 12px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); color: var(--secondary); font-size: 13px; }
.sync-status[data-connected="true"] { border-color: #d9e4d8; background: #edf2e9; color: #34573a; }
.sync-label { display: block; margin-bottom: 8px; color: var(--text); font-size: 13px; }
.sync-key-row { display: flex; align-items: stretch; gap: 8px; }
.sync-key-row input { min-width: 0; min-height: 40px; flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--secondary); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.sync-key-row button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; font-size: 12px; white-space: nowrap; cursor: pointer; }
.sync-key-row button svg { width: 16px; height: 16px; }
.sync-key-row button:disabled { opacity: .6; cursor: wait; }
.sync-help, .sync-footnote { margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sync-divider { height: 1px; margin: 20px 0; background: var(--line); }
.sync-footnote { margin: 12px 0 0; }
@media (max-width: 600px) {
  .nav-note.sync-open { width: 32px; min-height: 32px; justify-content: center; padding: 0; border-radius: 8px; }
  .nav-note.sync-open > span, .nav-note.sync-open > .sync-dot { display: none; }
  .sync-dialog { padding: 24px 20px; }
  .sync-key-row { gap: 4px; }
  .sync-key-row input { font-size: 10px; }
  .sync-key-row button { gap: 4px; padding-inline: 8px; }
}
