/* === St Sava NYC Cathedral Dashboard === */
/* Color palette inspired by the church icon:
   - Gold (halo)        #C8A04A
   - Deep red (frame)   #A63A2A
   - Dark olive (robes) #3E3528
   - Cream warm bg      #F5EDD8
   - Off-white surface  #FBF7EE
   - Charcoal text      #1A1612
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

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

:root {
  --gold: #C8A04A;
  --gold-light: #D4B86A;
  --gold-dark: #A8842F;
  --red: #A63A2A;
  --red-dark: #82281C;
  --olive: #3E3528;
  --cream: #F5EDD8;
  --surface: #FBF7EE;
  --text: #1A1612;
  --muted: #6B5F4A;
  --border: #E0D5BC;
  --shadow: 0 2px 12px rgba(62,53,40,0.08);
}

html, body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--olive);
  font-weight: 600;
  letter-spacing: 0.01em;
}

a { color: var(--red); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--red-dark); text-decoration: underline; }

/* === Layout === */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--olive);
  color: var(--cream);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  /* dvh = dynamic viewport height. On mobile Safari/Chrome `100vh` includes
     the chrome (address bar), so the bottom of the drawer — including the
     Sign Out link in .sidebar-footer — falls below the visible area when
     the address bar is showing. dvh tracks the actually-visible area. */
  height: 100dvh;
  overflow-y: auto;
}

.sidebar-header {
  text-align: center;
  padding: 0 1.5rem 1.1rem;
}

.sidebar-header img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  object-fit: cover;
  margin-bottom: 0.75rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.sidebar-header .church-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.sidebar-header .church-loc {
  font-size: 0.8rem;
  color: rgba(245,237,216,0.7);
}

.sidebar-nav { padding: 1rem 0.5rem; flex: 1; }

.sidebar-nav a {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--cream);
  border-radius: 6px;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: rgba(200,160,74,0.15);
  color: var(--gold);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: var(--gold);
  color: var(--olive);
  font-weight: 600;
}

.sidebar-nav a.active:hover { color: var(--olive); }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(200,160,74,0.2);
  font-size: 0.85rem;
}

.sidebar-footer .user-name { color: var(--gold); margin-bottom: 0.25rem; font-weight: 600; }
.sidebar-footer a { color: rgba(245,237,216,0.7); }
.sidebar-footer a:hover { color: var(--gold); }

.main {
  flex: 1;
  margin-left: 240px;
  padding: 2.5rem 3rem;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold);
  flex-wrap: wrap;  /* no-op when display is block; activates for our /me page-headers that set display:flex inline */
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.page-header .subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

/* === Stats grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
}

.stat-card.red { border-top-color: var(--red); }
.stat-card.olive { border-top-color: var(--olive); }

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--olive);
  line-height: 1;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* When a .card is an <a>, give it the same hover affordance as .corner-card
   so clickable cards behave consistently across the portal. Non-link .card
   divs (display-only) are unaffected. */
a.card {
  display: block;
  color: var(--text);
  text-decoration: none;
  transition: all 0.18s ease;
}
a.card:hover {
  background: white;
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(62, 53, 40, 0.10);
  text-decoration: none;
  color: var(--text);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.4rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1100px) { .card-grid { grid-template-columns: 1fr; } }

/* === Tables === */
table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--gold);
  font-weight: 600;
}

table.data td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

table.data tr:last-child td { border-bottom: none; }

table.data tr:hover td { background: rgba(200,160,74,0.05); }

table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

table.data .money {
  text-align: right;
  font-weight: 600;
  color: var(--olive);
  font-variant-numeric: tabular-nums;
}

/* === Bars (for monthly chart) === */
.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.bar-label { font-size: 0.9rem; color: var(--muted); font-weight: 500; }

.bar-bg {
  height: 24px;
  background: var(--cream);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 0 4px 4px 0;
}

.bar-value {
  font-weight: 600;
  color: var(--olive);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* === Filter bar === */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.filter-bar input, .filter-bar select {
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,160,74,0.2);
}

.filter-bar input[type=search] { width: 280px; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  background: var(--gold);
  color: var(--olive);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--gold-dark); color: white; text-decoration: none; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover { background: var(--cream); color: var(--olive); }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-eft { background: rgba(200,160,74,0.2); color: var(--gold-dark); }
.badge-square { background: rgba(166,58,42,0.15); color: var(--red); }
.badge-recurring { background: rgba(62,53,40,0.15); color: var(--olive); }
.badge-autopay { background: rgba(46,125,50,0.18); color: #2e7d32; }
.badge-mail { background: rgba(62,53,40,0.10); color: var(--olive); }

.fund-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
  color: var(--olive);
}

.fund-pill .amt { font-weight: 600; color: var(--gold-dark); margin-left: 0.25rem; }

/* === QStone Network masthead === */
/* Edge-to-edge bar at the very top of the login page (and any future entry
   page). Breaks out of the .login-page 1rem padding via negative margins so
   the underlying card + footer layout stays unchanged. Co-brands "Qstone
   Network" (parent) with "Parish Operations Platform" (product). Faint gold
   rule along the bottom ties it visually to the gold card-border. */
.qn-masthead {
  align-self: stretch;
  margin: -1rem -1rem 1rem;
  padding: 0.85rem 1rem 0.6rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 100%);
  border-bottom: 1px solid rgba(200,160,74,0.2);
}
.qn-masthead .qn-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--olive);
}
.qn-masthead .qn-network { color: var(--muted); font-weight: 500; }
.qn-masthead .qn-bar {
  width: 1px;
  height: 12px;
  background: var(--gold);
  display: inline-block;
}
@media (max-width: 480px) {
  .qn-masthead .qn-line {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    gap: 0.45rem;
  }
}

/* === Login page === */
/* Sticky-footer column: card stays vertically centered in remaining space
   via `margin: auto`; footer naturally lands at viewport bottom on short
   pages; on tall content the page scrolls and the footer flows after the
   card with no overlap. */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, var(--cream) 0%, #EDE0BE 100%);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  padding: 3rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(62,53,40,0.15);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border-top: 6px solid var(--gold);
  margin: auto;   /* vertical centering inside flex column */
}

