/* ===========================
   Prayer App — Global Styles
   =========================== */

/* ---------- Tokens ---------- */
:root {
  --bg:        #FAF8F5;
  --bg-card:   #FFFDF8;
  --text:      #3D2B1F;
  --text-muted:#8A7060;
  --gold:      #C9A84C;
  --gold-light:#E8D194;
  --gold-dark: #A07C30;
  --border:    #EAE2D6;
  --shadow:    0 4px 24px rgba(61,43,31,.10);
  --shadow-sm: 0 2px 8px  rgba(61,43,31,.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei",
           BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout Wrapper ---------- */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
}

/* ---------- Top Bar ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,248,245,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.top-bar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.top-bar .logo-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.top-bar .logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

/* Lang Toggle */
.lang-toggle {
  display: flex;
  background: rgba(232,224,213,.7);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 4px 11px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.lang-toggle button.active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 1px 4px rgba(201,168,76,.35);
}

/* ---------- Page Content ---------- */
.page-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Cross Banner ---------- */
.cross-banner {
  position: relative;
  width: calc(100% + 40px);
  margin: -20px -20px 0;
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f0e8;
}
.cross-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.cross-banner-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, #f5f0e8);
}

/* ---------- Page Title ---------- */
.page-title {
  text-align: center;
  padding: 4px 0 2px;
}
.page-title h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.4px;
  line-height: 1.4;
}
.page-title p {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-sub-ref {
  display: block;
  text-align: right;
  margin-top: 2px;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .65px;
  margin-bottom: 12px;
}

/* ---------- Form Elements ---------- */
textarea, input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.13);
}

/* ---- Reminder Card ---- */
.reminder-card {
  padding: 20px;
  background: #fffef9;
  border-radius: 16px;
  border: 0.5px solid #e2d9c5;
}

/* Header row */
.reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reminder-title {
  font-size: 13px;
  font-weight: 500;
  color: #9e9087;
}

.reminder-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.reminder-badge::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.reminder-badge.granted {
  background: #e8f5e9;
  color: #2e7d32;
}

.reminder-badge.granted::before {
  background: #4caf50;
}

.reminder-badge.denied {
  background: #fdecea;
  color: #c62828;
}

.reminder-badge.denied::before {
  background: #f44336;
}

.reminder-badge.default {
  background: #fff8e1;
  color: #8a6200;
}

.reminder-badge.default::before {
  background: #ffc107;
}

/* Divider */
.reminder-divider {
  border-top: 0.5px solid #e2d9c5;
  margin: 12px 0;
}

/* Time block + button row — Row / crossAxisAlignment: stretch */
.reminder-row {
  display: flex;
  align-items: stretch;   /* CrossAxisAlignment.stretch */
  gap: 10px;
  height: 100px;          /* fixed row height */
}

/* Left: Expanded — fills remaining width */
.reminder-time-block {
  flex: 1;                /* Expanded */
  background: #fdf6e3;
  border: 1.5px solid #c9a84c;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.reminder-time-label {
  font-size: 10px;
  color: #a07c30;
  font-weight: 500;
  letter-spacing: 0.03em;
  user-select: none;
}

