* { box-sizing: border-box; }
body { margin: 0; }
.app-root {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #FAF6EC;
  color: #2A2A24;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 32px;
}

.hero {
  background: linear-gradient(160deg, #26314A 0%, #354260 55%, #E4A83B 130%);
  color: #FAF6EC;
  padding: 28px 20px 16px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}
.hero-eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.hero-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 30px; margin: 0 0 6px; line-height: 1.1; }
.hero-sub { font-size: 13px; opacity: .85; margin: 0; }
.hero-vine { margin-top: 14px; font-size: 15px; opacity: .55; letter-spacing: 2px; white-space: nowrap; overflow: hidden; }

.tabbar { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; text-decoration: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px; padding: 8px 12px;
  font-size: 11px; color: #6B7A4F; text-decoration: none; cursor: pointer;
}
.tab-btn.active { background: #6E7F4F; border-color: #6E7F4F; color: #FAF6EC; }
.tab-emoji { font-size: 18px; }
.tab-avatar { width: 26px; height: 26px; border-radius: 50%; }
.tab-label { font-weight: 600; white-space: nowrap; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }

.content { padding: 8px 16px 0; }
.section-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; margin: 14px 0 10px; cursor: default; }
.editable-name { cursor: pointer; }
.edit-hint { font-size: 13px; opacity: .4; }
.person-header { display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 44px; height: 44px; border-radius: 50%; margin-top: 10px; }

