/* साई साधना — shrine, not productivity app. Big, warm, forgiving — built for
   elderly devotees on phones. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f6f3ec; --card: #fffdf8; --ink: #2e2419; --muted: #7d7160;
  --line: #e2d9c4; --verm: #a93b2c; --saff: #b97c14; --saff-bg: #f6ead2;
  --dev-bg: #ece4d0; --gold-bg: #faf3df; --ok: #3e7d4e;
  --msg-size: 19px;          /* devotee-adjustable, see the A / A+ / A++ button */
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; font-size: 17px; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ── auth ── */
#auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-inner { width: 100%; max-width: 380px; text-align: center; }
.diya { font-size: 60px; margin-bottom: 10px; }
#auth h1 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 36px; font-weight: 600; }
.promise { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-style: italic; font-size: 19px; color: var(--saff); margin-top: 6px; }
.tagline { color: var(--muted); font-size: 15.5px; margin: 12px 0 28px; line-height: 1.6; }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
#auth-form input { padding: 15px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16.5px; color: var(--ink); }
#auth-form button[type=submit] { padding: 16px; border: 0; border-radius: 12px; background: var(--verm); color: #fff7ec; font-size: 18px; font-weight: 700; }
.error { color: var(--verm); font-size: 14px; min-height: 18px; }
.switch a { color: var(--saff); font-size: 14.5px; text-decoration: none; }

/* ── shell ── */
#app { height: 100dvh; display: flex; flex-direction: column; }
header { padding: calc(env(safe-area-inset-top) + 10px) 14px 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.textsize { background: var(--card); border: 1.5px solid var(--line); border-radius: 9px; padding: 4px 11px; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.brand { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 21px; font-weight: 700; }
.chapter-chip { font-size: 12.5px; color: var(--saff); background: var(--saff-bg); border-radius: 999px; padding: 4px 12px; }

main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }

/* ── bottom nav (thumb reach) ── */
.bottom-nav { display: flex; border-top: 1px solid var(--line); background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav .tab { flex: 1; background: none; border: 0; padding: 9px 0 7px; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bottom-nav .tab span { font-size: 21px; }
.bottom-nav .tab.active { color: var(--verm); font-weight: 700; }
.bottom-nav .tab.has-pending { position: relative; }
.bottom-nav .tab.has-pending::after {
  content: attr(data-count); position: absolute; top: 4px; left: 50%; margin-left: 8px;
  background: var(--verm); color: #fff7ec; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: flex;
  align-items: center; justify-content: center; padding: 0 5px;
}

/* ── दर्शन (chat) ── */
#messages { flex: 1; overflow-y: auto; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 11px; }
.msg { max-width: 92%; padding: 13px 16px; border-radius: 14px; font-size: var(--msg-size); line-height: 1.7; white-space: pre-wrap; }
.msg.baba { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.msg.baba .tag { display: block; font-family: -apple-system, sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--saff); margin-bottom: 5px; }
.msg.devotee { align-self: flex-end; background: var(--dev-bg); border: 1px solid var(--line); border-bottom-right-radius: 5px; }
.msg.typing { color: var(--muted); font-style: italic; animation: breathe 2s infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.daybreak { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .1em; margin: 10px 0 2px; }
.tick { align-self: flex-end; font-size: 12px; color: var(--ok); margin: -6px 4px 0 0; }
.tick.fail { color: var(--verm); }

/* ── coach hint ── */
.coach { margin: 0 14px 8px; background: var(--gold-bg); border: 1.5px dashed var(--saff); border-radius: 12px; padding: 12px 14px; font-size: 15.5px; text-align: center; animation: breathe 2.4s infinite; }

/* ── composer (idle) ── */
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.composer button { border: 1.5px solid var(--line); background: var(--card); border-radius: 50%; width: 48px; height: 48px; font-size: 20px; flex-shrink: 0; }
.mic-main { width: 58px !important; height: 58px !important; font-size: 26px !important; background: var(--verm) !important; border-color: var(--verm) !important; }
#input { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 16px; padding: 13px 15px; font-size: 16.5px; background: var(--card); color: var(--ink); max-height: 120px; font-family: inherit; min-height: 48px; }
#btn-send { background: var(--verm); color: #fff7ec; border-color: var(--verm); }

/* ── बोलते समय (recording strip) ── */
.rec-strip { border-top: 2px solid var(--verm); background: var(--card); padding: 14px 14px calc(env(safe-area-inset-bottom) + 6px); display: flex; flex-direction: column; gap: 10px; }
.rec-head { font-size: 16.5px; font-weight: 700; color: var(--verm); display: flex; align-items: center; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--verm); display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .5; } }
.rec-live { min-height: 44px; max-height: 120px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: calc(var(--msg-size) - 2px); color: var(--ink); }
.rec-live:empty::before { content: "…your words will appear here…"; color: var(--muted); font-style: italic; }

/* ── review (confirm before send) ── */
.review { border-top: 2px solid var(--saff); background: var(--card); padding: 14px 14px calc(env(safe-area-inset-bottom) + 6px); display: flex; flex-direction: column; gap: 10px; }
.rev-head { font-size: 16px; font-weight: 700; color: var(--saff); }
#rev-text { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; font-size: calc(var(--msg-size) - 1px); font-family: inherit; background: var(--bg); color: var(--ink); resize: vertical; }
.rev-actions { display: flex; gap: 10px; }

.big-btn { flex: 1; padding: 15px 10px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 16.5px; font-weight: 700; background: var(--card); color: var(--ink); }
.big-btn.primary { background: var(--verm); border-color: var(--verm); color: #fff7ec; }
.big-btn.done { background: var(--saff-bg); border-color: var(--saff); color: var(--ink); }
.big-btn.ghost { background: var(--bg); }

/* ── यात्रा ── */
#view-journey { padding: 18px 16px; }
.journey-head h2 { font-family: "Iowan Old Style", Palatino, Georgia, serif; }
#j-meta { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }
#view-journey h3 { font-size: 16.5px; margin: 14px 0 4px; }
.j-note { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.thread { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; }
.thread b { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 16.5px; }
.thread .note { font-size: 14px; color: var(--muted); margin-top: 5px; }
.thread .del { float: right; background: none; border: 0; color: var(--muted); font-size: 13.5px; }
.quiet { margin-top: 26px; background: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; color: var(--muted); width: 100%; font-size: 15px; }
.mirror-btn { background: var(--gold-bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 15.5px; color: var(--ink); margin-bottom: 14px; width: 100%; text-align: left; }
.mirror-out { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--saff); border-radius: 12px; padding: 15px 17px; font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 16.5px; line-height: 1.65; white-space: pre-wrap; margin-bottom: 20px; }

/* ── what Baba sees in you ── */
.inner-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; margin-bottom: 9px; }
.inner-item.carries { border-left: 4px solid var(--ok); }
.inner-item.binds { border-left: 4px solid var(--saff); }
.inner-item b { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 16px; }
.inner-item .ev { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.inner-item .acts { float: right; display: flex; gap: 12px; }
.inner-item .acts button { background: none; border: 0; color: var(--muted); font-size: 13px; }
.inner-empty { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
