/* HariBaik V4 — styles.css
   Estetika: dark forest green + gold + teal action. Tema via CSS variables. */

:root {
  /* Dark (default, sesuai brand) */
  --bg-primary: #0c1a13;
  --bg-secondary: #101f16;
  --bg-elevated: #16291d;
  --bg-glass: rgba(22, 41, 29, 0.6);
  --border: rgba(196, 175, 120, 0.18);
  --text-primary: #eef3ee;
  --text-muted: #9bb0a2;
  --accent-gold: #c4af78;
  --accent-teal: #2d9b6e;
  --accent-purple: #9b8cff;
  --bubble-user: #1d6f50;
  --bubble-ai: #16291d;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

[data-theme='light'] {
  --bg-primary: #f3f1e7;
  --bg-secondary: #eae6d6;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border: rgba(120, 100, 50, 0.22);
  --text-primary: #1c2a20;
  --text-muted: #5d6b60;
  --accent-gold: #9c7e3a;
  --accent-teal: #1f7e57;
  --accent-purple: #6b58d6;
  --bubble-user: #2d9b6e;
  --bubble-ai: #ffffff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-secondary), var(--bg-primary));
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* iOS/touch: cegah auto-zoom saat fokus input (font < 16px) & hilangkan flash ketuk */
html { -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

.arabic { font-family: 'Amiri', serif; direction: rtl; line-height: 1.9; }

/* ---------- Layout ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 720px; margin: 0 auto; width: 100%; }

header.app-header {
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; }
.brand > div { min-width: 0; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal));
  display: grid; place-items: center; font-weight: 700; color: #0c1a13;
}
.brand h1 { font-size: 18px; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .tagline { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

nav.tabs { display: flex; gap: 2px; flex-shrink: 1; flex-wrap: wrap; }
.header-actions { flex-shrink: 0; }

/* Layar sempit: pindahkan tab ke baris kedua selebar penuh agar header tidak meluber */
@media (max-width: 480px) {
  nav.tabs { order: 3; flex-basis: 100%; justify-content: space-around; margin-top: 8px; gap: 4px; }
  .brand { flex: 1; }
}
nav.tabs a {
  color: var(--text-muted); text-decoration: none; font-size: 12.5px;
  padding: 6px 8px; border-radius: 10px; white-space: nowrap;
}
nav.tabs a.active, nav.tabs a:hover { color: var(--text-primary); background: var(--bg-elevated); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: transform 0.15s ease;
}
.icon-btn:hover { transform: translateY(-1px); }

/* Context bar */
.context-bar {
  display: flex; gap: 18px; align-items: center; margin-top: 12px;
  font-size: 14px; color: var(--text-muted); flex-wrap: wrap; font-weight: 500;
}
.context-bar .chip { display: inline-flex; align-items: center; gap: 6px; }
.context-bar .streak { color: var(--accent-gold); font-weight: 600; }

/* ---------- Chat area ---------- */
.chat { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.msg { display: flex; gap: 10px; max-width: 92%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal)); color: #0c1a13;
}
.bubble {
  padding: 11px 14px; border-radius: var(--radius); line-height: 1.5; font-size: 14.5px;
  box-shadow: var(--shadow);
}
.msg.user .bubble { background: var(--bubble-user); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai .bubble { background: var(--bubble-ai); border: 1px solid var(--border); border-bottom-left-radius: 6px; }

.msg.ai .stack { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }

/* Cards */
.card { border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow); position: relative; }
.card .label { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; justify-content: space-between; }

.ayat-card {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-secondary));
  border: 1px solid var(--border);
}
.ayat-card .arabic { font-size: 24px; color: var(--accent-gold); text-align: right; margin: 6px 0 10px; }
.ayat-card .translation { font-size: 14px; color: var(--text-primary); }
.ayat-card .source { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase;
}
.badge.quran { background: rgba(45, 155, 110, 0.18); color: var(--accent-teal); border: 1px solid var(--accent-teal); }
.badge.hadits { background: rgba(196, 175, 120, 0.16); color: var(--accent-gold); border: 1px solid var(--accent-gold); }
.badge.doa { background: rgba(155, 140, 255, 0.16); color: var(--accent-purple); border: 1px solid var(--accent-purple); }

