:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #12263a;
    --muted: #5f7285;
    --primary: #12634f;
    --primary-soft: #1d8a63;
    --secondary: #2058c6;
    --accent: #f5b04c;
    --border: #dde3ed;
    --shadow: 0 24px 65px rgba(11, 17, 69, 0.06);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

main {
    padding: 2rem 1.5rem 4rem;
}

.app-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo {
    height: 34px;
    width: auto;
    display: block;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px 14px 14px 4px;
    background: linear-gradient(135deg, #f6c851, #ff8036);
    position: relative;
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 30%, #2e7cf6, #1c4bcd);
}

.site-nav {
    display: flex;
    gap: 1.25rem;
    font-weight: 500;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.institution-cta {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(32, 88, 198, 0.5);
    background: rgba(32, 88, 198, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.institution-cta p {
    margin: 0;
    flex: 1;
}

.nav-cta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.notification-button {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.notification-button .notification-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--secondary);
    position: absolute;
    top: 4px;
    right: 4px;
}

.notification-center {
    align-items: stretch;
    gap: 1.5rem;
}

.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-entry {
    background: rgba(244, 247, 251, 0.6);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
}

.notification-title {
    margin: 0;
    font-weight: 600;
}

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

.notification-question,
.notification-response,
.notification-status {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

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

.notification-link {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 600;
}

.notification-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.avatar-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nav-icon svg {
    width: 1.1em;
    height: 1.1em;
}

.nav-icon-img {
    width: 1.1em;
    height: 1.1em;
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.nav-avatar.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 88, 198, 0.15);
    color: var(--secondary);
    font-weight: 600;
}

.btn {
    background: var(--secondary);
    color: #fff;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(34, 73, 236, 0.25);
}

.btn.ghost {
    background: rgba(32, 88, 198, 0.08);
    color: var(--secondary);
}

.btn.outline {
    background: transparent;
    border: 1px solid rgba(32, 88, 198, 0.6);
    color: var(--secondary);
}

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

.btn.full-width {
    width: 100%;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    background: rgba(18, 99, 79, 0.08);
    color: var(--primary);
    font-weight: 500;
}

.hero-grid,
.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-card h1 {
    margin: 0;
    font-size: 2.5rem;
}

.hero-card .subhead {
    color: var(--muted);
    margin-bottom: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    background: rgba(18, 99, 79, 0.12);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.hero-illustration {
    min-height: 280px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #e5f6ff, #f3fbf5);
    position: relative;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-illustration::before,
.hero-illustration::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(18, 99, 79, 0.2);
}

.hero-illustration::before {
    width: 160px;
    height: 160px;
    top: -30px;
    right: -30px;
}

.hero-illustration::after {
    width: 210px;
    height: 210px;
    bottom: -80px;
    left: -20px;
    background: rgba(32, 88, 198, 0.15);
}

.hero-character {
    position: absolute;
    inset: 50px 40px 40px;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(31, 62, 114, 0.12);
}

.hero-character h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.feature-icons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    gap: 1rem;
}

.feature-icon {
    flex: 1;
    text-align: center;
}

.feature-icon svg {
    width: 48px;
    height: 48px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-card,
.info-card,
.category-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.single-panel {
    max-width: 720px;
    margin: 0 auto;
}

.location-grid {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hidden {
    display: none !important;
}

.map-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

#neighbr-map {
    width: 100%;
    height: 700px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 1.5rem;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.org-form-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.logo-uploader {
    min-width: 180px;
}

.org-head-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: block;
}

.form-input,
textarea,
select {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.form-input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(32, 88, 198, 0.2);
}

.checkbox-input {
    width: auto;
    margin-right: 0.75rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--muted);
}

.step-indicator {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.step {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--muted);
}

.step.active {
    border-color: var(--primary);
    color: var(--primary);
}

.step.complete {
    background: rgba(18, 99, 79, 0.1);
    border-color: rgba(18, 99, 79, 0.2);
    color: var(--primary);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    color: var(--muted);
}

.info-list li::before {
    content: '✓';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(18, 99, 79, 0.1);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

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

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

.category-card {
    border: 1px solid #e1e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(25, 60, 102, 0.12);
}

.category-card .icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(32, 88, 198, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.category-card h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.progress-list {
    display: grid;
    gap: 1rem;
}

.progress-card {
    border: 1px solid var(--border);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stacked-radio li,
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fbff;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.stacked-radio input[type="radio"] {
    transform: scale(1.15);
}

.support-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.switch-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.switch-links a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.site-footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--muted);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.institution-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.institution-logo.placeholder {
    border: 1px dashed var(--border);
}

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#institution-map {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.location-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

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

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

.institution-marker .marker-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background-size: cover;
    border: 1px solid #fff;
    background-position: center;
    /* box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); */
}

.institution-marker .marker-logo.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 88, 198, 0.2);
    color: var(--secondary);
    font-weight: 600;
}

.institution-marker {
    background: transparent;
    border: none;
}

.institution-marker.simple .marker-logo.icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1.2rem;
}

.institution-marker .marker-count {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #fff;
    color: var(--secondary);
    border-radius: 999px;
    padding: 0 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(32, 88, 198, 0.2);
}

.popup-entry {
    margin: 0.25rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.popup-entry-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.popup-entry-avatar.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 88, 198, 0.15);
    color: var(--secondary);
    font-weight: 600;
}

