/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
    --bg-top: #f5f2e9;
    --bg-bottom: #e8edf4;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --text: #1d2935;
    --muted: #5a6875;
    --brand: #1f4d70;
    --brand-hover: #153a55;
    --success-bg: #e6f4ec;
    --success-text: #1f5f3b;
    --warning-bg: #fff5df;
    --warning-text: #815b15;
    --danger-bg: #fdebea;
    --danger-text: #8d2a2a;
    --border: #d5dee7;
    --shadow: 0 20px 60px rgba(18, 33, 51, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body.app-body {
    color: var(--text);
    font-family: "Source Sans 3", "Trebuchet MS", "Gill Sans", sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(108, 150, 187, 0.18), transparent 42%),
        radial-gradient(circle at 85% 90%, rgba(255, 214, 146, 0.18), transparent 40%),
        linear-gradient(175deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.top-nav {
    display: flex;
    position: relative;
    z-index: 80;
    isolation: isolate;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    margin: 0.2rem auto 1rem;
    max-width: 920px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 22px rgba(20, 36, 53, 0.1);
}

.brand-link {
    font-family: "Alegreya", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    flex: 0 0 auto;
    padding-top: 0.25rem;
}

.top-nav-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
}

.top-nav-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.top-nav-links-main {
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
}

.top-nav-links-account {
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.top-nav-links-guest {
    margin-left: auto;
}

.top-nav .button_to {
    margin: 0;
}

.top-nav-links .link,
.top-nav-links .notification-bell-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.4rem 0.78rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(213, 222, 231, 0.95);
    text-decoration: none;
    line-height: 1;
}

.top-nav-links .link:hover,
.top-nav-links .notification-bell-link:hover {
    background: #fff;
    border-color: #b9c9d8;
}

.top-nav-links .link.is-active,
.top-nav-links .notification-bell-link.is-active {
    background: rgba(31, 77, 112, 0.1);
    border-color: rgba(31, 77, 112, 0.28);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(31, 77, 112, 0.04);
}

.top-nav-links .top-nav-link-secondary {
    background: rgba(247, 249, 252, 0.92);
    color: var(--muted);
    border-color: rgba(213, 222, 231, 0.85);
    font-weight: 500;
}

.top-nav-links .top-nav-link-secondary:hover {
    color: var(--brand);
    background: rgba(255, 255, 255, 0.98);
}

.notification-bell-link {
    position: relative;
    gap: 0.4rem;
    color: var(--text);
    font-weight: 600;
}

.account-menu {
    position: relative;
}

.account-menu summary {
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 36px;
    padding: 0.4rem 0.78rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(213, 222, 231, 0.95);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: var(--text);
}

.account-menu-trigger:hover {
    background: #fff;
    border-color: #b9c9d8;
}

.account-menu-trigger.is-active {
    background: rgba(31, 77, 112, 0.1);
    border-color: rgba(31, 77, 112, 0.28);
    color: var(--brand);
}

.account-menu-avatar {
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(31, 77, 112, 0.12);
    color: var(--brand);
    flex: 0 0 auto;
}

.account-menu-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}

.account-menu-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.account-menu-caret {
    color: var(--muted);
    font-size: 0.85rem;
}