.badge-case {
  background: linear-gradient(160deg, #FBF2D9 0%, #F3E6C4 100%);
  border: 1px solid #E8D9A8; border-radius: 18px; padding: 14px 14px 10px; margin-bottom: 14px;
}
.badge-case-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.badge-case-head h3 { font-family: 'Fraunces', serif; font-size: 16px; margin: 0; color: #6B5A20; }
.badge-case-head span { font-size: 11px; color: #9C8A45; font-weight: 600; }
.badge-case-empty { font-size: 12px; color: #9C8A45; font-style: italic; padding: 6px 0 4px; }

.shield-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.shield { flex: 0 0 auto; width: 92px; text-align: center; }
.shield-icon-wrap {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; box-shadow: 0 3px 10px rgba(180, 140, 40, 0.25); border: 2px solid #E4A83B;
}
.shield img { width: 56px; height: 56px; }
.shield span { display: block; font-size: 10.5px; font-weight: 700; color: #6B5A20; margin-top: 2px; line-height: 1.2; }

.verse-box { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.verse-label { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: #26314A; }
.verse-input {
  width: 100%; border: none; background: #FAF6EC; border-radius: 10px; padding: 10px;
  font-family: 'Fraunces', serif; font-style: italic; font-size: 15px; resize: vertical;
  min-height: 54px; color: #2A2A24;
}
.verse-input:focus { outline: 2px solid #E4A83B; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.card { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 16px; padding: 12px 14px; }
.card-done { border-color: #B7C79A; background: #F5F8EE; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { display: flex; gap: 10px; align-items: flex-start; }
.card-icon { font-size: 22px; margin-top: 1px; }
.card-label { font-weight: 600; font-size: 14.5px; }
.card-sub { font-size: 11.5px; color: #8A8368; margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 6px; }

.check-btn {
  border: 1px solid #C9BE9C; background: #FAF6EC; color: #6B7A4F; border-radius: 999px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.check-btn.checked { background: #6E7F4F; border-color: #6E7F4F; color: #fff; }
.check-btn:focus-visible, .tab-btn:focus-visible, .small-btn:focus-visible { outline: 2px solid #E4A83B; outline-offset: 2px; }

.remove-btn { border: none; background: transparent; color: #B98A7C; font-size: 14px; cursor: pointer; padding: 4px; }

.branch { margin-top: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.leaf { font-size: 16px; }
.branch-empty { display: block; margin-top: 8px; font-size: 11.5px; color: #B4AC8C; font-style: italic; }

.add-goal-btn { margin-top: 12px; width: 100%; text-align: center; }
.add-goal-form { margin-top: 12px; background: #FFFFFF; border: 1px dashed #C9BE9C; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.add-goal-row { display: flex; gap: 6px; align-items: center; }
.text-input {
  border: 1px solid #E7DFC9; border-radius: 10px; padding: 9px 10px; font-size: 13.5px;
  font-family: 'Inter', sans-serif; background: #FAF6EC; color: #2A2A24; width: 100%;
}
.icon-input { width: 52px; text-align: center; flex: none; }
.select-input { border: 1px solid #E7DFC9; border-radius: 10px; padding: 9px 6px; font-size: 13px; background: #FAF6EC; flex: none; }
.name-edit { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; width: auto; }

.small-btn { border: 1px solid #C9BE9C; background: #FAF6EC; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: #6B7A4F; cursor: pointer; }
.small-btn.primary { background: #6E7F4F; border-color: #6E7F4F; color: #fff; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #26314A; color: #FAF6EC; padding: 9px 16px; border-radius: 999px; font-size: 12.5px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); z-index: 50;
}

.foot-note { text-align: center; margin-top: 22px; font-family: 'Fraunces', serif; font-style: italic; font-size: 12.5px; color: #A6A07E; padding: 0 20px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- new: header admin gear ---------- */
.hero { position: relative; }
.admin-gear {
  position: absolute; top: 20px; right: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #FAF6EC;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 15px;
}
.admin-gear:hover { background: rgba(255,255,255,0.22); }

/* ---------- new: verse of the day ---------- */
.votd-box {
  background: #F1EAD6; border: 1px solid #E7DFC9; border-radius: 16px;
  padding: 12px 14px; margin-bottom: 12px;
}
.votd-label { font-weight: 600; font-size: 12px; color: #8A7A45; margin-bottom: 6px; }
.votd-text { font-family: 'Fraunces', serif; font-style: italic; font-size: 14px; color: #2A2A24; }
.votd-ref { font-size: 11.5px; color: #8A8368; margin-top: 4px; text-align: right; }

/* ---------- new: shield emoji fallback ---------- */
.shield-icon-wrap .shield-emoji { font-size: 46px; line-height: 1; display: block; }

/* ---------- new: bible link card ---------- */
.bible-link-card {
  display: block; background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px;
  padding: 12px 14px; margin: 10px 0 14px; font-weight: 600; font-size: 13.5px;
  color: #354260; text-decoration: none;
}
.bible-link-card:hover { border-color: #B7C79A; }

/* ---------- new: bible tracker page ---------- */
.wide-root { max-width: 1100px; }
.bible-topbar { padding: 12px 16px 0; }
.bible-content { padding-top: 14px; }

.bible-summary-card {
  background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 18px;
  padding: 18px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.bible-ring {
  --pct: 0;
  width: 96px; height: 96px; border-radius: 50%; flex: none;
  background: conic-gradient(#6E7F4F calc(var(--pct) * 1%), #EFE7CF 0);
  display: flex; align-items: center; justify-content: center;
}
.bible-ring-inner {
  width: 74px; height: 74px; border-radius: 50%; background: #FAF6EC;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.bible-ring-pct { font-family: 'Fraunces', serif; font-weight: 700; font-size: 19px; }
.bible-ring-label { font-size: 9.5px; color: #8A8368; text-transform: uppercase; letter-spacing: .05em; }
.bible-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; flex: 1; min-width: 220px; }
.bible-stat { background: #FAF6EC; border-radius: 12px; padding: 10px 12px; }
.bible-stat-num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; color: #26314A; }
.bible-stat-label { font-size: 10.5px; color: #8A8368; margin-top: 2px; }

.bible-columns { display: grid; grid-template-columns: 1fr; gap: 18px; }
.bible-column-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bible-column-head h2 { font-family: 'Fraunces', serif; font-size: 18px; margin: 0; }
.bible-column-head span { font-size: 11.5px; color: #8A8368; }

.bible-book { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.bible-book-name { font-weight: 600; font-size: 12.5px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.bible-book-count { color: #8A8368; font-weight: 500; }
.bible-chapter-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.bible-chapter {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #E7DFC9;
  background: #FAF6EC; color: #6B7A4F; font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.bible-chapter.read { background: #6E7F4F; border-color: #6E7F4F; color: #fff; }
.bible-chapter:focus-visible { outline: 2px solid #E4A83B; outline-offset: 1px; }

/* ---------- new: admin page ---------- */
.admin-content { padding-bottom: 40px; }
.admin-section { margin-bottom: 30px; }
.admin-people-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-person-card { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 16px; padding: 14px; text-align: center; }
.admin-avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; border: 2px solid #E7DFC9; }
.admin-name-input { text-align: center; margin-bottom: 8px; font-weight: 600; }
.admin-avatar-controls { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.upload-label { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

.admin-progress-panel { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 16px; padding: 14px; }
.admin-progress-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-progress-controls .select-input, .admin-progress-controls input[type="date"] { flex: 1; min-width: 120px; }
.progress-dates-list { display: flex; flex-wrap: wrap; gap: 6px; }
.progress-date-chip {
  display: flex; align-items: center; gap: 6px; background: #FAF6EC; border: 1px solid #E7DFC9;
  border-radius: 999px; padding: 5px 10px; font-size: 11.5px;
}

.admin-badges-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.admin-badge-row { display: flex; align-items: center; gap: 10px; background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px; padding: 10px 12px; }
.admin-badge-icon { width: 34px; height: 34px; }
.admin-badge-icon-emoji { font-size: 26px; width: 34px; text-align: center; }
.admin-badge-info { flex: 1; }
.admin-badge-label { font-weight: 600; font-size: 13.5px; }
.admin-badge-sub { font-size: 11px; color: #8A8368; margin-top: 2px; }
.admin-badge-form { margin-top: 6px; }
.badge-trackers-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.badge-tracker-checkbox { font-size: 12px; display: flex; align-items: center; gap: 4px; background: #FAF6EC; border: 1px solid #E7DFC9; border-radius: 8px; padding: 5px 8px; }

/* ==================== DESKTOP / WIDE VIEWPORT ==================== */
@media (min-width: 720px) {
  .app-root { max-width: 720px; padding-bottom: 48px; }
  .wide-root { max-width: 1100px; }

  .hero { border-radius: 0 0 28px 28px; padding: 34px 32px 20px; }
  .hero-title { font-size: 36px; }
  .content { padding: 8px 32px 0; }

  .tabbar { padding: 16px 32px 4px; flex-wrap: wrap; overflow: visible; }
  .tab-btn { padding: 10px 16px; }

  .card-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: start; }

  .shield-row { flex-wrap: wrap; overflow: visible; }

  .bible-columns { grid-template-columns: 1fr 1fr; }
  .bible-topbar, .admin-content { padding-left: 32px; padding-right: 32px; }

  .admin-people-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-progress-controls { flex-wrap: nowrap; }
}

@media (min-width: 1040px) {
  .app-root { max-width: 960px; }
  .card-list { grid-template-columns: repeat(2, 1fr); }
  .admin-people-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- v2 additions ---------- */

.card-icon-img { width: 24px; height: 24px; margin-top: 1px; }

/* admin per-person feature toggles */
.admin-toggles { margin-top: 10px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.admin-toggle-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #6B7A4F; }

/* goal management rows (family + person + stories share this look) */
.goal-manage-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.goal-manage-row { display: flex; align-items: center; gap: 10px; background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px; padding: 10px 12px; flex-wrap: wrap; }
.goal-manage-icon { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.goal-manage-icon-emoji { font-size: 22px; width: 28px; text-align: center; }
.goal-manage-info { flex: 1; min-width: 160px; display: flex; gap: 6px; }
.goal-manage-info .goal-label-input { flex: 1; min-width: 0; font-weight: 600; }
.goal-manage-info .goal-freq-select { flex: none; width: 88px; font-size: 11.5px; }
.goal-reorder { display: flex; flex-direction: column; gap: 2px; }
.reorder-btn {
  width: 22px; height: 18px; border: 1px solid #E7DFC9; background: #FAF6EC; border-radius: 4px;
  font-size: 9px; color: #6B7A4F; cursor: pointer; line-height: 1; padding: 0;
}
.reorder-btn:disabled { opacity: 0.3; cursor: default; }
.goal-row-actions { display: flex; gap: 6px; align-items: center; width: 100%; justify-content: flex-end; margin-top: 4px; }
.upload-label.tiny { font-size: 11px; padding: 6px 9px; white-space: nowrap; }
#goal-person-select { margin-bottom: 12px; }
.admin-hint { font-size: 12px; color: #8A8368; margin: -6px 0 12px; }

/* story tracker grid */
.story-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.story-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 14px; padding: 12px 8px;
  cursor: pointer; text-align: center;
}
.story-card.read { background: #F5F8EE; border-color: #B7C79A; }
.story-icon { font-size: 26px; }
.story-icon-img { width: 32px; height: 32px; object-fit: contain; }
.story-title { font-size: 11px; font-weight: 600; color: #2A2A24; line-height: 1.25; }
.story-check { position: absolute; top: 6px; right: 8px; color: #6E7F4F; font-weight: 700; font-size: 13px; }

/* heatmap */
.heatmap-card { background: #FFFFFF; border: 1px solid #E7DFC9; border-radius: 16px; padding: 14px; margin-top: 16px; }
.heatmap-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.heatmap-head h3 { font-family: 'Fraunces', serif; font-size: 15px; margin: 0; }
.heatmap-head span { font-size: 11px; color: #8A8368; }
.heatmap-grid { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap-col { display: flex; flex-direction: column; gap: 3px; }
.heatmap-cell { width: 12px; height: 12px; border-radius: 3px; background: #EFE7CF; flex: none; }
.heatmap-cell-empty { background: transparent; }
.heatmap-cell.level-0 { background: #EFE7CF; }
.heatmap-cell.level-1 { background: #CFE0B0; }
.heatmap-cell.level-2 { background: #A8C97F; }
.heatmap-cell.level-3 { background: #7FA855; }
.heatmap-cell.level-4 { background: #4F6B2F; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 10px; color: #8A8368; }
.heatmap-legend .heatmap-cell { width: 10px; height: 10px; }

@media (min-width: 720px) {
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-toggles { flex-direction: row; gap: 14px; justify-content: center; }
}
