/* 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);
}

/*
 * The rail is on every page now, wizards included, because Lucy and the
 * messenger live in it — and a form is where someone is most likely to need
 * either. It collapses rather than disappearing, so a long form can still
 * have the full width.
 *
 * Content makes room only while the rail is open, and only where there is
 * room to give: below 1280px it slides over the page instead.
 */
@media (min-width: 1280px) {
    body:has(.delegate-events-aside:not(.is-collapsed)) .fi-main {
        padding-inline-end: 22.5rem !important;
    }
}

/*
 * A table page uses the width it is given.
 *
 * Filament caps .fi-main at 80rem, which is right for a column of prose
 * and wrong for a grid: on a wide screen the submissions table was held
 * to 888px with several hundred pixels of empty page beside it, and the
 * Status and Submitted columns fell off the end into a scrollbar.
 *
 * Only list pages. Forms keep the cap, because a 1600px-wide text input
 * is its own kind of unreadable.
 */
body:has(.fi-resource-list-records-page) .fi-main,
body:has(.fi-page-list-records) .fi-main {
    max-width: none;
}

/* A grid that still outgrows the page scrolls inside its own card,
   rather than pushing the whole layout sideways. */
.fi-resource-list-records-page .fi-ta-ctn {
    overflow-x: auto;
}

/* Collapsed: off to the side, with only its handle left on screen. */
.delegate-events-aside.is-collapsed {
    width: 0;
    padding-inline: 0;
    border-inline-start-color: transparent;
    background: none;
    overflow: visible;
}

.delegate-rail-toggle {
    position: absolute;
    top: 0.75rem;
    inset-inline-start: -1.9rem;
    width: 1.9rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eef0f3;
    border-inline-end: 0;
    border-radius: 0.6rem 0 0 0.6rem;
    background: #fff;
    color: #4a5878;
    cursor: pointer;
    box-shadow: -2px 0 8px rgb(15 23 42 / 0.05);
}

.delegate-rail-toggle:hover { color: #2d4a8a; }

/*
 * Narrow screens: it slides over rather than vanishing.
 *
 * It used to be hidden outright below 1280px, which was fine when it held
 * only a list of events — now it holds the assistant and the messages, and
 * hiding it would take both away from anyone on a laptop or a phone.
 */
@media (max-width: 1279.98px) {
    .delegate-events-aside {
        width: min(21rem, 92vw);
        box-shadow: -8px 0 28px rgb(15 23 42 / 0.12);
    }

    .delegate-events-aside.is-collapsed {
        box-shadow: none;
    }
}

/* ── Brand: logo + wordmark ── */
/*
 * Bigger, since the collapse arrow no longer shares the corner with it.
 * The brand is the one thing in the sidebar that says where you are.
 */
.delegate-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.45rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

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

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

/* ── 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.
 *
 * Only where the form really does ask one question at a time. A form whose
 * steps are grouped and named wants that header as its rail, and this rule
 * used to hide it everywhere: a newly grouped form lost its step list and
 * rendered as one long scroll with no sense of progress.
 *
 * .iaam-stepped-form is put on the body by the panel, on the same routes it
 * already treats as grouped — so the opt-out list lives in one place now
 * rather than being repeated here and in the step-heading script.
 */
body:not(.iaam-stepped-form) .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 ═══ */
.iaam-stepped-form .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 .iaam-stepped-form .fi-sc-wizard { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); }

.iaam-stepped-form .fi-sc-wizard > input[type="hidden"] { display: none; }

/* The step rail: a vertical list, spanning every row of the grid. */
.iaam-stepped-form .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 .iaam-stepped-form .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. */
.iaam-stepped-form .journal-step-heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1.5rem;
    padding-inline: 0.4rem;
}

.iaam-stepped-form .journal-step-count {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2d4a8a;
}

.iaam-stepped-form .journal-step-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.dark .iaam-stepped-form .journal-step-count { color: #9ec1ff; }
.dark .iaam-stepped-form .journal-step-name { color: #f9fafb; }

.iaam-stepped-form .fi-sc-wizard-header-step { flex: 0 0 auto; }

.iaam-stepped-form .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;
}

.iaam-stepped-form .fi-sc-wizard-header-step-icon-ctn { flex-shrink: 0; }

.iaam-stepped-form .fi-sc-wizard-header-step-label { font-size: 0.86rem; font-weight: 600; text-align: start; }
.iaam-stepped-form .fi-sc-wizard-header-step-text { min-width: 0; text-align: start; }

/* The chevrons between steps belong to a horizontal row. */
.iaam-stepped-form .fi-sc-wizard-header-step > svg,
.iaam-stepped-form .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. */
.iaam-stepped-form .fi-sc-wizard-header-step-icon-ctn { position: relative; }

.iaam-stepped-form .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 .iaam-stepped-form .fi-sc-wizard-header-step:not(:last-child) .fi-sc-wizard-header-step-icon-ctn::after { background: rgb(255 255 255 / 0.12); }

.iaam-stepped-form .fi-sc-wizard-step { grid-column: 2; }
.iaam-stepped-form .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 .iaam-stepped-form .fi-sc-wizard-footer { border-top-color: rgb(255 255 255 / 0.08); }

/* Fields read at their normal size here, not the typeform scale. */
.iaam-stepped-form .fi-sc-wizard .fi-fo-field-label-content { font-size: 0.875rem !important; font-weight: 600 !important; }
.iaam-stepped-form .fi-sc-wizard input:is([type="text"], [type="email"], [type="url"], [type="date"]),
.iaam-stepped-form .fi-sc-wizard .fi-select-input,
.iaam-stepped-form .fi-sc-wizard textarea { font-size: 0.9rem !important; }
.iaam-stepped-form .fi-sc-wizard .fi-input-wrp input,
.iaam-stepped-form .fi-sc-wizard .fi-input-wrp .fi-select-input { font-size: 0.9rem !important; }
.iaam-stepped-form .fi-sc-wizard .fi-select-input-btn { font-size: 0.9rem !important; }
.iaam-stepped-form .fi-sc-wizard input:is([type="text"], [type="email"]),
.iaam-stepped-form .fi-sc-wizard .fi-select-input { min-height: 2.4rem; }
.iaam-stepped-form .fi-sc-wizard .fi-input-wrp input::placeholder { text-transform: none; letter-spacing: 0; font-size: 0.9rem; }
.iaam-stepped-form .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. */
.iaam-stepped-form .fi-sc-wizard .fi-fo-radio,
.iaam-stepped-form .fi-sc-wizard .fi-fo-checkbox-list { margin-top: 0; }

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

.iaam-stepped-form .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) {
    .iaam-stepped-form .fi-sc-wizard { grid-template-columns: minmax(0, 1fr); row-gap: 1.25rem; }
    .iaam-stepped-form .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 .iaam-stepped-form .fi-sc-wizard-header { border-bottom-color: rgb(255 255 255 / 0.08); }
    .iaam-stepped-form .fi-sc-wizard-header { --journal-step-gap: 0; --journal-step-pad: 0.45rem; }
    .iaam-stepped-form .journal-step-heading { display: none; }
    .iaam-stepped-form .fi-sc-wizard-header-step { flex: 1 1 0; min-width: 0; }
    .iaam-stepped-form .fi-sc-wizard-header-step-btn { gap: 0.4rem; padding-inline: 0.25rem; }
    .iaam-stepped-form .fi-sc-wizard-header-step-label { font-size: 0.78rem; }
    .iaam-stepped-form .fi-sc-wizard-header-step:not(:last-child) .fi-sc-wizard-header-step-icon-ctn::after { display: none; }
    .iaam-stepped-form .fi-sc-wizard-step,
    .iaam-stepped-form .fi-sc-wizard-footer { grid-column: 1; }
}

