:root {
    color-scheme: light;
    --brand: #007a3d;
    --brand-dark: #006b34;
    --brand-soft: #eaf5ee;
    --text: #202923;
    --muted: #66736a;
    --line: #e8ece9;
    --surface: #fff;
    --page: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--page);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; margin: 0; }
body { background: var(--page); }
button, input, textarea, select { font: inherit; }
a { color: var(--brand-dark); }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100dvh; }
.app-shell:has(.home-page) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.app-shell:not(:has(.home-page)) .bottom-nav { display: none; }
.page-content { --page-gutter: 18px; width: min(100%, 800px); margin: 0 auto; padding: 0 var(--page-gutter) 28px; }
.page-content:focus { outline: none; }

.bottom-nav {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(calc(100% - 32px), 768px);
    height: 64px;
    padding: 6px 12px;
    border-radius: 18px;
    background: var(--brand);
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

.install-notice { position: fixed; z-index: 21; inset-inline: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 520px); margin-inline: auto; padding: 6px 8px 6px 12px; border: 1px solid #d6e7db; border-radius: 15px; display: flex; align-items: center; gap: 8px; color: var(--text); background: #f8fbf9; box-shadow: 0 2px 8px rgb(20 55 34 / 10%); }
.install-notice-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.install-notice-copy strong { color: var(--brand-dark); font-size: 13px; }
.install-notice-copy small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.install-account-link { color: var(--muted); font-size: 10px; line-height: 1.3; text-decoration: none; }
.install-account-link:hover, .install-account-link:focus-visible { color: var(--brand-dark); text-decoration: underline; }
.user-admin-help { margin: -6px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.install-notice-action { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.install-notice-close { flex: 0 0 36px; height: 38px; padding: 0; border: 0; color: #57665d; background: transparent; font-size: 22px; cursor: pointer; }
.install-settings-help { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pwa-update[hidden] { display: none; }
.pwa-update { position: fixed; z-index: 22; inset-inline: 16px; top: calc(10px + env(safe-area-inset-top)); max-width: 400px; margin-inline: auto; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid #d6e7db; border-radius: 15px; background: #f8fbf9; box-shadow: 0 2px 8px rgb(20 55 34 / 10%); }
.pwa-update [role="status"] { flex: 1; color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.pwa-update button:disabled { opacity: .65; cursor: wait; }

.nav-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #fff;
    text-decoration: none;
    opacity: .88;
}

.navigation-icon { display: block; }
.navigation-icon svg { display: block; width: 100%; height: 100%; }
.nav-item .navigation-icon { width: 26px; height: 26px; }
.nav-item span { font-size: 11px; line-height: 14px; }
.nav-item.active { opacity: 1; font-weight: 700; }
.nav-item:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #e3ad46; outline-offset: 3px; }

/* Home follows the MAUI screen: logo, 3-column shortcuts, and bottom navigation. */
.page-content:has(.home-page) { padding: 0; }
.home-page { min-height: calc(100dvh - 84px - env(safe-area-inset-bottom)); display: grid; grid-template-rows: 210px 1fr auto 1fr; }
.home-page:has(.install-notice) { padding-bottom: 68px; }
.home-page:has(.install-notice small) { padding-bottom: 116px; }
.home-brand-area { position: relative; margin: 0 24px; display: grid; place-items: center; }
.home-logo { width: 100%; height: 210px; object-fit: contain; }
.login-status { position: absolute; top: 8px; right: 0; font-size: 14px; }
.login-status.logged-out { color: #66736a; }
.login-status.logged-in { color: var(--brand-dark); }
.home-verificar-email { position: absolute; top: 32px; right: 0; font-size: 12px; text-align: right; }
.home-grid { grid-row: 3; width: min(100%, 720px); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
.home-tile { display: flex; flex-direction: column; align-items: center; color: #111; text-align: center; text-decoration: none; font-size: 13px; }
.home-tile .navigation-icon { width: 90px; height: 90px; }
.home-tile:last-child { grid-column: 2; }

.page-heading { position: sticky; z-index: 10; top: 0; margin: 0 calc(-1 * var(--page-gutter)) 12px; padding-top: env(safe-area-inset-top); color: #fff; background: var(--brand); }
@supports (width: 100cqw) {
    .app-shell { container-type: inline-size; }
    .page-heading { width: 100cqw; margin-inline: calc((100% - 100cqw) / 2); }
}
.page-toolbar { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; min-height: 56px; padding: 4px 5px; }
.page-toolbar-center { grid-column: 2; min-width: 0; padding-inline: 4px; }
.page-toolbar-actions { grid-column: 3; display: flex; }
.page-heading-copy { padding: 0 24px 24px; }
.page-heading-centered { text-align: center; }
.back-link, .toolbar-icon { width: 48px; height: 48px; padding: 12px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; cursor: pointer; }
.back-link img, .toolbar-icon img { width: 24px; height: 24px; object-fit: contain; }
.toolbar-icon:focus-within { outline: 3px solid #e3ad46; outline-offset: -3px; }
.bible-edition-select { width: 100%; min-height: 48px; padding: 4px 8px; border: 1px solid #b9e4c8; border-radius: 12px; color: white; background: var(--brand-dark); text-align: center; font-weight: 650; }
.eyebrow { margin: 0 0 4px; color: var(--brand-dark); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.page-heading h1 { margin: 0; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
/* O Blazor foca o título ao navegar para anunciar a página aos leitores de tela. */
.page-heading h1:focus { outline: none; }
.page-heading p { margin: 6px 0 0; font-size: 14px; line-height: 1.4; }
.maui-search { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 10px; padding-inline: 14px; border-radius: 18px; background: #f3f6f4; }
.maui-search img { width: 22px; height: 22px; }
.maui-search input { min-width: 0; min-height: 48px; border: 0; background: transparent; color: var(--text); }
.maui-search input::placeholder { color: #69776e; }

.content-stack { display: flex; flex-direction: column; gap: 14px; }
.content-card, .state-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.content-card h2, .content-card h3 { margin: 0 0 10px; }
.content-card h2 { font-size: 19px; }
.content-card h3 { margin-top: 20px; font-size: 16px; }
.content-card p { color: #414a44; line-height: 1.55; }
.content-card p:last-child { margin-bottom: 0; }
.schedule-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row div { display: flex; flex-direction: column; gap: 4px; }
.schedule-row strong { font-size: 15px; }
.schedule-row span { color: var(--muted); font-size: 13px; }
.schedule-row time { white-space: nowrap; color: var(--brand-dark); font-size: 15px; font-weight: 650; }
.link-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.link-list a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); text-decoration: none; font-size: 14px; font-weight: 600; }
.map-frame-wrap { width: 100%; height: 280px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.map-frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.about-page { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 2px; color: #171717; font-size: 15px; line-height: 1.5; }
.about-page :is(h2, h3, p, dl, dd) { margin: 0; }
.about-page h2 { text-align: center; font-size: 20px; font-weight: 400; }
.about-page h3 { margin-top: 12px; color: var(--brand); font-size: 15px; font-weight: 500; }
.about-page hr { width: 100%; margin: 16px 0 0; border: 0; border-top: 1px solid #eee; }
.about-church-logo { width: 100%; height: 160px; object-fit: contain; }
.about-fields > div { padding: 8px 0; border-block-start: 1px solid #eee; }
.about-fields:not(.about-contact, .about-faith) > div:last-child { border-block-end: 1px solid #eee; }
.about-contact > div:first-child, .about-faith > div { border-block-start: 0; }
.about-fields dt { margin-bottom: 4px; color: #666; font-size: 12px; }
.about-fields a { display: inline-block; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.about-fields a:hover { text-decoration: underline; }
.about-page .map-frame-wrap { height: 200px; margin: 0; border: 0; border-radius: 0; }
.about-directions { margin-bottom: 8px; }
.about-social { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.about-social a, .about-ipb { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; text-align: center; text-decoration: none; font-size: 12px; }
.about-social img { width: 100%; height: 72px; padding: 14px 6px; object-fit: contain; }
.about-ipb { align-self: center; }
.about-ipb img { width: 180px; height: 130px; padding: 10px; object-fit: contain; }

.state-card { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.error-state { display: block; color: #8f2222; background: #fff8f8; border-color: #f1dada; }
.error-state p { margin-top: 0; }
.loading-spinner { width: 22px; height: 22px; border: 3px solid #dce8df; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.app-startup { min-height: 100dvh; display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--brand-dark); }
@keyframes spin { to { transform: rotate(360deg); } }

.primary-button, .secondary-button { min-height: 46px; padding: 11px 18px; border: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 650; text-align: center; cursor: pointer; }
.primary-button { color: #fff; background: var(--brand); }
.primary-button:disabled, .secondary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button { color: var(--brand-dark); background: var(--brand-soft); }
.button-link { text-decoration: none; }
.full-button { width: 100%; margin-top: 20px; }
.form-card { max-width: 600px; margin: 0 auto; padding: 22px; }
.login-form-card { max-width: 480px; padding: 24px; }
.login-logo { display: block; width: 100%; height: 100px; margin: 10px auto 5px; object-fit: contain; }
.field-label { display: block; margin: 16px 0 7px; color: #303a33; font-size: 14px; font-weight: 650; }
.text-field { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd3cd; border-radius: 10px; background: #fff; color: var(--text); outline: none; }
.text-field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(0 122 61 / 12%); }
.password-field { position: relative; display: flex; align-items: center; }
.password-field .text-field { padding-right: 54px; }
.password-toggle { position: absolute; right: 2px; width: 44px; height: 44px; padding: 10px; border: 0; display: grid; place-items: center; background: transparent; cursor: pointer; }
.password-toggle img { width: 24px; height: 24px; }
.text-button { padding: 8px; border: 0; background: transparent; color: var(--brand-dark); font-size: 13px; font-weight: 650; cursor: pointer; }
.login-assistance { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.login-register-button { min-height: 46px; border: 0; border-radius: 12px; color: var(--brand-dark); background: var(--brand-soft); font-size: 14px; font-weight: 600; cursor: pointer; }
.login-forgot-button { min-height: 40px; border: 0; color: var(--brand-dark); background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-help-copy { margin: 0; padding: 10px 12px; border-radius: 10px; color: var(--muted); background: #f6f8f6; font-size: 13px; line-height: 1.45; }
.password-instructions { margin: 4px 0 8px; color: var(--text); font-size: 14px; line-height: 1.5; }
.help-details { margin-top: 20px; color: var(--brand-dark); font-size: 14px; }
.help-details summary { cursor: pointer; font-weight: 650; }
.help-details p, .quiet-copy { color: var(--muted); font-size: 13px; line-height: 1.5; }
.quiet-copy { margin: 18px 0 0; }
.form-alert { padding: 12px; border: 1px solid #f1dada; border-radius: 10px; color: #8f2222; background: #fff8f8; font-size: 14px; line-height: 1.45; }
.empty-card { text-align: center; }
.empty-card .button-link { margin-top: 10px; }
.account-card { display: flex; align-items: center; gap: 16px; }
.account-card h2 { margin-bottom: 5px; }
.account-card p:last-child { margin: 0; font-size: 14px; }
.account-avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 60px; color: #fff; background: var(--brand); font-size: 19px; font-weight: 700; }
.notice-card { border-color: #ead7ad; background: #fffcf4; }
.action-card { min-height: 70px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); background: var(--surface); text-decoration: none; }
.action-card > span:first-child { display: flex; flex-direction: column; gap: 5px; }
.action-card strong { font-size: 15px; }
.action-card small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.action-card > span:last-child { color: var(--brand); font-size: 25px; }
.settings-page { width: min(100%, 640px); margin-inline: auto; padding: 12px 6px 0; }
.settings-group { display: flex; flex-direction: column; gap: 14px; }
.settings-group + .settings-group { margin-top: 4px; }
.settings-group h2 { margin: 2px 0 2px; color: var(--brand-dark); font-size: 18px; }
.settings-button { min-height: 64px; display: grid; place-items: center; padding: 12px 20px; border: 1px solid #dce9e0; border-radius: 16px; background: white; color: var(--brand-dark); text-align: center; text-decoration: none; font-size: 17px; font-weight: 700; cursor: pointer; }
.settings-account { border-color: var(--brand); background: var(--brand); color: white; }
.settings-signout { margin-top: 10px; border-color: #f0dada; background: #faeeee; color: #a13a3a; }
.signout-button { width: 100%; margin-top: 2px; color: #a13a3a; background: #faeeee; }
.settings-logo { width: min(240px, 65%); height: 80px; margin: 8px auto 16px; object-fit: contain; }
.text-area { min-height: 110px; resize: vertical; line-height: 1.5; }
.compact-area { min-height: 70px; }
.admin-form-section h2 { margin-bottom: 12px; color: #174a2b; }
.admin-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.admin-span-two { grid-column: 1 / -1; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-section-heading h2 { margin: 0 0 5px; }
.admin-section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.schedule-editor-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.schedule-editor-group h3 { margin: 0 0 10px; color: var(--brand-dark); }
.schedule-editor-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(110px, .7fr) minmax(130px, .9fr); gap: 0 10px; align-items: end; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; }
.schedule-editor-row .field-label { min-width: 0; margin: 0 0 10px; }
.remove-row-button { grid-column: 3; justify-self: end; padding: 8px 10px; border: 0; border-radius: 9px; color: #a13a3a; background: #faeeee; cursor: pointer; }
.save-message { margin: 0; padding: 12px; border-radius: 10px; }
.success-message { color: #145d32; background: var(--brand-soft); }
.document-card, .document-item { min-height: 82px; }
.document-card strong, .document-item strong { color: #174a2b; }
.document-item small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.source-notes { background: #f8fbf8; }
.source-notes h2 { color: var(--brand-dark); }
.credit-line { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.scanned-page-card h2 { color: #174a2b; }
.scanned-page { display: block; width: 100%; height: auto; max-height: 76vh; object-fit: contain; background: #f7f5ef; }
.page-switcher, .reading-navigation { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.page-switcher { margin-top: 12px; }
.page-switcher span { color: var(--muted); font-size: 12px; text-align: center; white-space: nowrap; }
.page-switcher .secondary-button { padding: 8px 10px; font-size: 12px; }
.reading-card { padding: 22px; }
.reading-card h2 { margin-bottom: 16px; font-size: 20px; line-height: 1.45; }
.reference-box { margin-top: 18px; padding: 14px; border-radius: 12px; color: #174a2b; background: #f0f7f2; }
.reference-box p { margin: 6px 0 0; color: #526057; font-size: 14px; }
.reading-navigation { margin-top: 4px; }
.reading-navigation > :first-child { justify-self: start; }
.reading-navigation > :last-child { justify-self: end; }
.hymn-row { min-height: 64px; padding: 12px 14px; border: 1px solid #dce9e0; border-radius: 14px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; align-items: center; gap: 12px; color: #174a2b; background: #f8fbf8; text-decoration: none; }
.hymn-row strong { color: var(--brand-dark); font-size: 17px; text-align: center; }
.hymn-row span:last-child { color: var(--brand); font-size: 24px; text-align: right; }
.hymn-reading pre { margin: 12px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #26332a; font-family: inherit; font-size: 19px; line-height: 1.75; }
.button-row, .import-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row > * { flex: 1 1 auto; }
.delete-button { color: #a13a3a; background: #faeeee; }
.lyrics-editor { min-height: 280px; white-space: pre-wrap; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.event-form { max-width: 680px; margin-inline: auto; padding: 0 2px 12px; }
.event-form-fields { display: flex; flex-direction: column; gap: 8px; }
.event-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-form .field-label { margin: 8px 0 0; color: #263b2d; font-size: 15px; }
.event-form .text-field { display: block; min-width: 0; min-height: 54px; margin-top: 4px; font-size: 16px; }
.event-form .quiet-copy { margin: 0; font-size: 12px; }
.event-form .file-button { width: 100%; }
.event-form .rich-editor-frame { min-height: 340px; }
.event-form .rich-editor { min-height: 284px; }
.event-form .full-button { min-height: 48px; margin-top: 4px; border-radius: 6px; }
.event-form .event-cancel { border: 1px solid var(--brand); background: white; }
.event-form .event-time-button { color: #263b2d; font-size: 17px; font-weight: 700; cursor: pointer; }
.event-time-dialog { width: min(calc(100% - 32px), 480px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 12px; }
.event-time-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.event-time-dialog h2 { margin: 0; padding: 20px 24px; background: var(--brand); color: white; font-size: 24px; }
.event-time-options { padding: 4px 24px 24px; }
.event-time-options .field-label { color: var(--brand-dark); }
.event-author { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: #304638; font-size: 13px; }
.event-author img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; background: #f1f7f3; }
.event-author small { margin: 0; }
.event-details-button { width: 100%; margin-top: 12px; border-radius: 14px; }
.event-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--brand-soft); }
.event-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; color: var(--brand-dark); background: transparent; font-weight: 650; cursor: pointer; }
.event-tabs button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.event-attendee-event { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.event-registration h2 { margin-bottom: 12px; }
.event-registration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-confirmation { margin-top: 12px; padding: 12px; background: var(--brand-soft); border-radius: 12px; }
.request-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.request-details { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.request-details p { margin: 4px 0; }
.approval-notice { position: fixed; z-index: 22; inset: auto 16px calc(84px + env(safe-area-inset-bottom)); width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 8px rgb(20 55 34 / 18%); }
.event-attendees { display: grid; gap: 10px; padding: 0; margin: 0 0 14px; list-style: none; }
.event-attendee { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbf9; }
.event-attendee img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.event-attendee strong { color: var(--brand-dark); overflow-wrap: anywhere; }
.event-attendee-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 5px; font-size: 14px; }
.event-attendee-contacts a { overflow-wrap: anywhere; }
.event-whatsapp { padding: 4px 9px; border-radius: 8px; background: var(--brand-soft); font-weight: 650; text-decoration: none; }
.form-cover { height: 150px; margin-bottom: 10px; border-radius: 16px; }
.rich-editor-frame { overflow: hidden; border: 1px solid #dce8e1; border-radius: 12px; }
.rich-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid #dce8e1; background: #f7faf8; }
.rich-toolbar span { margin: 0 5px 0 2px; color: var(--muted); font-size: 12px; font-weight: 650; }
.rich-toolbar button { min-width: 40px; min-height: 40px; padding: 6px 9px; border: 1px solid #dce8e1; border-radius: 8px; color: #174a2b; background: #fff; cursor: pointer; }
.rich-toolbar button:active { color: #fff; background: var(--brand); }
.rich-editor { min-height: 250px; padding: 14px; outline: none; color: #303a33; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #89948c; pointer-events: none; }
.rich-editor p, .rich-editor div { margin: 0 0 9px; }
.rich-editor h2, .rich-editor h3 { margin: 14px 0 8px; color: #174a2b; }
.rich-editor ul, .rich-editor ol { margin: 6px 0 10px; padding-left: 24px; }
.rich-editor blockquote { margin: 8px 0; padding: 5px 0 5px 12px; border-left: 3px solid var(--brand); color: #526057; }
.version-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.version-row .field-label { margin-top: 0; }
.bible-import-button { margin-bottom: 0; white-space: nowrap; }
.progress-copy { text-align: center; }
.credit-details { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #f8fbf8; font-size: 13px; line-height: 1.5; }
.credit-details summary { color: var(--brand-dark); font-weight: 650; cursor: pointer; }
.credit-details p { margin: 10px 0; }
.credit-details a { color: var(--brand-dark); }
.bible-book-list { gap: 0; }
.bible-book-row { min-height: 45px; padding: 8px 4px 8px 8px; border-bottom: 1px solid #e8e8e8; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; color: #303a33; font-size: 17px; text-decoration: none; }
.bible-book-row strong { color: var(--brand); font-size: 16px; text-align: center; }
.chapter-instruction { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(56px, calc((100% - 40px) / 6)), 1fr)); gap: 12px 8px; }
.chapter-button { min-height: 56px; border: 1px solid #dedede; border-radius: 12px; display: grid; place-items: center; color: #303a33; background: #fafafa; font-size: 17px; font-weight: 700; text-decoration: none; }
.bible-reading { padding: 0 2px; }
.bible-verse { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; margin: 0; padding: 12px 0; border-bottom: 1px solid #e8e8e8; color: #26332a; font-size: 18px; line-height: 1.5; }
.bible-verse sup { padding-top: 2px; color: var(--brand); font-size: 12px; font-weight: 700; text-align: center; }
.chapter-navigation { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); background: white; }
.chapter-navigation .primary-button { min-height: 52px; padding: 4px; font-size: 13px; }

.user-list { display: flex; flex-direction: column; gap: 9px; }
.user-row { min-height: 82px; padding: 12px; border: 1px solid #e0e9e3; border-radius: 16px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 20px; align-items: center; gap: 12px; color: var(--text); background: #fff; text-decoration: none; }
.user-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand); font-size: 15px; font-weight: 700; }
.user-row-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.user-row-copy strong { overflow: hidden; color: var(--brand-dark); text-overflow: ellipsis; white-space: nowrap; }
.user-row-copy small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-row-arrow { color: var(--brand); font-size: 23px; text-align: right; }
.admin-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.admin-span-two { grid-column: 1 / -1; }
.form-section-title { margin: 22px 0 6px; color: var(--brand-dark); font-size: 17px; }
.check-field { min-height: 44px; display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--brand); }
.user-photo-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 14px; }
.user-photo-picker img { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; background: #f3f7f4; }
.user-profile-card { padding: 18px; }
.user-profile-heading { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 18px; }
.user-profile-heading img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; background: #f3f7f4; }
.user-profile-heading h2 { margin: 0 0 4px; color: var(--brand-dark); font-size: 19px; }
.user-profile-heading p { margin: 0 0 4px; color: var(--muted); overflow-wrap: anywhere; }
.account-details { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); gap: 10px 12px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.account-details dt { color: var(--muted); font-size: 13px; }
.account-details dd { min-width: 0; margin: 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.membership-card { container-type: inline-size; width: min(100%, 520px); aspect-ratio: 400 / 252; margin: 18px auto 20px; border: 1px solid #cfe3d5; border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; color: #202923; background: #f2f8f4; }
.membership-card header { min-height: 13cqw; padding: 7px 4cqw; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; }
.membership-card header img { width: max(36px, 12cqw); aspect-ratio: 1; object-fit: contain; }
.membership-card header div { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.membership-card header span { color: #526359; font-size: max(9px, 2.5cqw); }
.membership-card header strong { color: var(--brand-dark); font-size: max(12px, 3.25cqw); }
.membership-card header small { color: #68746c; font-size: max(8px, 2.25cqw); }
.membership-card-main { padding: 3cqw 4cqw; display: grid; grid-template-columns: 21cqw minmax(0, 1fr); align-items: center; gap: 4cqw; }
.membership-photo { width: 100%; aspect-ratio: 4 / 5; border: 1px solid #dbe4dd; border-radius: 10px; object-fit: cover; background: #fff; }
.membership-photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: #e9eeeb; }
.membership-photo-placeholder img { width: 68%; height: auto; filter: grayscale(1); opacity: .64; }
.membership-photo-placeholder small { color: #526359; font-size: max(8px, 2.4cqw); }
.membership-identity { min-width: 0; display: flex; flex-direction: column; gap: max(4px, 1.45cqw); }
.membership-identity > strong { overflow-wrap: anywhere; color: #153a25; font-size: max(14px, 4.5cqw); line-height: 1.16; }
.membership-identity > span { color: #526359; font-size: max(10px, 3cqw); }
.membership-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.membership-facts div { display: flex; flex-direction: column; gap: 2px; }
.membership-facts small { color: #68746c; font-size: max(8px, 2cqw); }
.membership-facts span { color: #202923; font-size: max(10px, 3cqw); overflow-wrap: anywhere; }
.membership-facts .membership-number { color: var(--brand-dark); font-weight: 750; }
.membership-card footer { min-height: max(25px, 8cqw); padding: 3px 4cqw; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #fff; background: var(--brand); font-size: max(9px, 2.5cqw); }
.membership-card .membership-inactive { background: #a13a3a; }
.membership-card footer small { font-size: max(8px, 2cqw); letter-spacing: .04em; text-align: right; }
.card-details, .membership-actions { width: min(100%, 520px); margin-inline: auto; }
.membership-actions { display: grid; gap: 8px; margin-top: 14px; }
.card-presentation { position: fixed; z-index: 500; inset: 0; padding: 0 14px max(16px, env(safe-area-inset-bottom)); display: grid; grid-template-rows: auto 1fr; overflow: auto; background: #f2f8f4; }
.card-presentation .membership-card { align-self: center; width: min(100%, calc((100dvh - 88px) * 400 / 252)); margin: 10px auto; }
.presentation-close { justify-self: start; }
.success-alert { padding: 12px 14px; border-radius: 10px; color: #17633a; background: #eaf5ee; font-size: 14px; }

.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-row .text-field { min-width: 0; }
.filter-button { min-width: 78px; }
.filter-panel { padding: 14px; border: 1px solid #e1eae4; border-radius: 16px; background: #f8fbf8; }
.filter-title { display: flex; align-items: center; justify-content: space-between; color: #174a2b; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.filter-grid label { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.filter-grid .text-field { min-height: 43px; margin-top: 4px; padding: 8px; font-size: 13px; }
.event-list { display: flex; flex-direction: column; gap: 16px; }
.ebd-professor small { display: block; color: var(--muted); }
.ebd-professor { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.ebd-professor img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.bible-reference-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 8px; }
.bible-reference-grid select { min-width: 0; padding-inline: 7px; }
.filter-span-all { grid-column: 1 / -1; }
.event-card { overflow: hidden; border: 1px solid #e5ebe7; border-radius: 20px; color: var(--text); background: #fff; text-decoration: none; }
.event-cover { display: block; width: 100%; height: 150px; object-fit: cover; background: #f1f7f3; }
.event-card-body { padding: 16px 18px 18px; }
.event-card-body h2 { margin: 0 0 9px; font-size: 18px; }
.event-card-body p { margin: 0 0 8px; color: #5e6962; font-size: 14px; }
.event-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #5e6962; font-size: 14px; }
.event-meta strong { color: var(--brand); }
.event-card-body small, .event-creator { display: block; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.detail-cover { height: 172px; border-radius: 18px; }
.detail-facts { display: grid; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid #dce9e0; border-radius: 16px; background: #f0f7f2; }
.detail-facts div { display: flex; flex-direction: column; gap: 5px; }
.detail-facts strong { color: var(--brand-dark); font-size: 13px; }
.detail-facts span { color: #303a33; font-size: 15px; line-height: 1.45; }
.rich-content { color: #303a33; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.rich-content p, .rich-content div { margin: 0 0 12px; }
.rich-content h2, .rich-content h3 { color: #174a2b; }
.empty-state { justify-content: center; min-height: 96px; text-align: center; }

#blazor-error-ui { position: fixed; z-index: 1000; right: 12px; bottom: calc(94px + env(safe-area-inset-bottom)); left: 12px; display: none; padding: 14px 42px 14px 14px; border-radius: 12px; color: #fff; background: #8d2222; box-shadow: 0 3px 12px rgb(0 0 0 / 20%); }
#blazor-error-ui .dismiss { position: absolute; top: 9px; right: 12px; cursor: pointer; }
.blazor-error-boundary { padding: 16px; border-radius: 12px; color: #fff; background: #8d2222; }

@media (min-width: 640px) {
    .page-content { --page-gutter: 24px; }
    .content-card, .state-card { padding: 22px; }
}

@media (min-width: 860px) {
    .page-content { width: min(100%, 1080px); }
    .page-toolbar, .page-heading-copy { width: min(100%, 1080px); margin-inline: auto; }
}

@media (max-width: 380px) {
    .home-grid { padding-right: 16px; padding-left: 16px; column-gap: 6px; }
    .home-tile { font-size: 14px; }
    .home-tile .navigation-icon { width: 80px; height: 80px; }
    .filter-grid { grid-template-columns: 1fr; }
    .admin-field-grid, .schedule-editor-row { grid-template-columns: 1fr; }
    .admin-span-two, .remove-row-button { grid-column: auto; }
    .schedule-editor-row .field-label:first-child, .schedule-editor-row .admin-span-two { grid-column: auto; }
    .page-switcher { grid-template-columns: 1fr 1fr; }
    .page-switcher span { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 540px) {
    .schedule-editor-row { grid-template-columns: 1fr 1fr; }
    .schedule-editor-row .field-label:first-child, .schedule-editor-row .admin-span-two { grid-column: 1 / -1; }
    .remove-row-button { grid-column: 2; }
}