.aksi-card { background: var(--bg-elevated); border-left: 3px solid var(--accent-teal); }
.aksi-card .body { font-size: 14px; }

.doa-card { background: var(--bg-elevated); border-left: 3px solid var(--accent-purple); }
.doa-card .arabic { font-size: 18px; color: var(--text-primary); text-align: right; margin: 4px 0 8px; }
.doa-card .translation { font-size: 13px; color: var(--text-muted); }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 10px; border-radius: 9px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center;
}
.mini-btn:hover { color: var(--text-primary); border-color: var(--accent-gold); }
.mini-btn.active { color: var(--accent-gold); border-color: var(--accent-gold); }

/* Quick replies */
.quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-btn {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent-teal); }

/* Typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ---------- Mood selector ---------- */
.mood-selector { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 4px; }
.mood-pill {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: all 0.15s ease;
}
.mood-pill:hover, .mood-pill.selected { background: var(--accent-teal); color: #fff; border-color: var(--accent-teal); }

/* ---------- Footer input ---------- */
footer.composer {
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
  background: var(--bg-glass); backdrop-filter: blur(14px);
}
.input-row { display: flex; align-items: flex-end; gap: 8px; }
.input-row textarea {
  flex: 1; resize: none; max-height: 120px; min-height: 44px;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 14.5px; outline: none;
}
.input-row textarea:focus { border-color: var(--accent-teal); }
.send-btn, .voice-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
}
.send-btn { background: var(--accent-teal); color: #fff; }
.voice-btn { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); }
.voice-btn.recording { background: #c0392b; color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192,57,43,0.5); } 70% { box-shadow: 0 0 0 12px rgba(192,57,43,0); } 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); } }
.powered { text-align: center; font-size: 10.5px; color: var(--text-muted); margin-top: 8px; }

/* ---------- Favorites page ---------- */
.fav-page { max-width: 720px; margin: 0 auto; width: 100%; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); flex: 1; }
.fav-filters { display: flex; gap: 8px; margin: 14px 0; }
.fav-grid { display: flex; flex-direction: column; gap: 12px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 20px; }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 50;
}
.toast.show { opacity: 1; }