.account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(213, 222, 231, 0.95);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 36, 53, 0.16);
    padding: 0.55rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.account-menu-label {
    margin: 0;
    padding: 0.4rem 0.5rem 0.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.account-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.account-menu-link:hover {
    background: var(--surface-soft);
    color: var(--brand);
}

.account-menu-link.is-active {
    background: rgba(31, 77, 112, 0.08);
    color: var(--brand);
}

.account-menu-signout {
    width: 100%;
    justify-content: center;
    margin-top: 0.2rem;
}

.notification-bell-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.notification-bell-icon {
    font-size: 0.95rem;
}

.notification-bell-badge {
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.notification-row:first-child {
    border-top: 0;
}

.notification-row-unread {
    background: rgba(31, 77, 112, 0.04);
    border-radius: 12px;
    padding: 1rem;
}

.notification-kind {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 700;
}

.top-nav-meta {
    font-size: 0.92rem;
    color: var(--muted);
    padding: 0 0.15rem;
    white-space: nowrap;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    background: rgba(29, 41, 53, 0.06);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.live-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #8f98a2;
    box-shadow: 0 0 0 0 rgba(61, 159, 103, 0.35);
}

.live-status[data-state="live"] {
    background: rgba(31, 95, 59, 0.1);
    color: var(--success-text);
}

.live-status[data-state="live"] .live-status-dot {
    background: #2e9a5d;
    animation: livePulse 1.8s ease-out infinite;
}

.live-status[data-state="connecting"] {
    background: rgba(177, 118, 14, 0.12);
    color: var(--warning-text);
}

.live-status[data-state="connecting"] .live-status-dot {
    background: #c78f25;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 154, 93, 0.35);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(46, 154, 93, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 154, 93, 0);
    }
}

.top-nav-button {
    padding: 0.42rem 0.9rem;
    font-size: 0.9rem;
    box-shadow: none;
    min-height: 36px;
}

.page-card {
    max-width: 760px;
    margin: 1.4rem auto;
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.page-card-wide {
    max-width: 980px;
}

.page-card-narrow {
    max-width: 520px;
}

h1,
h2 {
    margin: 0;
    font-family: "Alegreya", Georgia, serif;
    line-height: 1.15;
    letter-spacing: 0.2px;
}

.title-xl {
    font-size: clamp(2rem, 3.6vw, 3rem);
}

.title-md {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}

.lead {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
    margin: 1rem 0 0;
}

.muted {
    color: var(--muted);
}

.center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.9rem;
}

.mt-4 {
    margin-top: 1.2rem;
}

.mt-6 {
    margin-top: 2rem;
}

.stack>*+* {
    margin-top: 0.95rem;
}

.alert-box {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    border: 1px solid transparent;
}

.alert-info {
    background: #e9f1f8;
    color: #234d6e;
    border-color: #c8deee;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: #e9d2a0;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: #eab5b0;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #bee2cb;
}

.flash {
    max-width: 760px;
    margin: 0.8rem auto 1.2rem;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    border-left: 4px solid transparent;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-notice {
    background: var(--success-bg);
    color: var(--success-text);
    border-left-color: #1f5f3b;
}

.flash-notice::before {
    content: "✓ ";
    font-weight: bold;
    margin-right: 0.5rem;
}

.flash-alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-left-color: #8d2a2a;
}

.flash-alert::before {
    content: "⚠ ";
    font-weight: bold;
    margin-right: 0.5rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 77, 112, 0.25);
}

.btn-primary:hover {
    background: var(--brand-hover);
}

.btn-muted {
    background: #5a6671;
    color: #fff;
}

.btn-warning {
    background: #b1760e;
    color: #fff;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.field {
    margin-top: 0.85rem;
}

.field label {
    display: block;
    margin-bottom: 0.34rem;
    font-weight: 600;
    color: #31404f;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.68rem 0.78rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: 2px solid rgba(31, 77, 112, 0.22);
    border-color: #84a9c7;
    background: #fff;
}

.link {
    color: var(--brand);
    font-weight: 600;
}

.link:hover {
    color: var(--brand-hover);
}

.feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #d7e0e8;
}

.feature-list li:last-child {
    border-bottom: 0;
}

/* Profile Styles */
.profile-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8ecf2;
}

.avatar-display,
.avatar-preview {
    display: inline-block;
}

.avatar-frame {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(20, 36, 53, 0.14);
    background: #f3f6fa;
    cursor: grab;
    touch-action: none;
}

.avatar-frame-dragging {
    cursor: grabbing;
}

.hidden {
    display: none !important;
}

.avatar-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    transform-origin: center center;
}

.avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c96bb, #5a7ea0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    font-family: "Alegreya", Georgia, serif;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(20, 36, 53, 0.14);
}

.avatar-frame .avatar-placeholder {
    width: 100%;
    height: 100%;
    border: 0;
    box-shadow: none;
}

