:root {
  --church-primary: #0f766e;
  --church-secondary: #0f172a;
  --church-accent: #22c55e;
  --portal-bg: #eef1f4;
  --portal-surface: #ffffff;
  --portal-text: #0f172a;
  --portal-muted: #64748b;
  --portal-border: #e2e8f0;
  --portal-radius: 22px;
  --portal-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.portal-app *,
.portal-app *::before,
.portal-app *::after {
  box-sizing: border-box;
}

.portal-app a {
  -webkit-tap-highlight-color: transparent;
}

body.portal-body {
  margin: 0;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.portal-body-public .portal-topbar {
  position: static;
}

.portal-app {
  min-height: 100vh;
  width: min(100%, 860px);
  margin: 0 auto;
  background: var(--portal-bg);
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 13px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--portal-border);
}

.portal-topbar--home {
  background: #17479f;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.portal-brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--portal-border);
  background: #fff;
}

.portal-brand-text {
  min-width: 0;
}

.portal-brand-text strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-brand-text span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--portal-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-topbar--home .portal-brand-text strong,
.portal-topbar--home .portal-brand-text span {
  color: #ffffff;
}

.portal-header-right,
.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-topbar-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: #ffffff;
  color: #334155;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.portal-topbar-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.portal-topbar-icon em {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.portal-topbar-icon.is-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.portal-topbar--home .portal-topbar-icon {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.portal-topbar-tabs-wrap {
  background: #17479f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-top-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 420px;
  margin: 0 auto;
}

.portal-top-tabs a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 46px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.portal-top-tabs a.is-active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.portal-content {
  padding: 0;
}

.portal-page {
  padding-bottom: 112px;
}

.portal-container {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 16px;
}

.portal-alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

.portal-alert.is-success {
  background: #dcfce7;
  color: #166534;
}

.portal-alert.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.portal-dashboard {
  display: grid;
  gap: 16px;
}

.portal-welcome-card {
  border-radius: 26px;
  padding: 20px;
  background: linear-gradient(135deg, var(--church-primary), var(--church-secondary));
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  color: #ffffff;
}

.welcome-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.member-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  overflow: hidden;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.9;
}

.portal-welcome-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.portal-welcome-card p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.94;
}

.portal-welcome-card .portal-btn {
  margin-top: 14px;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
}

.portal-home-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portal-pill-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #e7e9ee;
  background: #ffffff;
  color: var(--portal-text);
  text-decoration: none;
}

.portal-pill-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: #fef3c7;
  color: #854d0e;
}

.portal-pill-icon.is-secondary {
  background: #f3e8ff;
  color: #6b21a8;
}

.portal-pill-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.portal-pill-card small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--portal-muted);
}

.portal-feature-card {
  position: relative;
  min-height: 230px;
  border-radius: 24px;
  overflow: hidden;
  background: #d1d5db;
}

.portal-feature-card img,
.portal-feature-fallback {
  width: 100%;
  min-height: 230px;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-feature-fallback {
  background: linear-gradient(130deg, #274472, #4a6fa5);
}

.portal-feature-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 18px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.66));
}

.portal-feature-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.portal-feature-overlay h2 {
  margin: 10px 0 12px;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.portal-feature-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.portal-section {
  margin-top: 8px;
}

.portal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.portal-section-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #1f2937;
}

.portal-section-header a {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--church-primary);
}

.portal-trending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-trending-item {
  min-height: 98px;
  border-radius: 14px;
  overflow: hidden;
  background: #d1d5db;
}

.portal-trending-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 112px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: var(--portal-shadow);
  color: #111827;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.09);
}

.portal-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.1);
  color: var(--church-primary);
}

.portal-action-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.portal-action-card strong {
  font-size: 15px;
  line-height: 1.2;
}

.portal-action-card span {
  font-size: 12px;
  line-height: 1.35;
  color: var(--portal-muted);
}

.portal-empty {
  padding: 18px;
  border: 1px dashed #d1d5db;
  border-radius: 22px;
  background: #ffffff;
  color: #6b7280;
  line-height: 1.45;
}

.portal-empty strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
  font-size: 15px;
}

p.portal-empty {
  margin: 0;
}