.popup-entry-body {
    flex: 1;
    min-width: 0;
}

.popup-entry-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.popup-entry-title {
    font-weight: 600;
    display: block;
}

.popup-entry-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
}

.popup-entry-notes {
    margin: 0.2rem 0 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.popup-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.popup-cluster-meta {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-cta {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.feed-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-intro {
    background: transparent;
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.feed-intro .badge {
    margin: 0;
}

.feed-floating-button {
    border-radius: 999px;
    border: none;
    background: var(--secondary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    box-shadow: 0 12px 34px rgba(32, 88, 198, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-floating-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(32, 88, 198, 0.35);
}

.feed-stream {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-post {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-post-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.feed-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #f1f5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.1rem;
}

.feed-avatar img,
.feed-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.feed-author-name {
    font-weight: 600;
}

.feed-author-meta,
.feed-comment-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.feed-post-body p {
    margin: 0;
    line-height: 1.5;
}

.feed-post-media {
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    max-width: 240px;
}

.feed-post-media img {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 240px;
}

.feed-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.feed-post-actions form {
    margin: 0;
}

.feed-comment-toggle {
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.feed-comment-toggle:hover {
    color: var(--secondary);
}

.feed-like-button {
    background: rgba(18, 99, 79, 0.08);
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.feed-like-button .icon,
.feed-comment-toggle .icon {
    width: 1em;
    height: 1em;
}

.icon-img {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.feed-like-button.active {
    background: rgba(32, 88, 198, 0.12);
    color: var(--secondary);
}

.feed-comments {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    display: none;
}

.feed-comments.open {
    display: flex;
    flex-direction: column;
}

.feed-comments-inner {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-comment {
    display: flex;
    gap: 0.6rem;
}

.feed-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(32, 88, 198, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.85rem;
}

.feed-comment-form textarea.form-input {
    resize: vertical;
}

.feed-comment-form {
    width: 100%;
    display: block;
}

.feed-comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.location-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: #f9fbff;
}

#post-location-map {
    width: 100%;
    height: 220px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    overflow: hidden;
}

.location-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.location-actions .btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

.radio-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.radio-group li {
    list-style: none;
}

.map-badge-row {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#map-badge-row preceding definitions remain

.map-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.map-filter-button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.map-filter-button.active {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.map-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 0.5rem;
    border: 2px solid var(--border);
}

.user-post-marker .user-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(18, 18, 18, 0.2);
}

.user-post-marker .marker-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
}

.user-post-marker .marker-logo.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 88, 198, 0.2);
    color: var(--secondary);
    font-weight: 600;
}

.map-post-popup {
    max-width: 220px;
}

.map-post-popup p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.map-post-popup img {
    margin-top: 0.5rem;
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 140px;
    object-fit: cover;
}

.map-popup,
.map-post-popup {
    max-width: 240px;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popup-header div {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.popup-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
}

.popup-media {
    margin-top: 0.5rem;
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
}

.popup-link {
    display: inline-flex;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
}

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

.popup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.popup-avatar.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 88, 198, 0.2);
    color: var(--secondary);
    font-weight: 600;
}

.popup-meta {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
}

.popup-meta i {
    margin-right: 0.25rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.feed-floating-button .icon {
    font-size: 1rem;
}

.feed-floating-button .label {
    line-height: 1;
}

/* --- 2024 Neighbr UI refresh --- */
:root {
    --bg: #e9edfb;
    --surface: #ffffff;
    --surface-muted: #f3f6ff;
    --surface-alt: #eef2ff;
    --text: #122046;
    --muted: #5c6785;
    --primary: #2d63ff;
    --primary-strong: #1f46d8;
    --accent: #ffb347;
    --success: #23b480;
    --danger: #f46d5e;
    --border: #d9e1f5;
    --shadow-soft: 0 24px 55px rgba(15, 21, 51, 0.1);
    --radius-lg: 32px;
    --radius-md: 22px;
    --radius-sm: 14px;
    --text-xs: 0.82rem;
    --shell-pad: 1.2rem;
}

body {
    background: #edf2ff;
    color: var(--text);
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
}

main {
    padding: 1.5rem 1.5rem 4rem;
}

.app-shell {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 var(--shell-pad) 3rem;
}

.site-header {
    background: #f1f0f9;
    border-radius: 0;
    padding: 3px;
    display: flex;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(13, 32, 96, 0.12);
    border: none;
    width: 100vw;
    margin: 0 calc(-50vw + 50%) 0.75rem;
}

.site-header-content {
    width: 100%;
    max-width: 1480px;
    display: grid;
    grid-template-columns: auto minmax(420px, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    justify-content: center;
}

.brand-link {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
}

.brand-logo {
    width: 65px;
    height: 65px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.brand-logo img {
    max-width: 80%;
}

.brand-text {
    color: var(--text);
    font-size: 1.3rem;
}

.global-search {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(15, 28, 74, 0.08);
    box-shadow: inset 0 1px 2px rgba(16, 22, 70, 0.08);
}

.global-search input {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    width: 100%;
}

.global-search input:focus {
    outline: none;
}

.site-nav {
    display: inline-flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.2rem 0.35rem;
    background: #f6f8ff;
    border-radius: 999px;
    border: 1px solid rgba(19, 42, 109, 0.08);
    margin: 0 auto;
}

.site-nav a {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: var(--surface-alt);
}

.site-nav a.active {
    background: rgba(45, 99, 255, 0.12);
    color: var(--primary);
    border-color: rgba(45, 99, 255, 0.3);
}

.nav-cta,
.header-right {
    gap: 0.75rem;
    justify-content: flex-end;
}

.notification-button {
    background: var(--surface-muted);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
}

.nav-avatar {
    width: 44px;
    height: 44px;
    border-radius: 18px;
    border: 2px solid var(--border);
    box-shadow: 0 8px 16px rgba(16, 36, 94, 0.15);
}

.btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    box-shadow: 0 15px 30px rgba(33, 78, 255, 0.3);
    border-radius: 16px;
    padding: 0.7rem 1.35rem;
}

.btn.ghost {
    background: rgba(45, 99, 255, 0.1);
    color: var(--primary);
    box-shadow: none;
}

.btn.outline {
    background: transparent;
    border-radius: 16px;
    border: 1px solid rgba(45, 99, 255, 0.3);
    color: var(--primary);
    box-shadow: none;
}

.badge {
    background: rgba(45, 99, 255, 0.15);
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

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

.form-card,
.info-card,
.category-card,
.hero-card,
.map-section,
.feed-post {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-card,
.form-card,
.info-card,
.category-card {
    padding: 2rem;
}

.map-section {
    padding: 1.75rem;
}

.map-filter-bar {
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.map-filter-button {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    font-weight: 600;
}

.map-filter-button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 16px rgba(32, 82, 255, 0.15);
}

#neighbr-map {
    border: 1px solid var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.feed-wrapper,
.map-layout {
    display: grid;
    gap: 1.5rem;
}

.feed-wrapper {
    grid-template-columns: minmax(0, 1fr);
}

.feed-post-header {
    align-items: flex-start;
}

.feed-post-actions button,
.feed-post-actions .feed-like-button {
    border-radius: 999px;
    border: 1px solid rgba(89, 113, 164, 0.2);
    background: var(--surface-muted);
}

.feed-comment-form textarea {
    border-radius: 16px;
    background: var(--surface-muted);
    border: 1px solid transparent;
}

.flash {
    border-radius: 16px;
}

.site-footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--muted);
}

.map-layout {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
}

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

.map-panel,
.stat-card,
.activity-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.activity-header,
.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.activity-stream {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-entry {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.activity-avatar {
    width: 44px;
    height: 44px;
    border-radius: 17px;
    overflow: hidden;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(49, 56, 96, 0.15);
}

.activity-avatar img,
.activity-avatar .feed-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.activity-initial {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    background: rgba(45, 99, 255, 0.18);
}

.activity-entry p {
    margin: 0.1rem 0;
}

.activity-meta {
    font-size: var(--text-xs);
    color: var(--muted);
}

.chip-set {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
}

.feed-tabs {
    margin-bottom: 1.5rem;
}

.chip {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid transparent;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
}

.chip.active {
    background: rgba(45, 99, 255, 0.15);
    color: var(--primary);
    border-color: rgba(45, 99, 255, 0.35);
}

.stat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.stat-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text);
}

.stat-list li i {
    color: var(--primary);
}

.stat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.quick-poll {
    margin-top: 1rem;
}

.poll-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-muted);
    margin-top: 0.35rem;
    overflow: hidden;
}

.poll-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.map-action-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 20px rgba(24, 41, 99, 0.25);
}

.action-pill.post { background: linear-gradient(135deg, #4387ff, #1f55ff); }
.action-pill.poll { background: linear-gradient(135deg, #30c4ff, #2391ff); }
.action-pill.report { background: linear-gradient(135deg, #ffa94d, #ff7b2c); }
.action-pill.group { background: linear-gradient(135deg, #38c98d, #2aa86b); }
.action-pill.you { background: linear-gradient(135deg, #6b5bff, #4835ff); }

.action-pill .icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.map-badge-row {
    margin: 0.5rem 0 0.5rem;
}

.feed-floating-button {
    border-radius: 18px;
    padding: 0.6rem 1.2rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.highlight-card {
    background: radial-gradient(circle at top right, rgba(45, 99, 255, 0.2), transparent 60%), var(--surface);
}

.mini-map {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.mini-map img {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: inset 0 0 30px rgba(24, 36, 74, 0.05);
}

.feed-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.75rem;
}

.feed-layout.single {
    grid-template-columns: minmax(0, 920px);
    justify-content: center;
}

.feed-main,
.feed-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-center {
    max-width: 920px;
    margin: 0 auto;
}

.feed-side .stat-list li {
    gap: 0.5rem;
    font-weight: 500;
}

.feed-side .stat-list li a {
    color: var(--text);
    text-decoration: none;
}

.hero-public .hero-card {
    min-height: 260px;
}

.hero-public .stat-list {
    gap: 0.85rem;
}

@media (max-width: 1024px) {
    .feed-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }
}

.form-input,
textarea,
select {
    border-radius: 16px;
    border-color: rgba(89, 113, 164, 0.25);
    background: var(--surface-muted);
}

.form-input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 99, 255, 0.2);
}

.single-panel {
    background: var(--surface);
}

.map-main,
.map-sidebar,
.map-activity {
    position: relative;
}

.stat-metric {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 1100px) {
    .site-header-content {
        grid-template-columns: 1fr;
    }

    .header-center {
        justify-content: flex-start;
    }

    .map-layout {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        --shell-pad: 1rem;
    }

    .global-search {
        display: none;
    }

    .site-header {
        padding: 1rem;
        margin: 0 calc(-50vw + 50%) 0.5rem;
        width: 100vw;
    }

    .site-header-content {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1.5rem 0.8rem 3rem;
    }

    .app-shell {
        padding: 0 var(--shell-pad) 2.5rem;
    }

    .map-layout {
        grid-template-columns: 1fr;
    }
}

/* ==================================================================
   M4 brand-aligned app header — Neighbr logo + multicolor wordmark +
   tagline + landing-page button styles. Lives alongside the existing
   header rules; the new classes (.app-brand, .app-btn) replace the
   inline render of .brand-logo / .brand-text / .btn for the M4 update.
   ================================================================== */
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.app-brand__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.app-brand__logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.app-brand__text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.05;
}

.app-brand__wordmark {
    color: #071B4D;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}

.app-brand__br,
.app-brand__i {
    position: relative;
    color: #0B5FFF;
}

/* Dotless-i with a primary-blue dot, matching the landing wordmark. */
.app-brand__i {
    color: #071B4D;
}

.app-brand__i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.2em;
    width: 0.15em;
    height: 0.15em;
    border-radius: 50%;
    background: #0B5FFF;
    transform: translateX(-50%);
}

.app-brand__tagline {
    color: #071B4D;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}

.app-brand__tag-c { color: #0B5FFF; }
.app-brand__tag-v { color: #6D35E8; }
.app-brand__tag-p { color: #16A34A; }

/* Brand-aligned action buttons in the header (Sign In / Join Now /
   Institution Portal). Visual matches the landing-page header. */
.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease,
                border-color 160ms ease, box-shadow 160ms ease;
    white-space: nowrap;
}

.app-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.app-btn--ghost {
    background: #fff;
    color: #071B4D;
    border-color: #E5E7EB;
}

.app-btn--ghost:hover {
    background: #F8FAFC;
    border-color: #0B5FFF;
}

.app-btn--primary {
    background: #0B5FFF;
    color: #fff;
    border-color: #0B5FFF;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
}

.app-btn--primary:hover {
    background: #0A4FD6;
    border-color: #0A4FD6;
    color: #fff;
}

.app-btn--outline {
    background: #fff;
    color: #6D35E8;
    border-color: #6D35E8;
}

.app-btn--outline:hover {
    background: #6D35E8;
    color: #fff;
}

@media (max-width: 900px) {
    .app-brand__tagline { display: none; }
    .app-brand__wordmark { font-size: 1.35rem; }
    .app-brand__logo,
    .app-brand__logo img { width: 40px; height: 40px; }
    .app-btn span { display: none; }
    .app-btn { padding: 0.55rem 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .app-btn { transition: none; }
}

/* ===== Mobile header alignment fix =====
   When the site-header-content grid collapses to a single column, the
   .header-right (action buttons) was still right-justified, pushing the
   Institution Portal button off-screen. Switch it to start-aligned and
   add wrapping so all three buttons remain on-screen. */
@media (max-width: 1100px) {
    .header-right {
        justify-content: flex-start !important;
        flex-wrap: wrap;
    }
    .header-center {
        overflow-x: auto;
    }
    .site-nav {
        flex-wrap: nowrap;
    }
}

@media (max-width: 720px) {
    .header-right {
        gap: 0.5rem;
    }
    .app-btn {
        padding: 0.5rem 0.7rem;
    }
}

@media (max-width: 480px) {
    /* On very narrow phones, hide the Institution Portal button to free
       space for the primary auth buttons. It is still reachable via the
       landing page footer + the Civic nav link. */
    .header-right .app-btn--outline {
        display: none;
    }
}