.login-page > footer { margin-top: auto; }

.login-card img {
  width: 165px;
  height: 165px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  margin: 0 auto 1rem;
  display: block;
  background: white;
}

.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.login-card form { text-align: left; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,160,74,0.2);
}

.btn-block { width: 100%; padding: 0.85rem; font-size: 1rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-error { background: rgba(166,58,42,0.1); color: var(--red-dark); border: 1px solid rgba(166,58,42,0.3); }
.flash-success { background: rgba(62,110,42,0.12); color: #2A4D1F; border: 1px solid rgba(62,110,42,0.35); font-weight: 600; }
.flash-info    { background: rgba(60,90,110,0.10); color: var(--olive); border: 1px solid rgba(60,90,110,0.25); }

/* === Donor detail === */
.donor-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.donor-meta .item label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.donor-meta .item .value { font-size: 1rem; color: var(--text); }

.empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-style: italic;
}


/* --- donor detail / filters / extras --- */
.back-link { color: var(--red); text-decoration: none; font-size: 0.9rem; display: inline-block; margin-bottom: 0.5rem; }
.back-link:hover { text-decoration: underline; }

.card-grid.two-col { grid-template-columns: 1fr 1fr; }

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0.6rem 1rem; margin: 0; padding: 1rem 1.25rem; }
dl.kv dt { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
dl.kv dd { margin: 0; color: var(--ink); }

.big-number { font-family: 'Cormorant Garamond', serif; font-size: 3.2rem; font-weight: 600; color: var(--red); padding: 1.5rem 1.25rem 0.25rem; line-height: 1; }
.big-sub { color: var(--muted); padding: 0 1.25rem 1.5rem; }

.fund-line { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.9rem; padding: 1px 0; }
.fund-line .fund-name { color: var(--ink); }
.fund-line .fund-amt { color: var(--muted); font-variant-numeric: tabular-nums; }

.filter-bar { display: flex; gap: 1rem; align-items: end; padding: 1rem 1.25rem; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-bar label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-bar select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: white; font-size: 0.95rem; min-width: 180px; }
.filter-bar button { padding: 0.55rem 1.25rem; border: 0; background: var(--red); color: white; border-radius: 6px; font-size: 0.95rem; cursor: pointer; font-weight: 500; }
.filter-bar button:hover { background: var(--red-dark); }
.filter-bar .btn-clear { padding: 0.55rem 1rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.filter-bar .btn-clear:hover { color: var(--red); }

.badge-mail { background: rgba(200,160,74,0.15); color: var(--gold-dark); border: 1px solid rgba(200,160,74,0.4); }

table.data tfoot td { font-weight: 600; background: var(--cream); border-top: 2px solid var(--border); }

/* --- year tabs --- */

/* --- year tabs (refined Byzantine-style pills) --- */
.year-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0.5rem;
  background: linear-gradient(180deg, #FBF6E6 0%, var(--cream) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(62,53,40,0.04);
}
.year-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  color: var(--muted);
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.18s ease;
}
.year-tab:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.65);
  text-decoration: none;
}
.year-tab.active {
  color: white;
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  border-color: var(--red-dark);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 2px 6px rgba(166,58,42,0.35);
}
.year-tab.active::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(200,160,74,0.25);
}
.year-tab[data-label="All"] { font-style: italic; }


/* ========================================================
   Mobile / responsive (added 2026-04-30)
   ======================================================== */

