:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: #111512;
  background: #f2f2f7;
  font-synthesis: none;
  color-scheme: light;

  --accent: #167a52;
  --accent-strong: #0f5f3f;
  --accent-bright: #24a56d;
  --accent-soft: #e8f4ed;
  --text: #111512;
  --secondary: #6d7470;
  --tertiary: #8e9691;
  --surface: #ffffff;
  --surface-soft: #f7f8f7;
  --grouped: #f2f2f7;
  --line: rgba(60, 60, 67, .12);
  --line-strong: rgba(60, 60, 67, .19);
  --danger: #c83333;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-card: 0 10px 30px rgba(15, 25, 20, .055), 0 1px 2px rgba(15, 25, 20, .035);
  --shadow-float: 0 18px 44px rgba(12, 24, 18, .14), 0 3px 12px rgba(12, 24, 18, .06);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--grouped); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(720px 320px at 50% -150px, rgba(44, 166, 107, .11), transparent 72%),
    var(--grouped);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(22, 122, 82, .23);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 16px calc(104px + env(safe-area-inset-bottom));
}
.app-shell.no-bottom-nav { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.app-shell > main { min-width: 0; }

/* Native-style top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -16px 8px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 13px;
  background: rgba(242, 242, 247, .88);
  border-bottom: 1px solid rgba(60,60,67,.055);
  backdrop-filter: saturate(170%) blur(22px);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
}
.topbar-copy { min-width: 0; }
.topbar-brand {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: .78rem;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.01em;
}
.topbar h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.055em;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.install-button,
.text-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255,255,255,.82);
  color: var(--accent-strong);
  font-weight: 750;
  font-size: .9rem;
}
.text-button { color: var(--secondary); background: transparent; padding-inline: 8px; }

/* Common surfaces */
.panel,
.campaign-card,
.action-card,
.stats-grid,
.quiet-card,
.church-banner {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.panel { padding: 22px 18px; }
.centered { text-align: center; padding-block: 58px; }
.eyebrow,
.step-label {
  margin: 0;
  color: var(--accent);
  font-size: .82rem;
  line-height: 1.25;
  font-weight: 780;
  letter-spacing: -.01em;
}
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  font-weight: 780;
  font-size: 1.06rem;
}
.primary-button {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 11px 24px rgba(22,122,82,.17);
}
.primary-button:active { transform: scale(.99); background: var(--accent-strong); }
.primary-button:disabled { background: #aeb8b2; box-shadow: none; cursor: not-allowed; }
.secondary-button {
  border: 0;
  background: #f1f3f2;
  color: #25322b;
}
.secondary-button:active { background: #e8ebe9; }
.secondary-button:disabled { color: #919894; background: #eceeec; }
.error-message { min-height: 1.4em; margin: 12px 2px 0; color: var(--danger); font-size: .92rem; font-weight: 700; }
.error-message:empty { display: none; }
.sync-status { min-height: 20px; margin: 10px 0 0; text-align: center; color: var(--secondary); font-size: .85rem; line-height: 1.45; }
.sync-status:empty { display: none; }

/* Setup / empty state */
.status-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 850;
}
.setup-icon { background: #fff0df; color: #9a5a08; }
.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border: 4px solid #e3e6e4;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.setup-error h2 { margin: 8px 0 10px; font-size: 1.55rem; line-height: 1.2; letter-spacing: -.04em; }
.setup-error > p:not(.step-label) { color: var(--secondary); line-height: 1.55; }
.setup-error .primary-button { margin-top: 18px; }
.admin-help-link { display: inline-block; margin-top: 16px; color: var(--secondary); font-size: .9rem; font-weight: 700; }

/* Registration / welcome */
.app-shell.registration-mode {
  width: min(100%, 480px);
  padding: 0 14px calc(16px + env(safe-area-inset-bottom));
}
.registration-mode .topbar { display: none; }
.registration-screen {
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: env(safe-area-inset-top);
}
.welcome-hero {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  padding: clamp(44px, 8.5dvh, 76px) 8px 8px;
  text-align: center;
  overflow: visible;
}
.welcome-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -86px;
  width: 360px;
  height: 250px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 175, 111, .19) 0%, rgba(45,175,111,.07) 42%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}
.welcome-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 0;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--accent-strong);
  box-shadow: 0 4px 16px rgba(20,42,31,.055);
  font-size: .82rem;
  font-weight: 760;
  letter-spacing: -.01em;
}
.welcome-title {
  margin: 14px 0 0;
  color: #0d100e;
  white-space: nowrap;
  font-size: clamp(2.9rem, 12.5vw, 3.7rem);
  line-height: .98;
  font-weight: 850;
  letter-spacing: -.075em;
}
.welcome-glow { display: none; }
.registration-screen:not([data-stage="parish"]) .welcome-hero {
  padding-top: 18px;
  padding-bottom: 0;
}
.registration-screen:not([data-stage="parish"]) .welcome-kicker { min-height: 26px; font-size: .75rem; }
.registration-screen:not([data-stage="parish"]) .welcome-title { margin-top: 8px; font-size: 2rem; }
.registration-sheet {
  flex: 0 0 auto;
  min-width: 0;
  padding: 20px;
  border-radius: 30px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 16px 44px rgba(18,32,25,.075), 0 2px 5px rgba(18,32,25,.03);
}
.registration-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}
.registration-heading h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.055em;
}
.back-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2f2f7;
  color: #25312b;
}
.back-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.registration-stage { min-width: 0; margin-top: 16px; }
.selection-summary {
  min-height: 42px;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: #f4f5f4;
  color: #49534e;
  font-size: .92rem;
  line-height: 1.4;
  font-weight: 700;
}
.choice-grid { min-width: 0; }
.parish-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}
.parish-grid .choice-button { grid-column: span 2; }
.parish-grid .choice-button:nth-child(4) { grid-column: 2 / span 2; }
.parish-grid .choice-button:nth-child(5) { grid-column: 4 / span 2; }
.district-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.choice-button {
  min-width: 0;
  min-height: 94px;
  border: 0;
  border-radius: 19px;
  background: #f2f3f2;
  padding: 13px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--text);
  transition: transform .14s ease, background-color .14s ease, color .14s ease;
}
.choice-button:active { transform: scale(.975); background: #e7ebe8; }
.choice-button.selected {
  background: var(--accent);
  color: #fff;
}
.choice-title {
  font-size: clamp(1.08rem, 4.5vw, 1.22rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.choice-leader {
  color: #5e6762;
  font-size: clamp(.84rem, 3.5vw, .95rem);
  line-height: 1.25;
  font-weight: 650;
  word-break: keep-all;
}
.choice-button.selected .choice-leader { color: rgba(255,255,255,.82); }
.large-input {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  padding: 0 16px;
  background: #f7f7f8;
  color: var(--text);
  font-size: 1.12rem;
}
.large-input:focus { border-color: rgba(22,122,82,.48); background: #fff; outline: 3px solid rgba(22,122,82,.12); }
.registration-sheet .primary-button { margin-top: 12px; }
.registration-progress {
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 0 0 5px;
}
.registration-progress span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c9cfcb;
  transition: width .18s ease, background-color .18s ease;
}
.registration-screen[data-stage="parish"] .registration-progress span:nth-child(1),
.registration-screen[data-stage="district"] .registration-progress span:nth-child(2),
.registration-screen[data-stage="name"] .registration-progress span:nth-child(3) {
  width: 22px;
  background: var(--accent);
}

/* Home */
#homeView { display: grid; gap: 12px; }
.campaign-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(260px 180px at 94% -12%, rgba(108,229,166,.34), transparent 58%),
    linear-gradient(140deg, #0c5035 0%, #167a52 56%, #1e9162 100%);
  box-shadow: 0 16px 34px rgba(11,84,55,.18);
}
.campaign-card .eyebrow { color: rgba(255,255,255,.72); }
.campaign-heading { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.campaign-heading h2 { margin: 3px 0 0; color: rgba(255,255,255,.9); font-size: .96rem; font-weight: 680; }
.day-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: .86rem;
  font-weight: 760;
  backdrop-filter: blur(12px);
}
.goal-number { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 6px; margin: 16px 0 13px; }
.goal-number strong {
  font-size: clamp(3rem, 13vw, 4rem);
  line-height: .88;
  font-weight: 820;
  letter-spacing: -.08em;
  font-variant-numeric: tabular-nums;
}
.goal-number span { font-size: 1.05rem; font-weight: 760; color: rgba(255,255,255,.82); }
.progress-track { position: relative; z-index: 1; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: #fff; transition: width .28s ease; }
.progress-meta { position: relative; z-index: 1; display: flex; justify-content: space-between; margin-top: 9px; color: rgba(255,255,255,.76); font-size: .86rem; font-weight: 650; }
.action-card { padding: 18px; }
.action-prompt { margin: 0 0 12px; color: #414a45; font-size: .98rem; font-weight: 720; }
.plus-one {
  width: 100%;
  min-height: 104px;
  border: 0;
  border-radius: 24px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 13px 28px rgba(22,122,82,.18);
}
.plus-one:active { transform: scale(.988); background: var(--accent-strong); }
.plus-one:disabled { background: #aeb8b2; box-shadow: none; }
.plus-one-value {
  font-size: 3.6rem;
  line-height: .9;
  font-weight: 800;
  letter-spacing: -.07em;
}
.plus-one-copy { display: grid; gap: 2px; text-align: left; }
.plus-one-copy strong { font-size: 1.22rem; line-height: 1.15; font-weight: 780; letter-spacing: -.03em; }
.plus-one-copy small { color: rgba(255,255,255,.76); font-size: .84rem; font-weight: 600; }
.action-card .secondary-button { margin-top: 10px; min-height: 50px; border-radius: 16px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  gap: 0;
  padding: 0;
}
.stat-card {
  position: relative;
  min-height: 96px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
}
.stat-card:nth-child(odd) { border-right: 1px solid var(--line); }
.stat-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.stat-card > span { color: var(--secondary); font-size: .88rem; font-weight: 650; }
.stat-card strong { margin-top: 10px; font-size: 1.8rem; line-height: 1; font-weight: 780; letter-spacing: -.055em; }
.stat-card strong span { color: inherit; }
.quiet-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.quiet-card > div { min-height: 76px; padding: 15px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.quiet-card > div:first-child { border-right: 1px solid var(--line); }
.quiet-card span { color: var(--secondary); font-size: .85rem; font-weight: 650; }
.quiet-card strong { font-size: 1.18rem; font-weight: 760; }
.church-banner {
  padding: 18px;
  background: #ecf7f1;
  border-color: rgba(22,122,82,.08);
  box-shadow: none;
}
.church-banner h2 { margin: 5px 0 5px; font-size: 1.22rem; line-height: 1.25; letter-spacing: -.04em; }
.church-banner p { margin: 0; color: #4d5d55; font-size: .92rem; line-height: 1.5; }
.church-banner .primary-button { margin-top: 14px; }
.church-banner .text-button { display: block; margin: 3px auto 0; }

/* Map / rankings */
.app-view {
  min-width: 0;
  margin: 0;
  padding: 12px 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 2px 2px 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 2rem; line-height: 1.08; font-weight: 800; letter-spacing: -.055em; }
.section-number { margin-top: 4px; color: var(--accent); font-size: 1.3rem; font-weight: 780; white-space: nowrap; }
.section-description { margin: 0 2px 14px; color: var(--secondary); font-size: .92rem; line-height: 1.55; }
.filter-scroll {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  overflow: visible;
}
.filter-button {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  background: #e8eae9;
  color: #4d5551;
  font-size: .9rem;
  font-weight: 700;
}
.filter-button.selected { background: #1f2924; color: #fff; }
.map-canvas {
  width: 100%;
  height: min(55dvh, 480px);
  min-height: 340px;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: #dfe5e1;
  box-shadow: var(--shadow-card);
}
.map-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.legend-item { min-width: 0; text-align: center; color: var(--secondary); font-size: .7rem; font-weight: 650; }
.legend-swatch { display: block; width: 100%; height: 6px; margin-bottom: 4px; border-radius: 999px; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 0 0 12px;
  padding: 3px;
  border-radius: 12px;
  background: #e4e6e5;
}
.segment {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #525a56;
  font-size: .94rem;
  font-weight: 720;
}
.segment.selected {
  background: #fff;
  color: #151917;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.ranking-list {
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.ranking-row {
  position: relative;
  min-height: 66px;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: transparent;
}
.ranking-row + .ranking-row::before {
  content: "";
  position: absolute;
  left: 69px;
  right: 15px;
  top: 0;
  height: 1px;
  background: var(--line);
}
.ranking-row.mine { background: #edf7f2; }
.rank-number { color: var(--accent); font-size: .98rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 720; }
.rank-count { color: #353d39; font-size: .98rem; font-weight: 760; font-variant-numeric: tabular-nums; }

/* Bottom tab bar */
.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 460px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 6px 12px 7px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 24px;
  background: rgba(248,248,250,.9);
  box-shadow: 0 12px 34px rgba(18,28,23,.15);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.nav-button {
  min-height: 58px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #8a918d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 650;
}
.nav-icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { line-height: 1; }
.nav-button.selected { color: var(--accent); }
.nav-button.selected .nav-icon { stroke-width: 2.15; }

/* Toast and sheets */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 420px);
  min-height: 52px;
  padding: 9px 10px 9px 16px;
  border-radius: 18px;
  background: rgba(27,31,29,.93);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 15px 36px rgba(0,0,0,.2);
  backdrop-filter: blur(18px);
}
.toast-action { min-width: 58px; min-height: 36px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-weight: 750; }
.multi-dialog {
  width: min(calc(100% - 20px), 480px);
  border: 0;
  border-radius: 30px;
  padding: 0;
  background: transparent;
}
.multi-dialog::backdrop { background: rgba(0,0,0,.22); backdrop-filter: blur(7px); }
.dialog-card { position: relative; padding: 28px 20px 22px; border-radius: 30px; background: #fff; box-shadow: var(--shadow-float); }
.dialog-card h2 { margin: 7px 0 22px; font-size: 1.5rem; letter-spacing: -.045em; }
.dialog-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f0f1f1;
  color: #454c48;
  font-size: 1.5rem;
}
.install-card h2 { padding-right: 44px; }
.install-help-text { margin: 8px 0 0; color: #4a5550; font-size: 1rem; line-height: 1.65; font-weight: 600; }
.location-note { margin: 14px 2px 0; color: var(--secondary); font-size: .82rem; line-height: 1.5; }
.counter-row { display: grid; grid-template-columns: 58px 1fr 58px; gap: 10px; align-items: center; }
.counter-button { height: 58px; border: 0; border-radius: 17px; background: #f1f2f2; font-size: 1.7rem; font-weight: 650; }
.count-field { min-height: 74px; border: 1px solid var(--line-strong); border-radius: 18px; display: flex; align-items: baseline; justify-content: center; gap: 5px; background: #f8f8f9; }
.count-field input { width: 100px; border: 0; outline: 0; background: transparent; text-align: center; font-size: 2.4rem; font-weight: 800; }
.count-field small { font-size: .95rem; font-weight: 750; }
.prayer-card { text-align: center; }
.prayer-timer { margin: 28px 0 20px; font-size: clamp(4rem, 19vw, 5.7rem); line-height: .9; font-weight: 800; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.prayer-guide { min-height: 3em; margin: 0 6px 12px; color: #3e4943; font-size: 1.05rem; line-height: 1.55; font-weight: 650; }

/* Leaflet cleanup */
.leaflet-control-zoom a { color: #26322c !important; }
.leaflet-control-attribution { font-size: 9px !important; }

@media (max-width: 390px) {
  .app-shell { padding-inline: 12px; }
  .topbar { margin-inline: -12px; padding-inline: 14px; }
  .welcome-hero { padding-top: clamp(38px, 7dvh, 56px); }
  .welcome-title { font-size: clamp(2.68rem, 12.1vw, 3.2rem); }
  .registration-sheet { padding: 18px 14px; border-radius: 27px; }
  .registration-heading h2 { font-size: 1.62rem; }
  .parish-grid, .district-grid { gap: 8px; }
  .choice-button { min-height: 90px; padding-inline: 5px; }
  .choice-title { font-size: 1.03rem; }
  .choice-leader { font-size: .8rem; }
  .plus-one { min-height: 98px; }
  .plus-one-value { font-size: 3.35rem; }
  .stats-grid { border-radius: 24px; }
  .map-legend { grid-template-columns: repeat(3, 1fr); row-gap: 8px; }
}

@media (min-width: 541px) {
  .app-shell:not(.registration-mode) { width: min(100%, 520px); }
  .app-shell.registration-mode { width: min(100%, 500px); }
  .welcome-title { font-size: 3.75rem; }
}

@media (max-height: 720px) and (max-width: 540px) {
  .welcome-hero { padding-top: 26px; }
  .welcome-title { margin-top: 8px; font-size: 2.7rem; }
  .registration-screen { gap: 10px; }
  .registration-sheet { padding-top: 16px; padding-bottom: 15px; }
  .registration-stage { margin-top: 12px; }
  .choice-button { min-height: 82px; }
  .registration-progress { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

/* v0.6.4 visual balance refinements after mobile review */
.registration-screen[data-stage="parish"] .welcome-hero {
  flex: 1 1 auto;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 14px;
}
.registration-screen[data-stage="parish"] .registration-progress {
  margin-top: 0;
  padding-top: 0;
}
.registration-screen:not([data-stage="parish"]) .registration-sheet {
  margin-top: auto;
  margin-bottom: auto;
}
.registration-screen:not([data-stage="parish"]) .registration-progress {
  margin-top: 0;
}
