/* Delegate panel — airy layout: the sidebar carries the brand colour,
   centered greeting, soft rounded cards on a light canvas. */

/* ── Sidebar: primary background, light type ── */
.fi-sidebar {
    background: #2d4a8a !important;
    border-inline-end: 1px solid rgb(255 255 255 / 0.08) !important;
}

.fi-sidebar-header {
    background: #2d4a8a !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

/* The brand name sits on the blue now. */
.fi-sidebar-header .fi-logo,
.fi-sidebar-header .delegate-brand { color: #ffffff !important; }

/* A white chip keeps the logo legible against the blue. */
.delegate-brand img {
    background: #ffffff;
    border-radius: 9999px;
    padding: 0.15rem;
}

.fi-sidebar .fi-icon-btn { color: rgb(255 255 255 / 0.75) !important; }
.fi-sidebar .fi-icon-btn:hover { color: #ffffff !important; background: rgb(255 255 255 / 0.1) !important; }

.fi-sidebar-nav {
    padding: 0.75rem 1rem;
}

/* CTA button injected at the top of the sidebar */
.delegate-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0.5rem 1.25rem;
    padding: 0.7rem 1rem;
    background: #ffffff;
    color: #2d4a8a !important;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 9999px;
    box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.35);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.delegate-cta:hover {
    background: #eef3fc;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgb(0 0 0 / 0.4);
}

.delegate-cta svg { width: 1.1rem; height: 1.1rem; }

/* Pill-shaped nav items */
.fi-sidebar-item-btn {
    border-radius: 0.75rem !important;
    padding-block: 0.55rem !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.fi-sidebar-item-label {
    color: rgb(255 255 255 / 0.82);
    font-size: 0.9rem;
}

.fi-sidebar-item-icon {
    color: rgb(255 255 255 / 0.6);
}

.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover {
    background: rgb(255 255 255 / 0.1);
    transform: translateX(3px);
}

.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #ffffff; }

.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background: rgb(255 255 255 / 0.16);
    position: relative;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 18%;
    height: 64%;
    width: 3px;
    border-radius: 9999px;
    background: #ffffff;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: #ffffff;
    font-weight: 600;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #ffffff;
}

/* ── Main background ── */
.fi-main-ctn, .fi-body {
    background: #fafbfc;
}

/* ── Greeting header ── */
.delegate-greeting {
    text-align: left;
    padding: 1.25rem 0 0.25rem;
}

.delegate-greeting h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #111827;
}

.delegate-greeting p {
    margin-top: 0.45rem;
    font-size: 0.95rem;
    color: #6b7280;
}

.delegate-greeting-dot {
    margin: 0 0.35rem;
    color: #d1d5db;
}

.dark .delegate-greeting h1 { color: #f9fafb; }

/* ── Cards (shared) ── */
.delegate-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

.delegate-action-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.35rem 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dark .delegate-action-card {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-action-card:hover {
    transform: translateY(-3px);
    border-color: #d8e2f5;
    box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.25);
}

.delegate-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 0.85rem;
    background: #eef3fc;
    color: #2d4a8a;
}

.dark .delegate-action-icon {
    background: rgb(45 74 138 / 0.35);
    color: #9ec1ff;
}

.delegate-action-icon svg { width: 1.45rem; height: 1.45rem; }

.delegate-action-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
}

.dark .delegate-action-title { color: #f3f4f6; }

.delegate-action-desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.83rem;
    color: #6b7280;
}