/* Tablet & below: collapse sidebar to top bar */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 3px solid var(--gold);
  }

  .sidebar-header {
    padding: 0;
    border-bottom: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
  }

  .sidebar-header img { object-fit: contain;
    width: 44px; height: 44px;
    border-width: 2px;
    margin: 0;
  }

  .sidebar-header .church-name {
    font-size: 0.95rem;
    margin: 0;
    white-space: nowrap;
  }

  .sidebar-header .church-loc { display: none; }

  .sidebar-nav {
    padding: 0;
    flex: 1;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav a {
    padding: 0.45rem 0.85rem;
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .sidebar-footer {
    padding: 0;
    border-top: none;
    flex-shrink: 0;
    text-align: right;
  }

  .sidebar-footer .user-name { display: none; }
  .sidebar-footer a { font-size: 0.85rem; }

  .main {
    margin-left: 0;
    padding: 1.25rem 1rem 2rem;
    max-width: 100%;
  }

  .page-header { margin-bottom: 1.25rem; padding-bottom: 0.75rem; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header .subtitle { font-size: 0.85rem; }
}

/* Phone-specific tweaks */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card { padding: 1rem 1.1rem; }
  .stat-value { font-size: 1.75rem; }
  .stat-label { font-size: 0.7rem; }

  .card { padding: 1rem 1.1rem; margin-bottom: 1rem; }
  .card-header h2 { font-size: 1.15rem; }

  /* Tables become horizontally scrollable on phones */
  .card, .main > table.data {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.data {
    min-width: 480px;
    font-size: 0.88rem;
  }
  table.data th, table.data td {
    padding: 0.55rem 0.4rem;
    font-size: 0.85rem;
  }

  /* Wrap any direct-child table in a scroll container effectively */
  .main > table.data {
    display: block;
    width: 100%;
  }

  /* Bar-row chart: compact label/value columns */
  .bar-row {
    grid-template-columns: 50px 1fr 75px;
    gap: 0.5rem;
    padding: 0.4rem 0;
  }
  .bar-label { font-size: 0.8rem; }
  .bar-fill { font-size: 0.7rem; padding: 0 0.3rem; }
  .bar-value { font-size: 0.85rem; }

  /* Filter bar — stack form controls full-width */
  .filter-bar {
    padding: 0.85rem 1rem;
    gap: 0.6rem;
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar label { width: 100%; }
  .filter-bar select, .filter-bar input { width: 100%; min-width: 0; }
  .filter-bar input[type=search] { width: 100%; }
  .filter-bar button, .filter-bar .btn-clear { width: 100%; text-align: center; }

  /* Year tabs scroll horizontally rather than wrapping into many rows */
  .year-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.25rem;
  }
  .year-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.95rem;
  }

  /* Donor detail: kv-list stacks instead of two columns */
  dl.kv {
    grid-template-columns: 1fr;
    gap: 0.15rem 0;
    padding: 0.85rem 1rem;
  }
  dl.kv dt { margin-top: 0.35rem; }
  dl.kv dt:first-child { margin-top: 0; }

  .big-number { font-size: 2.4rem; padding: 1rem 1rem 0.25rem; }
  .big-sub { padding: 0 1rem 1rem; font-size: 0.85rem; }

  .card-grid.two-col, .card-grid { grid-template-columns: 1fr; gap: 1rem; }

  .donor-meta { gap: 0.6rem; }

  /* Login card on small phones */
  .login-card { padding: 2rem 1.5rem; max-width: 100%; }
  .login-card img { width: 135px; height: 135px; }
  .login-card h1 { font-size: 1.35rem; }

  /* Pills/badges stay readable */
  .fund-pill { font-size: 0.75rem; padding: 0.1rem 0.45rem; }
  .badge { font-size: 0.7rem; padding: 0.15rem 0.5rem; }
}

/* Very narrow (small phones) */
@media (max-width: 380px) {
  .sidebar-header .church-name { display: none; }
  .stat-value { font-size: 1.55rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
/* === Overview toolbar (year tabs + download merged into one pill bar) === */
.overview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0.5rem;
  background: linear-gradient(180deg, #FBF6E6 0%, var(--cream) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(62,53,40,0.04);
}
.overview-toolbar .year-tabs {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 auto;
}
.overview-toolbar .btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  margin-left: auto;
  background: var(--gold);
  color: var(--olive);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.overview-toolbar .btn-download:hover { background: var(--gold-dark); color: white; text-decoration: none; }
@media (max-width: 600px) {
  .overview-toolbar .btn-download { margin-left: 0; width: 100%; justify-content: center; }
}

/* === St Sava additions: expenses, stewardship, priest, forms === */

.btn-primary {
  background: var(--gold);
  color: white;
  border: 1px solid var(--gold-dark);
}
.btn-primary:hover { background: var(--gold-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--olive);
  border: 1px solid var(--border);
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(62,53,40,0.05);
}
.btn-ghost:hover {
  background: var(--cream);
  color: var(--olive);
  border-color: var(--gold);
  box-shadow: 0 2px 6px rgba(62,53,40,0.12);
  transform: translateY(-1px);
}

/* (Upload buttons reuse .btn-back styling — see definition further down.) */

.section-title {
  font-family: 'Cormorant Garamond', serif;
  color: var(--olive);
  font-size: 1.45rem;
  margin: 1.75rem 0 0.75rem;
  font-weight: 600;
}

.form-card {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 740px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.form-card label {
  /* Plain block (not flex-column) so the label text and the red asterisk
     stay on the same line ("Full Name *"), and the input below wraps
     naturally on its own line. Was flex-column with gap, which split each
     text node and span into separate rows. */
  display: block;
  font-size: 0.9rem;
  color: var(--olive);
  font-weight: 600;
  margin-bottom: 0;
}
.form-card label > input,
.form-card label > select,
.form-card label > textarea {
  display: block;
  margin-top: 0.15rem;   /* tiny breathing room under the label text */
}
.form-card input[type=text],
.form-card input[type=email],
.form-card input[type=tel],
.form-card input[type=password],
.form-card input[type=search],
.form-card input[type=url],
.form-card input[type=number],
.form-card input[type=date],
.form-card input[type=datetime-local],
.form-card input[type=time],
.form-card input[type=month],
.form-card input[type=week],
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font: inherit;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.progress-bar {
  display: inline-block;
  width: 80px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.3s ease;
}

.muted { color: var(--muted); }

table.data .badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  background: rgba(62,53,40,0.10);
  color: var(--olive);
  border-radius: 3px;
  margin-left: 0.4rem;
  letter-spacing: 0.04em;
}

/* Restoration fund featured card */
.featured-card {
  background: linear-gradient(135deg, var(--olive), #2A2118);
  color: var(--cream);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.featured-card .card-eyebrow {
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.featured-card h2 {
  color: var(--gold-light);
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  font-family: 'Cormorant Garamond', serif;
}
.featured-card .card-amount {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  color: white;
}
.featured-card .card-meta {
  color: rgba(245,237,216,0.7);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.featured-card .progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(245,237,216,0.15);
  margin: 0.6rem 0 0.4rem;
}

/* === Sveštenik Corner section cards === */
.corner-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.corner-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s ease;
  position: relative;
}
.corner-card:hover {
  background: white;
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(62,53,40,0.10);
  text-decoration: none;
  color: var(--text);
}
.corner-card h3 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--olive);
  margin-bottom: 0.4rem;
  font-size: 1.3rem;
}
.corner-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.corner-card .corner-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
  font-weight: 600;
}

/* === Priest's Office — sticky section nav ===
   Shared by /priest and /priest/section/<slug>. Each link goes to a
   dedicated page; .active highlights the current section. Scoped under
   .priest-section-nav so it cannot collide with /me/* or admin pages. */
.priest-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  margin: 0 0 1.5rem;
  background: linear-gradient(180deg, var(--cream) 0%, #ECE3CB 100%);
  border: 1px solid var(--gold);
  border-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(62,53,40,0.06);
}
.priest-section-nav .priest-section-link {
  font-family: 'Cormorant Garamond', serif;
  color: var(--olive);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.priest-section-nav .priest-section-link:hover {
  background: var(--gold);
  color: var(--cream);
}
.priest-section-nav .priest-section-link.active {
  background: var(--olive);
  color: var(--cream);
}

/* Notification badge shown next to a header-menu link when the
   underlying section has pending items (e.g. pending requests on
   Personal & Diocesan). Small red pill, sits inline with the link
   text. Stays readable on the .active dark background because the
   badge uses its own contrast colors, not the link's. */
.priest-section-nav .priest-nav-badge {
  display: inline-block;
  background: #a73e3e;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  margin-left: 0.45rem;
  vertical-align: middle;
  min-width: 1.2rem;
  text-align: center;
}

/* Badge inside a corner-card h3 (e.g. Requests card). Same pill style;
   "X new" string. Card itself gets a subtle red ring when it has the
   badge, so it stands out in the section-page grid. */
.corner-card .corner-card-badge {
  display: inline-block;
  background: #a73e3e;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.55rem;
  border-radius: 1rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}
.corner-card.corner-card-has-badge {
  box-shadow: 0 0 0 1px #a73e3e33, var(--shadow);
}
.corner-card.corner-card-has-badge:hover {
  box-shadow: 0 0 0 2px #a73e3e80, var(--shadow);
}

.priest-section {
  scroll-margin-top: 4rem;
}

/* Smaller, nicer Prev/Next buttons for the calendar's top toolbar.
   Replaces the bulkier .btn .btn-ghost on Prev/Next so the month-title
   stays the visual focus at the top. Subtle olive border on cream,
   fills with gold on hover. */
.calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2rem;
  padding: 0 0.7rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--olive);
  background: var(--surface);
  border: 1px solid var(--olive);
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.calendar-nav-btn:hover {
  background: var(--gold);
  color: var(--cream);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* Bottom toolbar — actions row below the month grid + agenda.
   Visually distinct from the top toolbar (centered, lighter background)
   so the calendar reads top-down: navigate → see month → take action. */
.calendar-toolbar-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0 0;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* === Orthodox calendar (priest's office) === */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.calendar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--olive);
  margin: 0;
  flex: 1;
  text-align: center;
}
.calendar-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 0.25rem auto 0;
}

table.calendar-grid {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(62,53,40,0.08);
  margin-bottom: 1.5rem;
}
table.calendar-grid thead th {
  background: var(--olive);
  color: var(--gold-light);
  padding: 0.7rem 0.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-right: 1px solid rgba(200,160,74,0.25);
  text-align: center;
}
table.calendar-grid thead th:last-child { border-right: none; }
table.calendar-grid tbody td.cal-cell {
  width: 14.28%;
  height: 110px;
  vertical-align: top;
  padding: 0.35rem 0.4rem;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  transition: background 0.15s ease;
}
table.calendar-grid tbody td.cal-cell:last-child { border-right: none; }
table.calendar-grid tbody td.cal-cell.cal-out {
  background: rgba(245,237,216,0.4);
  color: var(--muted);
}
table.calendar-grid tbody td.cal-cell.cal-out .cal-date { opacity: 0.4; }
table.calendar-grid tbody td.cal-cell.cal-today {
  background: linear-gradient(180deg, rgba(200,160,74,0.18), rgba(200,160,74,0.06));
  box-shadow: inset 0 0 0 2px var(--gold);
}
table.calendar-grid tbody td.cal-cell:hover { background: rgba(245,237,216,0.6); }
.cal-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--olive);
  margin-bottom: 0.25rem;
}
.cal-cell.cal-today .cal-date {
  color: var(--gold-dark);
  font-size: 1.2rem;
}
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px;
  font-size: 0.7rem;
  border-radius: 3px;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-weight: 500;
}
.cal-event:hover { filter: brightness(0.92); }
.cal-event-icon { font-size: 0.75rem; flex-shrink: 0; }
.cal-event-time { font-variant-numeric: tabular-nums; opacity: 0.85; flex-shrink: 0; font-size: 0.65rem; }
.cal-event-title { overflow: hidden; text-overflow: ellipsis; }
.cal-more {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
  margin-top: 1px;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}