.profile-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.verified-badge {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bee2cb;
}

.profile-section {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f3f7;
}

.profile-section:last-of-type {
    border-bottom: 0;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin: 0 0 0.5rem 0;
}

.bio-text {
    color: var(--text);
    line-height: 1.6;
}

.avatar-upload-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8ecf2;
}

.avatar-crop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.avatar-crop-help {
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
}

.profile-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-soft);
}

.profile-chip:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.vouch-tree {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.vouch-tree-node {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vouch-tree-node-self {
    border-color: #c9d8e8;
    background: #f7fbff;
}

.vouch-tree-children {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-left: 1rem;
    border-left: 2px solid #dde7f2;
}

.profile-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-activity-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 0.85rem 0.95rem;
}

.profile-activity-meta {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
}

/* Vouch List Styles */
.vouch-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8ecf2;
}

.vouch-section:last-of-type {
    border-bottom: 0;
}

.vouch-list {
    margin-top: 1rem;
}

.vouch-item {
    background: var(--surface-soft);
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.vouch-item:last-child {
    margin-bottom: 0;
}

.vouch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.vouch-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.vouch-name:hover {
    color: var(--brand);
}

.vouch-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vouch-badge-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #e9d2a0;
}

.vouch-badge-active {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bee2cb;
}

.vouch-badge-revoked {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #eab5b0;
}

.vouch-details {
    margin-top: 0.5rem;
}

.vouch-meta {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.vouch-meta strong {
    color: var(--text);
}

/* Post Styles */
.feed-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.85rem;
}

.feed-header-copy {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 36rem;
}

.feed-header-copy .title-md {
    margin: 0;
}

.feed-header-copy .lead {
    margin-top: 0.45rem;
}

