/* Mobile-first, plain CSS */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f6f3ef;
  font-size: 1.05rem;
  -webkit-text-size-adjust: 100%;
}
a { color: #0a5; }
a:focus-visible { outline: 2px solid #0a5; outline-offset: 2px; }
a.tree-back-link {
  text-decoration: none;
  color: #666;
  font-weight: 500;
}
a.tree-back-link:hover { color: #0a5; text-decoration: none; }
main { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
main.public-main { padding-top: 1rem; }

/* Public site top bar */
body.is-public { background: #f6f3ef; }
.public-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0dcd4;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 4px 20px rgba(0,0,0,.04);
  margin: 0;
}
.public-topbar__inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.public-topbar__member-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.public-topbar__member-nav a {
  color: #2a3d35;
  text-decoration: none;
}
.public-topbar__member-nav a:hover {
  color: #0a5;
  text-decoration: underline;
}
.public-topbar__member-nav a:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 3px;
  border-radius: 0.2rem;
}
.public-topbar__brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.public-topbar__brand:hover { color: #0a5; }
.public-topbar__brand:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 3px;
  border-radius: 0.25rem;
}
.public-topbar__logout { margin: 0; }
.public-topbar__signout {
  min-height: 2.35rem;
  padding: 0.38rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #f4f2ef;
  background: #2a322f;
  border: 1px solid #1c2220;
  border-radius: 0.45rem;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.public-topbar__signout:hover { background: #3a4541; }
.public-topbar__signout:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}

/* Public signed-in: member profile card */
.public-member-profile {
  position: relative;
  margin: 0 0 1.15rem;
  padding: 1.1rem 1.2rem 1.15rem;
  border-radius: 0.65rem;
  border: 1px solid #e0d8ce;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, #faf8f4 48%, #f5f1ea 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 8px 28px rgba(45, 40, 30, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.public-member-profile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0a5 0%, #1b8a52 35%, #1565c0 100%);
  border-radius: 0.65rem 0.65rem 0 0;
}
.public-member-profile__id-line {
  margin: 0;
  font-weight: 600;
  color: #1a1816;
  line-height: 1.5;
}
.public-member-profile__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
}
.public-member-profile__display-name {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: #1a1816;
  line-height: 1.35;
  word-break: break-word;
  min-width: 0;
}
.head-pill.head-pill--public-profile {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 0.22rem 0.55rem 0.24rem;
  vertical-align: middle;
}
.public-member-profile__phone {
  margin: 0.65rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
}
.public-member-profile__id {
  display: inline-block;
  vertical-align: baseline;
  padding: 0.3rem 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 0%, #f0ebe4 100%);
  border: 1px solid #d4cbc0;
  border-radius: 0.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Public hub: Donation + Tree */
.public-hub {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}
.hub-card {
  position: relative;
  background: linear-gradient(165deg, #fbfaf8 0%, #fff 55%);
  border: 1px solid #e6e0d8;
  border-radius: 0.5rem;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  min-height: 8rem;
  overflow: hidden;
}
.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--hub-accent, #0a5);
  border-radius: 0.5rem 0.5rem 0 0;
}
.hub-card--donation { --hub-accent: #1565c0; }
.hub-card--tree { --hub-accent: #0a5; }
.hub-card--expense { --hub-accent: #c45c26; }
.hub-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #111;
}
.hub-card__desc {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.hub-card__subhead {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.hub-card__body { flex: 1; min-width: 0; }
.hub-card__actions {
  margin-top: auto;
  padding-top: 0.75rem;
}
.hub-card__cta {
  text-decoration: none;
  display: inline-block;
}
.hub-card--tree .hub-card__actions { margin-top: 0.5rem; }
h1 { font-size: 1.35rem; margin: 0 0 0.75rem; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 1rem;
}
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
input[type="text"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.35rem;
  min-height: 2.75rem;
}
/* Normalize search: remove Safari/Chrome default decoration so it matches other inputs */
input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.35rem;
  background: #0a5;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  min-height: 2.75rem;
  line-height: 1.25;
  text-align: center;
}
button.secondary,
a.secondary {
  background: #444;
  color: #fff;
  text-decoration: none;
}
a.secondary:visited {
  color: #fff;
}
a.secondary:hover {
  background: #555;
  color: #fff;
}
button.danger,
a.danger {
  background: #a30;
  color: #fff;
  text-decoration: none;
}
a.danger:visited { color: #fff; }
a.danger:hover { background: #b40; color: #fff; }
.muted { color: #666; font-size: 0.9rem; }
.flash {
  background: #e8f5e9;
  border: 1px solid #8bc34a;
  padding: 0.75rem 1rem;
  border-radius: 0.35rem;
  margin-bottom: 1rem;
}
.alert { color: #a30; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.5rem 0.35rem; border-bottom: 1px solid #e0e0e0; }
th { background: #fafafa; }

/* Table row: paired actions (e.g. Edit + Remove) — same size and baseline */
td.cell-actions { vertical-align: middle; }
.cell-actions__group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cell-actions__group form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.cell-actions__group .btn,
.cell-actions__group button.danger {
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

/* Admin: top bar + nav (see _layout_admin.php) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.is-admin { background: #f2eeea; }
body.is-admin main.admin-main {
  max-width: 56rem;
}
.admin-back-wrap { margin-top: 1rem; }
a.admin-back-link {
  text-decoration: none;
  font-weight: 600;
  color: #234536;
}
a.admin-back-link:hover {
  text-decoration: none;
  color: #0a5;
}
a.admin-back-link:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 3px;
  border-radius: 0.2rem;
}

/* Admin people list: filters, exports, sortable table */
.people-filter-row select {
  max-width: 22rem;
}
.people-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
}
.people-toolbar__new { margin: 0; }
.people-toolbar__export {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.people-toolbar__export .btn {
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  min-height: 2.5rem;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
}
table.people-table { min-width: 42rem; }
.people-invite-cell { vertical-align: top; }
.people-invite-cell .invite-wa-link {
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  min-height: 2.05rem;
  font-weight: 600;
}
a.th-sort {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
a.th-sort:hover { text-decoration: underline; color: #0a5; }
.sort-ind { font-weight: 400; color: #666; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0dcd4;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 4px 20px rgba(0,0,0,.04);
  margin: 0;
}
.admin-topbar__inner {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0.85rem clamp(1rem, 4vw, 2rem) 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.admin-nav {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
}
.admin-topbar__logout {
  margin: 0;
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}
.admin-topbar__signout {
  min-height: 2.35rem;
  padding: 0.38rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #f4f2ef;
  background: #2a322f;
  border: 1px solid #1c2220;
  border-radius: 0.45rem;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.admin-topbar__signout:hover { background: #3a4541; }
.admin-topbar__signout:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}
.admin-nav__link {
  text-decoration: none;
  color: #234536;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.42rem 0.75rem;
  border-radius: 0.4rem;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.admin-nav__link:hover {
  background: #e0f0e6;
  color: #053;
}
.admin-nav__link--active {
  color: #fff;
  background: #0a5;
  border-color: #095;
  box-shadow: 0 1px 4px rgba(0, 110, 55, 0.28);
}
.admin-nav__link--active:hover {
  background: #099649;
  color: #fff;
}
.admin-nav__link--subtle {
  font-weight: 500;
  color: #4d6358;
  background: #f6f3ef;
  border: 1px dashed #b5c4bb;
  margin-left: 0.15rem;
}
.admin-nav__link--subtle:hover {
  color: #0a5;
  background: #eef6f0;
  border-color: #0a5;
  border-style: solid;
}
.admin-nav__link:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}
.badge { display: inline-block; padding: 0.15rem 0.4rem; font-size: 0.75rem; background: #eee; border-radius: 0.25rem; }
code.member-id { font-size: 0.95em; background: #f0f0f0; padding: 0.2rem 0.4rem; border-radius: 0.2rem; word-break: break-all; }
.tree-list { list-style: none; margin: 0.25rem 0 0 0.5rem; padding: 0; border-left: 1px solid #ccc; }
.tree-list .tree-list { margin-left: 0.4rem; }
.tree-node { font-weight: 600; }

/* Public family tree: top-down, scroll X+Y, viewer card highlighted */
.family-tree-lang[data-lang="gu"] .ft-name--en { display: none !important; }
.family-tree-lang[data-lang="en"] .ft-name--gu { display: none !important; }
.family-tree-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.family-tree-download-wrap {
  margin-left: auto;
  flex: 0 0 auto;
}
@media (max-width: 34rem) {
  .family-tree-download-wrap {
    margin-left: 0;
    width: 100%;
  }
  .family-tree-download-wrap .btn { width: 100%; justify-content: center; }
}
/* Expand scroll box so PNG export includes the whole tree (not only the viewport) */
.family-tree-scroll.family-tree-scroll--capture {
  overflow: visible !important;
  max-height: none !important;
  max-width: none !important;
  min-height: auto !important;
}
.family-tree-lang-toggle {
  border: 1px solid #e0d8ce;
  border-radius: 0.45rem;
  padding: 0.65rem 1rem 0.7rem;
  margin: 0 0 1rem;
  background: linear-gradient(180deg, #faf8f4 0%, #fff 100%);
}
.family-tree-lang-toggle__legend {
  padding: 0;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c574f;
  border: 0;
}
.family-tree-lang-toggle__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
  cursor: pointer;
}
.family-tree-lang-toggle__opt input {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  accent-color: #0a5;
  cursor: pointer;
}
.tree-family-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
/* align-items: flex-start — centering a wide flex child makes left overflow unreachable (scrollLeft ≥ 0) */
.family-tree-scroll {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  min-height: min(85vh, 56rem);
  max-height: min(85vh, 56rem);
  padding: 1rem 1rem 1.25rem;
  margin: 0.5rem 0 0;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #f7f4ef 0%, #fdfcfa 45%, #fff 100%);
  border: 1px solid #e4ddd3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.family-tree-scroll:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}
.family-tree-forest {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  min-width: min-content;
  padding: 0.25rem 0.5rem 0.5rem 0;
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}
.family-tree-flat {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.85rem;
  align-items: stretch;
  justify-content: center;
  min-width: min-content;
}
.ft-flat-card {
  flex: 0 0 auto;
  max-width: 16rem;
}
/* Top-down: card column, stem, horizontal bar, child verticals */
.ft-unit--vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: min-content;
}
.ft-node-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: min-content;
}
.ft-node {
  flex-shrink: 0;
}
/* Parent trunk: meets top border of .ft-children-row (no gap) */
.ft-junction__stem {
  width: 2px;
  height: 0.7rem;
  min-height: 0.7rem;
  background: #c5bfb4;
  flex-shrink: 0;
  margin-bottom: -1px; /* meet 2px horizontal bar with no visible gap */
}
.ft-children-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  min-width: min-content;
  position: relative;
}
/* Horizontal segment only between first & last child card centers (--ft-h-* set by JS) */
.ft-children-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--ft-h-start, 0);
  right: var(--ft-h-end, 0);
  height: 2px;
  background: #c5bfb4;
  pointer-events: none;
}
/* Drop from horizontal bar down to each child subtree */
.ft-branch-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 0.7rem;
  min-width: min-content;
}
.ft-branch-v::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 0.7rem;
  transform: translateX(-50%);
  background: #c5bfb4;
  pointer-events: none;
}
.ft-card {
  min-width: 10.5rem;
  max-width: 15rem;
  padding: 0.65rem 0.85rem 0.7rem;
  background: #fff;
  border: 1px solid #d8d0c4;
  border-radius: 0.45rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 0 rgba(255,255,255,.8) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}
.ft-card--you {
  border-color: #0a5;
  background: linear-gradient(165deg, #e8f7ee 0%, #f4fbf7 55%, #fff 100%);
  box-shadow:
    0 0 0 2px rgba(10, 130, 70, 0.28),
    0 4px 14px rgba(10, 90, 50, 0.12),
    0 1px 0 rgba(255,255,255,.9) inset;
}
.ft-card--you .ft-card__name {
  color: #053a1f;
}
.ft-card--you .badge {
  background: #0a5;
  color: #fff;
  font-weight: 700;
}
.ft-card__name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #141210;
  word-break: break-word;
  text-align: center;
}
a.ft-card__person-link {
  color: inherit;
  text-decoration: none;
}
a.ft-card__person-link:hover {
  color: #0a5;
  text-decoration: underline;
}
.ft-card--you a.ft-card__person-link:hover {
  color: #042;
}
.ft-name { display: inline; }
.ft-card__spouse .ft-name { font-weight: 600; }
.ft-card__spouse {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.35;
}
.ft-card .badge {
  font-size: 0.68rem;
  vertical-align: 0.08em;
}
.ft-card .spouse {
  font-weight: 500;
}
.spouse { color: #555; font-weight: 500; font-size: 0.95em; }
.row { margin-bottom: 0.9rem; }
hr.sep { border: 0; border-top: 1px solid #ddd; margin: 1.25rem 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.inline-form .row { margin: 0; flex: 1; min-width: 8rem; }
/* Space between inline fields and full-width row below (e.g. donation note) */
.inline-form + .row {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
}
.search-people .row { margin-bottom: 0.35rem; }
.search-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.search-actions .btn { margin: 0; }

/* Admin dashboard */
.dashboard-lead { color: #555; font-size: 0.95rem; margin: 0 0 1.25rem; line-height: 1.45; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.stat-card {
  --stat-accent: #0a5;
  position: relative;
  background: linear-gradient(165deg, #fbfaf8 0%, #fff 55%);
  border: 1px solid #e6e0d8;
  border-radius: 0.5rem;
  padding: 1rem 1rem 0.9rem;
  min-height: 6.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent);
  border-radius: 0.5rem 0.5rem 0 0;
}
.stat-card--people { --stat-accent: #0a5; }
.stat-card--heads { --stat-accent: #b8860b; }
.stat-card--money { --stat-accent: #1565c0; }
.stat-card--gifts { --stat-accent: #6a4c93; }
.stat-card--expense { --stat-accent: #c45c26; }
.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #111;
  margin: 0.15rem 0 0;
}
.stat-value--inr { font-size: 1.35rem; line-height: 1.25; word-break: break-word; }
.stat-label {
  order: -1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c574f;
  margin: 0;
}
.stat-hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.35rem;
  line-height: 1.3;
}
.stat-cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #0a5;
}
.stat-cta:hover { text-decoration: underline; }
.stat-cta:focus-visible { outline: 2px solid #0a5; outline-offset: 2px; border-radius: 0.2rem; }
.stat-card--heads .stat-cta { color: #8a6d1a; }
.stat-card--heads .stat-cta:hover { color: #6b5210; }
.stat-card--expense .stat-cta { color: #a34a1d; }
.stat-card--expense .stat-cta:hover { color: #7d3815; }

/* Admin: expenses — overall summary on list page */
.expense-overall {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem 1.05rem;
  border-radius: 0.5rem;
  border: 1px solid #e8d4c8;
  border-top: 4px solid #c45c26;
  background: linear-gradient(155deg, #fffaf6 0%, #fff 50%);
  box-shadow: 0 2px 10px rgba(196, 92, 38, 0.08);
}
.expense-overall__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c574f;
}
.expense-overall__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1a1512;
  line-height: 1.2;
}

/* Public read-only expenses page */
.public-expenses__block {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e4de;
}
.public-expenses__heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #1a1a1a;
}
.public-expenses__sub {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

/* New person form: callout + family head pill + option row */
.form-callout {
  margin: 0 0 0.5rem;
  padding: 1rem 1.1rem 1.05rem;
  background: linear-gradient(150deg, #f9f7f2 0%, #f2ede4 100%);
  border: 1px solid #e0d8ce;
  border-left: 4px solid #0a5;
  border-radius: 0.45rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.form-callout__text {
  margin: 0;
  color: #3d3a36;
  line-height: 1.5;
  font-size: 0.95rem;
}
.form-callout__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin-top: 0.8rem;
}
a.callout-link {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.25;
  border-radius: 999px;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
a.callout-link:first-of-type {
  color: #fff;
  background: #0a5;
  border: 1px solid #094;
  box-shadow: 0 1px 3px rgba(0,100,50,.2);
}
a.callout-link:first-of-type:hover { background: #088f48; }
a.callout-link + a.callout-link {
  color: #0a5;
  background: #fff;
  border: 1px solid #0a5;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
a.callout-link + a.callout-link:hover { background: #f0faf4; }
a.callout-link:focus-visible {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}
.form-section-title { margin: 1.25rem 0 0.5rem; }
label.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 0.75rem 0 1.1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid #e4ddd3;
  border-radius: 0.45rem;
  background: linear-gradient(180deg, #fffcf8 0%, #faf7f1 100%);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
label.option-card:hover { border-color: #cfc4b6; }
label.option-card:has(.option-card__input:focus-visible) {
  outline: 2px solid #0a5;
  outline-offset: 2px;
}
.option-card__input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0.1rem 0 0;
  flex-shrink: 0;
  accent-color: #0a5;
  cursor: pointer;
}
.option-card__body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.option-card__title { font-weight: 700; font-size: 0.98rem; color: #222; }
.option-card__desc { font-size: 0.86rem; color: #5a5650; font-weight: 400; line-height: 1.45; }
.head-pill {
  display: inline-block;
  padding: 0.18rem 0.5rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5c4812;
  background: linear-gradient(180deg, #fff9e6 0%, #f8e6b0 100%);
  border: 1px solid #c9a03a;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(180,130,0,.12);
  vertical-align: 0.12em;
  line-height: 1.2;
  margin: 0 0 0 0.4rem;
}
h1 .head-pill { margin: 0; vertical-align: middle; }
.people-name-line .head-pill--table { margin: 0; }
.head-pill--table {
  font-size: 0.62rem;
  padding: 0.12rem 0.4rem 0.14rem;
  vertical-align: middle;
}
.people-name-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; max-width: 100%; }
.people-name-cell { vertical-align: middle; }
.profile-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.25rem;
}
.profile-title__name { line-height: 1.3; }

@media (min-width: 36rem) {
  .public-hub {
    grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
    align-items: stretch;
  }
}

@media (min-width: 50rem) {
  main { max-width: 56rem; }
  .public-topbar__inner { max-width: 56rem; }
  main.public-main { max-width: 56rem; }
  .stat-value { font-size: 1.85rem; }
  .stat-value--inr { font-size: 1.45rem; }
}

/* -------------------------------------------------------------------------- */
/* Admin standalone reports (donation + family heads)                           */
/* -------------------------------------------------------------------------- */
.report-page__head {
  text-align: center;
  margin: 0 0 0.25rem;
}
.report-page__head .report-page__org {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  color: #1f1c19;
  letter-spacing: -0.01em;
}
.report-page__head .report-page__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.75rem;
  color: #3d3833;
}
.report-page__title-gu {
  font-weight: 600;
}
.report-page__title-sep {
  font-weight: 400;
  opacity: 0.65;
  padding: 0 0.2em;
}
.report-toolbar {
  padding: 0.75rem 1rem;
  margin: 0 -1rem 1rem -1rem;
  background: #f2eeea;
  border: 1px solid #e0dcd4;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
@media print {
  body.is-admin .report-toolbar.no-print { display: none !important; }
  body.is-admin .admin-topbar,
  body.is-admin form.admin-topbar__logout { display: none !important; }
  body.is-admin .admin-main { padding-top: 0; }
  body.is-admin .flash { display: none !important; }
  body.is-admin .no-print { display: none !important; }
  body.is-admin a[href]::after { content: none !important; }
  body.is-admin .report-page a:link,
  body.is-admin .report-page a:visited { color: inherit; text-decoration: none; }
  /* <tfoot> repeats on every printed page by default; show totals only once at end */
  body.is-admin .report-page table tfoot {
    display: table-row-group;
  }
}