.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--olive);
}
.cal-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* === This-week feed list (on Sveštenik's Office home) === */
.weekfeed { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.weekfeed-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: rgba(245,237,216,0.10);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  text-decoration: none;
  color: var(--cream);
  transition: background 0.15s;
}
.weekfeed-row:hover { background: rgba(245,237,216,0.20); color: var(--cream); text-decoration: none; }
.weekfeed-day {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--gold-light);
  min-width: 95px;
  font-weight: 600;
}
.weekfeed-icon {
  font-size: 1rem;
  color: var(--gold);
  width: 22px;
  text-align: center;
}
.weekfeed-title { flex: 1; font-size: 0.95rem; }
.weekfeed-cat {
  font-size: 0.72rem;
  color: rgba(245,237,216,0.65);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Donor detail action bar === */
.donor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 1.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.donor-actions .btn-action {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: white;
  border: 1px solid var(--gold-dark);
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 2px 6px rgba(168,132,47,0.18);
  transition: all 0.15s ease;
}
.donor-actions .btn-action:hover {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(168,132,47,0.28);
  color: white;
  text-decoration: none;
}
.donor-actions .btn-icon {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 1rem;
}
.donor-actions .action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}
.donor-actions .action-group-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.donor-actions .btn-tax {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: white;
  border: 1px solid var(--gold-dark);
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(168,132,47,0.18);
  transition: all 0.15s ease;
}
.donor-actions .btn-tax:hover {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(168,132,47,0.28);
  color: white;
  text-decoration: none;
}

/* === Login page — parish identity lines === */
.login-card .login-parish {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--olive);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 0.25rem;
}
.login-card .login-loc {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 1rem;
}
.login-card .subtitle {
  text-align: center;
}

/* === Expense import dropzone === */

.dropzone {
  display: block;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--gold);
  border-radius: 10px;
  background: var(--cream);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}
.dropzone:hover, .dropzone.dragover {
  background: rgba(200,160,74,0.18);
  border-color: var(--gold-dark);
  transform: scale(1.005);
}
.dropzone.has-file {
  background: rgba(46,125,50,0.08);
  border-color: var(--gold-dark);
}
.dropzone-icon {
  font-size: 2.4rem;
  color: var(--gold-dark);
  margin-bottom: 0.5rem;
}
.dropzone-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  color: var(--olive);
  margin-bottom: 0.4rem;
}
.dropzone-sub {
  font-size: 0.85rem;
}
.dropzone-filename {
  margin-top: 0.75rem;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.95rem;
}