.portal-stack {
  display: grid;
  gap: 10px;
}

.portal-content-card,
.portal-event-card,
.portal-giving-card,
.portal-card {
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  padding: 16px;
}

.portal-card + .portal-card {
  margin-top: 14px;
}

.portal-content-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.portal-content-meta span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 650;
}

.portal-content-meta small {
  color: var(--portal-muted);
}

.portal-content-card h3,
.portal-giving-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.portal-content-card p,
.portal-giving-card p {
  margin: 7px 0 0;
  color: var(--portal-muted);
  line-height: 1.5;
}

.portal-react-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.portal-react-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1f2937;
  font-size: 17px;
}

.portal-react-row em {
  font-style: normal;
  color: #f43f5e;
  font-size: 22px;
  line-height: 1;
}

.portal-event-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-date-pill {
  width: 54px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--church-primary);
  display: grid;
  place-items: center;
}

.event-date-pill span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-date-pill strong {
  font-size: 22px;
  font-weight: 800;
}

.event-info h3 {
  margin: 0;
  font-size: 16px;
}

.event-info p,
.event-info small {
  margin: 4px 0 0;
  color: var(--portal-muted);
}

.portal-giving-card .give-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: var(--church-primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.portal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.portal-meta-row small {
  color: var(--portal-muted);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--church-primary);
  font-size: 12px;
  font-weight: 700;
}

.portal-chip,
.portal-chip-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--portal-border);
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.portal-chip-soft {
  background: #f8fafc;
}

.portal-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--church-primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.portal-btn-secondary {
  border-color: var(--portal-border);
  background: #ffffff;
  color: #1f2937;
}

.portal-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
}

.portal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.portal-section-head h1,
.portal-section-head h2,
.portal-section-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.portal-section-head p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  line-height: 1.45;
}