@media (max-width: 640px) {
    .iaam-stepped-form .fi-sc-wizard { padding: 1rem; }
    .iaam-stepped-form .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; }

/*
 * Pages outside the Filament panel.
 *
 * The panel ships its own reset, so the sign-in page never showed the
 * browser's default body margin. A page built on the plain layout has no
 * such reset, and that 8px turned up as a pale frame around the whole
 * registration page — most visibly as a gap above the navy topbar, which is
 * meant to sit flush against the top of the window.
 *
 * Only the margin is reset: this file is loaded inside the panel too, where
 * everything else is already handled.
 */
body { margin: 0; }

/* ---------------------------------------------------------------- sign-in */
/*
 * The member sign-in page, measured off the design file
 * IAAM_Lattice_Sign-in_dark.html.
 *
 * Lengths are written in px rather than rem on purpose: they are the design's
 * own numbers, and rem would move them the moment anything changed the root
 * size. Only the two typefaces the design names are declared — IBM Plex Sans
 * for the page, IBM Plex Serif for the headline — and the panel already loads
 * both, so nothing is embedded here.
 */

.iaam-login {
    --iaam-navy: #06173f;
    --iaam-deep: #0a2a6e;
    --iaam-blue: #0b3ba8;
    --iaam-line: #dde4f0;
    --iaam-rule: #b6c2d9;
    --iaam-ink: #12203f;
    --iaam-muted: #4a5878;

    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    background: #f4f7fc;
    color: var(--iaam-ink);

    /*
     * The design sets no page line-height, so every box that does not declare
     * one is sized by the browser default. Filament's 1.5 made each of them a
     * few pixels taller, and ten of those down the card is a visible drift.
     * The ones the design does declare are restated where they belong.
     */
    line-height: normal;
}

/* Visually hidden, for the labels the design draws as icons. */
.iaam-login-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- topbar */

.iaam-login-topbar {
    flex: 1 1 100%;
    box-sizing: border-box;
    background: var(--iaam-navy);
    color: #dce5f6;
    font-size: 13px;
    padding: 8px 64px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
}