/* === Sidebar user-name link to /account === */
.sidebar-footer .user-name-link {
  display: block;
  font-weight: 600;
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  text-decoration: none;
  margin-bottom: 0.25rem;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s ease;
}
.sidebar-footer .user-name-link:hover {
  text-decoration: none;
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* === Calendar day-detail === */
.day-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.day-events {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.day-event {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(62,53,40,0.05);
}
.day-event:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(62,53,40,0.10);
  text-decoration: none;
  color: var(--text);
}
.day-event-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
}
.day-event-body { flex: 1; min-width: 0; }
.day-event-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--olive);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.day-event-cat {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.day-event-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.day-event-time {
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
/* ============= Parishioner shell ============= */
body.me-shell { background: var(--cream); margin: 0; }
.me-header { background: linear-gradient(135deg, var(--olive), #2A2118); border-bottom: 3px solid var(--gold); padding: 1rem 0; }
/* Layout: brand → platform-brand (snug) | …auto-space… | nav (right).
   Tom feedback 2026-05-23: space-between was centering the platform
   brand between brand and nav, leaving a big gap. `margin-left: auto`
   on .me-nav absorbs the free space so brand + platform sit together. */
.me-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.me-header-inner .me-nav { margin-left: auto; }
.me-brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--cream); }
.me-brand img { height: 117px; width: 117px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.me-brand-eyebrow { font-size: 0.78rem; opacity: 0.7; letter-spacing: 0.05em; }
.me-brand-name { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: var(--gold-light); line-height: 1.1; }
.me-brand-loc { font-size: 0.82rem; opacity: 0.75; }

/* Parish Operations Platform — masthead aside (welcome page only).
   2026-05-21: thin gold vertical line + 3 stacked words on the right
   side of the masthead. On mobile (handled in the @media block below)
   the line collapses to a horizontal rule and the words run inline. */
.me-platform-brand {
  display: flex;
  align-items: stretch;
  gap: 1.1rem;
  align-self: stretch;
  padding: 0.3rem 0;
}
.me-platform-brand-line {
  width: 1px;
  background: var(--gold);
  align-self: stretch;
  flex: 0 0 1px;
  opacity: 0.85;
}
.me-platform-brand-words {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 600;
  line-height: 1.1;
}
.me-platform-brand-words span { display: block; }

/* Sidebar variant (base.html, staff dashboard). Horizontal gold rule
   above stacked centered words. Lives between .sidebar-header and
   .sidebar-nav. */
.sidebar-platform-brand {
  padding: 0.35rem 1.25rem 0.6rem;
  text-align: center;
}
.sidebar-platform-brand-line {
  display: block;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
  margin: 0 auto 0.7rem;
  width: 70%;
}
.sidebar-platform-brand-words {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 600;
  line-height: 1.15;
  opacity: 0.92;
}
.sidebar-platform-brand-words span { display: block; }

/* Standalone-login variant (login.html, 2fa_verify.html). Centered
   horizontal rule + 3 stacked centered words. Sits between the parish
   identity block and the "Sign in to continue" subtitle. */
.login-platform-brand {
  margin: 0.9rem auto 0.6rem;
  text-align: center;
}
.login-platform-brand-line {
  display: block;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
  margin: 0 auto 0.6rem;
  width: 50%;
  max-width: 200px;
}
.login-platform-brand-words {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  line-height: 1.1;
}
.login-platform-brand-words span { display: block; }

.me-nav { display: flex; align-items: center; gap: 1.2rem; }
.me-nav a { color: rgba(245,237,216,0.85); text-decoration: none; font-size: 0.95rem; padding: 0.35rem 0; border-bottom: 2px solid transparent; transition: all 0.15s; }
.me-nav a:hover, .me-nav a.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.me-nav .me-donate-btn { background: var(--gold-dark); color: var(--olive); padding: 0.5rem 1.1rem; border-radius: 4px; font-weight: 600; border-bottom: none; }
.me-nav .me-donate-btn:hover { background: var(--gold-light); border-bottom: none; }
.me-nav .me-logout { font-size: 0.85rem; opacity: 0.65; }
.me-main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.me-footer { text-align: center; padding: 1.5rem; color: var(--olive); opacity: 0.6; font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 3rem; }
.me-login-card { max-width: 540px; margin: 4rem auto; padding: 2.5rem; background: white; border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.big-number { font-family: 'Cormorant Garamond', serif; font-size: 3rem; color: var(--olive); font-weight: 600; }
.big-sub { color: var(--gold-dark); font-size: 0.95rem; margin-top: 0.25rem; }
@media (max-width: 720px) {
  .me-nav { gap: 0.75rem; font-size: 0.85rem; }
  .me-brand-name { font-size: 1.1rem; }
  /* Platform brand: collapse to a horizontal rule above the words,
     words run inline on a single row. Full-width below the parish brand. */
  .me-platform-brand {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gold);
    gap: 0.45rem;
  }
  .me-platform-brand-line { display: none; }
  .me-platform-brand-words {
    flex-direction: row;
    justify-content: center;
    gap: 0.85rem;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
  }
}
/* ============================================================
   MOBILE OVERHAUL — appended to style.css
   Wins via cascade: rules below override earlier @media blocks
   ============================================================ */

/* === Mobile topbar (hidden on desktop, shown <900px) === */
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--olive), #2A2118);
    border-bottom: 3px solid var(--gold);
    color: var(--cream);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .nav-toggle span {
    display: block;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }
  .mobile-topbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }
  .mobile-topbar-title img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    object-fit: cover;
    flex-shrink: 0;
  }
  .mobile-topbar-title span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    color: var(--gold-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-user {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--olive) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    font-size: 1rem;
  }

  /* Replace horizontal-nav layout with a slide-in drawer */
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;     /* mobile Safari/Chrome dynamic viewport — see desktop rule */
    width: 280px;
    max-width: 85vw;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;   /* momentum scroll on iOS */
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    border-bottom: none;
    gap: 0;
  }
  .sidebar.open { transform: translateX(0); }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .nav-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }

  /* Drawer-style sidebar header */
  .sidebar-header {
    padding: 0 0 0.6rem;
    text-align: center;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .sidebar-header img {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-width: 2px;
  }
  .sidebar-header .church-name {
    display: block;
    font-size: 1.05rem;
    white-space: normal;
    margin: 0.4rem 0 0.2rem;
  }
  .sidebar-header .church-loc { display: block; font-size: 0.85rem; }

  /* Drawer-style nav links: full-width, 44px touch target */
  .sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    flex-direction: column;
    gap: 0.15rem;
    /* min-height:0 lets this flex child actually shrink when the drawer
       runs short of vertical space, so the .sidebar-footer (Sign Out) below
       stays visible instead of being pushed off-screen. */
    min-height: 0;
    overflow-y: auto;
    display: flex;
  }
  .sidebar-nav a {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    text-align: left;
    border-radius: 6px;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin: 0;
    white-space: normal;
  }
  .sidebar-footer {
    padding: 1rem 0 0;
    border-top: 1px solid rgba(212,165,116,0.3);
    flex-direction: column;
    text-align: left;
    flex-shrink: 0;
    align-items: stretch;
    gap: 0.4rem;
  }
  .sidebar-footer .user-name,
  .sidebar-footer .user-name-link {
    display: block !important;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    color: var(--gold) !important;
  }
  .sidebar-footer a { font-size: 0.95rem; padding: 0.5rem 0; }

  /* Main content uses full width */
  .main {
    margin-left: 0;
    padding: 1rem 1rem 2rem;
    max-width: 100%;
  }

  /* Page header tighter on mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .page-header h1 { font-size: 1.5rem; }
}

/* === Table-to-card transformation (<600px) === */
@media (max-width: 600px) {
  /* Reset prior <600px rules that gave tables horizontal scroll */
  .card { overflow-x: visible; padding: 0.75rem; }
  .main > table.data { display: block; }

  table.data {
    display: block;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
  }
  table.data thead { display: none; }
  table.data tbody, table.data tr, table.data td {
    display: block;
    width: auto;
  }
  table.data tbody tr {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.85rem;
    box-shadow: 0 1px 3px rgba(62,53,40,0.05);
  }
  table.data tbody tr:hover {
    background: white;
  }
  table.data tbody tr:hover td { background: transparent; }
  table.data tbody tr:last-child { margin-bottom: 0; border-bottom: 1px solid var(--border); }

  table.data tbody td {
    border: none;
    padding: 0.3rem 0;
    text-align: left !important;
    display: grid;
    grid-template-columns: minmax(90px, 35%) 1fr;
    gap: 0.6rem;
    align-items: baseline;
    font-size: 0.93rem;
    min-height: 1.5em;
  }
  table.data tbody td.num { text-align: left !important; font-variant-numeric: tabular-nums; }

  table.data tbody td:before {
    content: attr(data-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Cells without a label get full-width (e.g., action button row) */
  table.data tbody td:not([data-label]) {
    grid-template-columns: 1fr;
  }
  table.data tbody td:not([data-label]):before { content: none; }

  /* tfoot becomes a summary card at the bottom */
  table.data tfoot { display: block; }
  table.data tfoot tr {
    background: var(--cream);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin-top: 0.5rem;
  }
  table.data tfoot td {
    display: grid;
    grid-template-columns: minmax(90px, 35%) 1fr;
    gap: 0.6rem;
    padding: 0.25rem 0;
    border: none;
    background: transparent;
    font-weight: 600;
  }
  table.data tfoot td:before {
    content: attr(data-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
  }

  /* Cards that ONLY wrap a table get see-through styling on mobile */
  .card:has(> table.data:only-child),
  .card:has(> table.data:first-child:last-child) {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
  }

  /* Dashboard squeeze fixes */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem;
  }
  .stat-card { padding: 0.85rem 0.95rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: 0.65rem; }
  .stat-sub { font-size: 0.72rem; }

  .bar-row {
    grid-template-columns: 50px 1fr 70px;
    gap: 0.4rem;
    padding: 0.4rem 0;
  }
  .bar-label { font-size: 0.78rem; }
  .bar-value { font-size: 0.82rem; }

  /* Reset any remaining inline-style left-margins on dashboard sub-rows */
  .card .bar-row + div[style*="margin"] {
    margin-left: 50px !important;
  }

  /* Page header buttons stack on mobile */
  .page-header > div { width: 100%; flex-wrap: wrap; gap: 0.4rem; }
  .page-header .btn { font-size: 0.88rem; padding: 0.5rem 0.85rem; }

  /* Filter bar already stacks via existing rules — pad it slightly tighter */
  .filter-bar { padding: 0.7rem 0.85rem; }
}

/* === Calendar agenda for mobile (replaces grid <720px) === */
.calendar-agenda { display: none; }

@media (max-width: 720px) {
  table.calendar-grid { display: none; }
  .calendar-agenda { display: block; }
  .cal-legend { display: none; }
  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .calendar-toolbar .btn,
  .calendar-toolbar .calendar-title {
    font-size: 0.95rem;
  }
  .calendar-toolbar h2.calendar-title {
    width: 100%;
    text-align: center;
    margin: 0.3rem 0;
    order: -1;
    font-size: 1.3rem;
  }

  .agenda-week {
    margin-bottom: 1.5rem;
  }
  .agenda-week-label {
    font-family: 'Cormorant Garamond', serif;
    color: var(--gold-dark);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
  }
  .agenda-row {
    display: grid;
    grid-template-columns: 56px 28px 1fr;
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    background: white;
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    margin-bottom: 0.4rem;
    text-decoration: none;
    color: var(--olive);
    min-height: 56px;
  }
  .agenda-row.today {
    background: rgba(212,165,116,0.1);
    border-color: var(--gold);
  }
  .agenda-date { text-align: center; line-height: 1; }
  .agenda-dow {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
  }
  .agenda-day {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--olive);
    line-height: 1;
    font-weight: 600;
  }
  .agenda-icon { font-size: 1.3rem; text-align: center; }
  .agenda-title { font-size: 0.92rem; line-height: 1.35; }
  .agenda-title strong { display: block; }
  .agenda-time {
    font-size: 0.78rem;
    color: var(--muted);
    margin-right: 0.3rem;
  }
  .agenda-desc {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
  }
  .agenda-empty {
    color: var(--muted);
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
  }
}

/* === Priest's Office "This week" panel — readable on mobile === */
@media (max-width: 600px) {
  .weekfeed-row {
    grid-template-columns: 70px 28px 1fr !important;
    gap: 0.5rem !important;
    padding: 0.6rem 0 !important;
  }
  .weekfeed-day { font-size: 0.78rem !important; }
  .weekfeed-title { font-size: 0.88rem !important; line-height: 1.35 !important; }
  .weekfeed-cat { display: none !important; }
}

/* === Form-cards already stack well; ensure inputs are 16px+ on mobile to avoid iOS zoom === */
@media (max-width: 600px) {
  .form-card input,
  .form-card select,
  .form-card textarea {
    font-size: 16px;
  }
  .form-card .form-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* === Parishioner topbar nav: switch to bottom-tab on tiny screens === */
@media (max-width: 480px) {
  .me-header-inner { gap: 0.6rem; }
  .me-brand-eyebrow { display: none; }
  .me-brand-loc { display: none; }
  .me-brand-name { font-size: 1rem; }
  .me-brand img { height: 90px; width: 90px; }
  .me-nav { gap: 0.55rem; font-size: 0.8rem; flex-wrap: wrap; }
  .me-nav .me-donate-btn { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
}

/* === Donor detail action bar — mobile stacking === */
@media (max-width: 600px) {
  .donor-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    padding: 0.85rem;
  }
  .donor-actions .btn-action {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .donor-actions .action-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 0.7rem;
  }
  .donor-actions .action-group-label {
    text-align: center;
    margin-bottom: 0.2rem;
  }
  .donor-actions .action-group .btn-tax {
    flex: 1 1 calc(25% - 0.4rem);
    min-width: 0;
    padding: 0.55rem 0.6rem;
    text-align: center;
  }
  .donor-actions .action-group {
    display: grid;
    grid-template-columns: 1fr;
  }
  .donor-actions .action-group .action-group-label {
    grid-column: 1;
  }
  /* Year buttons in a 4-column grid below the label */
  .donor-actions .action-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    align-items: center;
  }
  .donor-actions .action-group .action-group-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .donor-actions .action-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Back button — raised orthodox-style button used across priest pages ===== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--olive, #3E3528);
  background: linear-gradient(180deg, #FBF7EE 0%, #F0E5C8 100%);
  border: 1px solid var(--gold, #C8A04A);
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease, color 0.18s ease;
  box-shadow:
    0 2px 0 var(--gold-dark, #A8842F),
    0 3px 7px rgba(62, 53, 40, 0.14);
}
.btn-back:hover {
  background: linear-gradient(180deg, var(--gold-light, #D4B86A) 0%, var(--gold, #C8A04A) 100%);
  color: var(--olive, #3E3528);
  transform: translate(-2px, -1px);
  box-shadow:
    0 3px 0 var(--gold-dark, #A8842F),
    0 6px 14px rgba(200, 160, 74, 0.38);
}
.btn-back:active {
  transform: translate(-1px, 2px);
  box-shadow:
    0 0 0 var(--gold-dark, #A8842F),
    0 1px 3px rgba(62, 53, 40, 0.18);
}
.btn-back:focus-visible {
  outline: 2px solid var(--gold, #C8A04A);
  outline-offset: 2px;
}
.btn-back .arrow,
.btn-back > span:first-child { font-size: 1.05rem; line-height: 1; transition: transform 0.18s ease; }
.btn-back:hover > span:first-child { transform: translateX(-2px); }


/* ===================================================================== */
/*  Parishioner portal (/me/*) — mobile optimization                     */
/* ===================================================================== */

/* Tablet + smaller phone */
@media (max-width: 720px) {
  .me-main { margin: 1rem auto; padding: 0 0.9rem; }
  .me-header { padding: 0.7rem 0; }
  .me-header-inner { padding: 0 0.9rem; gap: 0.6rem; }
  .me-brand img { height: 99px; width: 99px; border-width: 1.5px; }
  .me-brand-name { font-size: 1.1rem; }
  .me-brand-eyebrow { font-size: 0.7rem; }
  .me-brand-loc { font-size: 0.75rem; }

  /* Nav wraps below brand */
  .me-nav { gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; width: 100%; padding-top: 0.3rem; border-top: 1px solid rgba(245,237,216,0.12); margin-top: 0.4rem; }
  .me-nav a { padding: 0.3rem 0.5rem; font-size: 0.88rem; }
  .me-nav .me-donate-btn { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
  .me-nav .me-logout { margin-left: auto; }

  /* Page header stacks */
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding-bottom: 0.6rem; margin-bottom: 0.9rem; }
  .page-header h1 { font-size: 1.4rem; margin: 0; }

  /* Big number tighter (lifetime giving) */
  .big-number { font-size: 2.2rem; padding: 1rem 1rem 0.2rem; }
  .big-sub { padding: 0 1rem 1rem; font-size: 0.85rem; }

  /* Card-header — actions row stacks on phone */
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .card-header h2 { font-size: 1.15rem; }
  .card { padding: 0.9rem 1rem; }

  /* Tables: horizontal scroll on phones, tighter rows */
  .card .data,
  .me-main .data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; font-size: 0.88rem; }
  .me-main .data th, .me-main .data td { padding: 0.45rem 0.55rem; }

  /* Filter bar — buttons wrap, tighter */
  .filter-bar { flex-wrap: wrap; gap: 0.35rem; padding: 0.55rem; }
  .filter-bar .btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

  /* Forms — required fields stack, labels smaller */
  .form-card { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .form-card label { font-size: 0.92rem; }
  .form-card input, .form-card select, .form-card textarea { font-size: 16px; /* iOS zoom prevention */ }
  .form-actions { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .form-actions .btn, .form-actions .btn-back, .form-actions .btn-ghost, .form-actions .btn-primary { width: 100%; justify-content: center; box-sizing: border-box; }
  .btn-block { width: 100%; }

  /* CTA button row on me_home → stack vertically on phone */
  .me-main .card + div[style*=text-align: center][style*=display:flex] { flex-direction: column !important; }
  .me-main .card + div[style*=text-align: center][style*=display:flex] .btn { width: 100%; box-sizing: border-box; }

  /* Login card padding */
  .me-login-card { margin: 1.5rem auto; padding: 1.5rem 1.25rem; }

  /* Footer */
  .me-footer { padding: 1rem 0.75rem; font-size: 0.75rem; line-height: 1.5; }
}

/* Compact phone (<= 480px) */
@media (max-width: 480px) {
  .me-header-inner { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .me-nav { gap: 0.35rem; }
  .me-nav a { font-size: 0.82rem; padding: 0.25rem 0.45rem; }

  .me-main { padding: 0 0.7rem; margin: 0.7rem auto; }
  .page-header h1 { font-size: 1.25rem; }
  .big-number { font-size: 1.9rem; }
  .card { padding: 0.8rem 0.9rem; }
  .card-header h2 { font-size: 1.05rem; }

  /* Corner-cards (services catalog) tighter padding */
  .corner-card { padding: 0.85rem 0.95rem; }
  .corner-card h3 { font-size: 1.1rem; }
  .corner-card p { font-size: 0.88rem; }

  /* Flash messages tighter */
  .flash { font-size: 0.9rem; padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; }
}

/* === Protocol ledger tables (book-style grid) === */
.protocol-ledger {
  width: 100%;
  overflow-x: auto;
  border: 2px solid var(--olive, #3E3528);
  border-radius: 6px;
  background: var(--cream, #FAF6E8);
}
.protocol-ledger table.protocol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: white;
}
.protocol-ledger table.protocol-table th,
.protocol-ledger table.protocol-table td {
  border: 1px solid var(--border, #E0D5BC);
  padding: 0.9rem 0.95rem;
  vertical-align: top;
  line-height: 1.45;
  min-width: 110px;
}
.protocol-ledger table.protocol-table th {
  font-weight: 600;
  padding: 0.85rem 0.95rem;
}
.protocol-ledger table.protocol-table thead th {
  border-bottom: 1px solid var(--olive, #3E3528);
}
.protocol-ledger table.protocol-table tr.protocol-section th,
.protocol-ledger table.protocol-table thead tr:first-child th {
  border-bottom: 2px solid var(--gold, #C8A04A);
}
.protocol-ledger table.protocol-table .content-cell {
  min-width: 260px;
  max-width: 480px;
  white-space: normal;
  word-break: break-word;
}
.protocol-ledger table.protocol-table tbody tr:hover td {
  background: rgba(200,160,74,0.06);
}

/* === Parish brand link in /me header — keep it visually static on hover/focus === */
.me-brand,
.me-brand:link,
.me-brand:visited,
.me-brand:hover,
.me-brand:focus,
.me-brand:active {
  text-decoration: none !important;
  color: var(--cream) !important;
  outline: none !important;
}
.me-brand:hover .me-brand-name,
.me-brand:focus .me-brand-name {
  color: var(--gold-light) !important;  /* match resting state */
  text-decoration: none !important;
}
.me-brand:hover .me-brand-eyebrow,
.me-brand:hover .me-brand-loc {
  text-decoration: none !important;
  opacity: inherit !important;
}

/* === Mobile accessibility sweep — 2026-05-11 === */

/* 1. Prevent iOS auto-zoom on input focus by ensuring all form inputs are >=16px */
.form-card input,
.form-card select,
.form-card textarea,
.filter-bar input,
.filter-bar select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
  font-size: 16px;
}

/* 2. Candle minus button — bump 28→40 for reliable tap target (WCAG AA) */
.candle-minus {
  width: 40px !important;
  height: 40px !important;
  font-size: 1.3rem !important;
}

/* 3. Candle quantity input — allow shrinking on very narrow phones */
.candle-qty {
  width: 100% !important;
  max-width: 100px !important;
}

/* 4. Parishioner /me CTA buttons — keep 2×2 grid readable at 320–500px */
@media (max-width: 500px) {
  .me-main .btn,
  .me-main .btn-primary,
  .me-main .btn-ghost {
    padding: 0.65rem 0.9rem !important;
    font-size: 0.95rem !important;
  }
}

/* 5. Gift chip row on /me/prayer — tighter at very small widths */
@media (max-width: 400px) {
  .gift-chip {
    padding: 0.4rem 0.85rem;
    font-size: 0.95rem;
  }
}

/* 6. Ensure all .protocol-ledger tables scroll horizontally on phones
      (already in CSS but reinforced here for any new ledger variants) */
@media (max-width: 720px) {
  .protocol-ledger { -webkit-overflow-scrolling: touch; }
  .protocol-ledger::after {
    content: "← scroll →";
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted, #6B5F4A);
    padding: 0.4rem;
    opacity: 0.6;
  }
}

/* === /me home CTAs — colorful pill buttons with tactile hover === */
.me-cta {
  font-size: 1.05rem;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-block;
  border: 2px solid var(--gold-dark, #A8842F);
  color: white !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
  will-change: transform, box-shadow;
}
.me-cta:hover, .me-cta:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.10) saturate(1.05);
  border-color: var(--gold-light, #D4B86A);
  outline: none;
}
.me-cta:active { transform: translateY(0); filter: brightness(0.96); }

.me-cta-gift    { background: var(--gold, #C8A04A); }
.me-cta-gift:hover    { box-shadow: 0 8px 22px rgba(200,160,74,0.40); }

.me-cta-candle  { background: var(--olive, #3E3528); }
.me-cta-candle:hover  { box-shadow: 0 8px 22px rgba(62,53,40,0.45); }

.me-cta-prayer  { background: #6B4D8C; }
.me-cta-prayer:hover  { box-shadow: 0 8px 22px rgba(107,77,140,0.45); }

.me-cta-service { background: var(--gold-dark, #A8842F); }
.me-cta-service:hover { box-shadow: 0 8px 22px rgba(168,132,47,0.45); }