.portal-link-inline {
  color: var(--church-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.portal-list,
.portal-member-list,
.portal-menu-list,
.portal-message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.portal-list li,
.portal-member-list article,
.portal-message-item {
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.portal-list li span {
  display: block;
  margin-top: 4px;
  color: var(--portal-muted);
}

.portal-list-item {
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.portal-list-item p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.portal-list-item .portal-btn {
  justify-self: flex-start;
}

.portal-kpi-grid {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.portal-kpi-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-kpi-card {
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.portal-kpi-card small {
  color: var(--portal-muted);
}

.portal-kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.portal-kpi-card span {
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-kpi-spacing {
  margin-top: 12px;
}

.portal-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.portal-form label {
  font-size: 13px;
  color: var(--portal-muted);
}

.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-form-inline input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 15px;
}

.portal-form textarea {
  min-height: 110px;
  resize: vertical;
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus,
.portal-form-inline input:focus {
  outline: none;
  border-color: var(--church-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.portal-form-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.portal-form-inline .portal-btn {
  min-width: 110px;
}

.portal-form-structured {
  gap: 14px;
}

.portal-form-block {
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  background: #f8fafc;
  padding: 14px;
}

.portal-form-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.2;
  color: #0f172a;
}

.portal-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.portal-field-span-2 {
  grid-column: 1 / -1;
}

.portal-form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-message-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.6fr);
  gap: 14px;
  margin-top: 14px;
}

.portal-thread-list-card,
.portal-thread-messages-card {
  min-height: 430px;
}

.portal-thread-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.portal-thread-list a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
  text-decoration: none;
  color: #1f2937;
}

.portal-thread-list a.is-active {
  border-color: rgba(15, 118, 110, 0.4);
  background: rgba(15, 118, 110, 0.08);
}

.portal-thread-list a small,
.portal-thread-list a span {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-unread-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.portal-thread-messages {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

.portal-chat-bubble {
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
}

.portal-chat-bubble.is-mine {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
}

.portal-chat-bubble header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-chat-bubble header small {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-chat-bubble p {
  margin: 6px 0 0;
  color: #0f172a;
  line-height: 1.5;
}

.portal-thread-compose {
  margin-top: 12px;
}

.portal-empty-block {
  text-align: center;
  padding: 20px 8px;
  color: var(--portal-muted);
}

.portal-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--portal-border);
}

.portal-status-pill.is-unread {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.portal-status-pill.is-read {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.portal-menu-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.portal-menu-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: #ffffff;
  padding: 12px;
  color: var(--portal-text);
  text-decoration: none;
}

.portal-menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--church-primary);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.portal-menu-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.portal-menu-copy small {
  display: block;
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-menu-chevron {
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
}

.portal-member-list article {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-member-list .avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: #f3f4f6;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #475569;
  font-weight: 700;
}

.portal-member-list .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-member-meta {
  min-width: 0;
}

.portal-muted-line {
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 14px;
}

.portal-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-profile-span-2 {
  grid-column: 1 / -1;
}

.portal-profile-grid div,
.portal-public-meta div {
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.portal-profile-grid label,
.portal-public-meta label {
  display: block;
  margin-bottom: 4px;
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-profile-grid strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.portal-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-profile-head-copy {
  min-width: 0;
  flex: 1 1 220px;
}

.portal-profile-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--portal-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portal-profile-head-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.portal-profile-head-copy p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  line-height: 1.4;
}

.portal-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 1px solid var(--portal-border);
  background: #f3f4f6;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #475569;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.portal-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-checkbox-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.portal-checkbox {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #ffffff;
}

.portal-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-checkbox-ui {
  width: 20px;
  height: 20px;
  border: 1.5px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  margin-top: 1px;
  transition: all 0.18s ease;
}

.portal-checkbox-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: #0f172a;
}

.portal-checkbox-copy small {
  display: block;
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.35;
}

.portal-checkbox input:checked + .portal-checkbox-ui {
  border-color: var(--church-primary);
  background: var(--church-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.portal-checkbox input:checked + .portal-checkbox-ui::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  margin: 2px 0 0 6px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.portal-checkbox input:focus-visible + .portal-checkbox-ui {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.portal-app input[type="checkbox"] {
  accent-color: var(--church-primary);
}

.portal-public-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.portal-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--church-primary);
}

.portal-card-hero {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.07), #ffffff);
}

.portal-copy-block {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.portal-bullet-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  display: grid;
  gap: 8px;
}

.portal-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-auth-card {
  max-width: 620px;
  margin: 20px auto;
}

.portal-logout-wrap {
  display: flex;
  justify-content: flex-end;
}

.portal-footer {
  margin-top: 18px;
  color: var(--portal-muted);
  font-size: 12px;
  text-align: center;
}

.portal-giving-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-bottom-nav {
  --portal-nav-count: 5;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(var(--portal-nav-count), minmax(0, 1fr));
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.08);
  z-index: 100;
}

.portal-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.portal-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  border: 1px solid var(--portal-border);
  background: #ffffff;
  display: grid;
  place-items: center;
}

.portal-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.portal-nav-label {
  line-height: 1;
}

.portal-bottom-nav a.is-active,
.portal-bottom-nav a.active {
  color: var(--church-primary);
}

.portal-bottom-nav a.is-active .portal-nav-icon,
.portal-bottom-nav a.active .portal-nav-icon {
  border-color: rgba(15, 118, 110, 0.4);
  background: rgba(15, 118, 110, 0.1);
}

.is-touching {
  transform: scale(0.99);
}

@media (min-width: 768px) {
  .portal-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .portal-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-giving-grid,
  .portal-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .portal-bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(100%, 860px);
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
  }
}

@media (max-width: 760px) {
  .portal-feature-overlay h2 {
    font-size: 29px;
  }

  .portal-section-header h2,
  .portal-section-head h1,
  .portal-section-head h2,
  .portal-section-head h3 {
    font-size: 18px;
  }
}

@media (max-width: 720px) {
  .portal-actions-grid,
  .portal-stack,
  .portal-menu-grid,
  .portal-kpi-grid-4,
  .portal-profile-grid,
  .portal-public-meta,
  .portal-home-pills,
  .portal-giving-grid {
    grid-template-columns: 1fr;
  }

  .portal-field-grid {
    grid-template-columns: 1fr;
  }

  .portal-form-inline {
    grid-template-columns: 1fr;
  }

  .portal-message-shell {
    grid-template-columns: 1fr;
  }

  .portal-logout-wrap .portal-btn {
    width: 100%;
  }
}