/* Share card (rendered off-screen, captured by html2canvas) */
.share-card {
  position: fixed; left: -9999px; top: 0; width: 540px; padding: 48px 44px;
  background: linear-gradient(160deg, #0c1a13, #16291d);
  color: #eef3ee; border-radius: 24px; box-sizing: border-box;
}
.share-card .ornament { font-size: 30px; color: var(--accent-gold); text-align: center; opacity: 0.5; }
.share-card .s-arabic { font-family: 'Amiri', serif; direction: rtl; font-size: 40px; color: #c4af78; text-align: center; margin: 24px 0; line-height: 1.8; }
.share-card .s-trans { font-size: 18px; text-align: center; line-height: 1.6; }
.share-card .s-source { text-align: center; color: #9bb0a2; margin-top: 18px; font-size: 14px; }
.share-card .s-watermark { text-align: center; color: #c4af78; margin-top: 30px; font-size: 13px; letter-spacing: 1px; font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Timestamps ---------- */
.col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg.user .col { align-items: flex-end; }
.msg-time { font-size: 10.5px; color: var(--text-muted); opacity: 0.75; padding: 0 4px; }
.msg.ai .stack > .msg-time { align-self: flex-start; }

/* ---------- Send button loading ---------- */
.send-btn.loading { cursor: default; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  display: inline-block; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.input-row textarea:disabled { opacity: 0.6; }

/* ---------- Save pop animation ---------- */
.mini-btn.pop { animation: pop 0.3s ease; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
.mood-pill.selected { animation: pop 0.25s ease; }

/* ---------- Settings bottom-sheet ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s ease;
}
.modal-overlay.show { opacity: 1; }
.sheet {
  background: var(--bg-secondary); border: 1px solid var(--border); border-bottom: none;
  border-radius: 24px 24px 0 0; padding: 10px 20px 26px; width: 100%; max-width: 720px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.show .sheet { transform: translateY(0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 14px; }
.sheet-title { font-size: 19px; margin-bottom: 4px; }
.sheet-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; color: var(--text-muted); }
.field em { font-style: normal; opacity: 0.7; }
.field input[type='text'], .field input[type='time'], .field input[type='number'], .field select {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14.5px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent-teal); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-primary); font-size: 14.5px; }
.row-between input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--accent-teal); }
.field-hint { font-size: 11.5px; color: var(--text-muted); }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sheet-actions .spacer { flex: 1; }
.primary-btn {
  background: var(--accent-teal); color: #fff; border: none; padding: 10px 20px;
  border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.primary-btn:hover { filter: brightness(1.05); }
.mini-btn.danger { border-color: rgba(192, 57, 43, 0.6); color: #e07a6f; }

/* ---------- Splash screen ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: #0c1a13 url('../icons/splash-bg.svg') center / cover no-repeat;
  animation: splashOut 0.7s ease 2.6s forwards;
}
@keyframes splashOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.splash-inner { text-align: center; padding: 0 24px; animation: splashIn 0.9s ease both; }
@keyframes splashIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.splash-logo {
  width: 104px; height: 104px;
  filter: drop-shadow(0 8px 26px rgba(196, 175, 120, 0.45));
  animation: splashFloat 3s ease-in-out infinite;
}
@keyframes splashFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.splash-title {
  margin-top: 20px; font-size: 42px; font-weight: 700; letter-spacing: 2.5px; color: #c4af78;
  text-shadow: 0 2px 18px rgba(196, 175, 120, 0.3);
}
.splash-tagline { margin-top: 8px; font-size: 15px; letter-spacing: 0.6px; color: #cdd9cf; }
@media (prefers-reduced-motion: reduce) {
  .splash-inner, .splash-logo { animation: none; }
}

/* ---------- Empty state (favorites) ---------- */
.empty-state .empty-emoji { font-size: 44px; margin-bottom: 8px; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 6px; font-size: 16px; }
.empty-state p { margin-bottom: 16px; line-height: 1.5; }

/* ---------- Disclaimer keaslian konten ---------- */
.disclaimer {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--accent-gold);
  border-radius: 10px; padding: 9px 12px; font-size: 12px; color: var(--text-muted);
  display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow);
}
.disclaimer .js-ok { margin-left: auto; flex-shrink: 0; }

/* ---------- Ghost button (mis. "Percakapan baru") ---------- */
.ghost-btn {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  padding: 11px 14px; border-radius: 12px; font: inherit; font-size: 14px; cursor: pointer; margin-bottom: 10px;
}
.ghost-btn:hover { border-color: var(--accent-teal); }

/* ---------- Favorites toolbar (export/import) ---------- */
.fav-toolbar { display: flex; gap: 8px; margin-bottom: 6px; }

/* ---------- Jurnal & Statistik (Fase 2) ---------- */
.journal-page { max-width: 720px; margin: 0 auto; width: 100%; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; flex: 1; overflow-y: auto; }
.jcard { display: flex; flex-direction: column; gap: 12px; }
.jtitle { font-size: 16px; }
.jsub { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.jhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mood-selector.inline { padding: 0; }
#jNote { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14px; resize: none; outline: none; }
#jNote:focus { border-color: var(--accent-teal); }

.jstats-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jstat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px; text-align: center; }
.jstat b { display: block; font-size: 18px; color: var(--accent-gold); }
.jstat span { font-size: 11px; color: var(--text-muted); }

.jdist { display: flex; flex-direction: column; gap: 7px; }
.jdist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.jdist-label { width: 110px; flex-shrink: 0; }
.jdist-bar { flex: 1; height: 10px; background: var(--bg-elevated); border-radius: 6px; overflow: hidden; }
.jdist-bar i { display: block; height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.jdist-n { width: 22px; text-align: right; color: var(--text-muted); }

.jtrend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.jtrend-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jtrend-cell i { width: 100%; height: 30px; border-radius: 8px; }
.jtrend-cell span { font-size: 10.5px; color: var(--text-muted); }

.jcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.jcal-head { margin-bottom: 4px; }
.jcal-cell { position: relative; aspect-ratio: 1; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; background: var(--bg-elevated); border: 1px solid transparent; }
.jcal-cell.empty { background: transparent; }
.jcal-dow { background: transparent; color: var(--text-muted); font-size: 11px; aspect-ratio: auto; padding: 2px 0; }
.jcal-cell.today { border-color: var(--accent-gold); }
.jcal-num { position: absolute; top: 4px; left: 6px; color: var(--text-muted); font-size: 11px; }
.jcal-dot { width: 12px; height: 12px; border-radius: 50%; }
.jcal-count { position: absolute; bottom: 3px; right: 5px; font-size: 9px; color: var(--text-muted); font-style: normal; }

.jperiod { display: flex; gap: 6px; }
.jperiod .chip-btn { padding: 5px 10px; font-size: 12px; }
.jperiod .chip-btn.selected { background: var(--accent-teal); color: #fff; border-color: var(--accent-teal); }

.jmonthtrend { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.jmonthtrend svg { width: 100%; height: 60px; display: block; }

.jlegend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.jleg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.jleg i { width: 11px; height: 11px; border-radius: 3px; }

button.jcal-cell { cursor: pointer; font: inherit; color: var(--text-primary); }
button.jcal-cell.has:hover { border-color: var(--accent-teal); }
.jcal-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 6px; }

.jday-entry { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.jday-mood { font-size: 14px; font-weight: 600; }
.jday-time { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.jday-note { font-size: 13px; margin: 6px 0 8px; line-height: 1.5; }
.jday-del { margin-top: 2px; }

.jempty { font-size: 13px; color: var(--text-muted); padding: 8px 2px; text-align: center; }

.jcompare { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; line-height: 1.4; }
.jcompare:empty { display: none; }
.jcompare-icon { font-size: 16px; flex-shrink: 0; }

.jhistory { margin-top: 12px; }
.jhist-list { display: flex; flex-direction: column; gap: 6px; }
.jhist-item { width: 100%; text-align: left; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.jhist-item small { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.jhist-item:hover { border-color: var(--accent-teal); }

.jinsight-empty { font-size: 13px; color: var(--text-muted); }
.jinsight h3 { font-size: 15px; color: var(--accent-gold); margin-bottom: 6px; }
.jinsight p { font-size: 14px; line-height: 1.55; margin-bottom: 8px; }
.jinsight-saran { color: var(--text-primary); }
.jinsight-day { color: var(--text-muted); font-size: 11px; }

/* ---------- Amalan (Fase 3) ---------- */
.deeds-count { font-size: 14px; color: var(--accent-gold); font-weight: 700; }
.deeds-list { display: flex; flex-direction: column; gap: 8px; }
.deed-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14.5px; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.deed-ico { font-size: 18px; }
.deed-label { flex: 1; }
.deed-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; color: transparent; flex-shrink: 0; }
.deed-item.done { border-color: var(--accent-teal); background: rgba(45, 155, 110, 0.12); }
.deed-item.done .deed-check { background: var(--accent-teal); border-color: var(--accent-teal); color: #fff; }

.deeds-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dweek-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: none; padding: 4px 0; cursor: pointer; font: inherit; border-radius: 8px; }
.dweek-cell:hover { background: var(--bg-elevated); }
.dweek-ring { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent-teal) calc(var(--p) * 1%), rgba(127, 127, 127, 0.18) 0); }
.dweek-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-secondary); }
.dweek-ring span { position: relative; font-size: 11px; font-weight: 700; color: var(--text-primary); }
.dweek-ring small { font-size: 8px; color: var(--text-muted); }
.dweek-til { width: 8px; height: 8px; border-radius: 50%; background: transparent; border: 1px solid var(--border); }
.dweek-til.on { background: var(--accent-gold); border-color: var(--accent-gold); }
.dweek-cell span { font-size: 10.5px; color: var(--text-muted); }

/* Jadwal Sholat */
.jadwal-controls { display: flex; gap: 8px; align-items: center; }
.jadwal-city { flex: 1; margin: 0; padding: 9px 12px; }
.jadwal-times { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.jt-item { display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 8px 2px; cursor: pointer; font: inherit; color: inherit; }
.jt-item:hover { border-color: var(--accent-teal); }
.jadwal-pick { display: block; margin-top: 8px; text-align: center; }
.jt-item span { font-size: 10.5px; color: var(--text-muted); }
.jt-item b { font-size: 12.5px; color: var(--text-primary); }
.jt-item.minor { opacity: 0.65; }
.jt-item.next { border-color: var(--accent-gold); background: rgba(196, 175, 120, 0.12); }
.jt-item.next b { color: var(--accent-gold); }
.jadwal-next { margin-top: 12px; text-align: center; font-size: 14px; color: var(--accent-teal); font-weight: 600; }
.jadwal-next:empty { display: none; }
.adzan-row { margin-top: 14px; color: var(--text-primary); font-size: 14.5px; }

/* Arah Kiblat (kompas) */
.qibla-wrap { display: grid; place-items: center; margin: 10px 0; }
.compass { position: relative; width: 180px; height: 180px; border-radius: 50%; border: 2px solid var(--border); background: radial-gradient(circle at 50% 50%, var(--bg-elevated), var(--bg-secondary)); will-change: transform; }
.compass::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-gold); transform: translate(-50%, -50%); }
.cmp { position: absolute; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.cmp-n { top: 7px; left: 50%; transform: translateX(-50%); color: var(--accent-gold); }
.cmp-s { bottom: 7px; left: 50%; transform: translateX(-50%); }
.cmp-e { right: 9px; top: 50%; transform: translateY(-50%); }
.cmp-w { left: 9px; top: 50%; transform: translateY(-50%); }
.needle { position: absolute; left: 50%; bottom: 50%; transform-origin: 50% 100%; font-size: 30px; line-height: 1; transition: transform 0.25s ease; }

/* Istiqomah Challenge */
.ch-input { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14.5px; outline: none; margin-bottom: 10px; }
.ch-input:focus { border-color: var(--accent-teal); }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.ch-progress { text-align: right; }
.ch-progress b { display: block; color: var(--accent-gold); }
.ch-progress span { font-size: 11px; color: var(--text-muted); }
.ch-bar { height: 8px; background: var(--bg-elevated); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-teal), var(--accent-gold)); transition: width 0.4s ease; }
.ch-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-bottom: 12px; }
.ch-cell { aspect-ratio: 1; border-radius: 7px; background: var(--bg-elevated); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; color: var(--text-muted); cursor: pointer; font-family: inherit; padding: 0; }
.ch-cell:disabled { cursor: default; }
.ch-cell:not(:disabled):hover { border-color: var(--accent-teal); }
.ch-hist-item { font-size: 13px; padding: 7px 0; border-top: 1px solid var(--border); color: var(--text-muted); }
.ch-hist-item b { color: var(--text-primary); }
.rcountdown { margin-top: 12px; font-size: 15px; color: var(--accent-gold); text-align: center; font-weight: 600; }
.rcountdown:empty { display: none; }
.ch-cell.done { background: var(--accent-teal); border-color: var(--accent-teal); color: #fff; font-weight: 700; }
.ch-cell.today { border-color: var(--accent-gold); }
.ch-cell.future { opacity: 0.5; }
.ch-actions { display: flex; gap: 8px; align-items: center; }
.ch-actions .primary-btn { flex: 1; }
.ch-done { margin-top: 10px; color: var(--accent-gold); font-size: 14px; text-align: center; }

/* Laporan Spiritual Mingguan */
.rep-empty { font-size: 13px; color: var(--text-muted); }
.rep h3 { font-size: 16px; color: var(--accent-gold); margin-bottom: 6px; }
.rep-sum { font-size: 14px; line-height: 1.55; margin-bottom: 12px; }
.rep-sec { margin-bottom: 11px; }
.rep-sec b { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.rep-sec p { font-size: 14px; line-height: 1.5; }

/* Ramadan mode */
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; transition: 0.2s; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--text-muted); border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--accent-teal); border-color: var(--accent-teal); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }
.ramadan-card .row-between { align-items: center; }
.ramadan-extra { margin-top: 12px; }
.rtimes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-ramadan='on'] { --accent-gold: #e8c468; --accent-purple: #c3b2ff; }
[data-ramadan='on'] .ramadan-card { border-color: var(--accent-gold); box-shadow: 0 0 24px rgba(232, 196, 104, 0.12); }
[data-ramadan='on'] .brand .logo { background: linear-gradient(135deg, #e8c468, #9b8cff); }

/* ---------- Akun Cloud + Dinding Doa (Fase 4) ---------- */
.cloud-box { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.cloud-box > b { font-size: 13px; }
.cloud-status { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.cloud-box .fav-toolbar { margin: 8px 0 0; }
#cloudUpgrade { background: rgba(196,175,120,0.08); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
#cloudUpgrade .field-hint { display: block; margin-bottom: 4px; }

/* Indikator sinkron cloud (chip kecil pojok bawah) */
.sync-chip {
  position: fixed; bottom: 90px; left: 50%; transform: translate(-50%, 8px);
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 49;
}
.sync-chip.show { opacity: 1; transform: translate(-50%, 0); }
.sync-chip.ok { border-color: var(--accent-teal); }
.sync-chip.err { border-color: #c0563f; }

/* Banner ajakan pasang aplikasi (PWA install) */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; z-index: 60;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow);
  transform: translateY(140%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease;
}
.install-banner.show { transform: translateY(0); opacity: 1; }
.install-banner .ib-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.install-banner .ib-text b { font-size: 14px; }
.install-banner .ib-text span { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.install-banner .ib-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.install-banner .ib-yes { padding: 9px 16px; }

/* ---------- Halaman Tentang & Disclaimer ---------- */
.about { max-width: 680px; margin: 0 auto; width: 100%; }
.about-lead { font-size: 15.5px; line-height: 1.65; color: var(--text-primary); margin: 4px 0 16px; }
.about-card { margin-bottom: 16px; }
.about-card h2 { font-size: 17px; margin: 0 0 10px; color: var(--accent-gold); }
.about-card h3 { font-size: 14px; margin: 16px 0 6px; color: var(--text-primary); }
.about-card p { font-size: 14px; line-height: 1.7; color: var(--text-secondary, var(--text-primary)); margin: 0 0 10px; }
.about-card ul { margin: 0 0 6px; padding-left: 20px; }
.about-card li { font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; color: var(--text-secondary, var(--text-primary)); }
.about-card blockquote {
  margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent-teal);
  background: var(--bg-elevated); border-radius: 0 10px 10px 0;
  font-style: italic; color: var(--text-primary); line-height: 1.6;
}
.about a { color: var(--accent-teal); text-decoration: none; }
.about a:hover { text-decoration: underline; }
.about-note { font-size: 12.5px !important; color: var(--text-muted) !important; }

.donate-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.donate-box {
  flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 3px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.donate-method { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.donate-num { font-size: 18px; font-weight: 700; color: var(--accent-gold); letter-spacing: 0.5px; }
.donate-name { font-size: 12.5px; color: var(--text-primary); }

.donor-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.donor-table th, .donor-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.donor-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; }
.donor-table td:first-child, .donor-table th:first-child { width: 32px; }

.about-closing { text-align: center; font-size: 15px; line-height: 1.7; margin: 18px 0; color: var(--accent-gold); }
.about-dev p { margin-bottom: 6px; }
.about-disclaimer { border: 1px solid var(--accent-gold); }
.about-foot { text-align: center; font-size: 12px; color: var(--text-muted); margin: 18px 0 8px; line-height: 1.6; }

#doaText { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14.5px; resize: none; outline: none; }
#doaText:focus { border-color: var(--accent-teal); }
.doa-item .doa-content { font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.doa-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-muted); margin: 8px 0 4px; }
.mini-btn.js-aamiin.active { color: var(--accent-gold); border-color: var(--accent-gold); }

/* ---------- Hormati prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