.reminder-time-text {
  font-size: 24px;
  font-weight: 700;
  color: #7a5c1e;
  font-family: var(--font);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Right: fixed width 90px, same radius & height as sibling */
.btn-save-reminder {
  width: 90px;
  flex: none;
  background: #b8892a;
  color: #fff;
  border: none;
  border-radius: 14px;    /* 与时间块完全一致 */
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background .18s;
  line-height: 1.4;
}

.btn-save-reminder:hover  { background: #a07c24; }
.btn-save-reminder:active { background: #8a6a1c; }

/* Permission request button — outline style */
.btn-perm-request {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid #b8892a;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--font);
  color: #b8892a;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.btn-perm-request:hover {
  background: rgba(184,137,42,0.06);
}

/* Footer: clock icon + status text */
.reminder-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.reminder-footer-icon {
  color: #c0b8a8;
  flex: none;
  line-height: 0;
}

.reminder-footer-text {
  font-size: 11px;
  color: #bbb;
  line-height: 1.4;
}

textarea {
  min-height: 110px;
}

::placeholder { color: #BBA898; }

/* ---------- Radio / Topic Selector ---------- */
.tone-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.tone-option {
  position: relative;
}

.tone-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.tone-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  transition: var(--transition);
  user-select: none;
  letter-spacing: .1px;
  line-height: 1.3;
  text-align: center;
}

.tone-option input[type="radio"]:checked + label {
  border-color: var(--gold);
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  color: var(--gold-dark);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}

.tone-option label:hover {
  border-color: var(--gold-light);
  color: var(--text);
  background: #FFFBF2;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  padding: 12px 20px;
  white-space: nowrap;
}

.btn-primary {
  background: #b8892a;
  color: #fff;
  width: 100%;
  letter-spacing: .2px;
}

.btn-primary:hover  { background: #a07c24; }
.btn-primary:active { background: #8a6a1c; }

.btn-primary:disabled {
  opacity: .55;
  pointer-events: none;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--gold-light);
  background: #FFF9EE;
  color: var(--gold-dark);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
}

.btn-icon:hover {
  border-color: var(--gold-light);
  color: var(--gold);
  background: #FFF9EE;
}

/* ---------- Verse Card (vellum style) ---------- */
.verse-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn .4s ease both;
}

.verse-card {
  position: relative;
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  border: 1px solid rgba(184,150,58,.45);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(120,80,20,.07);
}

.verse-card .verse-text {
  font-size: 15px;
  line-height: 1.6;
  color: #2C1A0E;
  font-style: normal;
  font-family: "STKaiti", "KaiTi", "AR PL UKai CN", Georgia, "Times New Roman", serif;
  letter-spacing: .3px;
}

.verse-card .verse-ref {
  font-size: 12.5px;
  color: #C9A84C;
  margin-top: 10px;
  text-align: right;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .5px;
  font-family: "STKaiti", "KaiTi", Georgia, serif;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 8px 0;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  flex-shrink: 0;
  transition: background var(--transition);
}

.step-dot.active {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.2);
}

.step-dot.done {
  background: #5BBF8A;
}

/* ---------- Result Box ---------- */
.result-box {
  padding: 24px;
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  border: 1px solid rgba(184,150,58,0.5);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.9;
  color: #2C1508;
  font-family: STKaiti, KaiTi, Georgia, serif;
  word-break: break-word;
}

.prayer-title {
  text-align: center;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prayer-title::before,
.prayer-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(184,150,58,0.5);
}

.prayer-body {
  margin: 0;
  text-indent: 2em;
}

.result-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 22px 0 24px 0;
}

/* 复制/朗读按钮：透明背景 + 金色描边 + SVG 图标对齐 */
.result-controls .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #C9A84C;
  border-radius: 8px;
  color: #C9A84C;
  font-family: "STKaiti", "KaiTi", Georgia, serif;
  letter-spacing: .4px;
  font-weight: 600;
  transition: var(--transition);
}

.result-controls .btn-secondary:hover {
  background: rgba(201,168,76,.08);
  border-color: #A8882A;
  color: #A8882A;
}

.result-controls .btn-secondary:hover svg {
  stroke: #A8882A;
}

/* Streaming cursor */
.cursor-blink {
  display: inline-block;
  width: 2px; height: 16px;
  background: #8A6020;
  border-radius: 1px;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink .9s step-end infinite;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%; transform: translateX(-50%);
  background: rgba(61,43,31,.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s, bottom .3s;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  bottom: 96px;
}

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(250,248,245,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: transform var(--transition);
}

.nav-item .nav-icon svg {
  color: inherit;
}

.nav-item.active {
  color: var(--gold-dark);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-item:hover { color: var(--gold); }

/* ---------- Section Divider (ornate gold) ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #A07C30;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font);
}

.divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent 0%, #C9A84C 50%, #E8D194 100%);
}

.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent 0%, #C9A84C 50%, #E8D194 100%);
}

/* ---------- Save Prompt Banner ---------- */
.save-prompt {
  background: linear-gradient(135deg, #FFF9EE, #FFEFD6);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: slideUp .4s cubic-bezier(.4,0,.2,1) both;
  box-shadow: 0 2px 8px rgba(201,168,76,.1);
}

.save-prompt p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.save-prompt .save-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Diary Page Specifics ---------- */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(201,168,76,.08);
}

.stat-card .stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold-dark);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: .2px;
}

/* Tag chips */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  position: relative;
}

.tag-chip input[type="checkbox"],
.tag-chip input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.tag-chip label {
  display: inline-block;
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg);
  transition: var(--transition);
  user-select: none;
}

.tag-chip input[type="checkbox"]:checked + label,
.tag-chip input[type="radio"]:checked + label {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 600;
}

.tag-chip label:hover { border-color: var(--gold-light); color: var(--text); }

/* Journal entries */
.date-group-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 4px 2px 2px;
  margin: 8px 0 10px;
}

.journal-entry {
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-md);
  padding: 14px 40px 14px 16px;
  position: relative;
  animation: slideUp .3s ease both;
  box-shadow: 0 2px 8px rgba(140,95,20,.06);
  margin-bottom: 16px;
}

.journal-entry .entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.journal-entry .entry-time {
  font-size: 12px;
  color: var(--text-muted);
}