.feed-actions {
    flex: 0 0 min(320px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-self: start;
}

.feed-actions> :only-child {
    grid-column: 1 / -1;
}

.feed-actions .btn {
    justify-content: center;
    text-align: center;
    margin: 0;
}

.feed-action-primary {
    grid-column: 1 / -1;
}

.empty-state-actions {
    display: grid;
    gap: 0.65rem;
    justify-content: center;
    width: min(100%, 320px);
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions .btn {
    justify-content: center;
    text-align: center;
    margin: 0;
}

.empty-state-actions-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state-action-primary {
    grid-column: 1 / -1;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-row {
    border: 1px solid #e5ecf3;
    border-radius: 14px;
    padding: 1rem;
    background: var(--surface-soft);
}

.post-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.post-kind-badge,
.prayer-status-badge,
.topic-chip,
.photo-count-chip {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.post-kind-badge {
    background: #e8eef5;
    color: #35516a;
    border: 1px solid #d7e1ec;
}

.prayer-status-badge {
    text-transform: uppercase;
}

.prayer-status-open {
    background: #e9f1f8;
    color: #234d6e;
    border: 1px solid #c8deee;
}

.prayer-status-answered {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bee2cb;
}

.prayer-status-archived {
    background: #efebe2;
    color: #635643;
    border: 1px solid #ddd0ba;
}

.topic-chip {
    background: #f3eee7;
    color: #775b33;
    border: 1px solid #e1d3bc;
}

.photo-count-chip {
    background: #eef3e3;
    color: #48603f;
    border: 1px solid #d4dfc6;
}

.post-row-title {
    margin: 0;
    font-size: 1.3rem;
}

.post-title-link {
    color: var(--text);
    text-decoration: none;
}

.post-title-link:hover {
    color: var(--brand);
}

.post-meta {
    font-size: 0.92rem;
    color: var(--muted);
}

.engagement-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.86rem;
    color: #607080;
    font-weight: 600;
}

.post-preview p,
.post-body p {
    margin: 0.6rem 0;
    line-height: 1.65;
}

.post-card .post-header {
    border-bottom: 1px solid #e5ecf3;
    padding-bottom: 1rem;
}

.post-photo-preview {
    display: block;
    text-decoration: none;
}

.post-photo-preview-image {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e0e7ef;
    box-shadow: 0 8px 22px rgba(18, 33, 51, 0.08);
}

.photo-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.photo-card {
    background: var(--surface-soft);
    border: 1px solid #e5ecf3;
    border-radius: 18px;
    overflow: hidden;
}

.photo-card-media {
    position: relative;
    background: #dfe7ef;
}

.photo-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.photo-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.photo-card-count {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
}

.photo-card-body {
    padding: 1rem;
}

.photo-card-title {
    margin: 0;
    font-size: 1.25rem;
}

.photo-card-caption {
    color: var(--muted);
    line-height: 1.55;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.photo-tile {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.photo-tile-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #dfe7ef;
    box-shadow: 0 10px 24px rgba(18, 33, 51, 0.1);
}

.photo-form-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.photo-form-preview {
    padding: 0.65rem;
    border-radius: 14px;
    border: 1px solid #e5ecf3;
    background: var(--surface-soft);
}

.photo-form-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
}

.photo-lightbox {
    width: min(92vw, 1100px);
    max-width: 1100px;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #0f1720;
    color: #f7f9fc;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.photo-lightbox::backdrop {
    background: rgba(8, 13, 19, 0.78);
}

.photo-lightbox-frame {
    position: relative;
    padding: 1rem;
}

.photo-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.photo-lightbox-image {
    display: block;
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 14px;
}

.photo-lightbox-caption {
    margin: 0.85rem 0 0;
    color: rgba(247, 249, 252, 0.82);
}

.prayer-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.prayer-filter-row .field {
    flex: 1 1 220px;
    margin-top: 0;
}

.prayer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.prayer-meta-block {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.engagement-panel {
    border-top: 1px solid #e7edf4;
    padding-top: 1rem;
}

.engagement-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reaction-picker {
    background: #f7fafc;
    border: 1px solid #e4ebf3;
    border-radius: 14px;
    padding: 0.9rem;
}

.reaction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.reaction-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid #d8e3ef;
    background: #fff;
    color: #2d4255;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.reaction-button:hover {
    border-color: #b7c9dc;
    background: #f2f6fb;
}

.reaction-button-active {
    background: #edf4fb;
    border-color: #9fb8d2;
    color: #1f4d70;
}

.reaction-symbol {
    font-size: 1rem;
}

.reaction-count {
    background: #e7eef7;
    color: #32536d;
    border-radius: 999px;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.05rem 0.35rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-row {
    border: 1px solid #e4ebf3;
    background: #f9fbfd;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
}

.comment-children {
    margin-left: 0.85rem;
    border-left: 2px solid #dde7f2;
    padding-left: 0.8rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    min-height: unset;
}

.comment-depth-1,
.comment-depth-2,
.comment-depth-3,
.comment-depth-4,
.comment-depth-5 {
    background: #fbfdff;
}

.comment-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.comment-body p {
    margin: 0.35rem 0;
}

.post-history {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.history-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.55rem 0.8rem;
}

.history-item summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.9rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.1rem;
    margin-bottom: 0.6rem;
}

.markdown-body code {
    background: #eef3f8;
    border-radius: 6px;
    padding: 0.1rem 0.3rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
}

@media (max-width: 700px) {

    /* Layout & Spacing */
    .page-shell {
        padding: 0.8rem 0.5rem 2rem;
    }

    html {
        font-size: 15px;
    }

    body {
        line-height: 1.5;
    }

    /* Navigation */
    .top-nav {
        border-radius: 0;
        align-items: stretch;
        flex-direction: column;
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .brand-link {
        font-size: 1.2rem;
        padding-top: 0;
    }

    .top-nav-content {
        width: 100%;
        gap: 0.55rem;
    }

    .top-nav-topline {
        align-items: flex-start;
    }

    .top-nav-links {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.1rem;
        padding-inline: 0.35rem;
        scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
    }

    .top-nav-links::-webkit-scrollbar,
    .feed-actions::-webkit-scrollbar,
    .empty-state-actions::-webkit-scrollbar,
    .empty-state-actions-multi::-webkit-scrollbar {
        display: none;
    }

    .top-nav-links-account {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        white-space: normal;
        overflow: visible;
        padding-inline: 0;
        padding-bottom: 0;
        scroll-snap-type: none;
        -webkit-mask-image: none;
        mask-image: none;
        flex-shrink: 0;
        gap: 0.4rem;
    }

    .account-menu-panel {
        right: 0;
        left: auto;
        min-width: min(260px, calc(100vw - 2rem));
    }

    .top-nav-links .link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    .top-nav-links-account .account-menu-trigger {
        min-height: 32px;
        padding: 0.34rem 0.62rem;
        font-size: 0.82rem;
        gap: 0.42rem;
    }

    .top-nav-links-account .account-menu-name {
        max-width: 5.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-nav-links-account .live-status {
        min-height: 32px;
        padding: 0.3rem 0.55rem;
        font-size: 0.78rem;
        gap: 0.35rem;
    }

    .top-nav-links-account .live-status-dot {
        width: 0.48rem;
        height: 0.48rem;
    }

    @media (max-width: 430px) {
        .top-nav-topline {
            align-items: center;
        }

        .top-nav-links-account .account-menu-trigger {
            min-height: 30px;
            padding: 0.28rem 0.45rem;
            gap: 0.3rem;
        }

        .top-nav-links-account .account-menu-avatar {
            display: inline-flex;
            width: 1.55rem;
            height: 1.55rem;
        }

        .top-nav-links-account .account-menu-name {
            display: none;
        }

        .top-nav-links-account .account-menu-caret {
            font-size: 0.72rem;
        }

        .top-nav-links-account .notification-bell-badge {
            min-width: 1rem;
            height: 1rem;
            padding: 0 0.24rem;
            font-size: 0.64rem;
        }

        .top-nav-links-account .live-status {
            padding-inline: 0.48rem;
            font-size: 0.74rem;
        }
    }

    .top-nav-meta {
        display: none;
    }

    .top-nav-button {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    /* Typography */
    .title-xl {
        font-size: 1.8rem;
        margin: 1rem 0 0.5rem;
    }

    .title-lg {
        font-size: 1.4rem;
    }

    .title-md {
        font-size: 1.1rem;
    }

    .lead {
        font-size: 1rem;
        margin: 0.75rem 0;
    }

    /* Cards */
    .page-card {
        padding: 1rem;
        border-radius: 8px;
        margin: 0.5rem 0;
    }

    .page-card.center {
        padding: 1.5rem 1rem;
    }

    /* Forms */
    .field {
        margin-bottom: 1rem;
    }

    .field input[type="text"],
    .field input[type="email"],
    .field input[type="password"],
    .field textarea,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea {
        font-size: 16px;
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    textarea {
        min-height: 120px;
        font-size: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        margin: 0.4rem 0;
    }

    .button-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .button-row .btn {
        margin: 0;
    }

    /* Feed & Posts */
    .feed-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 1rem;
    }

    .feed-header-copy {
        max-width: none;
    }

    .feed-header-copy .lead {
        margin-top: 0.75rem;
    }

    .feed-actions {
        width: 100%;
        flex: 1 1 auto;
        display: flex;
        gap: 0.55rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-self: stretch;
        padding-inline: 0.35rem;
        scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
    }

    .empty-state-actions,
    .empty-state-actions-multi {
        width: 100%;
        display: flex;
        gap: 0.55rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-inline: 0.35rem;
        scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
    }

    .feed-actions .btn,
    .empty-state-actions .btn,
    .empty-state-actions-multi .btn {
        width: auto;
        min-width: max-content;
        flex: 0 0 auto;
        padding-left: 1rem;
        padding-right: 1rem;
        scroll-snap-align: start;
    }

    .top-nav-links .link,
    .top-nav-links .notification-bell-link,
    .account-menu-trigger,
    .live-status {
        scroll-snap-align: start;
    }

    .feed-header h1 {
        margin-bottom: 0.75rem;
        font-size: 1.4rem;
    }

    .post-row {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 6px;
    }

    .post-row-tags,
    .prayer-filter-row,
    .prayer-actions,
    .prayer-meta-block {
        flex-direction: column;
        align-items: stretch;
    }

    .engagement-inline,
    .reaction-buttons {
        flex-wrap: wrap;
    }

    .reaction-button {
        width: 100%;
        justify-content: space-between;
    }

    .photo-feed-grid,
    .photo-gallery,
    .photo-form-preview-grid {
        grid-template-columns: 1fr;
    }

    .photo-lightbox {
        width: calc(100vw - 1rem);
    }

    .post-meta {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .post-preview {
        font-size: 0.95rem;
        line-height: 1.4;
        max-height: 80px;
        margin: 0.5rem 0;
    }

    /* Alerts */
    .alert-box {
        padding: 1rem;
        font-size: 0.95rem;
        margin: 0.75rem 0;
    }

    .alert-box strong {
        display: block;
        margin-bottom: 0.5rem;
    }

    .alert-box p {
        margin: 0.4rem 0;
    }

    /* Flash Messages */
    .flash {
        margin: 0;
        border-radius: 0;
        padding: 1rem 0.8rem;
        font-size: 0.95rem;
    }

    /* Lists */
    .feature-list {
        list-style: none;
        padding-left: 1rem;
    }

    .feature-list li {
        margin: 0.75rem 0;
        padding-left: 1.5rem;
        position: relative;
        font-size: 0.95rem;
    }

    .feature-list li:before {
        content: "•";
        position: absolute;
        left: 0;
        font-weight: bold;
    }

    /* Profile & Avatar */
    .avatar-upload-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .avatar-preview {
        max-width: 120px;
        height: auto;
    }

    .avatar-crop-grid {
        grid-template-columns: 1fr;
    }

    .avatar-upload-input {
        font-size: 0.9rem;
    }

    /* Vouch List */
    .vouch-row {
        padding: 0.8rem;
        margin: 0.4rem 0;
        border-radius: 6px;
        font-size: 0.95rem;
    }

    /* Text Utilities */
    .text-small {
        font-size: 0.85rem;
    }

    .text-muted {
        opacity: 0.7;
    }

    .muted {
        opacity: 0.7;
        font-size: 0.9rem;
    }

    /* Welcome Page */
    .welcome-section {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
    }

    /* Spacing Utilities */
    .mt-2 {
        margin-top: 0.5rem;
    }

    .mt-3 {
        margin-top: 0.75rem;
    }

    .mt-4 {
        margin-top: 1rem;
    }

    .mt-6 {
        margin-top: 1.5rem;
    }

    .mt-8 {
        margin-top: 2rem;
    }

    /* Touch Targets */
    a,
    button,
    [role="button"] {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ============================================================
   Mention Autocomplete Dropdown
   ============================================================ */

.mention-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}

.mention-option {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.mention-option:hover,
.mention-option--active {
    background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.mention-handle {
    font-weight: 600;
    color: var(--brand);
    font-size: 0.9rem;
}

.mention-name {
    color: var(--muted);
    font-size: 0.85rem;
}

/* ============================================================
   Search
   ============================================================ */

.search-filter-bar {
    margin-top: 1.5rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.search-filter-bar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.search-filter-bar .field {
    flex: 1 1 180px;
    margin-top: 0;
}

.search-filter-bar .search-q {
    flex: 2 1 300px;
}

.search-filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-result-count {
    font-size: 0.9rem;
    color: var(--muted);
}

/* ============================================================
   Recently Active
   ============================================================ */

.recently-active {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.recently-active-heading {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.recently-active-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recently-active-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.recently-active-item:last-child {
    border-bottom: none;
}

.recently-active-title {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    flex: 1;
}

.recently-active-title:hover {
    color: var(--brand);
    text-decoration: underline;
}

.recently-active-meta {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ============================================================
   Sort Toggle (prayers trending)
   ============================================================ */

.sort-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.sort-toggle-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.sort-option {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    min-height: unset;
}

.sort-option:hover {
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    color: var(--brand);
    border-color: var(--brand);
}

.sort-option.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}