:root {
    --popover-shadow: 0 0.75rem 3rem #11284b20;
    --motion-duration: 240ms;
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --bottom-bar-height: 4.75rem;
}
.avatar {
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-large {
    width: 3rem;
    height: 3rem;
}
.avatar-hero {
    width: 7rem;
    height: 7rem;
    border-width: 3px;
    box-shadow: 0 0 0 0.45rem #f1f5fc;
    margin: 0 auto 1rem;
}
.avatar-hero .icon {
    width: 3rem;
    height: 3rem;
}
.profile-trigger,
.language-trigger {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.25rem;
    border-radius: 0.65rem;
    color: #233d65;
    cursor: pointer;
}
.profile-trigger:hover,
.language-trigger:hover,
.profile-trigger[aria-expanded="true"],
.language-trigger[aria-expanded="true"] {
    background: #eef3ff;
}
.language-trigger {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 650;
}
.language-trigger .flag {
    width: 1.25rem;
    height: 1.25rem;
}
.language-trigger > .icon {
    transform: rotate(90deg);
    width: 0.8rem;
    height: 0.8rem;
}
.header-popover {
    position: fixed;
    inset: 5.25rem 2rem auto auto;
    margin: 0;
    border: 1px solid #e3e9f2;
    border-radius: 1rem;
    background: #fff;
    box-shadow: var(--popover-shadow);
    max-height: calc(100dvh - 7rem);
    overflow: auto;
    color: #182c49;
    padding: 0;
    animation: popover-in 180ms var(--motion-ease);
}
.header-popover:popover-open {
    display: block;
}
.language-popover {
    width: 15rem;
    right: 8.25rem;
    padding: 0.5rem;
}
.popover-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.6rem 0.65rem;
    font-weight: 650;
}
.language-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.65rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    text-align: left;
    font-size: 0.85rem;
    color: #334155;
}
.language-option .flag {
    width: 1.4rem;
    height: 1.4rem;
}
.language-option small {
    margin-left: auto;
    color: #64748b;
}
.language-option .icon {
    width: 1rem;
    height: 1rem;
    color: #003399;
}
.language-option:hover,
.language-option.selected {
    background: #f0f5ff;
    color: #003399;
}
.profile-popover {
    width: min(23rem, calc(100vw - 1.5rem));
    padding: 0.5rem;
}
.profile-menu-identity {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 0.75rem 1.2rem;
    min-width: 0;
}
.profile-menu-identity > div {
    min-width: 0;
}
.profile-menu-identity strong {
    font-size: 0.95rem;
    display: block;
    overflow-wrap: anywhere;
}
.profile-menu-identity span:not(.avatar):not(.icon) {
    font-size: 0.78rem;
    color: #64748b;
    display: block;
    overflow-wrap: anywhere;
}
.profile-menu-identity small {
    font-size: 0.7rem;
    color: #003399;
    display: block;
    margin-top: 0.35rem;
}
.popover-action {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 0.75rem;
    border-radius: 0.6rem;
    color: #334155;
    font-size: 0.85rem;
    min-height: 2.75rem;
}
.popover-action:hover {
    background: #f3f6fc;
    color: #003399;
}
.popover-action .icon:last-child {
    margin-left: auto;
    width: 1rem;
    height: 1rem;
}
.popover-divider {
    height: 1px;
    background: #e8edf4;
    margin: 0.4rem 0.75rem;
}
.logout-action {
    color: #b12a2a;
}
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    border-top: 1px solid #e4e9f1;
    background: transparent;
    width: 100%;
    padding: 1.25rem 0.6rem 0.4rem;
    text-align: left;
    color: #182c49;
    border-radius: 0.6rem;
}
.sidebar-profile:hover {
    background: #f5f8fd;
}
.sidebar-profile > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}
.sidebar-profile strong {
    font-size: 0.8rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-profile small {
    color: #64748b;
    font-size: 0.7rem;
    display: block;
    margin-top: 0.25rem;
}
.sidebar-profile > .icon {
    width: 0.9rem;
    height: 0.9rem;
    color: #94a3b8;
}
.notification-trigger {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 0.65rem;
}
.notification-trigger:hover {
    background: #f1f5fc;
}
.unread-badge {
    position: absolute;
    right: 0.05rem;
    top: 0.05rem;
    border-radius: 2rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.2rem;
    background: #e31d32;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 750;
    line-height: 1.1rem;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}
.notifications-popover {
    width: min(26rem, calc(100vw - 1.5rem));
    right: 4.8rem;
}
.notification-head {
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #e8edf4;
}
.notification-head h2 {
    font-size: 1rem;
}
.notification-head p {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.notification-head .text-link {
    font-size: 0.75rem;
    white-space: normal;
    text-align: left;
}
.notification-list {
    max-height: 24rem;
    overflow: auto;
    overscroll-behavior: contain;
}
.notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    width: 100%;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    padding: 1rem 1.25rem;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.55;
    transition: background 160ms;
}
.notification-item:last-child {
    border-bottom: 0;
}
.notification-item:hover {
    background: #f4f7fc;
}
.notification-item.is-unread {
    background: #f0f5ff;
}
.notification-item.is-unread:hover {
    background: #e9f0fd;
}
.notification-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.8rem;
    background: #edf2fa;
    color: #003399;
}
.is-unread .notification-icon {
    background: #e0eaff;
}
.notification-copy {
    flex: 1;
    min-width: 0;
}
.notification-title,
.notification-text {
    display: block;
    overflow-wrap: anywhere;
    font-weight: 400;
}
.is-unread .notification-title,
.is-unread .notification-text {
    font-weight: 700;
}
.notification-title {
    font-size: 0.85rem;
    color: #1e3557;
}
.notification-text {
    font-size: 0.78rem;
    margin-top: 0.2rem;
    color: #526177;
}
.notification-copy time {
    display: block;
    color: #77869b;
    font-size: 0.68rem;
    margin-top: 0.45rem;
    font-weight: 400;
}
.read-state {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.6rem;
}
.is-unread .read-state {
    background: #003399;
}
.notification-footer {
    border-top: 1px solid #e8edf4;
    display: flex;
    justify-content: center;
    padding: 0.9rem 1rem;
}
.notification-footer .text-link {
    font-size: 0.8rem;
}
.notification-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    color: #64748b;
}
.notification-empty > .icon {
    width: 2rem;
    height: 2rem;
    color: #91a3bf;
}
.notification-empty h3 {
    color: #334155;
    font-size: 0.9rem;
}
.notification-empty p {
    font-size: 0.8rem;
}
.notification-center {
    margin-bottom: 1.5rem;
}
.profile-page-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 1.8fr);
    gap: 1.5rem;
    align-items: start;
}
.profile-summary {
    text-align: center;
    padding: 2rem 1.4rem;
    position: sticky;
    top: 1.5rem;
}
.profile-summary h2 {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}
.profile-summary > p {
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    color: #64748b;
    margin-top: 0.5rem;
}
.role-chip {
    display: inline-flex;
    background: #edf3ff;
    color: #003399;
    border-radius: 2rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    margin: 0.9rem 0 1.5rem;
}
.profile-summary .portal-form {
    margin-top: 0.5rem;
}
.profile-summary .portal-form > .btn {
    white-space: normal;
}
.profile-summary > .danger-link {
    margin-top: 1rem;
}
.selected-file {
    font-size: 0.75rem;
    color: #526177;
    overflow-wrap: anywhere;
}
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.profile-summary:focus-within {
    outline: none;
}
.profile-form-column {
    display: grid;
    gap: 1.5rem;
    min-width: 0;
}
.profile-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.profile-card-heading > .icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #003399;
    flex-shrink: 0;
}
.profile-card-heading p {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.4rem;
    line-height: 1.6;
}
.profile-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.profile-fields-row > div {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
}
.profile-form-column label {
    font-size: 0.8rem;
    font-weight: 550;
    color: #334155;
}
.profile-form-column .portal-form > .btn {
    justify-self: start;
    min-width: 12rem;
}
.profile-form-column input[readonly] {
    background: #f7f9fc;
    color: #64748b;
}
.password-field {
    position: relative;
}
.password-field input {
    padding-right: 3rem;
}
.password-field .icon-button {
    position: absolute;
    right: 0.3rem;
    top: 0.25rem;
    min-width: 2.4rem;
    min-height: 2.4rem;
}
.form-feedback {
    font-size: 0.8rem;
    color: #14765c;
    line-height: 1.6;
    min-height: 0.4rem;
}
.form-feedback:empty {
    display: none;
}
.form-feedback.is-error {
    color: #b22727;
    background: #fff3f1;
    padding: 0.75rem;
    border-radius: 0.5rem;
}
.profile-form-column .source-warning {
    margin: 0;
}
.password-login {
    border-top: 1px solid #e4e9f1;
    padding-top: 1rem;
}
.password-login summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #003399;
    font-weight: 600;
}
.password-login .auth-form {
    margin-top: 1rem;
}
#profile-avatar,
#profile-security {
    scroll-margin-top: 1rem;
}
#mobile-navigation {
    display: none;
}
.mobile-sheet-open {
    overflow: hidden;
}
.mobile-menu-sheet,
.mobile-sheet-backdrop {
    visibility: hidden;
    pointer-events: none;
}
.mobile-sheet-backdrop {
    position: fixed;
    inset: 0 0 calc(var(--bottom-bar-height) + env(safe-area-inset-bottom)) 0;
    background: #10233b58;
    opacity: 0;
    transition:
        opacity var(--motion-duration),
        visibility var(--motion-duration);
    z-index: 80;
    backdrop-filter: blur(3px);
}
.mobile-menu-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
    max-height: calc(
        100dvh - var(--bottom-bar-height) - env(safe-area-inset-bottom) - 2rem
    );
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 1.4rem 1.4rem 0 0;
    background: #fff;
    z-index: 81;
    box-shadow: 0 -1rem 3rem #10233b18;
    padding: 0.5rem 1.25rem 1rem;
    transform: translateY(105%);
    transition:
        transform 320ms var(--motion-ease),
        visibility 320ms;
}
.sheet-is-open .mobile-menu-sheet {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}
.sheet-is-open .mobile-sheet-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.sheet-grabber {
    width: 2.5rem;
    height: 0.25rem;
    border-radius: 1rem;
    background: #cbd5e1;
    margin: 0.25rem auto 0.9rem;
}
.sheet-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
}
.sheet-heading h2 {
    font-size: 1.2rem;
    margin-top: 0.35rem;
}
.sheet-heading .eyebrow {
    font-size: 0.65rem;
}
.sheet-heading .icon-button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 50%;
    background: #f3f6fb;
}
.sheet-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.sheet-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.25rem;
    padding: 0.75rem;
    border: 1px solid #e7edf5;
    border-radius: 0.65rem;
    background: #fff;
    color: #334155;
    text-align: left;
    font-size: 0.78rem;
}
.sheet-link > .icon:first-child {
    width: 1.2rem;
    height: 1.2rem;
    color: #003399;
    flex-shrink: 0;
}
.sheet-link > .icon:last-child {
    width: 0.8rem;
    height: 0.8rem;
    margin-left: auto;
    color: #94a3b8;
}
.sheet-link:hover {
    background: #f2f6ff;
    border-color: #d4e0f8;
}
.sheet-account {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    border-top: 1px solid #e8edf4;
    margin-top: 1rem;
    padding-top: 1rem;
}
.sheet-account > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}
.sheet-account strong {
    font-size: 0.8rem;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sheet-account small {
    font-size: 0.7rem;
    color: #64748b;
}
.sheet-account form {
    margin-left: auto;
}
.sheet-account .icon-button {
    min-height: 2.75rem;
    min-width: 2.75rem;
}
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
    padding: 0 max(0.5rem, env(safe-area-inset-left))
        env(safe-area-inset-bottom) max(0.5rem, env(safe-area-inset-right));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #ffffffed;
    backdrop-filter: blur(16px);
    border-top: 1px solid #e4eaf3;
    box-shadow: 0 -0.25rem 1.5rem #16284608;
    z-index: 90;
}
.bottom-nav-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    background: none;
    min-width: 0;
    min-height: 3.75rem;
    font-size: 0.62rem;
    color: #758397;
    font-weight: 550;
    line-height: 1.2;
    padding: 0.5rem 0.1rem;
}
.bottom-nav-button > .icon {
    width: 1.4rem;
    height: 1.4rem;
    transition:
        transform var(--motion-duration) var(--motion-ease),
        color var(--motion-duration);
}
.bottom-nav-button.active {
    color: #003399;
    font-weight: 750;
}
.bottom-nav-button.active > .icon {
    transform: translateY(-0.1rem);
}
.mobile-active-indicator {
    position: absolute;
    top: -1px;
    left: calc(0.5rem + (100% - 1rem) / 5 * var(--active-index));
    width: calc((100% - 1rem) / 5);
    height: 3px;
    background: #003399;
    border-radius: 0 0 1rem 1rem;
    transition: left 320ms var(--motion-ease);
}
.bottom-unread-slot .unread-badge {
    top: 0.55rem;
    right: calc(50% - 1.4rem);
    font-style: normal;
}
#toast {
    z-index: 120;
    max-width: calc(100vw - 2rem);
}
@keyframes popover-in {
    from {
        opacity: 0;
        transform: translateY(-0.45rem) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@media (max-width: 1024px) {
    #mobile-navigation {
        display: block;
    }
    .sidebar {
        display: none !important;
    }
    .workspace {
        margin-left: 0;
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        padding: 0 1rem;
        height: 4.5rem;
    }
    .top-actions {
        gap: 0.5rem;
    }
    .breadcrumbs > span,
    .breadcrumbs > strong,
    .breadcrumbs > .icon {
        display: none;
    }
    .mobile-logo {
        display: block !important;
    }
    .mobile-logo img {
        width: 7rem;
    }
    .top-actions > .profile-trigger {
        display: flex !important;
    }
    .topbar .avatar {
        width: 2rem;
        height: 2rem;
    }
    .main {
        padding-bottom: calc(
            var(--bottom-bar-height) + env(safe-area-inset-bottom) + 1.5rem
        );
    }
    .header-popover {
        top: 5rem;
        right: 0.75rem;
    }
    .language-popover {
        right: 6.25rem;
    }
    .notifications-popover {
        right: 0.75rem;
    }
    .profile-popover {
        right: 0.75rem;
    }
    .profile-page-grid {
        grid-template-columns: 1fr;
    }
    .profile-summary {
        position: static;
        display: grid;
        justify-items: center;
        padding: 1.5rem;
    }
    .profile-summary > .portal-form {
        width: min(100%, 28rem);
    }
    #toast {
        bottom: calc(
            var(--bottom-bar-height) + env(safe-area-inset-bottom) + 1rem
        );
    }
    .profile-form-column {
        gap: 1rem;
    }
}
@media (max-width: 600px) {
    .topbar {
        padding: 0 0.75rem;
    }
    .top-actions {
        gap: 0.15rem;
    }
    .mobile-logo img {
        width: 6rem;
    }
    .language-trigger {
        padding: 0.35rem 0.45rem;
        gap: 0.3rem;
    }
    .profile-trigger {
        padding: 0.25rem;
    }
    .header-popover {
        max-height: calc(100dvh - 11rem - env(safe-area-inset-bottom));
    }
    .notification-head {
        padding: 1rem;
    }
    .notification-item {
        padding: 1rem;
        gap: 0.65rem;
    }
    .notification-head h2 {
        font-size: 0.95rem;
    }
    .notification-head .text-link {
        max-width: 8rem;
    }
    .notification-center .notification-head {
        flex-wrap: wrap;
    }
    .profile-fields-row {
        grid-template-columns: 1fr;
    }
    .profile-form-column .portal-form > .btn {
        width: 100%;
        justify-self: stretch;
    }
    .profile-summary .avatar-hero {
        width: 5.5rem;
        height: 5.5rem;
    }
    .profile-summary .avatar-hero .icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    .profile-summary h2 {
        font-size: 1.1rem;
    }
    .notifications-popover .notification-list {
        max-height: min(24rem, calc(100dvh - 20rem));
    }
    .sheet-link {
        gap: 0.45rem;
        font-size: 0.72rem;
        padding: 0.6rem;
    }
    .sheet-links {
        gap: 0.45rem;
    }
    .sheet-heading h2 {
        font-size: 1.1rem;
    }
    .profile-popover {
        width: calc(100vw - 1.5rem);
    }
    .language-popover {
        width: 14rem;
        right: 5.5rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.top-actions .profile-trigger .avatar {
    display: grid !important;
}
