@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/montserrat-400.woff2") format("woff2");
}
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/montserrat-500.woff2") format("woff2");
}
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
}
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/montserrat-800.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f3f3f3;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #878787;
  --line: #ececec;
  --accent: #e95e18;
  --accent-hover: #cf4d10;
  --teal: #00a492;
  --red: #dc2626;
  --orange: #e95e18;
  --yellow: #d6a419;
  --green: #00a492;
  --shadow: 0 4px 24px rgba(0, 0, 0, .08);
  --radius: 16px;
  --radius-large: 24px;
  --container: 1280px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 8px max(24px, calc((100vw - var(--container)) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
}
.brand-mark {
  flex-shrink: 0;
  height: 26px;
  display: block;
}
.brand-wordmark__crm {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: 1;
  margin-right: 3px;
}
.brand-wordmark__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.brand-wordmark__title-line {
  display: block;
  white-space: nowrap;
}
.brand-subtitle { min-width: 0; }
.brand-subtitle small { display: block; color: var(--muted); font-size: 11px; line-height: 16px; }
.sidebar nav { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.sidebar nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.sidebar nav a:hover { background: var(--bg); color: var(--accent); }
.sidebar-footer { display: flex; gap: 8px; align-items: center; }
.sidebar-footer form { margin: 0; }

.content {
  width: min(var(--container), calc(100vw - 48px));
  margin: 0 auto;
  padding: 40px 0 64px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 820px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  margin-bottom: 0;
  font-weight: 800;
  letter-spacing: 0;
}
h2 { font-size: 24px; line-height: 32px; margin-bottom: 18px; font-weight: 700; letter-spacing: 0; }
h3 { font-size: 18px; line-height: 26px; margin-bottom: 8px; font-weight: 700; }
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.user-chip {
  display: block;
  min-width: 210px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
a.user-chip:hover {
  border-color: rgba(0, 0, 0, .18);
  box-shadow: var(--shadow);
}
.user-chip span { display: block; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 500; margin-top: 3px; }
.account-hero { margin-bottom: 0; }
.profile-notifications .quick-actions { margin-top: 4px; }

.panel, .metric, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: none;
}
.panel { padding: 24px; }
.panel:hover, .metric:hover, .knowledge-card:hover { box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { margin-bottom: 0; }
.role-pending-panel { margin-bottom: 16px; }
.role-pending-panel .panel-head { align-items: flex-start; }
.role-pending-row { align-items: flex-start; }
.people-hub-inbox-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.people-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.people-view-switch__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.people-view-switch__item:hover { color: var(--text); }
.people-view-switch__item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.people-filters .panel-head { align-items: flex-start; }
.people-filters-meta { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; text-align: right; max-width: 22rem; }
.people-filters-grid { margin-bottom: 0; }
.people-filters-search { grid-column: 1 / -1; }
.people-filters-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.people-filters-more { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.people-filters-more > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}
.people-filters-more > summary::-webkit-details-marker { display: none; }
.people-filters-advanced { margin-top: 12px; }
.people-list-mobile { display: none; }
.people-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.people-card:last-child { border-bottom: 0; }
.people-card-main { display: grid; gap: 4px; text-decoration: none; color: inherit; }
.people-card-meta { color: var(--muted); font-size: 13px; line-height: 1.4; }
.people-card-side { display: grid; gap: 8px; justify-items: end; }
.participant-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.participant-request-card:last-child { border-bottom: 0; padding-bottom: 0; }
.participant-request-info { display: grid; gap: 6px; align-content: start; }
.participant-request-actions { display: grid; gap: 12px; align-content: start; }
.inline-access-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}
.inline-access-form select {
  min-width: 140px;
  padding: 8px 10px;
}
.inline-access-form button {
  white-space: nowrap;
}
.people-list-panel .panel-head p,
.panel .panel-head p.muted {
  margin: 4px 0 0;
}
.person-groups-panel .list-row { align-items: center; }
.person-group-add { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.person-care-history h3 { margin: 0 0 12px; font-size: 16px; }
.person-export-link { margin: 8px 0 0; }
.person-change-log { margin-bottom: 16px; }
.collapsible-panel { margin-bottom: 24px; }
.collapsible-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}
.collapsible-panel summary::-webkit-details-marker { display: none; }
.collapsible-panel summary h2 { margin-bottom: 0; }
.collapsible-panel form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.collapse-indicator {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}
.collapse-indicator::before,
.collapse-indicator::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  background: var(--text);
  transform: translateY(-50%);
}
.collapse-indicator::after { transform: translateY(-50%) rotate(90deg); }
.collapsible-panel[open] .collapse-indicator::after { opacity: 0; }
.page-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 24px; }
.grid { display: grid; gap: 24px; margin-bottom: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.metric { padding: 24px; min-height: 136px; display: grid; align-content: space-between; }
.metric span { display: block; font-size: 44px; line-height: 48px; font-weight: 800; color: var(--accent); }
.metric p { color: var(--muted); margin-bottom: 0; font-weight: 600; }

.primary, button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transition: background .2s ease, transform .2s ease;
}
.primary:hover, button.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.ghost, button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}
.ghost:hover, button.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost.danger, button.ghost.danger { color: var(--red); }
.ghost.danger:hover, button.ghost.danger:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }
.full { width: 100%; }
.flash { padding: 14px 18px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); margin-bottom: 24px; color: #9a3412; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.role-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  color: #1e3a8a;
}
.role-preview-banner__copy { min-width: 0; }
.role-preview-banner__copy p { margin: 0; }
.role-preview-banner__copy .eyebrow { color: #1d4ed8; margin-bottom: 6px; }
.role-preview-banner__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  border: 1px solid #f5d0a9;
  background: linear-gradient(135deg, #fff7ed 0%, #fafaf9 100%);
  color: #7c2d12;
}
.demo-banner strong { display: block; margin-bottom: 6px; }
.demo-banner .muted { margin: 0; color: #9a3412; }
.demo-banner form { flex-shrink: 0; margin: 0; }
@media (max-width: 720px) {
  .demo-banner { flex-direction: column; align-items: stretch; }
}
@media (max-width: 760px) {
  .role-preview-banner { flex-direction: column; align-items: stretch; }
  .role-preview-banner__actions { flex-wrap: wrap; }
}
.muted { color: var(--muted); }

.care-row, .list-row, .task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-row { grid-template-columns: 1fr; }
.care-row:last-child, .list-row:last-child, .task-row:last-child { border-bottom: 0; }
.care-row strong, .list-row strong, .task-row strong { font-weight: 700; }
.care-row p, .list-row span, .task-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 6px rgba(0, 0, 0, .035); }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }
.row-actions { display: flex; gap: 8px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.copy-field input { min-width: 0; }
.copy-field .ghost { white-space: nowrap; }
.account-invite h3 { margin: 0; font-size: 16px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.status-badge.registered { background: #ecfdf5; color: #047857; }
.status-badge.unregistered { background: #f3f4f6; color: #4b5563; }
.status-badge.pending { background: #fff7ed; color: #c2410c; }
.table-sub { margin-top: 6px; }
.person-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.person-hero-main { display: flex; gap: 14px; align-items: flex-start; }
.person-hero-main .dot { margin-top: 10px; }
.person-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.person-hero h2 { margin-bottom: 6px; }
.account-summary { margin-bottom: 0; }
.person-edit-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.person-notes-readonly { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.person-notes-readonly h3 { margin: 0 0 8px; font-size: 16px; }
.change-log { display: grid; gap: 12px; }
.change-log-row {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.change-log-row:last-child { border-bottom: 0; padding-bottom: 0; }
.change-log-row p { margin: 0; }
.user-row-actions { display: grid; gap: 8px; align-content: start; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--text); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn .icon-telegram { display: block; }
.task-row { grid-template-columns: 1fr auto; width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; }

label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 94, 24, .12); }
input[data-mask="phone"],
input[data-mask="telegram"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
textarea { resize: vertical; }
.stack { display: grid; gap: 14px; }
.compact { margin-top: 16px; }
.person-row-actions,
.user-row-actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check-list { display: grid; gap: 10px; }
.check-list label {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.check-list input { width: 22px; height: 22px; accent-color: var(--accent); }
.check-list small { color: var(--muted); }

.group-card { display: grid; gap: 12px; }
.capacity, .health { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.capacity span, .health span { display: block; height: 100%; background: var(--teal); }
.quick-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.details { display: grid; grid-template-columns: 170px 1fr; gap: 12px; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; }
.detail-field { display: grid; gap: 6px; align-content: start; }
.detail-read {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 28px;
}
.detail-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-value a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.detail-value a:hover { text-decoration: underline; }
.detail-edit-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: -4px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.detail-edit-btn:hover {
  border-color: var(--line);
  color: var(--accent);
  background: var(--bg);
}
.detail-edit {
  display: none;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.detail-field.is-editing .detail-read { display: none; }
.detail-field.is-editing .detail-edit { display: grid; }
.detail-edit input {
  min-width: 0;
  padding: 8px 10px;
}
.detail-save,
.detail-cancel {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.detail-save {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.detail-cancel:hover { border-color: var(--accent); color: var(--accent); }
.detail-error {
  margin: 0;
  color: #991b1b;
  font-size: 12px;
  font-weight: 600;
}
.detail-field.has-error input { border-color: #fecaca; }
.detail-field.is-saving { opacity: .72; pointer-events: none; }
.timeline { padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline p { color: var(--muted); margin: 6px 0 0; }
.miracle-inline { margin-top: 8px !important; color: var(--text) !important; }
.miracle-inline a { color: var(--accent); font-weight: 600; }
.prayer-testimony-details { margin-top: 10px; }
.prayer-testimony-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.prayer-testimony-details summary::-webkit-details-marker { display: none; }
.prayer-testimony-details[open] summary { margin-bottom: 10px; }
.prayer-status-form { min-width: 220px; }
.prayer-testimony-fields { display: grid; gap: 8px; }
.prayer-testimony-fields[hidden] { display: none; }
.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.prayer-public-shell {
  width: min(520px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.prayer-public-card { width: 100%; }
.prayer-public-from {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  line-height: 1.45;
}
.prayer-public-links { text-align: center; margin-top: 8px; }
[data-prayer-guest-name][hidden] { display: none; }
.miracle-intro h2 { margin-bottom: 8px; }
.miracle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.miracle-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(0, 164, 146, .08), transparent 42%),
    var(--surface);
  display: grid;
  gap: 10px;
  align-content: start;
}
.miracle-card .eyebrow { color: var(--teal); margin-bottom: 0; }
.miracle-card h3 { margin: 0; font-size: 22px; line-height: 1.25; }
.miracle-card h3 a:hover { color: var(--accent); }
.miracle-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.miracle-card__excerpt {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.miracle-card__archive { margin-top: 4px; }
.miracle-detail__body {
  margin: 18px 0 24px;
  font-size: 16px;
  line-height: 1.7;
  white-space: normal;
}
.miracle-detail__body br + br { display: block; content: ""; margin-top: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.plain { padding-left: 20px; line-height: 1.8; }

.knowledge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.knowledge-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.knowledge-card p,
.knowledge-card__body { color: var(--muted); line-height: 1.6; }
.knowledge-card .compact { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.knowledge-card--video {
  display: flex;
  flex-direction: column;
}
.knowledge-card--video .knowledge-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.knowledge-card--video .knowledge-card__body p {
  margin-top: auto;
}
.knowledge-card--video .knowledge-video {
  margin: 4px 0 16px;
}
.knowledge-card__media {
  margin: 0 0 14px;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
.knowledge-card__media img,
.knowledge-inline-image,
.knowledge-image-field__current img,
.knowledge-image-field__preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}
.knowledge-inline-image {
  margin: 12px 0;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  object-fit: contain;
  max-height: 420px;
  background: var(--bg);
}
.knowledge-image-field {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.knowledge-image-field__file {
  display: grid;
  gap: 8px;
  font-weight: 600;
}
.knowledge-image-field__current,
.knowledge-image-field__preview {
  display: grid;
  gap: 10px;
}
.knowledge-image-field__preview[hidden] { display: none; }
.knowledge-inline-tools {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.knowledge-inline-tools__hint { margin: 0; font-size: 13px; }

.knowledge-course-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: center;
  overflow: hidden;
}
.knowledge-course-promo__copy { display: grid; align-content: center; justify-items: start; }
.knowledge-course-promo__copy h2 { margin-bottom: 10px; }
.knowledge-course-promo__copy p { max-width: 680px; }
.knowledge-course-promo img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius);
}
.course-hero {
  min-height: 300px;
  display: grid;
  align-items: end;
  padding: 30px;
  margin-bottom: 24px;
  border-radius: var(--radius-large);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.course-hero .eyebrow { color: #fed7aa; }
.course-hero__content { max-width: 760px; }
.course-hero__content h2 {
  max-width: 760px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.02;
  margin-bottom: 16px;
}
.course-hero__content p { max-width: 700px; font-size: 16px; line-height: 1.7; }
.course-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.course-hero__actions .ghost { background: rgba(255,255,255,.92); }
.course-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.course-overview__item {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.course-overview__item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.course-overview__item span,
.course-lesson__head span {
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.course-overview__item strong { font-size: 16px; line-height: 22px; }
.course-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.course-toc {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.course-toc nav { display: grid; gap: 6px; }
.course-toc a {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}
.course-toc a:hover { background: var(--bg); color: var(--accent); }
.course-reader { display: grid; gap: 24px; min-width: 0; }
.course-intro,
.course-lesson {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
}
.course-intro__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.course-intro__grid p {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--text);
  line-height: 1.55;
}
.course-lesson { scroll-margin-top: 92px; }
.course-lesson__head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.course-lesson__head h2 { max-width: 820px; margin: 6px 0 8px; }
.course-lesson__head p { max-width: 840px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.course-lesson__body { max-width: 880px; }
.course-text,
.course-list-line { margin-bottom: 14px; font-size: 16px; line-height: 1.78; }
.course-list-line {
  padding-left: 16px;
  border-left: 3px solid rgba(0,164,146,.35);
}
.course-subheading {
  margin: 24px 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}
.course-marker {
  display: inline-flex;
  margin: 22px 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.course-quote {
  margin: 18px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #f8fafc;
  color: var(--text);
  font-size: 16px;
  line-height: 1.72;
}
.course-back-top {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.guide-hero {
  background:
    linear-gradient(90deg, rgba(29,29,27,.88), rgba(29,29,27,.42)),
    radial-gradient(circle at 18% 30%, rgba(255,186,13,.35), transparent 42%),
    radial-gradient(circle at 80% 70%, rgba(15,118,110,.28), transparent 38%),
    #1d1d1b;
}
.guide-article {
  margin: 0 0 28px;
  padding-bottom: 8px;
  scroll-margin-top: 92px;
}
.guide-article h3 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 28px;
}
.guide-callout {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
}
.guide-callout strong { display: block; margin-bottom: 6px; }
.guide-callout p { margin: 0; color: var(--text); line-height: 1.65; }
.guide-list {
  margin: 0 0 18px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  font-size: 16px;
  line-height: 1.7;
}
.guide-ui {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}
.guide-ui > div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.guide-ui dt { font-weight: 800; }
.guide-ui dd { margin: 0; color: var(--muted); line-height: 1.6; }
.guide-legend {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.guide-legend li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.guide-legend .dot { margin-top: 5px; }
.guide-legend p { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }
.guide-nav-preview {
  margin: 0 0 18px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 16px;
  line-height: 1.6;
}
.guide-nav-preview code {
  font-family: inherit;
  font-weight: 800;
  color: var(--text);
}
.guide-toc-sub {
  padding-left: 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
}
.knowledge-guide-promo__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 170px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 40%, rgba(255,186,13,.18), transparent 45%),
    var(--bg);
  border: 1px solid var(--line);
}
.knowledge-guide-promo__visual .dot {
  width: 18px;
  height: 18px;
}

.tree { overflow-x: auto; padding: 8px 0 24px; }
.tree-node {
  display: inline-grid;
  gap: 4px;
  min-width: 210px;
  margin: 8px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
}
.tree-node small { color: var(--muted); font-weight: 500; }
.tree-node.church { background: var(--text); color: #fff; border-color: var(--text); }
.tree-node.region { background: #fff7ed; border-color: #fed7aa; }
.tree-node.group { background: var(--bg); }
.tree-node.leader { border-color: var(--accent); }
.tree-node.future { border-color: var(--teal); }
.tree-branch { margin-left: 28px; padding-left: 20px; border-left: 2px solid var(--line); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card { width: min(560px, 100%); display: grid; gap: 16px; padding: 32px; }
.social-login-actions,
.social-join-choice__actions,
.social-link-actions { display: grid; gap: 10px; }
.social-login-actions,
.social-join-choice__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.social-join-choice { display: grid; gap: 14px; padding: 18px; border: 1px solid rgba(0, 164, 146, .28); border-radius: var(--radius); background: rgba(0, 164, 146, .07); }
.social-join-choice h2 { margin: 0; font-size: 21px; line-height: 28px; }
.social-sdk-button {
  --social-bg: #111;
  --social-fg: #fff;
  --social-border: transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--social-border);
  border-radius: 8px;
  background: var(--social-bg);
  color: var(--social-fg);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  transition: filter .15s ease, transform .15s ease, opacity .15s ease;
}
.social-sdk-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.social-sdk-button--yandex { --social-bg: #000; --social-fg: #fff; }
.social-sdk-button--vk { --social-bg: #0077ff; --social-fg: #fff; }
.social-sdk-button__icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; }
.social-sdk-button__icon svg { width: 24px; height: 24px; display: block; }
.social-sdk-button__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-sdk-button.is-disabled { --social-bg: #f8fafc; --social-fg: var(--muted); --social-border: var(--line); opacity: .82; cursor: not-allowed; }
.social-sdk-button.is-disabled:hover { filter: none; transform: none; }
.social-sdk-button.is-disabled.social-sdk-button--yandex .social-sdk-button__icon,
.social-sdk-button.is-disabled.social-sdk-button--vk .social-sdk-button__icon { filter: grayscale(1); opacity: .68; }
.social-join-choice__status { margin: 0; font-size: 13px; }
.manual-join-fields { display: grid; gap: 16px; }
.social-join-status { display: grid; gap: 6px; padding: 14px; border: 1px solid rgba(0, 164, 146, .28); border-radius: var(--radius); background: rgba(0, 164, 146, .07); }
.social-join-status span { color: var(--muted); font-size: 14px; }
.social-join-status .ghost { justify-self: start; margin-top: 4px; }
.brand--hero { justify-content: center; margin-bottom: 4px; }
.brand--hero .brand-mark { height: 40px; }
.brand--hero .brand-wordmark__crm { font-size: 44px; letter-spacing: -0.03em; }
.brand--hero .brand-wordmark__title { font-size: 17px; gap: 2px; }
.login-subtitle { margin: -8px 0 0; text-align: center; }

.ajax-loading .content { cursor: progress; }
.ajax-loading .content > * { transition: opacity .18s ease; }
.ajax-loading .content > * { opacity: .72; }
.is-submitting { opacity: .72; pointer-events: none; }
.ajax-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: var(--shadow);
  font-weight: 700;
}
.ajax-toast[data-type="error"] { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.ajax-toast[hidden] { display: none; }

@media (max-width: 1120px) {
  .sidebar { grid-template-columns: 1fr; align-items: stretch; gap: 14px; }
  .sidebar nav { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .sidebar-footer { justify-content: flex-start; }
}

@media (max-width: 768px) {
  .sidebar { position: static; min-height: auto; padding: 16px; }
  .brand { min-width: 0; }
  .brand-mark { height: 22px; }
  .brand-wordmark__crm { font-size: 26px; }
  .brand-wordmark__title { font-size: 10px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .sidebar nav a { justify-content: center; background: var(--bg); }
  .sidebar-footer { display: grid; grid-template-columns: 1fr; }
  .content { width: calc(100vw - 32px); padding: 28px 0 48px; }
  .topbar { display: grid; align-items: start; }
  .grid.two, .grid.three, .metric-grid, .knowledge-grid, .miracle-grid, .course-overview, .course-layout, .course-intro__grid, .knowledge-course-promo { grid-template-columns: 1fr; }
  .course-toc { position: static; }
  .course-hero { min-height: 260px; padding: 22px; border-radius: var(--radius); }
  .course-hero__content h2 { font-size: 30px; line-height: 34px; }
  .course-intro, .course-lesson { padding: 20px; border-radius: var(--radius); }
  .knowledge-course-promo img { height: 160px; }
  .form-grid { grid-template-columns: 1fr; }
  .people-filters .panel-head { flex-direction: column; }
  .people-filters-meta { text-align: left; max-width: none; }
  .people-hub-inbox .panel-head { flex-direction: column; align-items: flex-start; }
  .people-hub-inbox-actions { justify-content: flex-start; }
  .people-list-desktop { display: none; }
  .people-list-mobile { display: block; }
  .participant-request-card { grid-template-columns: 1fr; }
  .person-hero { flex-direction: column; }
  .person-hero-actions { justify-content: flex-start; }
  .social-login-actions, .social-join-choice__actions { grid-template-columns: 1fr; }
  .panel, .metric, .login-card { border-radius: var(--radius); }
  .panel { padding: 18px; }
  h1 { font-size: 34px; line-height: 38px; }
  h2 { font-size: 22px; line-height: 30px; }
  .details { grid-template-columns: 1fr; gap: 4px; }
  .care-row { grid-template-columns: auto 1fr; }
  .row-actions { grid-column: 2; }
}

.action-card { display: block; min-height: 150px; }
.action-card p { color: var(--muted); margin-bottom: 0; }
.inline-check { display: inline-flex; justify-content: center; }
.inline-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.inline-form { display: inline-flex; align-items: center; gap: 8px; }
.inline-form select { min-width: 150px; }
.map-board {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 164, 146, .12) 1px, transparent 1px),
    linear-gradient(rgba(0, 164, 146, .12) 1px, transparent 1px),
    #eef7f5;
  background-size: 64px 64px;
}
.map-pin {
  position: absolute;
  width: 230px;
  transform: translate(-50%, -50%);
  padding: 14px 16px;
  border: 1px solid rgba(0, 164, 146, .35);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.map-pin strong, .map-pin span { display: block; }
.map-pin span { color: var(--muted); margin-top: 4px; font-size: 12px; }
.stage-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.stage-strip span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-weight: 700;
}
.lesson-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lesson-row span { color: var(--muted); }
@media (max-width: 768px) {
  .inline-form, .lesson-row { display: grid; grid-template-columns: 1fr; }
  .map-board { min-height: 720px; }
  .map-pin { width: 190px; }
}

.pwa-install-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  border-color: rgba(0, 164, 146, .28);
  background: linear-gradient(0deg, rgba(0, 164, 146, .07), rgba(0, 164, 146, .07)), var(--surface);
}
.pwa-install-panel h2 { margin-bottom: 8px; }
.pwa-install-panel p:last-child { margin-bottom: 0; }
.pwa-install-panel[hidden] { display: none; }
.pwa-install-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.pwa-install-panel .primary { flex: 0 0 auto; }
.pwa-install-dismiss {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
}
.address-field { display: grid; gap: 8px; }
.address-geolocation,
.yandex-address-picker__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.address-geolocation__button.is-loading,
.yandex-address-picker__fill.is-loading { opacity: .7; }
.address-geolocation__status,
.yandex-address-picker__status {
  color: var(--muted);
  font-size: 13px;
}
.address-geolocation__status.is-error,
.yandex-address-picker__status.is-error { color: #b42318; }
.yandex-address-picker {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.yandex-address-picker__label { margin-bottom: 8px; }
.yandex-address-picker__select { min-width: 220px; }
.yandex-address-picker__list {
  margin: 0 0 8px;
  padding-left: 1.2em;
  color: var(--text);
}

.pwa-install-dismiss:hover { color: var(--text); border-color: rgba(0, 0, 0, .18); }
@media (max-width: 768px) {
  .pwa-install-panel { display: grid; }
  .pwa-install-actions { width: 100%; }
  .pwa-install-panel .primary { flex: 1 1 auto; }
}
@media (display-mode: standalone) {
  .pwa-install-panel { display: none; }
}

.public-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.homegroup-hero {
  margin-bottom: 20px;
}

.homegroup-hero.compact h1 {
  margin-bottom: 8px;
}

.homegroup-filters__intro {
  margin: 0 0 16px;
}

.homegroup-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.homegroup-filters__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-dropdown__title {
  font-size: 13px;
  font-weight: 600;
}

.filter-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.filter-dropdown__trigger:hover {
  border-color: #d8d8d8;
}

.filter-dropdown.is-open .filter-dropdown__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(233, 94, 24, .12);
}

.filter-dropdown__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.filter-dropdown__value.is-placeholder {
  color: var(--muted);
  font-weight: 500;
}

.filter-dropdown__chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s ease;
  margin-top: -4px;
  flex-shrink: 0;
}

.filter-dropdown.is-open .filter-dropdown__chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.filter-dropdown__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.filter-dropdown__options {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.filter-dropdown__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.filter-dropdown__option:hover {
  background: var(--bg);
}

.filter-dropdown__option input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.filter-dropdown__footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-time-range {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.homegroup-view {
  margin-top: 20px;
}

.homegroup-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  max-width: 100%;
}

.homegroup-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  color: var(--muted);
}

.homegroup-tabs__tab:hover {
  color: var(--text);
}

.homegroup-tabs__tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.homegroup-tabs__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(233, 94, 24, .12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.homegroup-tab-panel {
  margin-top: 0;
}

.homegroup-map {
  width: 100%;
  min-height: min(70vh, 640px);
  border-radius: var(--radius-large);
  overflow: hidden;
}

.homegroup-list {
  display: grid;
  gap: 12px;
}

.homegroup-card,
.group-catalog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
}

.homegroup-card.is-active,
.group-catalog-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(233, 94, 24, .12);
}

.homegroup-card__church {
  margin: 0 0 6px;
}

.homegroup-card h3 {
  margin: 0 0 8px;
}

.homegroup-balloon__church {
  margin: 0 0 6px;
}

.homegroup-card__meta,
.homegroup-card__address {
  margin: 0 0 8px;
  color: var(--muted);
}

.homegroup-card .primary,
.group-catalog-card .primary {
  display: inline-flex;
  margin-top: 8px;
}

.multi-select {
  min-height: 120px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.time-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.consent-check,
.consent-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.consent-check input[type="checkbox"],
.consent-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.consent-check span,
.consent-box span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.homegroup-balloon {
  max-width: 260px;
  padding: 4px 2px;
}

.homegroup-balloon strong {
  display: block;
  margin-bottom: 6px;
}

.homegroup-balloon p {
  margin: 0 0 6px;
  font-size: 13px;
}

.homegroup-balloon .primary {
  display: inline-flex;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .homegroup-filters__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .homegroup-tabs {
    display: flex;
    width: 100%;
  }

  .homegroup-tabs__tab {
    flex: 1;
    justify-content: center;
    padding: 0 12px;
  }

  .homegroup-map {
    min-height: 420px;
  }
}

@media (max-width: 600px) {
  .filter-dropdown__panel {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    top: auto;
    max-height: min(60vh, 420px);
  }
}

.knowledge-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.knowledge-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.districts-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 960px) {
  .districts-layout { grid-template-columns: 1fr; }
}
.districts-map { min-height: 420px; border-radius: var(--radius); overflow: hidden; background: #f3f4f6; }
.district-catalog-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; margin: 12px 0; }
.district-catalog-item { display: flex; gap: 8px; align-items: flex-start; }
.district-card { display: grid; gap: 12px; }
.districts-sidebar { display: grid; gap: 16px; }

/* Church public landing — phone / tablet / desktop */
.public-shell.church-landing,
.church-landing {
  width: min(48rem, 100%);
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding:
    max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(2.5rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  display: grid;
  gap: clamp(1.25rem, 3.5vw, 2.25rem);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.church-landing__section {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.church-landing__section--hero {
  justify-items: center;
  text-align: center;
  gap: 0.75rem;
  padding-block: clamp(0.25rem, 2vw, 1.25rem);
}
.church-landing__logo {
  margin: 0;
  display: flex;
  justify-content: center;
  max-width: 100%;
}
.church-landing__logo-img {
  display: block;
  width: clamp(9rem, 42vw, 12.5rem);
  height: clamp(9rem, 42vw, 12.5rem);
  max-width: min(100%, 12.5rem);
  object-fit: contain;
}
.church-landing__title {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.65rem, 5.5vw, 2.5rem);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.church-landing__city {
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
}
.church-landing__section h2 {
  margin: 0;
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  line-height: 1.25;
}
.church-landing__prose {
  line-height: 1.55;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
}
.church-landing__address {
  margin: 0;
  line-height: 1.45;
}
.church-landing__subheading {
  margin: 1.25rem 0 0.5rem;
  font-size: clamp(1.05rem, 2.8vw, 1.15rem);
  line-height: 1.3;
  font-weight: 650;
}
.church-landing__gallery {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
.church-landing__gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e8e8e8;
}
.church-landing__gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.church-landing__buttons {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
.church-landing-btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  border: 1px solid transparent;
  background: var(--landing-btn-bg, var(--accent));
  color: var(--landing-btn-fg, #fff);
  -webkit-tap-highlight-color: transparent;
}
.church-landing-btn--primary {
  --landing-btn-bg: var(--accent);
  --landing-btn-fg: #fff;
}
.church-landing-btn--custom {
  --landing-btn-bg: #fff;
  --landing-btn-fg: #111;
  border-color: var(--line);
}
.church-landing-btn__icon,
.church-landing-btn__icon-img {
  width: 1.375rem;
  height: 1.375rem;
  flex: 0 0 1.375rem;
}
.church-landing-btn__icon-img { object-fit: contain; }
.church-landing__pastors {
  display: grid;
  gap: 1rem;
}
.church-landing__ministries {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.45rem;
  list-style: disc;
}
.church-landing__ministries li::marker {
  color: var(--muted);
}
.church-landing__ministries-title {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
a.church-landing__ministries-title:hover {
  color: var(--accent);
  text-decoration: underline;
}
.church-landing__ministries .church-landing__prose {
  margin-top: 0.25rem;
}
.church-landing__pastor {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  align-items: start;
}
.church-landing__pastor-photo {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}
.church-landing__pastor h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.church-landing__contacts,
.church-landing__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.church-landing__contacts a,
.church-landing__list a {
  overflow-wrap: anywhere;
}
.church-landing__map {
  width: 100%;
  min-height: 12.5rem;
  aspect-ratio: 16 / 10;
  max-height: 26rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ececec;
}
.church-landing__faq { display: grid; gap: 0.5rem; }
.church-landing__faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem 0.75rem 0.65rem;
  background: var(--surface);
}
.church-landing__faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding-left: 0.35rem;
}
.church-landing__faq-item summary::-webkit-details-marker,
.church-landing__faq-item summary::marker {
  display: none;
  content: "";
}
.church-landing__faq-item summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.4em;
  margin-left: 0.2rem;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.church-landing__faq-item[open] summary::before {
  margin-top: 0.25em;
  transform: rotate(45deg);
}
.church-landing__faq-item .church-landing__prose {
  margin-top: 0.85rem;
  padding: 0.15rem 0.25rem 0.2rem 1.55rem;
}
.church-landing__crm-link {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: .55;
}
.church-landing__crm-link a { color: inherit; }

@media (min-width: 480px) {
  .church-landing__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .church-landing__pastor {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
  }
  .church-landing__pastor-photo {
    width: 5.5rem;
    height: 5.5rem;
  }
}

@media (min-width: 640px) {
  .public-shell.church-landing,
  .church-landing {
    width: min(42rem, calc(100% - 3rem));
    padding:
      max(1.75rem, env(safe-area-inset-top, 0px))
      max(1.5rem, env(safe-area-inset-right, 0px))
      max(3.5rem, env(safe-area-inset-bottom, 0px))
      max(1.5rem, env(safe-area-inset-left, 0px));
  }
  .church-landing__buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .church-landing__buttons:has(> :only-child) {
    grid-template-columns: 1fr;
  }
  .church-landing__logo-img {
    width: clamp(10.5rem, 22vw, 13.75rem);
    height: clamp(10.5rem, 22vw, 13.75rem);
    max-width: 13.75rem;
  }
}

@media (min-width: 768px) {
  .church-landing__gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .church-landing__map {
    min-height: 16rem;
  }
}

@media (min-width: 960px) {
  .public-shell.church-landing,
  .church-landing {
    width: min(48rem, calc(100% - 4rem));
    padding:
      max(2.5rem, env(safe-area-inset-top, 0px))
      max(2rem, env(safe-area-inset-right, 0px))
      max(4rem, env(safe-area-inset-bottom, 0px))
      max(2rem, env(safe-area-inset-left, 0px));
  }
  .church-landing__logo-img {
    width: 13.75rem;
    height: 13.75rem;
  }
  .church-landing__pastors {
    gap: 1.25rem;
  }
  .church-landing__ministries {
    gap: 0.65rem;
  }
}

/* Church landing constructor */
.landing-media-field {
  display: grid;
  gap: 8px;
}
.landing-media-field__row {
  display: grid;
  gap: 10px;
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}
.landing-media-field__url,
.landing-media-field__file {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.landing-media-field__upload {
  white-space: nowrap;
  min-height: 42px;
}
.landing-media-field__hint { margin: 0; }
.landing-media-field__preview { margin: 0; }
.landing-media-field__preview .brand-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
@media (max-width: 560px) {
  .landing-media-field__row {
    grid-template-columns: 1fr;
  }
  .landing-media-field__upload {
    width: 100%;
  }
}
.church-landing-editor { display: grid; gap: 16px; }
.landing-editor-guide {
  background: #f8fafc;
  border: 1px solid var(--line);
}
.landing-editor-guide__list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 6px;
  line-height: 1.45;
}
.landing-editor-workspace-head {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.landing-editor-workspace-head h3 { margin: 0; }
.landing-editor-workspace {
  display: grid;
  gap: 14px;
}
.landing-editor-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.landing-editor-block.is-hidden-on-landing {
  opacity: .72;
  background: #fafafa;
  border-style: dashed;
}
.landing-editor-block.is-dragging {
  opacity: .65;
  border-style: dashed;
}
.landing-editor-block.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.landing-editor-block__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.landing-editor-block__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.landing-editor-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.landing-editor-empty {
  margin: 0;
  padding: 14px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}
.landing-editor-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.landing-editor-field__label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.landing-editor-row-body {
  display: grid;
  gap: 10px;
}
.landing-editor-row-actions {
  margin-left: auto;
}
.landing-editor-section-title {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.landing-editor-section-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
.landing-editor-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.landing-editor-badge--on {
  background: #e8f7ee;
  color: #176b3a;
}
.landing-editor-badge--off {
  background: #f1f1f1;
  color: #666;
}
.landing-editor-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.landing-editor-jump {
  white-space: nowrap;
}
.church-landing-editor__row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.church-landing-editor__row.is-dragging {
  opacity: .7;
  border-style: dashed;
}
.church-landing-editor__row.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.church-landing-editor__row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.church-landing-editor__handle {
  cursor: grab;
  user-select: none;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f7f7;
  font-size: 14px;
  line-height: 1;
}
.church-landing-editor__handle:active { cursor: grabbing; }
.church-landing-editor__sections,
[data-landing-gallery],
[data-landing-buttons],
[data-landing-pastors],
[data-landing-schedule],
[data-landing-events],
[data-landing-ministries],
[data-landing-faq] { display: grid; gap: 10px; }
.church-landing-editor__sticky {
  position: sticky;
  bottom: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  z-index: 5;
}
@media (max-width: 720px) {
  .landing-editor-block__head,
  .church-landing-editor__row-head {
    flex-direction: column;
    align-items: stretch;
  }
  .landing-editor-row-actions {
    margin-left: 0;
  }
}
