:root {
  color-scheme: light;
  --canvas: #f3f6fa;
  --paper: #ffffff;
  --ink: #24354a;
  --muted: #637186;
  --blue: #245da8;
  --blue-dark: #1d4c8a;
  --blue-soft: #eaf1fc;
  --green: #286b52;
  --green-soft: #eaf4ef;
  --border: #dfe6ee;
  --danger: #a62b3c;
  --danger-soft: #fff1f2;
  --radius: 12px;
  --sidebar-width: 244px;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 2.3vw, 2.25rem); font-weight: 650; letter-spacing: -.04em; }
h2 { font-size: 1.12rem; font-weight: 650; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { max-width: 76ch; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: #cee0fb; color: #17385f; }
:focus-visible { outline: 3px solid #3e83da; outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; color: white; background: var(--blue); border-radius: 7px; transform: translateY(-160%); }
.skip-link:focus { transform: none; color: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Workspace: permanent orientation, quiet chrome. */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--paper); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 30px 18px 20px; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 1.22rem; font-weight: 650; letter-spacing: -.035em; line-height: 1.15; }
.brand:hover { color: var(--ink); }
.app-sidebar > .brand { margin: 0 11px 29px; }
.brand-second { display: block; color: var(--muted); font-size: .86rem; font-weight: 500; letter-spacing: 0; margin-top: 4px; }
.brand-mark { width: 38px; height: 42px; display: grid; place-items: center; background: var(--blue); color: white; border-radius: 10px 10px 4px 4px; flex: 0 0 38px; }
.brand-mark svg { width: 29px; height: 29px; }
.church-switcher { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 25px; color: var(--ink); }
.church-switcher:hover { background: #f7f9fc; border-color: #bfcddd; }
.church-monogram { display: grid; place-items: center; background: var(--green-soft); color: var(--green); width: 33px; height: 35px; border-radius: 6px; flex: 0 0 33px; font-weight: 650; }
.church-switcher-label { flex: 1; min-width: 0; }
.church-switcher-label strong { display: block; font-size: .85rem; line-height: 1.35; overflow-wrap: anywhere; }
.church-switcher-label > span { color: var(--muted); font-size: .74rem; }
.church-switcher > .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--muted); }
.primary-nav { display: grid; gap: 6px; }
.primary-nav > a { display: flex; gap: 13px; align-items: center; min-height: 45px; padding: 11px 13px; border-radius: 7px; color: #596a80; font-weight: 550; font-size: .94rem; }
.primary-nav > a:hover { background: #f2f5f9; color: var(--ink); }
.primary-nav > a.active { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.primary-nav .icon { width: 19px; height: 19px; flex-basis: 19px; }
.sidebar-context { display: flex; gap: 10px; margin: 29px 12px 24px; padding-top: 22px; border-top: 1px solid var(--border); color: #596a80; font-size: .8rem; }
.context-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.context-detail { display: block; font-size: .73rem; color: var(--muted); margin-top: 4px; }
.sidebar-account { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 20px 3px 0; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; display: grid; place-items: center; background: #edf0f5; color: #56677f; font-weight: 650; font-size: .85rem; }
.account-name { flex: 1; min-width: 0; }
.account-name strong { display: block; font-weight: 600; font-size: .8rem; overflow-wrap: anywhere; }
.account-name > span { display: block; font-size: .72rem; color: var(--muted); margin-top: 1px; }
.sidebar-account form { margin: 0; }
.icon-button { border: 0; padding: 8px; min-width: 36px; min-height: 36px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; }
.icon-button:hover { background: #edf2f8; color: var(--blue); }
.workspace { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.workspace-header { min-height: 77px; padding: 16px 36px; display: flex; align-items: center; gap: 16px; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .82); }
.workspace-identity { display: flex; align-items: center; gap: 14px; font-size: .84rem; min-width: 0; }
.workspace-identity strong { font-weight: 550; overflow-wrap: anywhere; }
.workspace-caption { color: var(--muted); }
.workspace-separator { color: #aeb9c7; }
.main-content { width: 100%; max-width: 1510px; margin: 0 auto; padding: 34px 36px 42px; flex: 1; }
.workspace-footer { padding: 17px 36px; display: flex; justify-content: space-between; gap: 16px; font-size: .72rem; color: #69788a; }
.nav-toggle, .sidebar-close { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(24, 41, 64, .38); z-index: 29; }

/* Common page components. */
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 27px; }
.page-header p { margin-top: 8px; font-size: .94rem; color: var(--muted); }
.page-header > div:first-child { min-width: 0; }
.page-header .eyebrow { margin: 0 0 8px; font-size: .76rem; color: var(--muted); }
.page-header h1 + .badge { margin-top: 12px; }
.page-actions, .actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-actions { flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; padding: 10px 16px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; font-size: .85rem; line-height: 1.4; white-space: nowrap; text-align: center; transition: background-color 120ms ease, border-color 120ms ease; }
.btn .icon { width: 17px; height: 17px; flex-basis: 17px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: white; }
.btn-secondary { border-color: #ccd7e4; background: white; color: #435b79; }
.btn-secondary:hover { border-color: #a4b8d1; background: #f4f7fb; color: var(--blue-dark); }
.btn-danger { border-color: #e9bbc2; background: white; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: #8a1b2b; }
.btn-small, .btn-sm { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.btn-full { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 4px; font-size: .81rem; font-weight: 600; white-space: nowrap; }
.text-link .icon { width: 15px; height: 15px; flex-basis: 15px; }
.back-link { display: inline-block; font-size: .84rem; margin-bottom: 17px; }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 22px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 23px; border-bottom: 1px solid #e8edf3; }
.panel-header p { color: var(--muted); font-size: .81rem; margin-top: 5px; }
.panel-body { padding: 23px; }
.panel > h2 { padding: 21px 23px 17px; border-bottom: 1px solid #e8edf3; }
.panel > p { padding: 12px 23px; font-size: .85rem; }
.panel > p:last-child { padding-bottom: 23px; }
.panel > h2 + p { padding-top: 17px; }
.panel > a:not(.btn) { display: inline-block; margin: 12px 23px 23px; font-size: .82rem; font-weight: 600; }
.main-content > .panel + .field-grid, .main-content > .field-grid + .panel, .main-content > .panel + .stats-grid { margin-top: 22px; }
.field-grid > .panel { margin-top: 0; }
.main-content > .alert { margin-bottom: 22px; }
.panel-footnote { display: flex; gap: 7px; align-items: center; border-top: 1px solid #e8edf3; padding: 13px 23px; color: var(--muted); font-size: .73rem; }
.panel-footnote .icon { width: 14px; height: 14px; flex-basis: 14px; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: .73rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge-neutral, .badge-muted { background: #edf1f5; color: #5d6c7e; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-info, .badge-member { background: var(--blue-soft); color: var(--blue); }
.badge-warning { background: #fff3dc; color: #845b13; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.role-badge { flex-shrink: 0; font-size: .73rem; padding: 5px 9px; }
.muted, .text-muted { color: var(--muted); }
.text-small { font-size: .8rem; }
.page-note { font-size: .82rem; color: var(--muted); margin-top: 23px; }
.stack { display: grid; gap: 20px; }
.stack > .panel { margin-top: 0; }
.empty-state { padding: 47px 25px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty-state h2, .empty-state h3 { margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 43ch; font-size: .88rem; }
.empty-state .btn { margin-top: 20px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 49px; height: 49px; color: var(--blue); background: var(--blue-soft); border-radius: 14px; margin-bottom: 20px; }
.empty-icon .icon { width: 25px; height: 25px; flex-basis: 25px; }
.empty-state-wide { grid-column: 1 / -1; }
.messages { display: grid; gap: 10px; margin: 0 0 24px; }
.message, .alert { padding: 12px 16px; border: 1px solid #cad9ed; border-radius: 7px; background: #edf4fd; color: #2e5684; font-size: .88rem; }
.message-success, .alert-success { background: var(--green-soft); border-color: #c9e3d6; color: var(--green); }
.message-error, .alert-error { background: var(--danger-soft); border-color: #f0c9ce; color: var(--danger); }
.message-warning { background: #fff6e4; border-color: #ebd6aa; color: #7c5719; }

/* Dashboard: one numerical overview, then the next gathering. */
.dashboard-heading { margin-bottom: 29px; }
.today-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.today-label .icon { width: 17px; height: 17px; flex-basis: 17px; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: white; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 28px; padding: 22px 0; }
.stat { display: flex; align-items: center; gap: 14px; padding: 0 23px; color: var(--ink); min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat:hover { color: var(--blue); }
.stat > span:not(.stat-icon) { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.stat strong { font-size: 1.85rem; font-weight: 650; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat > span > span { color: var(--muted); font-size: .77rem; }
.stat-icon { width: 42px; height: 44px; flex: 0 0 42px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.stat-icon .icon { width: 21px; height: 21px; }
.stat-icon-green { background: var(--green-soft); color: var(--green); }
.stat-chevron { color: #8798ad; width: 14px; height: 14px; flex-basis: 14px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(300px, 1fr); align-items: start; gap: 25px; }
.agenda-event { display: flex; align-items: center; gap: 18px; color: var(--ink); padding: 23px; min-height: 120px; }
.agenda-event + .agenda-event { border-top: 1px solid #e8edf3; }
.agenda-event:hover { background: #f8fafc; color: var(--ink); }
.agenda-event-next { background: #f5f8fd; min-height: 142px; }
.agenda-event-next:hover { background: #edf3fc; }
.date-tile { width: 58px; flex: 0 0 58px; display: flex; align-items: center; flex-direction: column; padding: 8px 4px; border: 1px solid #d9e3f0; border-radius: 8px; background: white; color: var(--muted); font-size: .65rem; line-height: 1.5; }
.date-tile strong { font-size: 1.7rem; color: #415a7b; line-height: 1.15; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.agenda-event-next .date-tile { border-color: #cbdbf1; }
.agenda-event-next .date-tile strong { color: var(--blue); }
.agenda-event-body { min-width: 0; flex: 1; }
.agenda-event h3 { font-size: 1.02rem; line-height: 1.35; overflow-wrap: anywhere; }
.next-label { display: block; color: var(--blue); font-size: .7rem; font-weight: 600; margin-bottom: 5px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.event-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.event-meta .icon { width: 13px; height: 13px; flex-basis: 13px; }
.agenda-chevron { color: #8295ad; width: 16px; height: 16px; flex-basis: 16px; }
.agenda-empty { min-height: 340px; justify-content: center; }
.dashboard-side { display: grid; gap: 24px; }
.dashboard-side > .panel { margin-top: 0; }
.quick-panel { background: #eaf2ef; border: 1px solid #d5e5dc; border-radius: var(--radius); padding: 23px; }
.quick-panel h2 { color: #2a5446; }
.quick-panel > p { margin-top: 6px; font-size: .81rem; color: #557367; }
.quick-links { display: grid; margin-top: 14px; }
.quick-links > a { display: flex; align-items: center; gap: 11px; color: #2a5446; padding: 12px 0; }
.quick-links > a + a { border-top: 1px solid #d3e1da; }
.quick-links > a:hover strong { color: #174e37; text-decoration: underline; text-underline-offset: 3px; }
.quick-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px; background: rgba(255,255,255,.65); display: grid; place-items: center; }
.quick-icon .icon { width: 17px; height: 17px; }
.quick-links > a > span:nth-child(2) { flex: 1; min-width: 0; }
.quick-links strong { display: block; font-weight: 600; font-size: .84rem; }
.quick-links strong + span { display: block; color: #587467; font-size: .72rem; margin-top: 2px; }
.quick-links > a > .icon { width: 14px; height: 14px; flex-basis: 14px; }
.activity-panel .panel-header { padding-top: 19px; padding-bottom: 18px; }
.activity-dot { background: #529a78; border: 4px solid #ebf5ef; border-radius: 50%; height: 14px; width: 14px; flex: 0 0 14px; }
.activity-list { list-style: none; margin: 0; padding: 20px 23px; display: grid; gap: 20px; }
.activity-list > li { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.activity-marker { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: #bdcfe5; margin-top: 7px; }
.activity-list p { font-size: .81rem; line-height: 1.5; overflow-wrap: anywhere; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; color: var(--muted); font-size: .68rem; margin-top: 6px; }
.activity-meta time { white-space: nowrap; }
.activity-empty p { color: var(--muted); }

/* Directory and event tables: dense, readable, bounded overflow. */
.table-wrap { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .85rem; }
.data-table caption { text-align: left; padding: 17px 21px; color: var(--muted); font-size: .8rem; }
.data-table th { background: #f7f9fc; color: #627187; font-weight: 600; font-size: .73rem; padding: 13px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 16px 20px; border-bottom: 1px solid #e8edf3; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table td:first-child a { font-weight: 600; }
.data-table td p + p, .data-table td div + div { margin-top: 3px; }
.data-table .actions { gap: 6px; }
.data-table .empty-state { display: table-cell; padding: 40px 20px; }
.data-table .empty-state p { margin: auto; }
.data-table .btn { font-size: .76rem; min-height: 34px; padding: 7px 11px; }
.data-table form { margin: 0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.panel > .filters { padding: 20px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.filters .field { flex: 1 1 180px; margin: 0; }
.filters .field:first-child { flex-grow: 2; }
.filters > input { width: min(100%, 360px); }
.filters > select { width: auto; min-width: 160px; }
.filters > label { font-size: .81rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 18px 0; font-size: .82rem; color: var(--muted); }
.panel > .pagination { padding: 18px 20px; border-top: 1px solid var(--border); }
.pagination a { font-weight: 600; }
.pagination > div { display: flex; gap: 13px; align-items: center; }
.pagination .current { padding: 5px 10px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.detail-item { min-width: 0; }
.detail-item > dt, .detail-item > label, .detail-item > .text-muted { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 5px; }
.detail-item > dd { margin: 0; overflow-wrap: anywhere; }
dl.detail-grid { margin: 0; padding: 23px; }
dl dt { color: var(--muted); font-size: .79rem; }
dl dd { margin: 3px 0 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 19px 22px; border: 1px solid var(--border); border-radius: 9px; background: white; }
.stat-card strong { display: block; font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: .8rem; }

/* Forms: native controls with clear labels and recoverable errors. */
form { margin: 0; }
label { color: #3d516d; font-weight: 600; font-size: .83rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { width: 100%; min-height: 42px; border: 1px solid #cad5e2; border-radius: 6px; background: white; color: var(--ink); padding: 10px 12px; line-height: 1.5; transition: border-color 120ms ease, box-shadow 120ms ease; }
input::placeholder, textarea::placeholder { color: #7a899b; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #6797d5; box-shadow: 0 0 0 3px rgba(57, 113, 184, .12); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); width: 17px; height: 17px; vertical-align: middle; margin: 0 6px 2px 0; }
select { padding-right: 30px; }
select[multiple] { padding: 6px; min-height: 130px; }
select[multiple] option { padding: 5px 7px; }
textarea { resize: vertical; min-height: 120px; }
input[readonly] { background: #f4f6f9; color: var(--muted); }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 22px; padding: 20px; }
legend { padding: 0 8px; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field + .field { margin-top: 19px; }
.field-grid .field + .field, .filters .field + .field { margin-top: 0; }
.field input[type="checkbox"] { align-self: flex-start; }
.field-invalid input, .field-invalid select, .field-invalid textarea, [aria-invalid="true"] { border-color: #c86070 !important; }
.field.field-error input, .field.field-error select, .field.field-error textarea { border-color: #c86070; }
.helptext, .help-text { display: block; color: var(--muted); font-size: .75rem; line-height: 1.55; font-weight: 400; }
.helptext ul, .help-text ul { padding-left: 19px; margin: 6px 0 0; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: .79rem; line-height: 1.5; }
.errorlist li + li { margin-top: 4px; }
.field-error { color: var(--danger); font-size: .79rem; }
.form-error, .form-errors { color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c9ce; padding: 12px 14px; border-radius: 6px; font-size: .84rem; margin-bottom: 20px; }
.form-error .errorlist, .form-errors .errorlist { font-size: inherit; }
.form-panel { max-width: 850px; }
.stacked-form, .form-panel > form { padding: 25px; }
.form-panel > form > p { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.form-panel > form > .errorlist { margin-bottom: 7px; }
.panel > form:not(.filters):not(.inline-form) { padding: 23px; }
.panel > form > p { margin-bottom: 18px; }
.panel > form > p > label { display: block; margin-bottom: 7px; }
.panel > form > p > .helptext { margin-top: 6px; }
.panel > form > .page-actions { margin-top: 22px; }
.panel > form > .alert { margin-bottom: 20px; }
.form-actions { border-top: 1px solid var(--border); padding-top: 21px; margin-top: 25px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form .field { flex: 1 1 160px; margin: 0; }
.inline-form > p { flex: 1 1 160px; margin: 0; }
.inline-form > p label { display: block; margin-bottom: 7px; }
.inline-form > select { width: auto; min-width: 160px; flex: 1; }
.inline-form > input { width: auto; flex: 1; }
.inline-form > button { flex: 0 0 auto; }
.panel .inline-form { padding: 18px 22px; }
.data-table .inline-form { padding: 0; }
.panel .panel-header .inline-form { padding: 0; }

/* Multi-church selection and setup. */
.church-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.church-card { display: flex; align-items: center; gap: 19px; min-height: 170px; padding: 27px; border-radius: var(--radius); border: 1px solid var(--border); background: white; color: var(--ink); }
.church-card:hover { border-color: #a9c4e6; background: #fcfdff; color: var(--ink); }
.church-card-mark { display: grid; place-items: center; width: 58px; height: 64px; flex: 0 0 58px; border-radius: 19px 19px 6px 6px; color: var(--blue); background: var(--blue-soft); font-size: 1.65rem; font-weight: 600; }
.church-card:nth-child(even) .church-card-mark { background: var(--green-soft); color: var(--green); }
.church-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.church-card-body > strong { font-size: 1.14rem; line-height: 1.4; overflow-wrap: anywhere; }
.church-card-body > span:not(.badge) { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.church-card-body > .badge { margin-top: 12px; }
.church-card > .icon { color: #8399b3; width: 18px; height: 18px; flex-basis: 18px; }
.setup-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 40px; max-width: 1120px; }
.setup-note { padding: 26px 6px; }
.setup-note .empty-icon { width: 43px; height: 43px; margin-bottom: 17px; }
.setup-note h2 { margin-bottom: 13px; }
.setup-note p { color: var(--muted); font-size: .87rem; line-height: 1.75; max-width: 36ch; }
.setup-note p + p { margin-top: 16px; }

/* Sign in: a simple doorway into the church office. */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; background: #f4f7fb; }
.auth-brand { padding: 32px 44px; }
.auth-brand .brand { width: fit-content; font-size: 1.23rem; }
.auth-brand .brand-mark { width: 34px; height: 38px; flex-basis: 34px; }
.auth-main { width: 100%; max-width: 1080px; margin: auto; padding: 35px 36px 70px; }
.login-layout { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 90px; }
.login-intro { padding: 10px 0; }
.login-intro h1 { font-size: clamp(2.1rem, 3.7vw, 3.3rem); line-height: 1.15; letter-spacing: -.055em; color: #284b75; font-weight: 600; }
.login-intro > p { color: var(--muted); font-size: 1.02rem; line-height: 1.8; max-width: 34ch; margin-top: 23px; }
.login-panel { border-radius: 15px; padding: 39px 35px; background: white; border: 1px solid var(--border); }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { font-size: 1.65rem; font-weight: 650; letter-spacing: -.04em; }
.login-heading p { color: var(--muted); font-size: .87rem; margin-top: 9px; }
.login-form .btn { min-height: 45px; margin-top: 26px; }
.login-form .btn .icon { margin-left: auto; }
.login-form .btn { justify-content: flex-start; }
.login-note { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .77rem; line-height: 1.65; }
.auth-footer { text-align: center; padding: 23px; color: #6c7a8c; font-size: .77rem; }
.welcome-illustration { height: 142px; width: 190px; position: relative; margin-bottom: 36px; }
.window { position: absolute; bottom: 0; border: 2px solid #bad0e9; background: #e7effa; width: 49px; border-radius: 26px 26px 0 0; }
.window-one { left: 0; height: 100px; background: #edf4fa; }
.window-two { left: 58px; height: 140px; border-color: #719ac9; background: #d8e7f7; }
.window-three { left: 116px; height: 116px; border-color: #a6cbbb; background: #e1efe8; }
.window::after { content: ""; position: absolute; height: 1px; left: 0; right: 0; top: 58%; background: currentColor; color: #b4cbe3; }
.window-floor { position: absolute; width: 190px; height: 2px; background: #bfd0df; bottom: 0; left: -13px; }

@media (min-width: 1600px) {
  .main-content { padding-top: 44px; }
}
@media (max-width: 1220px) {
  :root { --sidebar-width: 220px; }
  .app-sidebar { padding-left: 13px; padding-right: 13px; }
  .main-content { padding: 28px 26px 35px; }
  .workspace-header { padding-left: 26px; padding-right: 26px; }
  .workspace-footer { padding-left: 26px; padding-right: 26px; }
  .stat { padding: 0 17px; gap: 10px; }
  .stat-icon { width: 35px; height: 39px; flex-basis: 35px; }
  .stat-chevron { display: none; }
  .dashboard-grid { gap: 19px; grid-template-columns: minmax(0, 1.3fr) minmax(275px, 1fr); }
  .agenda-event, .panel-header { padding-left: 20px; padding-right: 20px; }
  .today-label { font-size: .76rem; }
  .church-card { padding: 22px; }
}
@media (max-width: 1060px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .stats-strip { padding: 20px 0; }
  .stat-icon { display: none; }
  .stat { justify-content: center; padding: 0 20px; }
  .stat strong { font-size: 1.7rem; }
  .today-label { display: none; }
  .setup-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .setup-note { max-width: 650px; padding: 10px; }
  .setup-note p { max-width: 65ch; }
  .church-grid { grid-template-columns: 1fr; }
  .login-layout { gap: 50px; }
}
@media (max-width: 850px) {
  .workspace { margin-left: 0; width: 100%; }
  .app-sidebar { width: 260px; }
  .js .app-sidebar { transform: translateX(-100%); visibility: hidden; transition: transform 180ms ease, visibility 180ms; }
  .js .navigation-open .app-sidebar { transform: translateX(0); visibility: visible; box-shadow: 8px 0 32px rgba(24,41,64,.13); }
  .js .nav-toggle { display: inline-flex; flex-shrink: 0; }
  .js .sidebar-close { display: inline-flex; position: absolute; top: 20px; right: 12px; font-size: 24px; width: 30px; min-width: 30px; }
  .app-sidebar > .brand { margin-top: 5px; }
  .navigation-open { overflow: hidden; }
  .workspace-header { min-height: 65px; gap: 10px; padding: 12px 20px; }
  .workspace-identity { margin-right: auto; gap: 10px; }
  .workspace-caption, .workspace-separator { display: none; }
  .no-js .app-shell { display: block; }
  .no-js .app-sidebar { position: static; width: 100%; padding: 20px; border-bottom: 1px solid var(--border); }
  .no-js .app-sidebar > .brand { margin-bottom: 18px; }
  .no-js .primary-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .no-js .church-switcher { max-width: 320px; margin-bottom: 15px; }
  .no-js .sidebar-account { max-width: 320px; margin-top: 18px; }
  .no-js .sidebar-context { display: none; }
  .auth-main { max-width: 760px; }
  .login-layout { gap: 35px; }
  .login-intro h1 { font-size: 2.35rem; }
  .login-intro > p { font-size: .91rem; }
  .login-panel { padding: 30px 26px; }
}
@media (max-width: 600px) {
  :root { font-size: 14px; }
  .main-content { padding: 25px 18px 30px; }
  .workspace-header { padding: 10px 13px; }
  .workspace-identity { font-size: .78rem; }
  .role-badge { font-size: .65rem; padding: 4px 6px; }
  .workspace-footer { padding: 14px 18px; flex-direction: column; gap: 4px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 22px; }
  .page-header h1 { font-size: 1.8rem; }
  .page-header p { font-size: .85rem; }
  .page-actions { width: 100%; }
  .dashboard-heading { gap: 10px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); padding: 0; margin-bottom: 20px; }
  .stat { padding: 20px; gap: 11px; justify-content: flex-start; }
  .stat-icon { display: grid; width: 34px; height: 38px; flex-basis: 34px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat strong { font-size: 1.5rem; }
  .stat > span > span { font-size: .69rem; }
  .dashboard-side { grid-template-columns: 1fr; gap: 20px; }
  .dashboard-grid { gap: 20px; }
  .panel-header { padding: 19px 18px; gap: 10px; }
  .panel > h2 { padding: 19px 18px 16px; }
  .panel > p { padding-left: 18px; padding-right: 18px; }
  .panel-header h2 { font-size: 1.03rem; }
  .panel-header p { font-size: .75rem; }
  .text-link { font-size: .75rem; }
  .agenda-event { padding: 20px 18px; gap: 13px; }
  .agenda-event h3 { font-size: .95rem; }
  .agenda-chevron { display: none; }
  .date-tile { width: 50px; flex-basis: 50px; }
  .date-tile strong { font-size: 1.6rem; }
  .event-meta { gap: 6px; flex-direction: column; align-items: flex-start; margin-top: 8px; font-size: .71rem; }
  .panel-footnote { padding: 12px 18px; font-size: .67rem; align-items: flex-start; }
  .panel-footnote .icon { margin-top: 2px; }
  .quick-panel { padding: 21px; }
  .activity-list { padding: 20px; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 13px 15px; }
  .data-table th { font-size: .7rem; }
  .filters { gap: 10px; }
  .filters > input, .filters > select { width: 100%; }
  .filters .field { flex-basis: 100%; }
  .filters .btn { flex: 1; }
  .detail-grid, .field-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-full { grid-column: auto; }
  .panel > form:not(.filters):not(.inline-form), .stacked-form, .form-panel > form { padding: 20px; }
  .panel .inline-form { padding: 18px; }
  .data-table .inline-form { padding: 0; }
  .form-actions { gap: 9px; }
  .form-actions .btn { flex: 1; }
  .church-card { gap: 14px; padding: 22px 18px; }
  .church-card-mark { width: 45px; height: 54px; flex-basis: 45px; font-size: 1.4rem; }
  .church-card-body > strong { font-size: 1.04rem; }
  .church-card-body > span:not(.badge) { font-size: .72rem; overflow-wrap: anywhere; }
  .church-card > .icon { width: 14px; height: 14px; flex-basis: 14px; }
  .no-js .primary-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .no-js .primary-nav > a { padding: 10px; font-size: .82rem; }
  .auth-brand { padding: 25px 25px 10px; }
  .auth-main { padding: 25px 22px 35px; margin: 0 auto; }
  .login-layout { grid-template-columns: 1fr; gap: 25px; }
  .login-intro { padding: 0 3px; }
  .welcome-illustration { display: none; }
  .login-intro h1 { font-size: 2rem; line-height: 1.2; }
  .login-intro h1 br { display: none; }
  .login-intro > p { margin-top: 12px; max-width: 44ch; font-size: .88rem; }
  .login-panel { padding: 27px 24px; }
  .login-heading { margin-bottom: 24px; }
  .login-heading h2 { font-size: 1.5rem; }
  .auth-footer { font-size: .7rem; padding: 15px; margin-top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
