#toolbar {
    position: absolute;
    top: var(--top-nav-height);
    left: 0;
    bottom: var(--bottom-bar-height);
    width: 76px;
    background: var(--color-g-000, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
}

#toolbar .toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    cursor: pointer;
    gap: 4px;
}

#toolbar .toolbar-item.selected {
    filter: var(--primary-filter);
}

#toolbar .toolbar-icon {
    width: 24px;
    height: 24px;
    background-color: var(--bs-body-color);
    mask: no-repeat center / contain;
    pointer-events: none;
    flex-shrink: 0;
}

#toolbar .toolbar-label {
    font-size: 12px;
    color: var(--bs-body-color);
    text-align: center;
    line-height: 1.2;
    max-width: 72px;
    text-align: center;
    pointer-events: none;
}

#toolbar .toolbar-separator {
    width: 60%;
    height: 1px;
    background-color: var(--color-g-200);
    margin: 2px 0;
}

.toolbar-popup {
    position: absolute;
    left: 84px;
    width: fit-content;
    background: var(--color-g-000, #fff);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.toolbar-popup .toolbar-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar-popup .toolbar-popup-item:hover {
    background: var(--color-g-100);
}

.toolbar-popup .toolbar-popup-flag {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
}

.toolbar-popup .toolbar-popup-minimap {
    width: 60px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
}
.toolbar-popup .toolbar-popup-minimap + .toolbar-popup-label {
    white-space: normal;
    line-break: anywhere;
}

.toolbar-popup .toolbar-popup-label {
    font-size: 8px;
    color: var(--bs-body-color, #333);
    text-align: center;
    white-space: nowrap;
}
.toolbar-popup-item.active {
    background-color: rgba(0, 0, 0, 0.103); 
}

/* Share toast */
.share-toast-map-container {
    position: relative;
}

.share-toast,
.shared-state-toast {
    position: absolute;
    top: 10px;
    left: 84px;
    z-index: 10000;
    display: flex;
    align-items: center;
    width: 345px;
    min-height: 42px;
    background: var(--color-g-100);
    border-radius: 6px;
    box-shadow: var(--shadow-300);
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.share-toast.hide,
.shared-state-toast.hide {
    opacity: 0;
    transform: translateY(-6px);
}

.share-toast-accent,
.shared-state-toast-accent {
    width: 12px;
    align-self: stretch;
}

.share-toast-accent {
    background: var(--color-scale-300);
}

.shared-state-toast.current .shared-state-toast-accent {
    background: var(--primary-color);
}

.shared-state-toast.historical .shared-state-toast-accent {
    background: var(--color-scale-700);
}

.share-toast-icon-wrapper,
.shared-state-toast-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px 0 10px;
}

.share-toast-icon,
.shared-state-toast-icon {
    width: 22px;
    height: 22px;
    display: block;
    
}
.share-toast-icon {
    filter: var(--filter-scale-300);
}

.shared-state-toast.current .shared-state-toast-icon {
    filter: var(--filter-500);
}

.shared-state-toast.historical .shared-state-toast-icon {
    filter: var(--filter-scale-700);
}

.share-toast-message,
.shared-state-toast-message {
    padding: 10px 14px 10px 0;
    color: var(--dark-color);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 500;
}


@media (pointer: coarse) and (max-width: 768px),
       (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
    #toolbar {
        display: none;
        width: 52px;
        bottom: calc(var(--bottom-bar-height) + var(--safe-bottom));
    }

    body.toolbar-open #toolbar {
        display: flex;
    }

    #toolbar .toolbar-item {
        padding: 7px 0;
        gap: 3px;
    }

    #toolbar .toolbar-icon {
        width: 18px;
        height: 18px;
    }

    #toolbar .toolbar-label {
        font-size: 9px;
        max-width: 48px;
    }

    .toolbar-popup {
        left: 58px;
    }

}