.iaam-login-topbar-item { display: flex; align-items: center; gap: 8px; }
.iaam-login-topbar-item strong { color: #fff; font-weight: 600; }

.iaam-login-lang { display: flex; align-items: center; gap: 8px; }

.iaam-login-lang select {
    height: 32px;
    background: transparent;
    color: #fff;
    border: 1px solid rgb(255 255 255 / .35);
    border-radius: 6px;
    padding: 0 8px;
    font-size: 13px;
    font-family: inherit;
}

.iaam-login-lang option { color: var(--iaam-ink); }

/* ------------------------------------------------------------ left panel */

.iaam-login-intro {
    position: relative;
    overflow: hidden;
    flex: 1 1 600px;
    min-width: 0;
    box-sizing: border-box;
    background: var(--iaam-deep);
    color: #fff;
    padding: 56px 64px 40px;
    display: flex;
    flex-direction: column;
    gap: 44px;
}

/* The hex lattice, drawn as a background rather than an inline SVG so it
   cannot pick up a stray fill from the panel's own stylesheet. */
.iaam-login-hex {
    position: absolute;
    inset: 0;
    opacity: .09;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97'%3E%3Cpath d='M28 0 56 16.2v32.4L28 64.8 0 48.6V16.2zM28 64.8V97' fill='none' stroke='%23FFFFFF' stroke-width='1.2'/%3E%3C/svg%3E");
}

.iaam-login-orb {
    position: absolute;
    right: -180px;
    bottom: -180px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    border: 1px solid rgb(255 255 255 / .12);
    pointer-events: none;
}

.iaam-login-intro > *:not(.iaam-login-hex):not(.iaam-login-orb) { position: relative; }

.iaam-login-brand { display: flex; align-items: center; gap: 22px; }

.iaam-login-mark {
    width: 104px;
    height: 104px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 30px rgb(0 0 0 / .25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-login-mark img { width: 88px; height: 88px; object-fit: contain; }

.iaam-login-brand-text { display: flex; flex-direction: column; gap: 6px; }

.iaam-login-wordmark {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.05;
    white-space: nowrap;
}

.iaam-login-tagline { font-size: 15px; color: #cfdaf2; }

.iaam-login-lede { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }

.iaam-login-eyebrow {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #ffb27a;
}

/*
 * The headline is the one serif on the page, as the design has it. Georgia
 * carries it if IBM Plex Serif has not arrived, so the heading never falls
 * back to the UI face.
 */
.iaam-login-lede h1 {
    margin: 0;
    font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
    font-size: 46px;
    line-height: 1.12;
    font-weight: 600;
    letter-spacing: -.01em;
}

.iaam-login-blurb { margin: 0; font-size: 17px; line-height: 1.65; color: #dce5f6; }

.iaam-login-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 700px;
}

.iaam-login-card {
    background: rgb(255 255 255 / .07);
    border: 1px solid rgb(255 255 255 / .14);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.iaam-login-card-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: rgb(255 154 77 / .16);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The icon takes its colour from here, so the strokes follow the panel. */
.iaam-login-card-icon svg { stroke: #ffb27a; }

.iaam-login-card-title { display: block; font-weight: 600; font-size: 15px; }

.iaam-login-card-detail {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.5;
    color: #cfdaf2;
}

.iaam-login-stats {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    max-width: 700px;
    border-top: 1px solid rgb(255 255 255 / .18);
    padding-top: 26px;
}

.iaam-login-stats > div { flex: 1 1 140px; min-width: 0; padding: 0 24px; }
.iaam-login-stats > div:first-child { padding-left: 0; padding-right: 24px; }
.iaam-login-stats > div + div { border-left: 1px solid rgb(255 255 255 / .18); }
.iaam-login-stats > div:last-child { padding-right: 0; }
.iaam-login-stats dt { font-size: 30px; font-weight: 700; }

/* The longest label is "National Councils"; it belongs on one line. */
.iaam-login-stats dd { margin: 0; font-size: 13px; color: #cfdaf2; white-space: nowrap; }

.iaam-login-mission {
    margin: 0;
    max-width: 700px;
    box-sizing: border-box;
    background: rgb(255 255 255 / .08);
    border: 1px solid rgb(255 255 255 / .22);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
}

/*
 * The registered particulars, with the gateway button set beside them.
 * A row that wraps: on a narrow column the button drops under the text
 * rather than squeezing it.
 */
.iaam-login-org {
    margin-top: auto;
    border-top: 1px solid rgb(255 255 255 / .18);
    padding-top: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #c2cfea;
}

.iaam-login-org-text {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Outlined rather than filled: it is a way out, not the thing to do here. */
.iaam-login-gateway {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid rgb(255 255 255 / .38);
    border-radius: 8px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}

.iaam-login-gateway:hover,
.iaam-login-gateway:focus-visible {
    background: rgb(255 255 255 / .1);
    border-color: rgb(255 255 255 / .6);
}

.iaam-login-org p { margin: 0; }
.iaam-login-org strong { color: #fff; font-weight: 600; }
.iaam-login-org a { color: #fff; }

/* ----------------------------------------------------------- right panel */

.iaam-login-panel {
    flex: 1 1 480px;
    min-width: 0;
    box-sizing: border-box;
    padding: 40px 56px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.iaam-login-panel-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.iaam-login-back { font-weight: 500; text-decoration: none; color: var(--iaam-blue); }
.iaam-login-back:hover { text-decoration: underline; }

/* ------------------------------------------------------- the assistant */

.iaam-login-assist { position: relative; }

.iaam-login-assist-btn {
    height: 44px;
    padding: 0 18px 0 14px;
    border: 0;
    border-radius: 22px;
    background: #b8520c;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgb(10 42 110 / .18);
}

.iaam-login-chat {
    position: absolute;
    top: 56px;
    right: 0;
    z-index: 50;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border: 1px solid #dce5f0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgb(10 42 110 / .28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--iaam-ink);
    text-align: left;
}

.iaam-login-chat-head {
    background: var(--iaam-deep);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.iaam-login-chat-mark {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-login-chat-mark img { width: 34px; height: 34px; object-fit: contain; }
.iaam-login-chat-who { flex: 1; min-width: 0; }
.iaam-login-chat-name { display: block; font-weight: 600; font-size: 15px; }
.iaam-login-chat-state { display: block; font-size: 12px; color: #cfdaf2; }

.iaam-login-chat-close {
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 8px;
    background: rgb(255 255 255 / .1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-login-chat-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f4f7fc;
}

.iaam-login-chat-bubble {
    margin: 0;
    align-self: flex-start;
    max-width: 85%;
    background: #fff;
    border: 1px solid var(--iaam-line);
    border-radius: 4px 14px 14px 14px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
}

/* The visitor's own turns, mirrored against Lucy's. */
.iaam-login-chat-bubble.is-visitor {
    align-self: flex-end;
    background: var(--iaam-deep);
    border-color: var(--iaam-deep);
    border-radius: 14px 4px 14px 14px;
    color: #fff;
}

.iaam-login-chat-bubble a { color: var(--iaam-blue); }
.iaam-login-chat-bubble.is-visitor a { color: #fff; }

/* Three dots while Lucy is with OpenAI, which takes a second or two. */
.iaam-login-chat-thinking { display: flex; gap: 5px; align-items: center; }

.iaam-login-chat-thinking span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa8c4;
    animation: iaam-login-chat-dot 1.2s infinite ease-in-out;
}

.iaam-login-chat-thinking span:nth-child(2) { animation-delay: .15s; }
.iaam-login-chat-thinking span:nth-child(3) { animation-delay: .3s; }

@keyframes iaam-login-chat-dot {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .iaam-login-chat-thinking span { animation: none; opacity: .6; }
}

.iaam-login-chat-error {
    margin: 0;
    background: #fff5eb;
    border: 1px solid #f6d2ac;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #5a3410;
}

.iaam-login-chat-body { max-height: 46vh; overflow-y: auto; }

.iaam-login-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.iaam-login-chat-chips button {
    min-height: 36px;
    box-sizing: border-box;
    padding: 6px 12px;
    border: 1px solid var(--iaam-rule);
    border-radius: 18px;
    background: #fff;
    color: var(--iaam-blue);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.iaam-login-chat-chips button:hover { background: #f1f4fa; }

.iaam-login-chat-composer input:disabled,
.iaam-login-chat-composer button:disabled { opacity: .5; cursor: not-allowed; }

.iaam-login-chat-hours { margin: 0; font-size: 12px; line-height: 1.5; color: var(--iaam-muted); }

.iaam-login-chat-composer {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e6ebf4;
}

.iaam-login-chat-composer input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--iaam-rule);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
}

.iaam-login-chat-composer button {
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 10px;
    background: var(--iaam-blue);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-login-chat-foot {
    margin: 0;
    padding: 0 12px 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--iaam-muted);
}

/* --------------------------------------------------------- the sign-in card */

.iaam-login-card-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }

.iaam-login-form {
    width: 100%;
    max-width: 448px;
    background: #fff;
    border: 1px solid var(--iaam-line);
    border-radius: 18px;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-shadow: 0 24px 48px rgb(11 42 110 / .10);
}

.iaam-login-form-head { display: flex; flex-direction: column; gap: 8px; }
.iaam-login-form-head h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.iaam-login-form-head p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--iaam-muted); }

/*
 * Filament's form, given the design's metrics.
 *
 * The markup is Filament's — the fields, the validation, the rate limiting
 * and the two-factor challenge all live inside it — so the design is applied
 * to its classes rather than reproduced as new markup. Everything here is
 * scoped to .iaam-login and so reaches nothing else in the Portal.
 */

/* The gaps the design has: 22px between field groups, 7px label to control. */
.iaam-login .fi-sc-has-gap { gap: 22px; }
.iaam-login .fi-fo-field { gap: 7px; }

.iaam-login .fi-fo-field-label,
.iaam-login .fi-fo-field-label-content {
    font-size: 14px;
    font-weight: 600;
    color: var(--iaam-ink);
}

/* The design marks nothing required: both fields plainly are. */
.iaam-login .fi-fo-field-label-required-mark { display: none; }

/* A checkbox label is the option itself, not a question about it. */
.iaam-login .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label,
.iaam-login .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-content {
    font-weight: 400;
    font-size: 14px;
    color: #33415e;
}

.iaam-login .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iaam-login .fi-checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: var(--iaam-blue);
    border-radius: 4px;
}

/* "Forgot password?", which Filament puts on the label row. */
.iaam-login .fi-fo-field-label-ctn + .fi-sc .fi-link { font-size: 13px; }
.iaam-login .fi-link-label { font-size: 13px; font-weight: 400; }

.iaam-login .fi-input-wrp {
    border: 1px solid var(--iaam-rule);
    border-radius: 10px;
    background: #fbfcfe;
    box-shadow: none;
    outline: 0;
    overflow: hidden;
}

.iaam-login .fi-input-wrp:focus-within {
    border-color: var(--iaam-blue);
    box-shadow: 0 0 0 3px rgb(11 59 168 / .14);
}

.iaam-login .fi-input {
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--iaam-ink);
}

/* The reveal toggle: its own 48px column, as the design draws it. */
.iaam-login .fi-input-wrp:has(.fi-revealable) .fi-input { height: 46px; }

.iaam-login .fi-input-wrp-actions {
    width: 48px;
    flex: none;
    align-self: stretch;
    border-left: 1px solid var(--iaam-line);
    background: #f1f4fa;
}

.iaam-login .fi-input-wrp-actions .fi-icon-btn {
    width: 100%;
    height: 100%;
    border-radius: 0;
    color: var(--iaam-muted);
}

.iaam-login .fi-input-wrp-suffix { padding: 0; }

/* The submit button. */
.iaam-login .fi-ac-btn-action.fi-btn {
    width: 100%;
    height: 50px;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    /* .fi-btn.fi-color-primary sets the brand navy !important further up. */
    background: var(--iaam-blue) !important;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
    box-shadow: 0 6px 16px rgb(11 59 168 / .25);
}

.iaam-login .fi-ac-btn-action.fi-btn:hover { background: #0a3494 !important; color: #fff; }

/* --------------------------------------------------- below the form fields */

.iaam-login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--iaam-muted);
}

.iaam-login-or::before,
.iaam-login-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e1e7f1;
}

.iaam-login-alt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.iaam-login-alt button {
    height: 46px;
    border: 1px solid var(--iaam-rule);
    border-radius: 10px;
    background: #fff;
    color: var(--iaam-ink);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Neither can sign anyone in yet, and the page says so rather than pretending. */
.iaam-login-alt button[disabled] { cursor: not-allowed; opacity: .55; }

.iaam-login-orcid {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    background: #a6ce39;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-login-register {
    margin: 0;
    border-top: 1px solid #e6ebf4;
    padding-top: 18px;
    font-size: 14px;
    color: #33415e;
    text-align: center;
}

.iaam-login-register a { font-weight: 600; color: var(--iaam-blue); }

.iaam-login-secure {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--iaam-muted);
}

/* ---------------------------------------------------------------- footer */

.iaam-login-footer {
    flex: 1 1 100%;
    box-sizing: border-box;
    background: var(--iaam-navy);
    color: #fff;
    padding: 32px 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px 48px;
    align-items: center;
    justify-content: space-between;
}

.iaam-login-footer-main {
    flex: 1 1 640px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    font-size: 15px;
}

.iaam-login-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.iaam-login-follow-label { font-weight: 500; white-space: nowrap; }

.iaam-login-follow ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.iaam-login-follow a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: rgb(255 255 255 / .08);
    transition: background .15s ease;
}

.iaam-login-follow a:hover,
.iaam-login-follow a:focus-visible { background: rgb(255 255 255 / .18); }
.iaam-login-follow a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.iaam-login-follow-rule { width: 1px; height: 26px; background: rgb(255 255 255 / .35); }

/*
 * "Contact us" is a plain link, not one of the 40px chips beside it.
 *
 * It has to outrank `.iaam-login-follow a`, which is a class plus an element
 * and so beat a lone class: without the `a` here the chip's background, size
 * and radius all still applied, and the link sat on a faint square.
 */
.iaam-login-follow a.iaam-login-follow-contact {
    width: auto;
    height: auto;
    white-space: nowrap;
    background: none;
    border-radius: 0;
    color: #fff;
    font-weight: 500;
}

.iaam-login-follow a.iaam-login-follow-contact:hover,
.iaam-login-follow a.iaam-login-follow-contact:focus-visible {
    background: none;
    text-decoration: underline;
}

.iaam-login-footer-nav { display: flex; flex-wrap: wrap; row-gap: 12px; }

/*
 * Four headings rather than eight links, set the way the design sets them:
 * weighted, spaced, each carrying the external-link mark, divided by a rule.
 * The weight is what makes four items read as a set of doors instead of a
 * sentence of small print.
 */
.iaam-login-footer-nav a,
.iaam-login-footer-nav button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    text-decoration: none;
    padding: 2px 20px;
    border: 0;
    border-left: 1px solid rgb(255 255 255 / .35);
    background: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Sits with the text rather than on the baseline, and stays quieter than it. */
.iaam-login-footer-nav svg { flex: none; opacity: .72; }

.iaam-login-footer-nav a:hover svg,
.iaam-login-footer-nav button:hover svg { opacity: 1; }

.iaam-login-footer-nav > :first-child { padding-left: 0; border-left: 0; }
.iaam-login-footer-nav a:hover,
.iaam-login-footer-nav button:hover { text-decoration: underline; }


/*
 * A section heading inside a grouped panel — what used to be its own link in
 * the strip. Ruled above rather than merely larger, because two documents in
 * one dialog need a visible seam or they read as one continuous text.
 */
.iaam-legal-section {
    margin: 30px 0 12px;
    padding-top: 22px;
    border-top: 1px solid var(--iaam-line, #dde4f0);
    font-size: 17px;
    font-weight: 700;
    color: var(--iaam-deep, #0a2a6e);
}

/* The first one opens the panel: no seam needed above it. */
.iaam-legal-body > .iaam-legal-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.dark .iaam-legal-section { color: #bfd0f4; border-top-color: #243049; }
.iaam-login-copyright { margin: 0; font-size: 13px; color: #b9c6e2; }

.iaam-login-wechat { display: flex; align-items: center; gap: 16px; }

.iaam-login-wechat-text { display: flex; flex-direction: column; gap: 4px; text-align: right; }

.iaam-login-wechat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #b9c6e2;
}

.iaam-login-wechat-sub { font-size: 13px; color: #dce5f6; }

/*
 * The WeChat code, in the 104px frame the design draws for it.
 *
 * No padding: the image carries its own four-module quiet zone, and insetting
 * it further would shrink each module below the ~2px a camera needs.
 */
.iaam-login-qr {
    width: 104px;
    height: 104px;
    flex: none;
    background: #fff;
    border-radius: 10px;
    display: block;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .iaam-login-follow a { transition: none; }
}

/* ------------------------------------------------------------- narrower */

@media (max-width: 1100px) {
    .iaam-login-intro { padding: 40px 32px; }
    .iaam-login-panel { padding: 32px; }
    .iaam-login-topbar,
    .iaam-login-footer { padding-left: 32px; padding-right: 32px; }
    .iaam-login-wechat-text { text-align: left; }
}

@media (max-width: 720px) {
    .iaam-login-cards { grid-template-columns: minmax(0, 1fr); }
    .iaam-login-lede h1 { font-size: 32px; }
    .iaam-login-brand { gap: 16px; }
    .iaam-login-mark { width: 72px; height: 72px; }
    .iaam-login-mark img { width: 61px; height: 61px; }
    .iaam-login-wordmark { font-size: 24px; white-space: normal; }
    .iaam-login-form { padding: 28px; }
    .iaam-login-alt { grid-template-columns: minmax(0, 1fr); }
    .iaam-login-stats > div { padding: 8px 0; flex-basis: 100%; }
    .iaam-login-stats dd { white-space: normal; }
    .iaam-login-stats > div + div { border-left: 0; }
    .iaam-login-footer-nav a,
    .iaam-login-footer-nav button { padding-left: 0; padding-right: 16px; border-left: 0; }
    .iaam-login-chat { right: auto; left: 0; }
}

/*
 * Dark mode.
 *
 * The panel follows the system theme and the rest of this stylesheet already
 * handles it, so a light-only sign-in page would render half dark: Filament's
 * own form controls dark inside a white card. These restate the surfaces only;
 * the layout is shared.
 */
.dark .iaam-login { background: #0b1220; color: #e6ecf8; }

/* The panel is already navy in both themes; dark mode only deepens it. */
.dark .iaam-login-intro { background: #0a1c47; color: #e6ecf8; }
.dark .iaam-login-hex { opacity: .07; }
.dark .iaam-login-mark { background: #fff; }
.dark .iaam-login-wordmark { color: #e6ecf8; }
.dark .iaam-login-back { color: #8fb0ef; }

.dark .iaam-login-form {
    background: #111a2e;
    border-color: #243049;
    box-shadow: 0 24px 48px rgb(0 0 0 / .4);
}

.dark .iaam-login-form-head p,
.dark .iaam-login-secure { color: #9fb0d0; }

.dark .iaam-login .fi-fo-field-label,
.dark .iaam-login .fi-fo-field-label-content { color: #e6ecf8; }

/* The :has() checkbox rule outweighs the plain label override above. */
.dark .iaam-login .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label,
.dark .iaam-login .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-content { color: #c6d2ea; }

.dark .iaam-login .fi-input-wrp { background: #16203a; border-color: #243049; }
.dark .iaam-login .fi-input { color: #e6ecf8; }
.dark .iaam-login .fi-input-wrp-actions { background: #1b2740; border-left-color: #243049; }

.dark .iaam-login-or { color: #9fb0d0; }
.dark .iaam-login-or::before,
.dark .iaam-login-or::after { background: #243049; }

.dark .iaam-login-alt button { background: #16203a; border-color: #243049; color: #e6ecf8; }

.dark .iaam-login-register { border-top-color: #243049; color: #c6d2ea; }
.dark .iaam-login-register a { color: #8fb0ef; }

.dark .iaam-login-chat { background: #111a2e; border-color: #243049; color: #e6ecf8; }
.dark .iaam-login-chat-body { background: #0d1526; }
.dark .iaam-login-chat-bubble { background: #16203a; border-color: #243049; }
.dark .iaam-login-chat-chips button { background: #16203a; border-color: #243049; color: #8fb0ef; }
.dark .iaam-login-chat-chips button:hover { background: #1b2740; }
.dark .iaam-login-chat-bubble.is-visitor { background: #1d3a7a; border-color: #1d3a7a; }
.dark .iaam-login-chat-error { background: #2a1c0d; border-color: #4a3b22; color: #f0d9bd; }
.dark .iaam-login-chat-hours,
.dark .iaam-login-chat-foot { color: #9fb0d0; }
.dark .iaam-login-chat-composer { border-top-color: #243049; }
.dark .iaam-login-chat-composer input { background: #16203a; border-color: #243049; color: #e6ecf8; }

/* ------------------------------------------------- manuscript production */
/*
 * The production checklist on an author's tracking page: the stretch between
 * acceptance and publication that used to be silent.
 */

.journal-production-lede { margin: 0 0 1rem; color: #4a5878; line-height: 1.6; }

.journal-production-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.journal-production-steps li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .875rem;
    border: 1px solid #e1e7f1;
    border-radius: .625rem;
    background: #fff;
}

.journal-production-mark {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    border-radius: 50%;
    border: 2px solid #c6d0e2;
}

.journal-production-steps li.done .journal-production-mark {
    border-color: #1d7a4c;
    background: #1d7a4c
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E")
        center / .75rem no-repeat;
}

.journal-production-label { flex: 1; min-width: 0; font-weight: 500; }

.journal-production-state { font-size: .8125rem; color: #6b7280; }
.journal-production-steps li.done .journal-production-state { color: #1d7a4c; font-weight: 600; }

.journal-production-count { margin: .875rem 0 0; font-size: .8125rem; color: #6b7280; }

.dark .journal-production-steps li { background: #16203a; border-color: #243049; }
.dark .journal-production-lede,
.dark .journal-production-state,
.dark .journal-production-count { color: #9fb0d0; }
.dark .journal-production-steps li.done .journal-production-state { color: #6ee7a8; }

/*
 * The progress bar went from five milestones to seven when initial
 * evaluation and production became steps of their own. Side by side that
 * leaves about 50px per step on a phone, which is not enough for a label
 * like "Initial evaluation", so below this width it reads as a list.
 */
@media (max-width: 760px) {
    .journal-progress { flex-direction: column; gap: .85rem; }

    .journal-progress li {
        flex: none;
        flex-direction: row;
        align-items: center;
        gap: .65rem;
        text-align: left;
    }

    /* The connector is drawn between columns; vertically it would cut
       across the labels, so it is replaced by a line down the dots. */
    .journal-progress li::before {
        top: auto;
        right: auto;
        left: .34rem;
        bottom: 50%;
        width: 2px;
        height: .85rem;
        transform: translateY(100%);
    }

    .journal-progress li:first-child::before { display: none; }

    .journal-progress-label { font-size: .85rem; }
}


/*
 * The exact stack asked for.
 *
 * Filament sets --font-family to the family alone and appends its own
 * fallbacks, which leave out Segoe UI — the face that would carry this on
 * Windows if the webfont never arrives. The emoji families are kept so
 * symbols do not fall back to a monochrome glyph.
 */
.fi-body,
.fi-body input,
.fi-body textarea,
.fi-body select,
.fi-body button {
    font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/*
 * Field labels carry weight.
 *
 * Filament sets them at medium, which reads as another line of prose beside
 * the help text. Bold separates the question from the answer.
 */
.fi-fo-field-label,
.fi-fo-field-wrp-label,
.fi-fo-field-wrp-label label { font-weight: 700; }

/*
 * Except a checkbox, whose label is the option itself rather than a question
 * about it — "Remember me on this device" set in bold reads as a heading.
 * Filament gives it the same class as every other field label, so the field
 * is identified by the control it contains.
 */
.fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label,
.fi-fo-field:has(.fi-radio-input) .fi-fo-field-label { font-weight: 500; }


/* ------------------------------------------------- the footer's panels */
/*
 * Native <dialog>, so focus trapping, Escape and the backdrop are the
 * browser's job rather than ours.
 */

.iaam-legal-dialog {
    /*
     * A modal <dialog> is centred by the UA stylesheet's `margin: auto`, which
     * a blanket margin reset further up this sheet overrides — so it is
     * restated here rather than left to be reset again.
     */
    margin: auto;
    width: min(640px, calc(100vw - 32px));
    max-height: min(80vh, 760px);
    padding: 0;
    border: 1px solid var(--iaam-line, #dde4f0);
    border-radius: 16px;
    background: #fff;
    color: #12203f;
    box-shadow: 0 32px 80px rgb(10 42 110 / .3);
    overflow: hidden;
}

.iaam-legal-dialog::backdrop { background: rgb(6 23 63 / .55); }

.iaam-legal-head {
    position: sticky;
    top: 0;
    background: #0a2a6e;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.iaam-legal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }

.iaam-legal-x {
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 8px;
    background: rgb(255 255 255 / .12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.iaam-legal-x:hover { background: rgb(255 255 255 / .22); }

.iaam-legal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(min(80vh, 760px) - 64px);
    font-size: 14px;
    line-height: 1.6;
}

.iaam-legal-body p { margin: 0 0 14px; }
.iaam-legal-body p:last-child { margin-bottom: 0; }
/*
 * A document's own sub-headings. They were h3 when each document had a
 * dialog to itself; grouped, the document's name is the h3 and these sit a
 * level below it. Same appearance as before — only the outline changed, so
 * that a screen reader reads two documents in a panel rather than one flat
 * list of fifteen headings.
 */
.iaam-legal-body h4 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
.iaam-legal-body ul { margin: 0 0 14px; padding-left: 20px; }
.iaam-legal-body li { margin-bottom: 6px; }
.iaam-legal-body a { color: #0b3ba8; }

.iaam-legal-body code {
    background: #f1f4fa;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 13px;
}

.iaam-legal-lede {
    background: #f4f7fc;
    border-left: 3px solid #0b3ba8;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
}

.iaam-legal-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e6ebf4;
    font-size: 13px;
    color: #4a5878;
}

.iaam-legal-table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }

.iaam-legal-table th,
.iaam-legal-table td {
    text-align: left;
    vertical-align: top;
    padding: 8px 10px;
    border-bottom: 1px solid #e6ebf4;
}

.iaam-legal-table thead th { background: #f4f7fc; font-weight: 600; }
.iaam-legal-table tbody th { width: 40%; font-weight: 600; }

.iaam-legal-action {
    border: 1px solid #b6c2d9;
    border-radius: 10px;
    background: #fff;
    color: #0b3ba8;
    font: inherit;
    font-weight: 600;
    padding: 9px 16px;
    cursor: pointer;
}

.iaam-legal-action:hover { background: #f1f4fa; }

/* --------------------------------------------------- the cookie banner */

.iaam-consent {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

/*
 * Hiding is stated here rather than left to the browser.
 *
 * The banner is dismissed by setting the hidden attribute, and the UA
 * stylesheet's [hidden]{display:none} is what would normally act on it — but
 * that is a UA rule, and the author rule above sets display:flex, which beats
 * it everywhere the two are weighed properly. Chrome happened to hide it
 * anyway; Firefox and Safari would have left the bar on screen after the
 * button was pressed, which reads as a button that does nothing.
 */
.iaam-consent[hidden] { display: none; }

/* Full width: a bar across the foot of the page, not a floating card. */
.iaam-consent-box {
    pointer-events: auto;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 0;
    border-top: 1px solid var(--iaam-line, #dde4f0);
    border-radius: 0;
    box-shadow: 0 -8px 40px rgb(10 42 110 / .18);
    padding: 20px 64px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #12203f;
}

.iaam-consent-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.iaam-consent-head h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }

.iaam-consent-x {
    width: 28px;
    height: 28px;
    flex: none;
    border: 0;
    border-radius: 6px;
    background: #f1f4fa;
    color: #4a5878;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iaam-consent-box p { margin: 0 0 14px; }

.iaam-consent-cats { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }

.iaam-consent-cat { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.iaam-consent-cat input { margin-top: 3px; accent-color: #0b3ba8; }

/* A category with nothing in it is shown, but plainly cannot be chosen. */
.iaam-consent-cat:has(input:disabled) { cursor: default; opacity: .65; }
.iaam-consent-cat.is-locked { cursor: default; opacity: 1; }

.iaam-consent-cat-text { display: flex; flex-direction: column; }
.iaam-consent-cat-name { font-weight: 600; font-size: 13px; }
.iaam-consent-cat-note { font-size: 12px; color: #4a5878; }

.iaam-consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.iaam-consent-spacer { flex: 1; }

.iaam-consent-ghost {
    border: 0;
    background: none;
    color: #0b3ba8;
    font: inherit;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.iaam-consent-btn {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: #0b3ba8;
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 0 18px;
    cursor: pointer;
}

.iaam-consent-btn:hover { background: #0a3494; }

.iaam-consent-btn.is-quiet {
    background: #fff;
    color: #12203f;
    border: 1px solid #b6c2d9;
}

.iaam-consent-btn.is-quiet:hover { background: #f1f4fa; }

@media (max-width: 1100px) {
    .iaam-consent-box { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 560px) {
    .iaam-consent-box { padding: 16px 20px; }
    .iaam-consent-actions { flex-direction: column; align-items: stretch; }
    .iaam-consent-spacer { display: none; }
    .iaam-consent-btn { width: 100%; }
}

/* Dark mode, for both. */
.dark .iaam-legal-dialog { background: #111a2e; border-color: #243049; color: #e6ecf8; }
.dark .iaam-legal-body a { color: #8fb0ef; }
.dark .iaam-legal-body code { background: #16203a; }
.dark .iaam-legal-lede { background: #16203a; border-left-color: #8fb0ef; }
.dark .iaam-legal-note { border-top-color: #243049; color: #9fb0d0; }
.dark .iaam-legal-table th,
.dark .iaam-legal-table td { border-bottom-color: #243049; }
.dark .iaam-legal-table thead th { background: #16203a; }
.dark .iaam-legal-action { background: #16203a; border-color: #243049; color: #8fb0ef; }

.dark .iaam-consent-box { background: #111a2e; border-top-color: #243049; color: #e6ecf8; }
.dark .iaam-consent-cat-note { color: #9fb0d0; }
.dark .iaam-consent-ghost { color: #8fb0ef; }
.dark .iaam-consent-x { background: #16203a; color: #9fb0d0; }
.dark .iaam-consent-btn.is-quiet { background: #16203a; border-color: #243049; color: #e6ecf8; }


/* ------------------------------------------------- forms outside the panel */
/*
 * The registration form, and anything else built in plain Blade rather than
 * by Filament. Same metrics as the sign-in card — 48px controls, a 10px
 * radius, #b6c2d9 rule, #fbfcfe fill, labels at 14/600 — written against
 * plain elements, since there are no .fi-* classes out here.
 */

/* Two columns of fields need more room than a sign-in card. */
.iaam-login-form.is-wide { max-width: 640px; }

/*
 * The form carries the card's own rhythm.
 *
 * .iaam-login-form spaces its children 22px apart, but everything below the
 * heading lives inside the <form>, which is one child — so the grid, the
 * disclosure, the agreements, the captcha and the button were all flush
 * against each other at 0px. The gap is restated here so the inside of the
 * form matches the outside.
 *
 * The hidden captcha inputs are display:none and so take no part in this.
 */
.iaam-login-form form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.iaam-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.iaam-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.iaam-field.is-full { grid-column: 1 / -1; }

.iaam-field > label { font-size: 14px; font-weight: 600; color: var(--iaam-ink, #12203f); }
.iaam-field > label span { color: #c2580d; }

.iaam-field input,
.iaam-field select {
    height: 48px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--iaam-rule, #b6c2d9);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--iaam-ink, #12203f);
    background: #fbfcfe;
}

/* A select keeps room for its own arrow. */
.iaam-field select { padding-right: 36px; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5878' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.iaam-field input:focus,
.iaam-field select:focus {
    outline: 0;
    border-color: var(--iaam-blue, #0b3ba8);
    box-shadow: 0 0 0 3px rgb(11 59 168 / .14);
}

.iaam-field input.is-invalid,
.iaam-field select.is-invalid { border-color: #c2410c; background: #fffaf6; }

.iaam-field-help { font-size: 12.5px; line-height: 1.5; color: var(--iaam-muted, #4a5878); }
.iaam-field-error { font-size: 12.5px; line-height: 1.5; color: #b3400a; font-weight: 500; }

/* A dialling code beside the number it belongs to. */
/* ------------------------------------- password field with a reveal
 *
 * The eye sits inside the box, so the field keeps its full width and the
 * control cannot be mistaken for something to submit. This replaced a
 * two-column grid that gave the button 1.4 parts to the input's 1.
 */
.iaam-password { position: relative; display: block; }

/* Room for the eye, so a long password never runs under it. */
.iaam-password input { padding-right: 46px; }

.iaam-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--iaam-muted, #4a5878);
    cursor: pointer;
}

.iaam-reveal:hover { background: #eef3fc; color: var(--iaam-ink, #12203f); }

.iaam-reveal:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgb(11 59 168 / .25);
    color: var(--iaam-ink, #12203f);
}

.iaam-reveal-icon { width: 19px; height: 19px; display: block; }

/* hidden is an attribute, not a class: the icons swap without a rebuild. */
.iaam-reveal-icon[hidden] { display: none; }

.iaam-disclosure {
    border: 1px solid var(--iaam-line, #dde4f0);
    border-radius: 12px;
    background: #f8fafd;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
}

.iaam-disclosure summary { font-weight: 600; cursor: pointer; font-size: 14px; }
.iaam-disclosure p { margin: 10px 0 0; color: var(--iaam-muted, #4a5878); }

.iaam-agreements { display: flex; flex-direction: column; gap: 10px; }

.iaam-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #33415e;
    cursor: pointer;
}

/*
 * The rule above colours any span inside a field label, because in every
 * other field that span is the required asterisk. In a checkbox label the
 * span holds the sentence, which should read as text and not as a warning.
 */
.iaam-field > label.iaam-check span { color: inherit; font-weight: inherit; }

.iaam-check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--iaam-blue, #0b3ba8); }
.iaam-check.is-invalid { color: #b3400a; }
.iaam-check a { color: var(--iaam-blue, #0b3ba8); font-weight: 600; }

/* Cloudflare draws the widget itself; it only needs its own line. */
/* MTCaptcha draws its own box; this only reserves room so the submit
   button does not jump when the widget arrives. */
.iaam-captcha { min-height: 110px; }
.iaam-captcha .mtcaptcha { display: block; }

.iaam-submit {
    /* A button is fit-content even as a block-level flex container, so
       stretching it takes saying so. */
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: var(--iaam-blue, #0b3ba8);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 16px rgb(11 59 168 / .25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.iaam-submit:hover { background: #0a3494; }
.iaam-submit:disabled { opacity: .7; cursor: progress; }

.iaam-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: iaam-spin .7s linear infinite;
}

@keyframes iaam-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .iaam-spinner { animation-duration: 2.4s; }
}

.iaam-note {
    margin: 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

.iaam-note.is-good { background: #ecfdf3; border: 1px solid #a6e9c3; color: #10492c; }
.iaam-note.is-bad { background: #fff5eb; border: 1px solid #f6d2ac; color: #5a3410; }

/* The form's own rows stack before the card does. */
@media (max-width: 860px) {
    .iaam-form-grid { grid-template-columns: minmax(0, 1fr); }
}

.dark .iaam-field > label { color: #e6ecf8; }
.dark .iaam-field input,
.dark .iaam-field select { background: #16203a; border-color: #243049; color: #e6ecf8; }
.dark .iaam-field-help { color: #9fb0d0; }
.dark .iaam-reveal { color: #9fb0d0; }
.dark .iaam-reveal:hover { background: rgb(255 255 255 / .08); color: #e6ecf8; }
.dark .iaam-disclosure { background: #16203a; border-color: #243049; }
.dark .iaam-disclosure p { color: #9fb0d0; }
.dark .iaam-check { color: #c6d2ea; }
.dark .iaam-check a { color: #8fb0ef; }
.dark .iaam-note.is-good { background: #0e2a1c; border-color: #1d5c3a; color: #a6e9c3; }
.dark .iaam-note.is-bad { background: #2a1c0d; border-color: #4a3b22; color: #f0d9bd; }

/* ------------------------------------------------- the abstract editor */
/*
 * An abstract is 150-300 words, and the editor opened about two lines tall —
 * barely enough to see the sentence being written, let alone the paragraph.
 *
 * min-height rather than height, so it still grows with the text; the cap
 * stops a long one pushing the step's buttons off the screen.
 */
.iaam-stepped-form .fi-fo-rich-editor-content {
    min-height: 16rem;
    max-height: 32rem;
    overflow-y: auto;
}

/* The toolbar stays put while the text scrolls under it. */
.iaam-stepped-form .fi-fo-rich-editor-content:focus-within { outline: none; }

/* ------------------------------------- radios inside a grouped form */
/*
 * Plain options, not cards.
 *
 * The boxed look above was drawn for the one-question-at-a-time forms,
 * where a single radio filled the screen and needed the weight. In a
 * grouped step it turns a short list of congresses into a stack of heavy
 * panels. The radio itself still shows which is chosen.
 */
.iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    padding: 0.3rem 0;
    gap: 0.65rem;
}

.iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label:hover {
    border-color: transparent;
    background: none;
}

/* Chosen reads from the control and the weight of the label, not a panel. */
.iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label:has(.fi-radio-input:checked) {
    border-color: transparent;
    background: none;
    box-shadow: none;
    font-weight: 600;
}

.dark .iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label,
.dark .iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label:hover,
.dark .iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label:has(.fi-radio-input:checked) {
    border-color: transparent;
    background: none;
    box-shadow: none;
}

/* ---------------------- option labels inside a grouped form */
/*
 * An option must not outshout the question.
 *
 * The question is set at 0.875rem in a grouped step, while the typeform
 * styling left radio and checkbox labels at 1.02rem — so "Annual Congress"
 * read larger than "Which congress are you registering for?", and the
 * question looked like a caption on its own answers.
 *
 * Same size, lighter weight: the bold question leads, the options follow.
 */
.iaam-stepped-form .fi-sc-wizard .fi-fo-radio-label-text p,
.iaam-stepped-form .fi-sc-wizard .fi-fo-checkbox-list-option-label {
    font-size: 0.875rem;
    font-weight: 400;
}


/* ------------------------------------------------- the rail's tabs */

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

.delegate-rail-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.delegate-rail-tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 0.9rem;
}

.delegate-rail-tab {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.2rem 0.6rem;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.delegate-rail-tab:hover { color: #2d4a8a; }

.delegate-rail-tab.is-active {
    color: #2d4a8a;
    border-bottom-color: #2d4a8a;
}

.delegate-rail-tab span:first-of-type { overflow: hidden; text-overflow: ellipsis; }

/* The unread count the corner bubble used to carry. */
.delegate-rail-tab-count {
    position: absolute;
    top: 0.25rem;
    inset-inline-end: 0.9rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    font-size: 0.65rem;
    line-height: 1.05rem;
    text-align: center;
}

.delegate-rail-pane { min-height: 0; flex: 1; overflow-y: auto; }

/* Lucy and the messenger manage their own scrolling. */
.delegate-rail-pane.is-flush { overflow: hidden; display: flex; flex-direction: column; }

.delegate-rail-empty {
    margin: 0;
    padding: 1rem 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #6b7280;
}

/* --------------------------------------------------- Lucy in the rail */

.lucy-rail { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 0.6rem; }

.lucy-rail-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-inline-end: 0.2rem;
}

.lucy-rail-msg {
    margin: 0;
    max-width: 92%;
    padding: 0.5rem 0.65rem;
    border-radius: 0.7rem;
    font-size: 0.82rem;
    line-height: 1.5;
}

.lucy-rail-msg.assistant {
    align-self: flex-start;
    background: #f3f5f9;
    border-bottom-left-radius: 0.2rem;
}

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

.lucy-rail-msg a { color: #2d4a8a; }
.lucy-rail-msg.user a { color: #fff; }

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

.lucy-rail-thinking span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9aa8c4;
    animation: iaam-login-chat-dot 1.2s infinite ease-in-out;
}

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

.lucy-rail-error,
.lucy-rail-off {
    margin: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
    background: #fff5eb;
    border: 1px solid #f6d2ac;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #5a3410;
}

.lucy-rail-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.lucy-rail-chips button {
    padding: 0.3rem 0.6rem;
    border: 1px solid #dbe1ee;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.75rem;
    color: #2d4a8a;
    cursor: pointer;
    text-align: start;
}

.lucy-rail-chips button:hover { background: #f3f5f9; }

.lucy-rail-composer { display: flex; gap: 0.4rem; }

.lucy-rail-composer input {
    flex: 1;
    min-width: 0;
    height: 2.4rem;
    border: 1px solid #dbe1ee;
    border-radius: 0.6rem;
    padding: 0 0.6rem;
    font: inherit;
    font-size: 0.82rem;
}

.lucy-rail-composer button {
    width: 2.4rem;
    height: 2.4rem;
    flex: none;
    border: 0;
    border-radius: 0.6rem;
    background: #2d4a8a;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lucy-rail-composer input:disabled,
.lucy-rail-composer button:disabled { opacity: .5; cursor: not-allowed; }

.lucy-rail-clear {
    align-self: flex-start;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* ---------------------------------------------- messenger in the rail */

.messenger-rail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.messenger-rail .messenger-panel { position: static; width: auto; height: 100%; box-shadow: none; border: 0; }

.dark .delegate-rail-tabs { border-bottom-color: rgb(255 255 255 / 0.1); }
.dark .delegate-rail-tab { color: #9ca3af; }
.dark .delegate-rail-tab.is-active { color: #9ec1ff; border-bottom-color: #9ec1ff; }
.dark .delegate-rail-toggle { background: #16203a; border-color: #243049; color: #9ca3af; }
.dark .lucy-rail-msg.assistant { background: rgb(255 255 255 / 0.06); }
.dark .lucy-rail-composer input { background: #16203a; border-color: #243049; color: #e6ecf8; }
.dark .lucy-rail-chips button { background: #16203a; border-color: #243049; color: #9ec1ff; }
.dark .delegate-rail-empty { color: #9ca3af; }

/* ------------------------------------- the bot check's fallback */

/* ------------------------- links written inside helper and placeholder text
 *
 * A link the same colour as the sentence around it, with no underline, is a
 * link nobody clicks. These are written as plain <a> tags inside an
 * HtmlString, so they get none of Filament's own link styling — the
 * manuscript template download has looked like ordinary prose since it was
 * added, and the abstract form's "account settings" link would have too.
 */
.iaam-inline-link,
.journal-template-link {
    color: #2d4a8a;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.iaam-inline-link:hover,
.journal-template-link:hover {
    color: #1e3360;
}

.dark .iaam-inline-link,
.dark .journal-template-link { color: #9ec1ff; }
.dark .iaam-inline-link:hover,
.dark .journal-template-link:hover { color: #c3d8ff; }

/* ------------------------------- the affiliation search on sign-up (A1)
 *
 * A text input with a suggestion list under it. The list is an enhancement:
 * without it the field is an ordinary box, so nothing here is load-bearing.
 */
.iaam-combo { position: relative; }

.iaam-combo-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 258px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--iaam-rule, #b6c2d9);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgb(18 32 63 / .12);
}

.iaam-combo-list li {
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--iaam-ink, #12203f);
    cursor: pointer;
}

.iaam-combo-list li:hover,
.iaam-combo-list li.is-active { background: #eef3fc; }

.iaam-field-hint { font-size: 13px; line-height: 1.4; color: #5b6880; }

/* --------------------------------- a long dropdown, made searchable
 *
 * The select is still the control that posts; this only hides it once the
 * script has put a search box in front of it. Without JavaScript the
 * is-enhanced class is never added and the dropdown behaves normally.
 */
.iaam-combo.is-enhanced > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Dressed as the select it replaces, chevron and all. */
.iaam-combo-search {
    height: 48px;
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--iaam-rule, #b6c2d9);
    border-radius: 10px;
    padding: 0 36px 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--iaam-ink, #12203f);
    background: #fbfcfe;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5878' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.iaam-combo-search:focus {
    outline: 0;
    border-color: var(--iaam-blue, #0b3ba8);
    box-shadow: 0 0 0 3px rgb(11 59 168 / .14);
}

.iaam-combo-search.is-invalid { border-color: #c2410c; background-color: #fffaf6; }

.iaam-combo-list li.is-empty { color: #5b6880; cursor: default; }
.iaam-combo-list li.is-empty:hover { background: transparent; }

.dark .iaam-combo-search { background-color: #16203a; border-color: #243049; color: #e6ecf8; }

/*
 * A short word in a narrow select should overflow, not shatter.
 *
 * Filament breaks the chosen value on word-break: break-word so a long
 * institution name wraps instead of blowing out the control. In a column
 * one-fifth of a row wide that rule reaches "Prof." too, and renders it
 * one letter per line — four lines tall for five characters.
 *
 * Titles and the like are short and known: let them sit on one line and
 * be clipped if they must be, which is the failure a reader can read.
 */
.iaam-stepped-form .fi-fo-select .fi-select-input-value-ctn,
.iaam-stepped-form .fi-input-wrp .fi-select-input-value-ctn {
    word-break: normal;
    overflow-wrap: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/*
 * Three buttons in the wizard footer, not two.
 *
 * Filament's footer is a single nowrap flex row sized for Back and Next.
 * The column it sits in is about 400px once the step rail has taken its
 * share, so adding "Save draft" between them left the row 4px short of
 * its contents — and flex answered by shrinking the buttons until their
 * labels broke, which made "Submit abstract" two lines tall.
 *
 * So: let the buttons keep their natural width and let the row wrap
 * instead. A second line on a narrow screen is a worse layout; a button
 * whose label has shattered is a broken one.
 */
.fi-sc-wizard-footer {
    flex-wrap: wrap;
    row-gap: 0.75rem;
    column-gap: 0.75rem;
}

/*
 * ...and give it the whole card to do it in.
 *
 * A contained wizard is a grid — step rail in column one, everything else
 * in column two — so the footer inherits the narrower column even though
 * nothing about Back and Next belongs beside the rail. Spanning both
 * columns is the ordinary shape for a wizard footer and takes it from
 * about 400px to about 670px, which is room enough that the three buttons
 * never have to wrap at all.
 *
 * Opt-in by class: the nomination wizard has two buttons and no problem.
 */
.fi-sc-wizard.iaam-wizard-wide-footer .fi-sc-wizard-footer {
    grid-column: 1 / -1;
}

.fi-sc-wizard-footer > * {
    flex: 0 0 auto;
}

.fi-sc-wizard-footer .fi-btn,
.fi-sc-wizard-footer .fi-ac-btn-action {
    white-space: nowrap;
}

/*
 * "(optional)" beside a label, on a form where most fields are not.
 *
 * Sign-up asks four required questions and two optional ones. An unmarked
 * field standing between required ones reads as required, and people
 * abandon forms at questions they think they must answer and would rather
 * not — which is the whole reason date of birth and gender were taken off
 * this form once. Quieter than the label, not hidden from it.
 */
.iaam-optional {
    font-weight: 400;
    font-size: 0.85em;
    color: #5b6880;
    margin-left: 0.25rem;
}

.dark .iaam-optional { color: #94a3c4; }

/*
 * A button that has to read as the link it replaces.
 *
 * The Conference Admissions Policy opens a dialog rather than a page, and
 * the control that opens a dialog is a button — but inside a sentence it
 * still has to look like the words around it, or the consent line grows a
 * grey box in the middle of it.
 */
.iaam-legal-link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: #2d4a8a;
    text-decoration: underline;
    cursor: pointer;
}

.iaam-legal-link:hover { text-decoration-thickness: 2px; }

.dark .iaam-legal-link { color: #9db4e8; }

/* ── Locked features ── */

/*
 * The panel that explains why a menu item will not open.
 *
 * Deliberately small and quiet: this is an answer to a question, not an
 * error. Same native <dialog> as the legal drawer, so Escape and focus
 * trapping come from the browser rather than from script.
 */
.iaam-lock-dialog {
    /*
     * Centred, which a modal <dialog> does for itself through the UA
     * stylesheet's `margin: auto` — until the blanket margin reset
     * further up this sheet takes it away and the panel lands in the
     * top-left corner. Restated here, as .iaam-legal-dialog already
     * has to.
     */
    margin: auto;
    border: 0;
    border-radius: 14px;
    padding: 0;
    max-width: 24rem;
    width: calc(100% - 2.5rem);
    box-shadow: 0 24px 60px rgb(16 32 64 / .28);
}

.iaam-lock-dialog::backdrop {
    background: rgb(16 32 64 / .45);
}

.iaam-lock-body {
    padding: 1.75rem 1.75rem 1.5rem;
    text-align: center;
    font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.iaam-lock-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2fb;
    color: #2d4a8a;
}

.iaam-lock-body h2 {
    margin: 0 0 .5rem;
    font-size: 1.12rem;
    font-weight: 700;
    color: #16203a;
}

.iaam-lock-body p {
    margin: 0 0 1.4rem;
    font-size: .95rem;
    line-height: 1.6;
    color: #5b6880;
}

.iaam-lock-close {
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: #2d4a8a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    padding: .6rem 1.6rem;
    cursor: pointer;
}

.iaam-lock-close:hover { background: #24396c; }

/* A locked item still reads as available, with a hint that it is not. */
.fi-sidebar-item-btn[href*="#lock-"] { opacity: .72; }
.fi-sidebar-item-btn[href*="#lock-"]:hover { opacity: 1; }