.dark .delegate-action-desc { color: #9ca3af; }

/* ── Upcoming Events (right rail) ── */
.delegate-events-rail {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.25rem;
    height: 100%;
}

.dark .delegate-events-rail {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-events-rail-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.delegate-events-rail-header svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #2d4a8a;
}

.dark .delegate-events-rail-header svg { color: #9ec1ff; }

.delegate-events-rail-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.dark .delegate-events-rail-header h2 { color: #f9fafb; }

.delegate-events-rail-list {
    display: flex;
    flex-direction: column;
}

.delegate-events-rail-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.dark .delegate-events-rail-item { border-color: rgb(255 255 255 / 0.06); }

.delegate-events-rail-item:last-child { border-bottom: none; }

.delegate-events-rail-item:hover { background: #f8fafd; }

.dark .delegate-events-rail-item:hover { background: rgb(255 255 255 / 0.03); }

.delegate-events-rail-marker {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.4rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #2d4a8a;
    box-shadow: 0 0 0 3px #e6edf9;
}

.dark .delegate-events-rail-marker { box-shadow: 0 0 0 3px rgb(45 74 138 / 0.4); }

.delegate-events-rail-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.dark .delegate-events-rail-item h3 { color: #f3f4f6; }

.delegate-events-rail-item p {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.delegate-events-rail-item a {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d4a8a;
    transition: color 0.2s ease;
}

.delegate-events-rail-item a:hover { color: #243b6e; }

.dark .delegate-events-rail-item a { color: #9ec1ff; }

.delegate-congress-empty {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Soften the default widget wrappers so sections float on the page */
.fi-wi-widget > .fi-section {
    border-radius: 1.1rem;
    border-color: #eef0f3;
}

/* ── Upcoming Events page (card grid) ── */
.delegate-congress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

.delegate-congress-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.35rem 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .delegate-congress-card {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-congress-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.22);
}

.delegate-congress-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #2d4a8a;
}

.dark .delegate-congress-card h3 { color: #9ec1ff; }

.delegate-congress-card p {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.delegate-congress-card a {
    display: inline-block;
    margin-top: 0.9rem;
    padding: 0.42rem 1rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: #2d4a8a;
    border: 1px solid #d8e2f5;
    border-radius: 9999px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.delegate-congress-card a:hover {
    background: #2d4a8a;
    border-color: #2d4a8a;
    color: #fff;
}

/* ── Right events sidebar (persistent) ── */
.delegate-events-aside {
    position: fixed;
    top: 4rem;
    bottom: 0;
    inset-inline-end: 0;
    width: 21rem;
    background: #fff;
    border-inline-start: 1px solid #eef0f3;
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    z-index: 25;
}

.dark .delegate-events-aside {
    background: #111827;
    border-inline-start-color: rgb(255 255 255 / 0.08);
}

@media (min-width: 1280px) {
    body:has(.delegate-events-aside):not(:has(.fi-sc-wizard)) .fi-main {
        padding-inline-end: 22.5rem !important;
    }
}

/* Wizard (typeform) pages never show the rail — even when a Livewire
   update morphs it back in (the render hook can't see the page route
   during component updates). */
body:has(.fi-sc-wizard) .delegate-events-aside {
    display: none !important;
}

@media (max-width: 1279.98px) {
    .delegate-events-aside {
        display: none;
    }
}

/* ── Brand: logo + wordmark ── */
.delegate-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

.dark .delegate-brand { color: #f9fafb; }

.delegate-brand img { height: 2.75rem; }

/* ── Upcoming Events page: information cards ── */
.delegate-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 1.15rem;
}

.delegate-event-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .delegate-event-card {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.25);
}

.delegate-event-card-body {
    padding: 1.4rem 1.35rem;
    flex: 1;
}

.delegate-event-card-body h3 {
    font-size: 1.08rem;
    font-weight: 700;
    color: #2d4a8a;
    line-height: 1.3;
}

.dark .delegate-event-card-body h3 { color: #9ec1ff; }

.delegate-event-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d4a8a;
    background: #eef3fc;
    border-radius: 9999px;
}

.dark .delegate-event-date {
    background: rgb(45 74 138 / 0.35);
    color: #9ec1ff;
}

.delegate-event-date svg { width: 0.95rem; height: 0.95rem; }

.delegate-event-desc {
    margin-top: 0.8rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #4b5563;
}

.dark .delegate-event-desc { color: #9ca3af; }

.delegate-event-card-footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid #f3f4f6;
    background: #fafbfd;
}

.dark .delegate-event-card-footer {
    background: rgb(255 255 255 / 0.02);
    border-top-color: rgb(255 255 255 / 0.06);
}

.delegate-event-card-footer a {
    display: inline-block;
    padding: 0.45rem 1.05rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #2d4a8a;
    border-radius: 9999px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.delegate-event-card-footer a:hover {
    background: #243b6e;
    transform: translateY(-1px);
}

/* ── Sidebar section labels ── */
.fi-sidebar-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 0.55);
}

.fi-sidebar-group-collapse-btn { color: rgb(255 255 255 / 0.55) !important; }

.fi-sidebar-group {
    margin-top: 0;
}

.fi-sidebar-nav,
.fi-sidebar-nav-groups {
    row-gap: 0;
}

/* ── Empty states & invoice list ── */
.delegate-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    color: #6b7280;
}

.dark .delegate-empty-state {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-empty-state svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.9rem;
    color: #c3cee4;
}

.delegate-empty-state h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
}

.dark .delegate-empty-state h3 { color: #f3f4f6; }

.delegate-empty-state p {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

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

.delegate-invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.1rem 1.3rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .delegate-invoice-row {
    background: rgb(255 255 255 / 0.04);
    border-color: rgb(255 255 255 / 0.1);
}

.delegate-invoice-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgb(45 74 138 / 0.25);
}

.delegate-invoice-main h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.dark .delegate-invoice-main h3 { color: #f3f4f6; }

.delegate-invoice-main p {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: #6b7280;
}

.delegate-invoice-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.delegate-invoice-badge.paid { background: #ecfdf5; color: #047857; }
.delegate-invoice-badge.pending { background: #fffbeb; color: #b45309; }
.delegate-invoice-badge.cancelled { background: #fef2f2; color: #b91c1c; }

.delegate-invoice-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.delegate-invoice-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delegate-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.05rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: #fff;
    background: #2d4a8a;
    border-radius: 9999px;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
}

.delegate-pay-btn:hover {
    background: #243b6e;
    transform: translateY(-1px);
}

.delegate-pay-btn svg { width: 0.9rem; height: 0.9rem; }

/* ── Community feed ── */
.community-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 44rem;
}

.community-composer {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.dark .community-composer { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-composer textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 0.92rem;
    color: #1f2937;
    background: transparent;
}

.dark .community-composer textarea { color: #f3f4f6; }

.community-composer-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.community-composer-footer button,
.community-comment-form button {
    padding: 0.45rem 1.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #2d4a8a;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.community-composer-footer button:hover,
.community-comment-form button:hover { background: #243b6e; }

.community-error { color: #dc2626; font-size: 0.8rem; margin-top: 0.3rem; }

.community-post {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.25rem 1.3rem;
}

.dark .community-post { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-post-head { display: flex; align-items: center; gap: 0.75rem; }

.community-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #eef3fc;
    color: #2d4a8a;
    font-weight: 700;
    font-size: 0.9rem;
}

.community-avatar.small { width: 1.9rem; height: 1.9rem; font-size: 0.72rem; }

.dark .community-avatar { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.community-post-head h3 { font-size: 0.92rem; font-weight: 600; color: #1f2937; }
.dark .community-post-head h3 { color: #f3f4f6; }
.community-post-head p { font-size: 0.78rem; color: #9ca3af; }

.community-post-body {
    margin-top: 0.8rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-line;
}

.dark .community-post-body { color: #d1d5db; }

.community-post-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.9rem;
}

.community-like,
.community-comment-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: #6b7280;
    background: #f6f7f9;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.dark .community-like, .dark .community-comment-toggle { background: rgb(255 255 255 / 0.06); color: #9ca3af; }

.community-like:hover { color: #dc2626; background: #fef2f2; transform: scale(1.04); }
.community-like.liked { color: #dc2626; background: #fef2f2; }
.community-comment-toggle:hover { color: #2d4a8a; background: #eef3fc; }

.community-like svg, .community-comment-toggle svg { width: 1.05rem; height: 1.05rem; }

.community-comments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dark .community-comments { border-top-color: rgb(255 255 255 / 0.06); }

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

.community-comment h4 { font-size: 0.82rem; font-weight: 600; color: #1f2937; }
.dark .community-comment h4 { color: #f3f4f6; }
.community-comment h4 span { font-weight: 400; color: #9ca3af; margin-left: 0.4rem; font-size: 0.75rem; }
.community-comment p { font-size: 0.86rem; color: #374151; margin-top: 0.1rem; }
.dark .community-comment p { color: #d1d5db; }

.community-comment-form { display: flex; gap: 0.6rem; margin-top: 0.3rem; }

.community-comment-form input {
    flex: 1;
    padding: 0.5rem 0.9rem;
    font-size: 0.86rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.community-comment-form input:focus {
    border-color: #2d4a8a;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12);
}

.dark .community-comment-form input { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

/* ── Badges ── */
.badges-summary { font-size: 0.95rem; color: #4b5563; margin-bottom: 1.25rem; }
.dark .badges-summary { color: #d1d5db; }

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.badge-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .badge-card { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.badge-card.earned:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.3);
}

.badge-card.locked { opacity: 0.55; filter: grayscale(0.9); }

.badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #eef3fc, #dbe7fb);
    color: #2d4a8a;
    margin-bottom: 0.8rem;
}

.dark .badge-icon { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.badge-icon svg { width: 1.7rem; height: 1.7rem; }

.badge-card h3 { font-size: 0.95rem; font-weight: 700; color: #1f2937; }
.dark .badge-card h3 { color: #f3f4f6; }

.badge-card p { margin-top: 0.3rem; font-size: 0.82rem; color: #6b7280; }

.badge-state {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #047857;
}

.badge-card.locked .badge-state { background: #f3f4f6; color: #6b7280; }

/* ── Feed: title, image, upload ── */
.community-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    background: transparent;
    margin-bottom: 0.4rem;
}

.dark .community-title-input { color: #f3f4f6; }

.community-composer-footer {
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

.community-composer-footer > button:last-child {
    margin-left: auto;
}

.community-image-pick {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d4a8a;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    background: #eef3fc;
    transition: background 0.2s ease;
}

.community-image-pick:hover { background: #dbe7fb; }

.dark .community-image-pick { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.community-image-pick input[type="file"] { display: none; }

.community-image-pick svg { width: 1.1rem; height: 1.1rem; }

.community-uploading { font-size: 0.8rem; color: #6b7280; }

.community-post-title {
    margin-top: 0.85rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.dark .community-post-title { color: #f9fafb; }

.community-post-title + .community-post-body { margin-top: 0.35rem; }

.community-post-image {
    display: block;
    width: 100%;
    max-height: 24rem;
    object-fit: cover;
    border-radius: 0.9rem;
    margin-top: 0.9rem;
    border: 1px solid #eef0f3;
}

.dark .community-post-image { border-color: rgb(255 255 255 / 0.1); }

.delegate-settings-footer { margin-top: 1.25rem; }
.community-comments-off { font-size: 0.83rem; color: #9ca3af; font-style: italic; }

.community-avatar.photo {
    object-fit: cover;
    border: 1px solid #eef0f3;
}

/* ── Event photos ── */
.delegate-event-image {
    display: block;
    width: 100%;
    height: 10rem;
    object-fit: cover;
}

.delegate-events-rail-thumb {
    width: 3.2rem;
    height: 3.2rem;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 0.6rem;
    border: 1px solid #eef0f3;
}

.dark .delegate-events-rail-thumb { border-color: rgb(255 255 255 / 0.1); }

/* ── Thin brand-colored scrollbars ── */
* {
    scrollbar-width: thin;
    scrollbar-color: #2d4a8a transparent;
}

*::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #2d4a8a;
    border-radius: 9999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #243b6e;
}

.dark * {
    scrollbar-color: #4a6bb5 transparent;
}

.dark *::-webkit-scrollbar-thumb {
    background: #4a6bb5;
}

/* ── Share button ── */
.community-share {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: #6b7280;
    background: #f6f7f9;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.dark .community-share { background: rgb(255 255 255 / 0.06); color: #9ca3af; }

.community-share:hover { color: #2d4a8a; background: #eef3fc; transform: scale(1.04); }

.community-share svg { width: 1.05rem; height: 1.05rem; }

[x-cloak] { display: none !important; }

/* Highlight a post arrived at via a shared link */
.community-post:target {
    border-color: #2d4a8a;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.15);
}

/* ── Hashtags, mentions, tag filter ── */
.c-hashtag { color: #2d4a8a; font-weight: 600; text-decoration: none; }
.c-hashtag:hover { text-decoration: underline; }
.dark .c-hashtag { color: #9ec1ff; }

.c-mention {
    color: #2d4a8a;
    font-weight: 600;
    background: #eef3fc;
    padding: 0.05rem 0.35rem;
    border-radius: 0.4rem;
}

.dark .c-mention { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.community-tag-filter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #eef3fc;
    color: #2d4a8a;
    font-size: 0.88rem;
    border-radius: 0.9rem;
    padding: 0.7rem 1rem;
}

.dark .community-tag-filter { background: rgb(45 74 138 / 0.3); color: #9ec1ff; }

.community-tag-filter button {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ── Polls ── */
.community-poll-builder {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.6rem 0;
    padding: 0.8rem;
    background: #f8fafd;
    border-radius: 0.75rem;
}

.dark .community-poll-builder { background: rgb(255 255 255 / 0.04); }

.community-poll-builder input {
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    outline: none;
}

.community-poll-builder input:focus { border-color: #2d4a8a; }

.dark .community-poll-builder input { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

.community-poll-add {
    align-self: flex-start;
    background: none;
    border: none;
    color: #2d4a8a;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
}

.community-poll-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d4a8a;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: 9999px;
    background: #eef3fc;
    transition: background 0.2s ease;
}

.community-poll-toggle:hover, .community-poll-toggle.active { background: #dbe7fb; }
.dark .community-poll-toggle { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }
.community-poll-toggle svg { width: 1.1rem; height: 1.1rem; }

.community-poll {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.community-poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    background: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.dark .community-poll-option { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

.community-poll-option:hover { border-color: #2d4a8a; transform: translateX(2px); }

.community-poll-option.chosen { border-color: #2d4a8a; font-weight: 600; }

.community-poll-fill {
    position: absolute;
    inset-block: 0;
    left: 0;
    background: #e3ecfb;
    transition: width 0.4s ease;
    z-index: 0;
}

.dark .community-poll-fill { background: rgb(45 74 138 / 0.4); }

.community-poll-label, .community-poll-pct { position: relative; z-index: 1; }

.community-poll-pct { font-weight: 600; color: #2d4a8a; }
.dark .community-poll-pct { color: #9ec1ff; }

.community-poll-total { font-size: 0.78rem; color: #9ca3af; }

/* ── Messenger ── */
.messenger {
    display: grid;
    grid-template-columns: 17rem 1fr;
    gap: 1rem;
    height: calc(100vh - 14rem);
    min-height: 24rem;
}

@media (max-width: 900px) {
    .messenger { grid-template-columns: 1fr; height: auto; }
    .messenger-thread { min-height: 24rem; }
}

.messenger-list {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 0.9rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dark .messenger-list { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.messenger-new {
    padding: 0.55rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #fff;
    background: #2d4a8a;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.messenger-new:hover { background: #243b6e; }

.messenger-search {
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    outline: none;
    margin-bottom: 0.4rem;
}

.messenger-search:focus { border-color: #2d4a8a; }

.dark .messenger-search { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

.messenger-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease;
}

.messenger-item:hover { background: #f3f4f6; }
.dark .messenger-item:hover { background: rgb(255 255 255 / 0.05); }

.messenger-item.active { background: #eef3fc; }
.dark .messenger-item.active { background: rgb(45 74 138 / 0.3); }

.messenger-item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.messenger-item-name { font-size: 0.86rem; font-weight: 600; color: #1f2937; }
.dark .messenger-item-name { color: #f3f4f6; }

.messenger-item-preview {
    font-size: 0.76rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-unread {
    background: #2d4a8a;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
}

.messenger-empty { font-size: 0.83rem; color: #9ca3af; padding: 0.5rem; }

.messenger-thread {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dark .messenger-thread { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.messenger-thread-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #f3f4f6;
}

.dark .messenger-thread-head { border-color: rgb(255 255 255 / 0.06); }

.messenger-thread-head h3 { font-size: 0.95rem; font-weight: 700; color: #1f2937; }
.dark .messenger-thread-head h3 { color: #f3f4f6; }

.messenger-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
}

.messenger-bubble-row { display: flex; }
.messenger-bubble-row.mine { justify-content: flex-end; }

.messenger-bubble {
    max-width: 72%;
    background: #f3f4f6;
    border-radius: 1rem 1rem 1rem 0.25rem;
    padding: 0.55rem 0.85rem;
}

.dark .messenger-bubble { background: rgb(255 255 255 / 0.08); }

.messenger-bubble-row.mine .messenger-bubble {
    background: #2d4a8a;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.messenger-bubble p { font-size: 0.88rem; color: #1f2937; line-height: 1.45; word-break: break-word; }
.dark .messenger-bubble p { color: #f3f4f6; }
.messenger-bubble-row.mine .messenger-bubble p { color: #fff; }

.messenger-bubble span {
    display: block;
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    text-align: right;
}

.messenger-bubble-row.mine .messenger-bubble span { color: rgb(255 255 255 / 0.7); }

.messenger-input {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid #f3f4f6;
}

.dark .messenger-input { border-color: rgb(255 255 255 / 0.06); }

.messenger-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.messenger-input input:focus {
    border-color: #2d4a8a;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12);
}

.dark .messenger-input input { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

.messenger-input button {
    width: 2.7rem;
    height: 2.7rem;
    border: none;
    border-radius: 9999px;
    background: #2d4a8a;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.messenger-input button:hover { background: #243b6e; transform: scale(1.05); }

.messenger-input button svg { width: 1.2rem; height: 1.2rem; }

.messenger-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ── Floating messenger dock (LinkedIn-style) ── */
.messenger-dock {
    position: fixed;
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 40;
}

.messenger-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: #2d4a8a;
    color: #fff;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 10px 28px -8px rgb(45 74 138 / 0.5);
    transition: background 0.2s ease, transform 0.2s ease;
}

.messenger-fab:hover { background: #243b6e; transform: translateY(-2px) scale(1.05); }

.messenger-fab svg { width: 2rem; height: 2rem; }

.messenger-fab-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    border: 2px solid #fff;
}

.dark .messenger-fab-badge { border-color: #111827; }

.messenger-panel {
    width: 21rem;
    height: 27rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    box-shadow: 0 18px 44px -12px rgb(15 23 42 / 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dock-rise 0.22s ease;
}

@keyframes dock-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.dark .messenger-panel { background: #111827; border-color: rgb(255 255 255 / 0.1); }

@media (max-width: 480px) {
    .messenger-panel { width: calc(100vw - 2rem); }
}

.messenger-panel-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfd;
}

.dark .messenger-panel-head { background: rgb(255 255 255 / 0.03); border-color: rgb(255 255 255 / 0.06); }

.messenger-panel-head h3 { font-size: 0.92rem; font-weight: 700; color: #1f2937; flex: 1; }
.dark .messenger-panel-head h3 { color: #f3f4f6; }

.messenger-back, .messenger-minimize {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.messenger-back:hover, .messenger-minimize:hover { background: #eef3fc; color: #2d4a8a; }

.messenger-back svg, .messenger-minimize svg { width: 1rem; height: 1rem; }

.messenger-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Pulse the unread badge so new messages catch the eye */
.messenger-fab-badge {
    animation: badge-ping 2s ease-in-out infinite;
}

@keyframes badge-ping {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(220 38 38 / 0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgb(220 38 38 / 0); }
}

/* ── Member profiles ── */
.community-author-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.community-author-link:hover h3 { color: #2d4a8a; text-decoration: underline; }

.member-profile { display: flex; flex-direction: column; gap: 1.25rem; max-width: 44rem; }

.member-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.6rem;
}

.dark .member-card { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.member-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid #eef0f3;
    flex-shrink: 0;
}

.member-avatar.initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef3fc;
    color: #2d4a8a;
    font-size: 1.5rem;
    font-weight: 700;
}

.member-info { flex: 1; min-width: 0; }

.member-info h2 { font-size: 1.3rem; font-weight: 700; color: #111827; }
.dark .member-info h2 { color: #f9fafb; }

.member-meta { margin-top: 0.2rem; font-size: 0.88rem; color: #6b7280; }

.member-bio { margin-top: 0.6rem; font-size: 0.9rem; color: #374151; line-height: 1.55; }
.dark .member-bio { color: #d1d5db; }

.member-stats { display: flex; gap: 2.25rem; margin-top: 1rem; }

.member-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }

.member-stat strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.dark .member-stat strong { color: #f9fafb; }

.member-stat small {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

.member-message-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #2d4a8a;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.member-message-btn:hover { background: #243b6e; transform: translateY(-1px); }
.member-message-btn svg { width: 1.15rem; height: 1.15rem; }

.member-section {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.3rem 1.4rem;
}

.dark .member-section { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.member-section h3 { font-size: 0.95rem; font-weight: 700; color: #111827; margin-bottom: 0.8rem; }
.dark .member-section h3 { color: #f9fafb; }

.member-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.member-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d4a8a;
    background: #eef3fc;
    border-radius: 9999px;
}

.dark .member-badge-chip { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.member-badge-chip svg { width: 1rem; height: 1rem; }

.member-post-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.4rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    transition: background 0.15s ease;
}

.dark .member-post-row { border-color: rgb(255 255 255 / 0.06); }

.member-post-row:last-child { border-bottom: none; }
.member-post-row:hover { background: #f8fafd; }
.dark .member-post-row:hover { background: rgb(255 255 255 / 0.03); }

.member-post-title { font-size: 0.9rem; font-weight: 600; color: #1f2937; }
.dark .member-post-title { color: #f3f4f6; }

.member-post-meta { font-size: 0.78rem; color: #9ca3af; }

/* ── Follow ── */
.community-feed-tabs {
    display: inline-flex;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 9999px;
    padding: 0.3rem;
    align-self: flex-start;
}

.dark .community-feed-tabs { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-feed-tabs button {
    padding: 0.4rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.community-feed-tabs button.active { background: #2d4a8a; color: #fff; }
.community-feed-tabs button:not(.active):hover { background: #f3f4f6; }
.dark .community-feed-tabs button:not(.active):hover { background: rgb(255 255 255 / 0.06); }

.member-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    color: #2d4a8a;
    background: #eef3fc;
    border: 1px solid #d8e2f5;
    border-radius: 9999px;
    cursor: pointer;
    margin-right: 0.6rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.member-follow-btn:hover { background: #dbe7fb; transform: translateY(-1px); }

.member-follow-btn.following {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.dark .member-follow-btn { background: rgb(45 74 138 / 0.35); color: #9ec1ff; border-color: transparent; }
.dark .member-follow-btn.following { background: rgb(4 120 87 / 0.3); color: #6ee7b7; }

/* ── Profile: achievements & gallery ── */
.member-achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.8rem;
}

.member-achievement {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem;
    background: #f8fafd;
    border: 1px solid #eef0f3;
    border-radius: 0.85rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .member-achievement { background: rgb(255 255 255 / 0.03); border-color: rgb(255 255 255 / 0.08); }

.member-achievement:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -12px rgb(45 74 138 / 0.25);
}

.member-achievement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: linear-gradient(135deg, #eef3fc, #dbe7fb);
    color: #2d4a8a;
}

.dark .member-achievement-icon { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

.member-achievement-icon svg { width: 1.25rem; height: 1.25rem; }

.member-achievement-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.member-achievement-name { font-size: 0.88rem; font-weight: 700; color: #1f2937; }
.dark .member-achievement-name { color: #f3f4f6; }

.member-achievement-desc { font-size: 0.78rem; color: #6b7280; }

.member-achievement-date { font-size: 0.72rem; color: #9ca3af; margin-top: 0.15rem; }

.member-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.6rem;
}

.member-gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #eef0f3;
}

.dark .member-gallery-item { border-color: rgb(255 255 255 / 0.1); }

.member-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.member-gallery-item:hover img { transform: scale(1.06); }

/* ── Verified by IAAM ── */
.verified-badge {
    display: inline-flex;
    vertical-align: middle;
    color: #2d4a8a;
    margin-left: 0.15rem;
}

.dark .verified-badge { color: #9ec1ff; }

.verified-badge svg { width: 1.05rem; height: 1.05rem; }

.community-post-video {
    display: block;
    width: 100%;
    max-height: 26rem;
    border-radius: 0.9rem;
    margin-top: 0.9rem;
    border: 1px solid #eef0f3;
    background: #000;
}

.dark .community-post-video { border-color: rgb(255 255 255 / 0.1); }

.member-scopus { margin-top: 0.35rem; font-size: 0.82rem; color: #6b7280; }

.member-scopus-verified {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    border-radius: 9999px;
}

.dark .member-scopus-verified { background: rgb(4 120 87 / 0.3); color: #6ee7b7; }

/* Icon-only composer buttons */
.community-image-pick.icon-only,
.community-poll-toggle.icon-only {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    justify-content: center;
}

.community-image-pick.icon-only svg,
.community-poll-toggle.icon-only svg {
    width: 1.25rem;
    height: 1.25rem;
}

.community-image-pick.icon-only.active,
.community-poll-toggle.icon-only.active {
    background: #2d4a8a;
    color: #fff;
}

/* ── Header search ── */
.fi-topbar > nav, .fi-topbar-ctn > nav { position: relative; }

.portal-search {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(26rem, 34vw);
    z-index: 30;
}

@media (max-width: 900px) {
    .portal-search { display: none; }
}

.portal-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 0.45rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.portal-search-box:focus-within {
    background: #fff;
    border-color: #2d4a8a;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12);
}

.dark .portal-search-box { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.1); }
.dark .portal-search-box:focus-within { background: rgb(255 255 255 / 0.1); }

.portal-search-box svg { width: 1.05rem; height: 1.05rem; color: #9ca3af; flex-shrink: 0; }

.portal-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    font-family: inherit;
    color: #1f2937;
    min-width: 0;
}

.dark .portal-search-box input { color: #f3f4f6; }

.portal-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 0.9rem;
    box-shadow: 0 18px 44px -12px rgb(15 23 42 / 0.25);
    padding: 0.5rem;
    max-height: 24rem;
    overflow-y: auto;
}

.dark .portal-search-results { background: #111827; border-color: rgb(255 255 255 / 0.1); }

.portal-search-group {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 0.5rem 0.6rem 0.25rem;
}

.portal-search-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.6rem;
    text-decoration: none;
    transition: background 0.15s ease;
}

.portal-search-item:hover { background: #f1f5fb; }
.dark .portal-search-item:hover { background: rgb(255 255 255 / 0.05); }

.portal-search-item img,
.portal-search-initial {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-search-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef3fc;
    color: #2d4a8a;
    font-size: 0.75rem;
    font-weight: 700;
}

.portal-search-text { display: flex; flex-direction: column; min-width: 0; }
.portal-search-text span { font-size: 0.86rem; font-weight: 600; color: #1f2937; }
.dark .portal-search-text span { color: #f3f4f6; }
.portal-search-text small { font-size: 0.75rem; color: #9ca3af; }

.portal-search-empty { font-size: 0.85rem; color: #9ca3af; padding: 0.75rem; text-align: center; }

/* ── Post page links & group chips ── */
.community-post-title a { color: inherit; text-decoration: none; }
.community-post-title a:hover { color: #2d4a8a; text-decoration: underline; }

.community-post-group-chip {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.15rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2d4a8a;
    background: #eef3fc;
    border-radius: 9999px;
}

.dark .community-post-group-chip { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

/* ── Trending hashtags ── */
.community-trending {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.1rem 1.25rem;
}

.dark .community-trending { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-trending h3 { font-size: 0.92rem; font-weight: 700; color: #111827; margin-bottom: 0.7rem; }
.dark .community-trending h3 { color: #f9fafb; }

.community-trending-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.community-trending-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 600;
    font-family: inherit;
    color: #2d4a8a;
    background: #eef3fc;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.community-trending-tag span { font-size: 0.72rem; color: #6b7280; }
.community-trending-tag:hover, .community-trending-tag.active { background: #2d4a8a; color: #fff; }
.community-trending-tag:hover span, .community-trending-tag.active span { color: rgb(255 255 255 / 0.75); }
.dark .community-trending-tag { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }

/* ── Groups ── */
.community-groups {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dark .community-groups { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-groups-head { display: flex; align-items: center; justify-content: space-between; }
.community-groups-head h3 { font-size: 0.92rem; font-weight: 700; color: #111827; }
.dark .community-groups-head h3 { color: #f9fafb; }

.community-group-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid #f3f4f6;
}

.dark .community-group-row { border-color: rgb(255 255 255 / 0.06); }
.community-group-row:last-child { border-bottom: none; }

.community-group-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    min-width: 0;
}

.community-group-name { font-size: 0.92rem; font-weight: 700; color: #1f2937; }
.dark .community-group-name { color: #f3f4f6; }
.community-group-main:hover .community-group-name { color: #2d4a8a; }
.community-group-meta { font-size: 0.76rem; color: #9ca3af; }
.community-group-desc { font-size: 0.82rem; color: #6b7280; }

.community-group-btn {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #2d4a8a;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.community-group-btn:hover { background: #243b6e; }
.community-group-btn.joined { background: #ecfdf5; color: #047857; }
.community-group-btn.joined:hover { background: #fee2e2; color: #b91c1c; }

.community-group-create {
    align-self: flex-start;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #2d4a8a;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
}

.community-group-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 0.9rem 1.1rem;
}

.dark .community-group-banner { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-group-banner > div { flex: 1; min-width: 0; }
.community-group-banner h3 { font-size: 0.95rem; font-weight: 700; color: #111827; }
.dark .community-group-banner h3 { color: #f9fafb; }
.community-group-banner p { font-size: 0.8rem; color: #6b7280; }

/* ── Group invitations ── */
.community-group-btn.invite { background: #eef3fc; color: #2d4a8a; }
.community-group-btn.invite:hover { background: #dbe7fb; }

.community-invite-panel {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1.1rem;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dark .community-invite-panel { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.community-invite-panel h4 { font-size: 0.88rem; font-weight: 700; color: #111827; }
.dark .community-invite-panel h4 { color: #f9fafb; }

.community-invite-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.2rem;
}

.community-invite-row .messenger-item-name { flex: 1; }

.community-invite-sent {
    font-size: 0.8rem;
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
}

.dark .community-invite-sent { background: rgb(4 120 87 / 0.3); color: #6ee7b7; }

/* ═══ Dark mode fixes ═══ */

/* Sidebar: dark surface instead of forced white */
.dark .fi-sidebar {
    background: #0f172a !important;
    border-inline-end-color: rgb(255 255 255 / 0.08) !important;
}

.dark .fi-sidebar-header {
    background: #0f172a !important;
    border-bottom-color: rgb(255 255 255 / 0.06);
}

.dark .fi-sidebar-item-label { color: #cbd5e1; }
.dark .fi-sidebar-item-icon { color: #7d8db1; }

.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover {
    background: rgb(255 255 255 / 0.06);
}

.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #ffffff;
}

.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background: rgb(45 74 138 / 0.45);
}

.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label { color: #ffffff; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: #9ec1ff; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn::before { background: #9ec1ff; }

.dark .fi-sidebar-group-label { color: #64748b; }

/* Main content: dark page background instead of forced light */
.dark .fi-main-ctn,
.dark .fi-body {
    background: #0b1220;
}

/* Cards that were relying on the light page background */
.dark .community-composer,
.dark .community-post,
.dark .community-trending,
.dark .community-groups,
.dark .community-group-banner,
.dark .community-invite-panel,
.dark .delegate-events-rail,
.dark .delegate-event-card,
.dark .delegate-empty-state,
.dark .delegate-invoice-row,
.dark .member-card,
.dark .member-section,
.dark .messenger-list,
.dark .messenger-thread,
.dark .badge-card {
    background: #111827;
    border-color: rgb(255 255 255 / 0.09);
}

/* Feed tab pill container */
.dark .community-feed-tabs {
    background: #111827;
    border-color: rgb(255 255 255 / 0.09);
}

/* Composer inputs readable on dark card */
.dark .community-composer textarea,
.dark .community-title-input { color: #f3f4f6; }

.dark .community-composer textarea::placeholder,
.dark .community-title-input::placeholder { color: #6b7280; }

/* Like/comment/share pills on dark cards */
.dark .community-like,
.dark .community-comment-toggle,
.dark .community-share {
    background: rgb(255 255 255 / 0.07);
    color: #9ca3af;
}

/* ── Scroll fade-in for feed posts ── */
.community-post.fade-bound {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.community-post.fade-bound.in-view {
    opacity: 1;
    transform: none;
}

.no-feed-fade .community-post.fade-bound {
    opacity: 1;
    transform: none;
    transition: none;
}

/* ── Typeform-style wizard polish ── */
.fi-sc-wizard-step-content,
.fi-sc-wizard > div:not(.fi-sc-wizard-header) {
    animation: wizard-step-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wizard-step-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ═══ Typeform-style wizards ═══ */

/* Hide the step-list header — one clean question canvas */
.fi-sc-wizard-header { display: none !important; }

/* Question card: roomy, full container width */
.fi-sc-wizard {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Big conversational question text */
.fi-sc-wizard .fi-fo-field-label-content {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.dark .fi-sc-wizard .fi-fo-field-label-content { color: #f9fafb; }

.fi-sc-wizard .fi-fo-field { margin-bottom: 0.4rem; }

/* Large inputs */
.fi-sc-wizard input:is([type="text"], [type="email"], [type="url"], [type="date"]),
.fi-sc-wizard textarea,
.fi-sc-wizard .fi-select-input {
    font-size: 1.05rem !important;
}

.fi-sc-wizard input:is([type="text"], [type="email"], [type="url"], [type="date"]) {
    min-height: 3.1rem;
}

/* Selects are custom divs — give them the same height as text inputs */
.fi-sc-wizard .fi-select-input {
    min-height: 3.1rem;
    display: flex;
    align-items: center;
}

/* ...and the same text size (the visible value is a nested button) */
.fi-sc-wizard .fi-select-input-btn {
    font-size: 1.45rem !important;
}

/* Placeholder text inside selects stays modest */
.fi-sc-wizard .fi-select-input-placeholder {
    font-size: 16px !important;
}

/* Options in the open dropdown stay readable too */
.fi-sc-wizard .fi-dropdown-panel {
    font-size: 1.05rem;
}

/* No "×" clear button on selected values */
.fi-sc-wizard .fi-select-input-value-remove-btn {
    display: none !important;
}

/* Stretch the select control to the full field width so its chevron
   sits at the end of the input, not right after the text */
.fi-sc-wizard .fi-select-input,
.fi-sc-wizard .fi-select-input > div,
.fi-sc-wizard .fi-select-input-ctn,
.fi-sc-wizard .fi-select-input-btn {
    width: 100%;
}

/* Slide-in animation on each question */
.fi-sc-wizard > *:not(.fi-sc-wizard-header) {
    animation: typeform-slide 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes typeform-slide {
    from { opacity: 0; transform: translateX(46px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fi-sc-wizard > *:not(.fi-sc-wizard-header) { animation: none; }
}

/* ═══ Typeform look: counter, serif question, underline inputs, progress ═══ */

.fi-sc-wizard { position: relative; }

/* Pinned to the card's top-right corner with even breathing room */
.typeform-counter {
    position: absolute;
    top: 0.25rem;
    inset-inline-end: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.01em;
    margin: 0;
    padding: 0;
}

.dark .typeform-counter { color: #9ca3af; }

.typeform-counter .tf-ring {
    width: 1.6rem;
    height: 1.6rem;
    transform: rotate(-90deg);
}

.typeform-counter .tf-ring circle {
    fill: none;
    stroke-width: 3.5;
}

.typeform-counter .tf-ring-track { stroke: #e5e7eb; }

.dark .typeform-counter .tf-ring-track { stroke: rgb(255 255 255 / 0.12); }

.typeform-counter .tf-ring-fill {
    stroke: #2d4a8a;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.dark .typeform-counter .tf-ring-fill { stroke: #9ec1ff; }

/* Question label — same family as the rest of the portal */
.fi-sc-wizard .fi-fo-field-label-content {
    font-size: 1rem;
    font-weight: 700;
    color: #16295c;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.dark .fi-sc-wizard .fi-fo-field-label-content { color: #e8effc; }

/* Bordered inputs: light grey 1px solid */
.fi-sc-wizard .fi-input-wrp {
    background: #fff !important;
    border: 1px solid #d9dfeb !important;
    border-radius: 0.6rem !important;
    box-shadow: none !important;
    padding-inline: 0.9rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fi-sc-wizard .fi-input-wrp:focus-within {
    border-color: #2d4a8a !important;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12) !important;
}

.dark .fi-sc-wizard .fi-input-wrp {
    background: rgb(255 255 255 / 0.03) !important;
    border-color: rgb(255 255 255 / 0.15) !important;
}

.dark .fi-sc-wizard .fi-input-wrp:focus-within {
    border-color: #9ec1ff !important;
    box-shadow: 0 0 0 3px rgb(158 193 255 / 0.12) !important;
}

.fi-sc-wizard .fi-input-wrp input,
.fi-sc-wizard .fi-input-wrp .fi-select-input {
    font-size: 1.45rem !important;
    background: transparent !important;
}

.fi-sc-wizard .fi-input-wrp input::placeholder {
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 1.15rem;
}

.fi-sc-wizard textarea {
    font-size: 0.8rem !important;
    background: #fff !important;
    border: 1px solid #d9dfeb !important;
    border-radius: 0.6rem !important;
    box-shadow: none !important;
    padding: 0.65rem 0.9rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fi-sc-wizard textarea:focus {
    outline: none;
    border-color: #2d4a8a !important;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12) !important;
}

.dark .fi-sc-wizard textarea {
    background: rgb(255 255 255 / 0.03) !important;
    border-color: rgb(255 255 255 / 0.15) !important;
}

.dark .fi-sc-wizard textarea:focus {
    border-color: #9ec1ff !important;
}

/* Filament wraps textareas in .fi-input-wrp, which already draws the border
   and focus ring — the textarea inside stays borderless so there's one box. */
.fi-sc-wizard .fi-input-wrp:has(textarea) { padding-inline: 0 !important; }

.fi-sc-wizard .fi-input-wrp textarea,
.fi-sc-wizard .fi-input-wrp textarea:focus,
.dark .fi-sc-wizard .fi-input-wrp textarea,
.dark .fi-sc-wizard .fi-input-wrp textarea:focus {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Footer: Continue pill + Enter hint */
.fi-sc-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-top: 1.75rem;
    border: none;
}

/* Keep the Enter hint pinned right while the buttons sit left */
.fi-sc-wizard-footer .typeform-enter-hint {
    margin-inline-start: auto;
}

.fi-sc-wizard-footer .fi-btn {
    font-size: 1rem;
    padding: 0.8rem 1.9rem;
    border-radius: 0.7rem;
}

.typeform-enter-hint {
    color: #9ca3af;
    font-size: 0.85rem;
}

.typeform-enter-hint kbd {
    font-family: ui-monospace, monospace;
    background: #f3f4f6;
    border-radius: 0.3rem;
    padding: 0.1rem 0.45rem;
}

.dark .typeform-enter-hint kbd { background: rgb(255 255 255 / 0.08); }

/* Bottom progress bar */
.typeform-progress {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    background: #ffffff;
    border-top: 1px solid #eef0f3;
    padding: 0.85rem 1.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.dark .typeform-progress { background: #111827; border-top-color: rgb(255 255 255 / 0.08); }

.typeform-progress-fill {
    position: absolute;
    top: -1px;
    left: 0;
    height: 3px;
    width: 0;
    background: #2d4a8a;
    transition: width 0.4s ease;
}

.dark .typeform-progress-fill { background: #9ec1ff; }

/* ═══ Onboarding checklist ═══ */
.onboard-card {
    background: linear-gradient(135deg, #eef3fc 0%, #ffffff 55%);
    border: 1px solid #d8e2f5;
    border-radius: 1.1rem;
    padding: 1.3rem 1.4rem;
}

.dark .onboard-card { background: rgb(45 74 138 / 0.18); border-color: rgb(158 193 255 / 0.25); }

.onboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.onboard-head h3 { font-size: 1.05rem; font-weight: 700; color: #111827; }
.dark .onboard-head h3 { color: #f9fafb; }
.onboard-head p { font-size: 0.85rem; color: #6b7280; margin-top: 0.2rem; }

.onboard-dismiss {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
}
.onboard-dismiss:hover { background: rgb(0 0 0 / 0.06); color: #4b5563; }

.onboard-bar {
    height: 6px;
    border-radius: 9999px;
    background: rgb(45 74 138 / 0.15);
    margin: 0.9rem 0 1rem;
    overflow: hidden;
}
.onboard-bar span { display: block; height: 100%; background: #2d4a8a; border-radius: 9999px; transition: width 0.4s ease; }
.dark .onboard-bar span { background: #9ec1ff; }

.onboard-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.onboard-step {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.dark .onboard-step { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.12); color: #d1d5db; }
.onboard-step:hover { border-color: #2d4a8a; transform: translateY(-1px); }
.onboard-step.done { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.dark .onboard-step.done { background: rgb(4 120 87 / 0.25); color: #6ee7b7; border-color: transparent; }

.onboard-check {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 9999px;
    border: 1.5px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
}

/* ═══ Insights ═══ */
.insights-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.9rem;
}

.insight-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.05rem 1.1rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dark .insight-card { background: #111827; border-color: rgb(255 255 255 / 0.09); }
.insight-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgb(45 74 138 / 0.3); }

.insight-card.highlight {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    border-color: transparent;
}

.insight-badge {
    position: absolute;
    top: 0.7rem;
    right: 0.8rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}
.insight-card.highlight .insight-badge { color: rgb(255 255 255 / 0.7); }

.insight-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: #eef3fc;
    color: #2d4a8a;
    align-items: center;
    justify-content: center;
}
.insight-icon svg { width: 1.1rem; height: 1.1rem; }
.dark .insight-icon { background: rgb(45 74 138 / 0.35); color: #9ec1ff; }
.insight-card.highlight .insight-icon { background: rgb(255 255 255 / 0.2); color: #fff; }

.insight-card p { font-size: 0.88rem; line-height: 1.45; color: #374151; font-weight: 500; }
.dark .insight-card p { color: #d1d5db; }
.insight-card.highlight p { color: #ffffff; }

/* ═══ Blogs ═══ */
.blogs-strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.blogs-strip-head h2 { font-size: 1.15rem; font-weight: 700; color: #111827; }
.dark .blogs-strip-head h2 { color: #f9fafb; }
.blogs-strip-head a { font-size: 0.85rem; font-weight: 600; color: #2d4a8a; text-decoration: none; }
.blogs-strip-head a:hover { text-decoration: underline; }
.dark .blogs-strip-head a { color: #9ec1ff; }

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
}
.blogs-grid.full { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dark .blog-card { background: #111827; border-color: rgb(255 255 255 / 0.09); }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.25); }

.blog-card img { width: 100%; height: 8.5rem; object-fit: cover; }

.blog-card-body { padding: 0.95rem 1.05rem; display: flex; flex-direction: column; gap: 0.35rem; }
.blog-card-body h3 { font-size: 0.95rem; font-weight: 700; color: #111827; line-height: 1.35; }
.dark .blog-card-body h3 { color: #f3f4f6; }
.blog-card-body p { font-size: 0.82rem; color: #6b7280; }
.blog-card-body span { font-size: 0.75rem; color: #9ca3af; margin-top: 0.2rem; }

/* Blog article page */
.blog-article { max-width: 46rem; }
.blog-article-cover { width: 100%; max-height: 22rem; object-fit: cover; border-radius: 1rem; margin-bottom: 1.2rem; }
.blog-article-meta { font-size: 0.85rem; color: #6b7280; margin-bottom: 1.2rem; }
.blog-article-body { font-size: 1rem; line-height: 1.8; color: #1f2937; }
.dark .blog-article-body { color: #d1d5db; }
.blog-article-back { display: inline-block; margin-top: 1.6rem; font-weight: 600; color: #2d4a8a; text-decoration: none; }
.blog-article-back:hover { text-decoration: underline; }
.dark .blog-article-back { color: #9ec1ff; }

/* ═══ Members directory ═══ */
.members-toolbar input {
    width: 100%;
    max-width: 26rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.92rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.members-toolbar input:focus {
    border-color: #2d4a8a;
    box-shadow: 0 0 0 3px rgb(45 74 138 / 0.12);
}

.dark .members-toolbar input { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.1); color: #f3f4f6; }

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
    margin-top: 1.1rem;
}

.member-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.3rem 1.1rem 1.1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .member-tile { background: #111827; border-color: rgb(255 255 255 / 0.09); }

.member-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgb(45 74 138 / 0.25); }

.member-tile-top { text-decoration: none; }

.member-tile-top img,
.member-tile-initials {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    object-fit: cover;
    margin: 0 auto 0.7rem;
    display: block;
}

.member-tile-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef3fc;
    color: #2d4a8a;
    font-weight: 700;
    font-size: 1.1rem;
}

.member-tile-top h3 { font-size: 0.95rem; font-weight: 700; color: #111827; }
.dark .member-tile-top h3 { color: #f3f4f6; }
.member-tile-top:hover h3 { color: #2d4a8a; }

.member-tile-top p { font-size: 0.8rem; color: #6b7280; margin-top: 0.2rem; min-height: 2.1em; }

.member-tile-meta { display: block; font-size: 0.75rem; color: #9ca3af; margin-top: 0.35rem; }

.member-tile-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }

.member-tile-btn {
    flex: 1;
    padding: 0.45rem 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 9999px;
    border: 1px solid #d8e2f5;
    background: #eef3fc;
    color: #2d4a8a;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.member-tile-btn:hover { background: #dbe7fb; transform: translateY(-1px); }

.member-tile-btn.following { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }

.member-tile-btn.message { background: #2d4a8a; border-color: #2d4a8a; color: #fff; }
.member-tile-btn.message:hover { background: #243b6e; }

.dark .member-tile-btn { background: rgb(45 74 138 / 0.35); color: #9ec1ff; border-color: transparent; }
.dark .member-tile-btn.following { background: rgb(4 120 87 / 0.3); color: #6ee7b7; }
.dark .member-tile-btn.message { background: #2d4a8a; color: #fff; }

/* ═══ Guided tour ═══ */
.tour-ring {
    position: fixed;
    z-index: 60;
    border-radius: 0.9rem;
    border: 2px solid #9ec1ff;
    box-shadow: 0 0 0 4px rgb(45 74 138 / 0.35), 0 0 0 9999px rgb(10 18 35 / 0.55);
    pointer-events: none;
    transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}

.tour-tip {
    position: fixed;
    z-index: 61;
    width: 300px;
    background: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 20px 50px -12px rgb(0 0 0 / 0.45);
    padding: 1rem 1.1rem;
    transition: top 0.35s ease, left 0.35s ease;
}

.dark .tour-tip { background: #1f2937; }

.tour-count {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #2d4a8a;
}

.dark .tour-count { color: #9ec1ff; }

.tour-tip h4 { font-size: 1rem; font-weight: 700; color: #111827; margin: 0.25rem 0 0.3rem; }
.dark .tour-tip h4 { color: #f9fafb; }

.tour-tip p { font-size: 0.86rem; line-height: 1.5; color: #4b5563; }
.dark .tour-tip p { color: #d1d5db; }

.tour-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }

.tour-actions button {
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    padding: 0.45rem 1rem;
    border: none;
    transition: background 0.2s ease;
}

.tour-skip { background: transparent; color: #9ca3af; margin-right: auto; padding-inline: 0.2rem !important; }
.tour-skip:hover { color: #4b5563; }

.tour-back { background: #f3f4f6; color: #374151; }
.tour-back:hover { background: #e5e7eb; }
.dark .tour-back { background: rgb(255 255 255 / 0.08); color: #d1d5db; }

.tour-next { background: #2d4a8a; color: #fff; }
.tour-next:hover { background: #243b6e; }

/* CTA in the topbar (right side of header) */
.delegate-cta.topbar {
    /* match the 1rem gap the topbar uses between bell and avatar */
    margin: 0 0.75rem 0 1rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px -4px rgb(45 74 138 / 0.4);
}

/* ═══ Icon hover tooltips ═══ */
[data-tip] { position: relative; }

[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    background: #111827;
    color: #f9fafb;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.32rem 0.65rem;
    border-radius: 0.45rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 70;
}

[data-tip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 70;
}

[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tip]:hover::before { opacity: 1; }

/* Messenger FAB tooltip should not clip at viewport edge */
.messenger-fab[data-tip]::after { left: auto; right: 0; transform: translateY(3px); }
.messenger-fab[data-tip]:hover::after { transform: translateY(0); }

/* ═══ Submission status widget (events rail) ═══ */
.delegate-status-header {
    margin-top: 1.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid #eef0f3;
}

.dark .delegate-status-header { border-top-color: rgb(255 255 255 / 0.08); }

.delegate-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.delegate-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.65rem;
    transition: background 0.15s ease;
}

.delegate-status-item:hover { background: #f3f5f9; }

.dark .delegate-status-item:hover { background: rgb(255 255 255 / 0.05); }

.delegate-status-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.delegate-status-type {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.delegate-status-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .delegate-status-label { color: #e5e7eb; }

.delegate-status-chip {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.delegate-status-chip.ok { background: #ecfdf5; color: #047857; }
.delegate-status-chip.pend { background: #fffbeb; color: #b45309; }
.delegate-status-chip.bad { background: #fef2f2; color: #b91c1c; }

.dark .delegate-status-chip.ok { background: rgb(16 185 129 / 0.15); color: #34d399; }
.dark .delegate-status-chip.pend { background: rgb(245 158 11 / 0.15); color: #fbbf24; }
.dark .delegate-status-chip.bad { background: rgb(239 68 68 / 0.15); color: #f87171; }

/* ═══ Typeform coach panel: fields left, encouragement right ═══ */
@media (min-width: 1100px) {
    .fi-sc-wizard:has(.typeform-coach) {
        position: relative;
        padding-inline-end: 20rem;
    }

    .typeform-coach {
        position: absolute;
        inset-inline-end: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 17.5rem;
        background: linear-gradient(150deg, #eef2fa 0%, #f8fafc 100%);
        border: 1px solid #e2e8f4;
        border-radius: 1rem;
        padding: 1.4rem 1.3rem;
        animation: coach-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }
}

@media (max-width: 1099.98px) {
    .typeform-coach { display: none; }
}

@keyframes coach-in {
    from { opacity: 0; transform: translateY(calc(-50% + 10px)); }
    to { opacity: 1; transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .typeform-coach { animation: none; }
}

.dark .typeform-coach {
    background: linear-gradient(150deg, rgb(45 74 138 / 0.18) 0%, rgb(17 24 39 / 0.6) 100%);
    border-color: rgb(255 255 255 / 0.08);
}

.typeform-coach svg {
    width: 1.6rem;
    height: 1.6rem;
    color: #2d4a8a;
    margin-bottom: 0.6rem;
}

.dark .typeform-coach svg { color: #9ec1ff; }

.typeform-coach h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #16295c;
    margin-bottom: 0.35rem;
}

.dark .typeform-coach h4 { color: #e8effc; }

.typeform-coach p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #4b5563;
    margin-bottom: 0.8rem;
}

.dark .typeform-coach p { color: #9ca3af; }

.typeform-coach-left {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2d4a8a;
    background: rgb(45 74 138 / 0.08);
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
}

.dark .typeform-coach-left {
    color: #9ec1ff;
    background: rgb(158 193 255 / 0.12);
}

/* ═══ One primary color for every button, light and dark ═══ */
.fi-btn-color-primary,
.fi-btn.fi-color-primary {
    background: #2d4a8a !important;
    background-image: none !important;
    color: #fff !important;
}

.fi-btn-color-primary:hover,
.fi-btn.fi-color-primary:hover,
.fi-btn-color-primary:focus-visible,
.fi-btn.fi-color-primary:focus-visible {
    background: #243b6e !important;
}

.fi-btn-color-primary .fi-btn-label,
.fi-btn.fi-color-primary .fi-btn-label,
.fi-btn-color-primary svg,
.fi-btn.fi-color-primary svg {
    color: #fff !important;
}

/* ═══ Wizard radios as selectable option boxes ═══ */

/* The oversized question text overflows its label row — give every
   wizard question clear breathing room before its control */
.fi-sc-wizard .fi-fo-field-label {
    display: block;
    margin-bottom: 1.75rem;
}

.fi-sc-wizard .fi-fo-radio {
    display: grid !important;
    gap: 1.1rem !important;
}

/* Inline radios flow horizontally as pill boxes */
.fi-sc-wizard .fi-fo-radio.fi-inline {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.8rem !important;
}

.fi-sc-wizard .fi-fo-radio.fi-inline .fi-fo-radio-label {
    padding: 0.75rem 1.15rem;
}

.fi-sc-wizard .fi-fo-radio-label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1.5px solid #dbe1ee;
    border-radius: 0.8rem;
    padding: 0.95rem 1.15rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.fi-sc-wizard .fi-fo-radio-label:hover { border-color: #2d4a8a; }

.fi-sc-wizard .fi-fo-radio-label:has(.fi-radio-input:checked) {
    border-color: #2d4a8a;
    background: #eef2fa;
    box-shadow: 0 0 0 1px #2d4a8a inset;
}

.fi-sc-wizard .fi-fo-radio-label-text p {
    font-size: 1.02rem;
    font-weight: 600;
    color: #1f2937;
}

.dark .fi-sc-wizard .fi-fo-radio-label {
    background: rgb(255 255 255 / 0.03);
    border-color: rgb(255 255 255 / 0.12);
}

.dark .fi-sc-wizard .fi-fo-radio-label:hover { border-color: #9ec1ff; }

.dark .fi-sc-wizard .fi-fo-radio-label:has(.fi-radio-input:checked) {
    border-color: #9ec1ff;
    background: rgb(158 193 255 / 0.08);
    box-shadow: 0 0 0 1px #9ec1ff inset;
}

.dark .fi-sc-wizard .fi-fo-radio-label-text p { color: #e5e7eb; }

/* An option's description reads as secondary text under its label. */
.fi-sc-wizard .fi-fo-radio-label-text p.fi-fo-radio-label-description {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    font-weight: 400;
    color: #6b7280;
}

.dark .fi-sc-wizard .fi-fo-radio-label-text p.fi-fo-radio-label-description { color: #9ca3af; }

/* ═══ Search scope filter inside the search pill ═══ */
.portal-search-box .portal-search-scope {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-inline-end: 1px solid #e5e7eb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    padding: 0 1.4rem 0 0.9rem;
    margin-inline-end: 0.6rem;
    height: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    background-size: 0.7rem;
}

.portal-search-box .portal-search-scope:focus {
    outline: none;
    color: #2d4a8a;
}

.dark .portal-search-box .portal-search-scope {
    border-inline-end-color: rgb(255 255 255 / 0.12);
    color: #d1d5db;
}

/* No focus ring on the search pill controls */
.portal-search-box input:focus,
.portal-search-box input:focus-visible,
.portal-search-box .portal-search-scope:focus,
.portal-search-box .portal-search-scope:focus-visible,
.portal-search-box:focus-within {
    outline: none !important;
    box-shadow: none !important;
    --tw-ring-color: transparent;
    --tw-ring-shadow: none;
}

/* ═══ Profile verification chip ═══ */
.profile-verify-chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-inline-end: 0.6rem;
}

.profile-verify-chip.ok { background: #ecfdf5; color: #047857; }
.profile-verify-chip.pend { background: #fffbeb; color: #b45309; }

.dark .profile-verify-chip.ok { background: rgb(16 185 129 / 0.15); color: #34d399; }
.dark .profile-verify-chip.pend { background: rgb(245 158 11 / 0.15); color: #fbbf24; }

.profile-verify-hint {
    font-size: 0.82rem;
    color: #6b7280;
}

/* ═══ Quick Actions dropdown ═══ */
.delegate-cta-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.delegate-cta-wrap [x-cloak] { display: none !important; }

.delegate-cta.topbar .delegate-cta-chevron {
    width: 0.85rem;
    height: 0.85rem;
    margin-inline-start: 0.1rem;
    transition: transform 0.2s ease;
}

.delegate-cta-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    inset-inline-end: 0.75rem;
    min-width: 15.5rem;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 0.85rem;
    box-shadow: 0 12px 32px -8px rgb(17 24 39 / 0.18);
    padding: 0.4rem;
    z-index: 65;
    display: flex;
    flex-direction: column;
}

.dark .delegate-cta-menu {
    background: #1f2937;
    border-color: rgb(255 255 255 / 0.08);
}

.delegate-cta-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s ease, color 0.15s ease;
}

.delegate-cta-menu-item:hover {
    background: #eef2fa;
    color: #2d4a8a;
}

.dark .delegate-cta-menu-item { color: #d1d5db; }

.dark .delegate-cta-menu-item:hover {
    background: rgb(255 255 255 / 0.06);
    color: #9ec1ff;
}

.delegate-cta-menu-item svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    color: #2d4a8a;
}

.dark .delegate-cta-menu-item svg { color: #9ec1ff; }

/* View Invoice button on invoice rows */
.delegate-view-invoice-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d4a8a;
    border: 1px solid #d9dfeb;
    border-radius: 0.55rem;
    padding: 0.45rem 0.9rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.delegate-view-invoice-btn:hover { background: #eef2fa; border-color: #2d4a8a; }

.delegate-view-invoice-btn svg { width: 1rem; height: 1rem; }

.dark .delegate-view-invoice-btn {
    color: #9ec1ff;
    border-color: rgb(255 255 255 / 0.15);
}

.dark .delegate-view-invoice-btn:hover { background: rgb(255 255 255 / 0.06); }

/* ═══ Admin-configured dashboard announcement ═══ */
.dashboard-announcement {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-top: 1.1rem;
    padding: 1rem 1.2rem;
    background: #eef2fa;
    border: 1px solid #d9e2f5;
    border-radius: 0.85rem;
}

.dark .dashboard-announcement {
    background: rgb(45 74 138 / 0.18);
    border-color: rgb(158 193 255 / 0.2);
}

.dashboard-announcement svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    color: #2d4a8a;
    margin-top: 0.1rem;
}

.dark .dashboard-announcement svg { color: #9ec1ff; }

.dashboard-announcement h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #16295c;
}

.dark .dashboard-announcement h3 { color: #e8effc; }

.dashboard-announcement p {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.2rem;
}

.dark .dashboard-announcement p { color: #9ca3af; }

/* ═══ Membership application progression ═══ */
.membership-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.9rem 0;
    max-width: 30rem;
}

.membership-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
}

.membership-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
}

.membership-step.done { color: #047857; }
.membership-step.done .membership-dot { background: #ecfdf5; color: #047857; }

.membership-step.current { color: #2d4a8a; }
.membership-step.current .membership-dot { background: #eef2fa; color: #2d4a8a; box-shadow: 0 0 0 2px #2d4a8a inset; }

.membership-step.rejected { color: #b91c1c; }
.membership-step.rejected .membership-dot { background: #fef2f2; color: #b91c1c; }

.membership-bar {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    border-radius: 999px;
}

.membership-bar.done { background: #2d4a8a; }

.dark .membership-step { color: #6b7280; }
.dark .membership-dot { background: rgb(255 255 255 / 0.08); color: #9ca3af; }
.dark .membership-step.done { color: #34d399; }
.dark .membership-step.done .membership-dot { background: rgb(16 185 129 / 0.15); color: #34d399; }
.dark .membership-step.current { color: #9ec1ff; }
.dark .membership-step.current .membership-dot { background: rgb(158 193 255 / 0.12); color: #9ec1ff; box-shadow: 0 0 0 2px #9ec1ff inset; }
.dark .membership-bar { background: rgb(255 255 255 / 0.1); }
.dark .membership-bar.done { background: #9ec1ff; }

/* ═══ Journal: submit & track AML / AMP manuscripts ═══ */
.journal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.journal-lede { color: #4b5563; font-size: 0.95rem; max-width: 46rem; line-height: 1.55; }
.journal-lede strong { color: #2d4a8a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.journal-head-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.journal-alert {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
}

.journal-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.journal-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.15rem 1.2rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.journal-stat:hover { border-color: #c7d3ea; }
.journal-stat.is-active { border-color: #2d4a8a; box-shadow: 0 0 0 1px #2d4a8a inset; }
.journal-stat:focus-visible { outline: 2px solid #2d4a8a; outline-offset: 2px; }
.journal-stat-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
}
.journal-stat-icon svg { width: 1.35rem; height: 1.35rem; }
.journal-stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.journal-stat-label { font-size: 0.82rem; color: #6b7280; }
.journal-stat.blue .journal-stat-icon { background: #eef3fc; color: #2d4a8a; }
.journal-stat.blue .journal-stat-value { color: #2d4a8a; }
.journal-stat.amber .journal-stat-icon { background: #fff4e5; color: #c2410c; }
.journal-stat.amber .journal-stat-value { color: #c2410c; }
.journal-stat.green .journal-stat-icon { background: #ecfdf5; color: #047857; }
.journal-stat.green .journal-stat-value { color: #047857; }
.journal-stat.slate .journal-stat-icon { background: #f1f3f6; color: #475569; }
.journal-stat.slate .journal-stat-value { color: #1f2937; }

.journal-panel {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.3rem 1.4rem;
}
.journal-panel h2 { font-size: 1.05rem; font-weight: 700; color: #111827; margin-bottom: 0.8rem; }
.journal-panel h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin: 1rem 0 0.35rem; }

.journal-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: -0.2rem 0 0.9rem;
}
.journal-panel-head h2 { margin: 0; }
.journal-tabs { display: inline-flex; gap: 0.25rem; background: #f3f5f9; border-radius: 0.7rem; padding: 0.2rem; }
.journal-tab {
    border-radius: 0.55rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}
.journal-tab span { font-size: 0.72rem; color: #9ca3af; font-weight: 600; }
.journal-tab.is-active { background: #fff; color: #2d4a8a; box-shadow: 0 1px 2px rgb(15 23 42 / 0.08); }
.journal-tab:focus-visible { outline: 2px solid #2d4a8a; outline-offset: 1px; }

.journal-table-wrap { overflow-x: auto; margin: 0 -1.4rem -1.3rem; }
.journal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.journal-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0.7rem 1.4rem;
    border-top: 1px solid #eef0f3;
    border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
}
.journal-table td { padding: 1rem 1.4rem; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
.journal-table tbody tr:last-child td { border-bottom: 0; }
.journal-table tbody tr:hover { background: #fafbfd; }
.journal-table td > * + * { margin-top: 0.2rem; }
/* Titles take the room; the other columns shrink to their content. */
.journal-table th:first-child,
.journal-table td:first-child { width: 100%; min-width: 13rem; }
.journal-table th:not(:first-child),
.journal-table td:not(:first-child) { width: 1%; white-space: nowrap; padding-inline: 0.9rem; }
.journal-table th:last-child,
.journal-table td:last-child { padding-inline-end: 1.4rem; }
.journal-table td.journal-status-cell { white-space: normal; min-width: 8.5rem; }
.journal-table td .journal-muted { display: block; }
.journal-ref {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b7791f;
}
.journal-title { display: block; color: #111827; font-weight: 600; text-decoration: none; }
.journal-title:hover { color: #2d4a8a; text-decoration: underline; }
.journal-muted { color: #6b7280; font-size: 0.8rem; }
.journal-nowrap { white-space: nowrap; }
.journal-actions { text-align: right; white-space: nowrap; }

.journal-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 0.4rem;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
}
.journal-badge.aml { background: #eef3fc; color: #2d4a8a; }
.journal-badge.amp { background: #f3effc; color: #6d28d9; }

.delegate-status-chip.warn { background: #fff4e5; color: #c2410c; }
.dark .delegate-status-chip.warn { background: rgb(234 88 12 / 0.15); color: #fb923c; }

.journal-empty { text-align: center; padding: 2.5rem 1rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.journal-empty svg { width: 2.6rem; height: 2.6rem; color: #9ca3af; }
.journal-empty h3 { font-size: 1rem; font-weight: 700; color: #111827; }
.journal-empty p { color: #6b7280; font-size: 0.9rem; max-width: 26rem; margin-bottom: 0.6rem; }

/* Tracking */
.journal-summary-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.journal-summary-top .journal-ref { display: inline; font-size: 0.85rem; }
.journal-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; margin-top: 0.9rem; }
.journal-facts dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.journal-facts dd { font-size: 0.92rem; color: #111827; }
.journal-facts dd a { color: #2d4a8a; }
.journal-facts.stacked { flex-direction: column; gap: 0.8rem; margin-top: 0; }

.journal-progress { display: flex; margin-top: 1.4rem; padding: 0; list-style: none; }
.journal-progress li {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}
.journal-progress li::before {
    content: '';
    position: absolute;
    top: 0.55rem;
    right: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
}
.journal-progress li:first-child::before { display: none; }
.journal-progress li.done::before,
.journal-progress li.current::before,
.journal-progress li.attention::before,
.journal-progress li.stopped::before { background: #2d4a8a; }
.journal-progress-dot {
    position: relative;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #d1d5db;
}
.journal-progress li.done .journal-progress-dot { background: #2d4a8a; border-color: #2d4a8a; }
.journal-progress li.current .journal-progress-dot { border-color: #2d4a8a; box-shadow: 0 0 0 4px #e3eaf7; }
.journal-progress li.attention .journal-progress-dot { border-color: #c2410c; background: #fff4e5; box-shadow: 0 0 0 4px #ffedd5; }
.journal-progress li.stopped .journal-progress-dot { border-color: #b91c1c; background: #fef2f2; }
.journal-progress-label { font-size: 0.78rem; color: #6b7280; font-weight: 500; }
.journal-progress li.done .journal-progress-label,
.journal-progress li.current .journal-progress-label { color: #2d4a8a; font-weight: 600; }
.journal-progress li.attention .journal-progress-label { color: #c2410c; font-weight: 600; }
.journal-progress li.stopped .journal-progress-label { color: #b91c1c; font-weight: 600; }

.journal-note {
    margin-top: 1.2rem;
    background: #f5f3ff;
    color: #4c1d95;
    border-radius: 0.7rem;
    padding: 0.75rem 0.95rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.journal-revise { border-color: #fdba74; background: #fffaf3; }
.journal-revise-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; align-items: flex-start; }
.journal-revise-form > :first-child { align-self: stretch; }
.journal-letter {
    border-left: 3px solid #2d4a8a;
    background: #f7f9fd;
    padding: 0.8rem 1rem;
    border-radius: 0 0.6rem 0.6rem 0;
    color: #1f2937;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.journal-columns { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
.journal-col-main, .journal-col-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.journal-prose { color: #374151; line-height: 1.7; font-size: 0.93rem; }
.journal-keywords { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.journal-keywords span { background: #f3f5f9; color: #374151; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.8rem; }
.journal-list { margin-top: 0.6rem; padding-left: 1.1rem; list-style: disc; font-size: 0.9rem; color: #374151; }

.journal-review-card { border-top: 1px solid #f1f3f6; padding-top: 0.9rem; margin-top: 0.9rem; }
.journal-review-card:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.journal-review-card header { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline; }
.journal-review-card h4 { margin-top: 0.7rem; }
.journal-review-card p { color: #374151; font-size: 0.9rem; line-height: 1.6; }

.journal-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.journal-timeline li { position: relative; padding: 0 0 0.95rem 1.2rem; display: flex; flex-direction: column; }
.journal-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #2d4a8a;
}
.journal-timeline li::after {
    content: '';
    position: absolute;
    left: 0.24rem;
    top: 1rem;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
}
.journal-timeline li:last-child { padding-bottom: 0; }
.journal-timeline li:last-child::after { display: none; }
.journal-timeline li:not(:first-child)::before { background: #c7d3ea; }
.journal-timeline-label { font-size: 0.88rem; font-weight: 600; color: #111827; }
.journal-timeline time { font-size: 0.78rem; color: #6b7280; }

.journal-files { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.journal-files li { display: flex; flex-direction: column; font-size: 0.88rem; color: #111827; overflow-wrap: anywhere; }

/* Submit wizard review step */
.journal-review h3 { font-size: 1.05rem; font-weight: 700; color: #111827; margin-bottom: 0.8rem; }
.journal-review dl { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.55rem 1rem; font-size: 0.9rem; }
.journal-review dt { color: #6b7280; font-weight: 600; }
.journal-review dd { color: #111827; overflow-wrap: anywhere; }

.dark .journal-lede { color: #d1d5db; }
.dark .journal-lede strong { color: #9ec1ff; }
.dark .journal-alert { background: rgb(245 158 11 / 0.12); border-color: rgb(245 158 11 / 0.35); color: #fcd34d; }
.dark .journal-stat,
.dark .journal-panel { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }
.dark .journal-stat.is-active { border-color: #9ec1ff; box-shadow: 0 0 0 1px #9ec1ff inset; }
.dark .journal-stat-label,
.dark .journal-muted,
.dark .journal-table th,
.dark .journal-facts dt,
.dark .journal-progress-label,
.dark .journal-timeline time,
.dark .journal-review dt,
.dark .journal-panel h4 { color: #9ca3af; }
.dark .journal-stat.blue .journal-stat-icon { background: rgb(158 193 255 / 0.12); color: #9ec1ff; }
.dark .journal-stat.blue .journal-stat-value { color: #9ec1ff; }
.dark .journal-stat.amber .journal-stat-icon { background: rgb(234 88 12 / 0.15); color: #fb923c; }
.dark .journal-stat.amber .journal-stat-value { color: #fb923c; }
.dark .journal-stat.green .journal-stat-icon { background: rgb(16 185 129 / 0.15); color: #34d399; }
.dark .journal-stat.green .journal-stat-value { color: #34d399; }
.dark .journal-stat.slate .journal-stat-icon { background: rgb(255 255 255 / 0.08); color: #cbd5e1; }
.dark .journal-stat.slate .journal-stat-value,
.dark .journal-panel h2,
.dark .journal-title,
.dark .journal-facts dd,
.dark .journal-empty h3,
.dark .journal-timeline-label,
.dark .journal-files li,
.dark .journal-review h3,
.dark .journal-review dd { color: #f9fafb; }
.dark .journal-tabs { background: rgb(255 255 255 / 0.06); }
.dark .journal-tab { color: #d1d5db; }
.dark .journal-tab.is-active { background: rgb(255 255 255 / 0.12); color: #9ec1ff; }
.dark .journal-table th { background: rgb(255 255 255 / 0.03); border-color: rgb(255 255 255 / 0.08); }
.dark .journal-table td { border-color: rgb(255 255 255 / 0.06); }
.dark .journal-table tbody tr:hover { background: rgb(255 255 255 / 0.03); }
.dark .journal-title:hover { color: #9ec1ff; }
.dark .journal-ref { color: #fbbf24; }
.dark .journal-badge.aml { background: rgb(158 193 255 / 0.12); color: #9ec1ff; }
.dark .journal-badge.amp { background: rgb(167 139 250 / 0.15); color: #c4b5fd; }
.dark .journal-progress li::before { background: rgb(255 255 255 / 0.12); }
.dark .journal-progress li.done::before,
.dark .journal-progress li.current::before,
.dark .journal-progress li.attention::before,
.dark .journal-progress li.stopped::before { background: #9ec1ff; }
.dark .journal-progress-dot { background: #111827; border-color: rgb(255 255 255 / 0.2); }
.dark .journal-progress li.done .journal-progress-dot { background: #9ec1ff; border-color: #9ec1ff; }
.dark .journal-progress li.current .journal-progress-dot { border-color: #9ec1ff; box-shadow: 0 0 0 4px rgb(158 193 255 / 0.15); }
.dark .journal-progress li.done .journal-progress-label,
.dark .journal-progress li.current .journal-progress-label { color: #9ec1ff; }
.dark .journal-note { background: rgb(167 139 250 / 0.12); color: #ddd6fe; }
.dark .journal-revise { background: rgb(234 88 12 / 0.06); border-color: rgb(234 88 12 / 0.35); }
.dark .journal-letter { background: rgb(255 255 255 / 0.04); border-left-color: #9ec1ff; color: #e5e7eb; }
.dark .journal-prose,
.dark .journal-list,
.dark .journal-review-card p { color: #d1d5db; }
.dark .journal-keywords span { background: rgb(255 255 255 / 0.08); color: #e5e7eb; }
.dark .journal-review-card { border-color: rgb(255 255 255 / 0.08); }
.dark .journal-timeline li::after { background: rgb(255 255 255 / 0.12); }
.dark .journal-timeline li::before { background: #9ec1ff; }

@media (max-width: 1100px) {
    .journal-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
    .journal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .journal-review dl { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
    .journal-review dd { margin-bottom: 0.5rem; }
}

@media (max-width: 640px) {
    .journal-table thead { display: none; }
    .journal-table, .journal-table tbody, .journal-table tr, .journal-table td { display: block; width: 100%; }
    .journal-table tr { padding: 0.9rem 1.4rem; border-bottom: 1px solid #f1f3f6; }
    .journal-table td { padding: 0.15rem 0; border: 0; }
    .journal-table td:first-child, .journal-table td:not(:first-child) { width: 100%; min-width: 0; white-space: normal; }
    .journal-actions { text-align: left; padding-top: 0.6rem !important; }
    .journal-progress-label { font-size: 0.68rem; }
    .journal-panel { padding: 1.1rem; }
    .journal-table-wrap { margin: 0 -1.1rem -1.1rem; }
}

/* ═══ Grouped step forms (manuscript, nomination): steps down the left ═══ */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 1rem;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 14.5rem minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
}

.dark :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard > input[type="hidden"] { display: none; }

/* The step rail: a vertical list, spanning every row of the grid. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header {
    /* One source of truth: the connector length is derived from these. */
    --journal-step-gap: 1.1rem;
    --journal-step-pad: 0.6rem;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: var(--journal-step-gap);
    grid-column: 1;
    grid-row: 1 / -1;
    margin: 0;
    padding: 0.25rem 1.75rem 0 0;
    border-right: 1px solid #eef0f3;
    border-bottom: 0;
    position: relative;
}

.dark :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header { border-right-color: rgb(255 255 255 / 0.08); }

/* Heading above the list: which step you are on, and its name. */
:is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1.5rem;
    padding-inline: 0.4rem;
}

:is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-count {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2d4a8a;
}

:is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.dark :is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-count { color: #9ec1ff; }
.dark :is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-name { color: #f9fafb; }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step { flex: 0 0 auto; }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: var(--journal-step-pad) 0.4rem;
    border-radius: 0.6rem;
}

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-icon-ctn { flex-shrink: 0; }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-label { font-size: 0.86rem; font-weight: 600; text-align: start; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-text { min-width: 0; text-align: start; }

/* The chevrons between steps belong to a horizontal row. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step > svg,
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-separator { display: none; }

/* A hairline joins the step icons down the rail — anchored to the icon
   itself so it stays centred whatever the padding. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-icon-ctn { position: relative; }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step:not(:last-child) .fi-sc-wizard-header-step-icon-ctn::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: calc(var(--journal-step-pad) * 2 + var(--journal-step-gap));
    background: #e2e7f0;
}

.dark :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step:not(:last-child) .fi-sc-wizard-header-step-icon-ctn::after { background: rgb(255 255 255 / 0.12); }

:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-step { grid-column: 2; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-footer {
    grid-column: 2;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid #eef0f3;
}

.dark :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-footer { border-top-color: rgb(255 255 255 / 0.08); }

/* Fields read at their normal size here, not the typeform scale. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field-label-content { font-size: 0.875rem !important; font-weight: 600 !important; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard input:is([type="text"], [type="email"], [type="url"], [type="date"]),
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-select-input,
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard textarea { font-size: 0.9rem !important; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-input-wrp input,
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-input-wrp .fi-select-input { font-size: 0.9rem !important; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-select-input-btn { font-size: 0.9rem !important; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard input:is([type="text"], [type="email"]),
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-select-input { min-height: 2.4rem; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-input-wrp input::placeholder { text-transform: none; letter-spacing: 0; font-size: 0.9rem; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field { margin-bottom: 0; }

/* Filament lifts a radio group by -1rem to sit under a hidden label; with a
   visible question above it, that pulls the options over the text. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-radio,
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-checkbox-list { margin-top: 0; }

/* Tighter rhythm than Filament's defaults. */
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-grid { gap: 0.85rem 1.25rem; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field-wrp { gap: 0.3rem; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field-label { margin-bottom: 0; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-input-wrp { min-height: 2.5rem; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard textarea { min-height: 0; }
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field-wrp-hint,
:is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard .fi-fo-field-wrp-helper-text { margin-top: 0.15rem; font-size: 0.78rem; }

:is(.journal-submit-form, .fi-resource-my-nominations) .journal-review dl { grid-template-columns: 10rem minmax(0, 1fr); }

/* Narrow panels: the rail becomes a row above the form again. */
@media (max-width: 1024px) {
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard { grid-template-columns: minmax(0, 1fr); row-gap: 1.25rem; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header {
        flex-direction: row;
        grid-row: auto;
        grid-column: 1;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 0 0.75rem;
        border-right: 0;
        border-bottom: 1px solid #eef0f3;
    }
    .dark :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header { border-bottom-color: rgb(255 255 255 / 0.08); }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header { --journal-step-gap: 0; --journal-step-pad: 0.45rem; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .journal-step-heading { display: none; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step { flex: 1 1 0; min-width: 0; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-btn { gap: 0.4rem; padding-inline: 0.25rem; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-label { font-size: 0.78rem; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step:not(:last-child) .fi-sc-wizard-header-step-icon-ctn::after { display: none; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-step,
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-footer { grid-column: 1; }
}

@media (max-width: 640px) {
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard { padding: 1rem; }
    :is(.journal-submit-form, .fi-resource-my-nominations) .fi-sc-wizard-header-step-label { font-size: 0.75rem; }
}

/* ═══ High-resolution screens (2K / 3K): scale the whole portal up ═══ */
@media (min-width: 1920px) {
    html { font-size: 17px; }
}

@media (min-width: 2500px) {
    html { font-size: 20px; }
}

@media (min-width: 3300px) {
    html { font-size: 23px; }
}

/* ═══ Lucy: the Portal assistant, pinned to the bottom of the content column ═══ */
.lucy {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 1.25rem 0 0;
    /* Clear of the messenger bubble in the bottom-right corner. */
    padding: 1.75rem 4.5rem 1rem 0;
    pointer-events: none;
}

/* The page scrolls underneath, so fade it out behind the bar rather than
   letting feed text collide with it. Transparent at the top so the fade
   has no visible edge. */
.lucy::before {
    content: "";
    position: absolute;
    inset: 0 0 0 -1rem;
    background: linear-gradient(
        to bottom,
        rgb(255 255 255 / 0) 0%,
        rgb(255 255 255 / 0.75) 35%,
        rgb(255 255 255 / 0.97) 70%,
        rgb(255 255 255) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* With the conversation open the panel is already opaque, so the fade only
   needs to cover the strip above it. */
.lucy.is-open::before { inset: 0 0 0 -1rem; }

.lucy > * { pointer-events: auto; }

.lucy-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 999px;
    box-shadow: 0 10px 30px -12px rgb(27 35 64 / 0.28), 0 2px 6px rgb(27 35 64 / 0.06);
    padding: 0.4rem 0.4rem 0.4rem 0.75rem;
}

.lucy-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2d4a8a, #5a7bc4);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.lucy-form { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 auto; min-width: 0; }

.lucy-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 0.95rem;
    color: #1b2340;
    padding: 0.55rem 0.25rem;
}

.lucy-input::placeholder { color: #8a94ad; }
.lucy-input:focus { outline: none; box-shadow: none; }
.lucy-input:disabled { cursor: not-allowed; }

.lucy-send {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: #2d4a8a;
    color: #fff;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lucy-send svg { width: 1.05rem; height: 1.05rem; }
.lucy-send:hover:not(:disabled) { background: #243c72; transform: translateX(1px); }
.lucy-send:disabled { background: #b9c3d8; cursor: not-allowed; }

.lucy-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.lucy-chip {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: #45506b;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.lucy-chip:hover { border-color: #2d4a8a; color: #2d4a8a; }

.lucy-panel {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 1rem;
    box-shadow: 0 18px 40px -18px rgb(27 35 64 / 0.3);
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.lucy-panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #eef1f6;
}

.lucy-panel-head > div { display: flex; flex-direction: column; line-height: 1.25; }
.lucy-panel-head strong { font-size: 0.9rem; color: #1b2340; }
.lucy-panel-head span { font-size: 0.72rem; color: #78839d; }
.lucy-panel-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 0.25rem; }

.lucy-ghost {
    font-size: 0.78rem;
    color: #6f7c9b;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lucy-ghost:hover { background: #f2f5fa; color: #2d4a8a; }
.lucy-ghost svg { width: 1rem; height: 1rem; }

.lucy-thread {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem;
    max-height: 22rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.lucy-msg {
    max-width: 85%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.85rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.lucy-msg.user {
    align-self: flex-end;
    background: #2d4a8a;
    color: #fff;
    border-bottom-right-radius: 0.3rem;
}

.lucy-msg.assistant {
    align-self: flex-start;
    background: #f4f6fb;
    color: #1b2340;
    border-bottom-left-radius: 0.3rem;
}

.lucy-error {
    align-self: stretch;
    background: #fdf2f2;
    border: 1px solid #f3d0d0;
    color: #9a2f2f;
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
}

.lucy-thinking { display: flex; gap: 0.25rem; align-items: center; }

.lucy-thinking span {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: #9aa5bd;
    animation: lucy-blink 1.3s infinite ease-in-out;
}

.lucy-thinking span:nth-child(2) { animation-delay: 0.18s; }
.lucy-thinking span:nth-child(3) { animation-delay: 0.36s; }

@keyframes lucy-blink {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 1024px) {
    .lucy { padding-right: 4rem; }
    .lucy-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
    .lucy-thinking span { animation: none; opacity: 0.6; }
    .lucy-send:hover:not(:disabled) { transform: none; }
}

.lucy-link {
    color: #2d4a8a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.lucy-msg.user .lucy-link { color: #fff; }
.lucy-link:hover { color: #1b2340; }