.journal-entry .entry-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(201,168,76,.15);
  color: var(--gold-dark);
}

.journal-entry .entry-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: #2C1A0E;
}

.journal-entry .entry-delete {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(138,112,96,.4);
  font-size: 15px;
  padding: 4px;
  transition: color var(--transition);
  line-height: 1;
}
.journal-entry .entry-delete:hover { color: #E05555; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.7; }

/* ---------- Reminder Page ---------- */
.time-display {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-dark);
  text-align: center;
  letter-spacing: -1px;
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
}

.permission-badge.granted { background: #E8F8EF; color: #2D7A4F; }
.permission-badge.denied  { background: #FEF0F0; color: #C0392B; }
.permission-badge.default { background: #FFF9EE; color: var(--gold-dark); }

/* 金句框：羊皮纸风格，与经文卡片统一 */
.verse-box {
  background: linear-gradient(160deg, #FDF8E8 0%, #F7EBC8 60%, #FAF0D8 100%);
  border-left: 4px solid var(--gold);
  border-top: 1px solid rgba(184,150,58,.22);
  border-right: 1px solid rgba(184,150,58,.1);
  border-bottom: 1px solid rgba(184,150,58,.15);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px 14px 16px;
  font-size: 15px;
  line-height: 1.95;
  font-style: italic;
  font-family: "STKaiti", "KaiTi", Georgia, serif;
  color: #2C1A0E;
  box-shadow: 0 2px 10px rgba(120,80,20,.08);
}

/* Canvas share area */
#shareCanvas {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-light);
  display: block;
  box-shadow: 0 2px 12px rgba(120,80,20,.08);
}

/* ---------- Community Page ---------- */
.prayer-card {
  background: linear-gradient(135deg, #FFF9EE, #FFF3D4);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-md);
  padding: 16px;
  animation: slideUp .3s ease both;
  box-shadow: 0 2px 8px rgba(140,95,20,.06);
  margin-bottom: 14px;
}

.prayer-card .prayer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.prayer-card .author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.prayer-card .category-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(201,168,76,.14);
  color: var(--gold-dark);
}

.prayer-card .prayer-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: #2C1A0E;
  margin-bottom: 12px;
}

.prayer-card .prayer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.candle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid rgba(184,150,58,.4);
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gold-dark);
  transition: var(--transition);
  font-family: var(--font);
}

.candle-btn:hover, .candle-btn.lit {
  border-color: var(--gold);
  background: rgba(201,168,76,.1);
  color: var(--gold-dark);
}

.candle-btn.lit { pointer-events: none; }

.prayer-card .prayer-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: var(--transition);
  font-family: var(--font);
}

.filter-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201,168,76,.28);
}

/* ---------- API Key Input Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40,25,15,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #FFFDF8;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 20px 60px rgba(40,25,10,.22),
    0 0 0 1px rgba(184,150,58,.15);
  transform: translateY(20px);
  transition: transform .3s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.modal p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.65;
}

.modal .modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ---------- Auth Button ---------- */
#authBtn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50% !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Default icon via CSS so button isn't blank before JS runs */
#authBtn:empty::after {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.hidden { display: none !important; }

/* Fade animation */
.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive minor tweaks for wider screens */
@media (min-width: 481px) {
  .app-wrapper {
    box-shadow: 0 0 0 1px rgba(184,150,58,.12),
                0 8px 48px rgba(61,43,31,.08);
  }
}

/* ---------- Shared Component Styles ---------- */

/* Top bar actions wrapper */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Auth modal — logged-in state (hidden by default; JS shows when logged in) */
.auth-logged-in {
  display: none;
  text-align: center;
}

/* Result section flex column */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Auth avatar */
.auth-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  margin-bottom: 10px;
}

/* Auth user name */
.auth-username {
  font-weight: 700;
  margin: 0 0 4px;
}

/* Auth user email */
.auth-useremail {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* Auth sync status */
.auth-sync-status {
  font-size: 13px;
  color: #2D7A4F;
  margin: 0 0 16px;
}

/* Auth description in modal */
.auth-desc {
  color: var(--text-muted);
  margin: 8px 0 20px;
  font-size: 14px;
}

/* Auth Google sign-in button */
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Auth sign-out button */
.auth-signout-btn {
  width: 100%;
}

/* Char counter row */
.char-counter-row {
  text-align: right;
  margin-top: 4px;
}

.char-counter {
  font-size: 12px;
  color: var(--text-muted);
}

/* Full-width button */
.btn-full {
  width: 100%;
}

/* Flex row with gap */
.flex-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inline margin helpers */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-10 { margin-bottom: 10px; }

/* .reminder-status removed — replaced by .reminder-footer */

/* Diary picker select */
.diary-picker {
  margin-top: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
